itom
Loading...
Searching...
No Matches
userManagementEdit.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2020, Institut für Technische Optik (ITO),
5 Universität 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 USERMANAGEMENTEDITWIDGET_H
24#define USERMANAGEMENTEDITWIDGET_H
25
26#include "../models/UserModel.h"
27
28#include <qdialog.h>
29
30#include "ui_userManagementEdit.h"
31
32namespace ito {
33
34class DialogUserManagementEdit : public QDialog
35{
36 Q_OBJECT
37
38 public:
40 const QString& filename,
41 UserModel* userModel,
42 QWidget* parent = nullptr,
43 Qt::WindowFlags f = Qt::WindowFlags(),
44 bool isStandardUser = false);
45
47 Ui::userManagementEdit ui;
48
49 private:
50 void updateScriptButtons();
51 void enableWidgetsByUserRole(const UserRole currentUserRole, const UserFeatures &currentFeatures, const UserRole userRole, const UserFeatures &features);
52
53 UserModel *m_userModel;
54 bool saveUser();
55 QString m_fileName;
56 QByteArray m_oldPassword;
57 QString m_osUser;
58 bool m_showsStandardUser;
59
60 protected:
61 QString clearName(const QString &name);
62
63 private slots:
64 void on_buttonBox_clicked(QAbstractButton* btn);
65 void on_lv_startUpScripts_currentRowChanged(int row);
66 void on_lineEdit_name_textChanged(const QString &text);
67 void on_cmdAutoID_toggled(bool checked);
68
69 public slots:
70 void on_pb_addScript_clicked();
71 void on_pb_removeScript_clicked();
72 void on_pb_downScript_clicked();
73 void on_pb_upScript_clicked();
74 void on_cmdUseWindowsUser_clicked();
75};
76
77} //end namespace ito
78
79#endif //USERMANAGEMENTEDITWIDGET_H
Definition userManagementEdit.h:35
void enableWidgetsByUserRole(const UserRole currentUserRole, const UserFeatures &currentFeatures, const UserRole userRole, const UserFeatures &features)
sets the enabled and check state of many controls depending on the rights of the currently logged use...
Definition userManagementEdit.cpp:295
class for for visualizing the available users
Definition UserModel.h:81
Definition apiFunctionsGraph.cpp:40
UserRole
Enumeration that defines some user roles.
Definition UserModel.h:33