itom  4.1.0
dialogSelectUser.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom.
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  itom is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17  General Public Licence for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with itom. If not, see <http://www.gnu.org/licenses/>.
21 *********************************************************************** */
22 
23 #ifndef DIALOGSELECTUSER_H
24 #define DIALOGSELECTUSER_H
25 
26 #include "../global.h"
27 #include "models/UserModel.h"
28 
29 #include <qdialog.h>
30 #include <qlist.h>
31 
32 #include "ui_dialogSelectUser.h"
33 
34 namespace ito {
35 
36 class DialogSelectUser : public QDialog
37 {
38  Q_OBJECT
39 
40 public:
41  DialogSelectUser(UserModel *model, QWidget *parent = NULL);
42  ~DialogSelectUser();
43 
44  bool selectUser(const QString &id);
45  QModelIndex selectedIndex() const { return ui.userList->currentIndex(); }
46 
47 
48 protected:
49  void init();
50 
51  Ui::DialogSelectUser ui;
52  UserModel *m_userModel;
53 
54 private slots:
55  void userListCurrentChanged(const QModelIndex &current, const QModelIndex &previous);
56  void on_userList_doubleClicked(const QModelIndex current);
57  void on_buttonBox_clicked(QAbstractButton* btn);
58 
59 private:
60  int checkPassword();
61 };
62 
63 } //end namespace ito
64 
65 #endif
Definition: dialogSelectUser.h:36
class for for visualizing the available users
Definition: UserModel.h:80
Definition: apiFunctionsGraph.cpp:39