OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ManageAccess.h
Go to the documentation of this file.
1#pragma once
2
3// OpenTwin header
4#include "OTWidgets/Table.h"
5#include "OTWidgets/Dialog.h"
6
7// Qt header
8#include <QtCore/qobject.h>
9
10namespace ot { class LineEdit; }
11namespace ot { class CheckBox; }
12
14 Q_OBJECT
15public:
17 ManageAccessTable(int _row, int _column);
18 virtual ~ManageAccessTable();
19
20 void addRow(const std::array<QTableWidgetItem *, 2> &_columns);
21
22 void Clear(void);
23
24 virtual void mouseMoveEvent(QMouseEvent * _event) override;
25
26 virtual void leaveEvent(QEvent * _event) override;
27
28 void getSelectedItems(QTableWidgetItem *&first, QTableWidgetItem *&second);
29
30Q_SIGNALS:
32
33private Q_SLOTS:
34 void slotSelectionChanged();
35
36private:
37 std::vector<std::array<QTableWidgetItem *, 2>> my_dataRowItems;
38
39 int my_selectedRow;
40};
41
42class ManageAccess : public ot::Dialog {
43 Q_OBJECT
44
45public:
46 ManageAccess(const std::string &authServerURL, const std::string &projectName);
47 virtual ~ManageAccess();
48
49public Q_SLOTS:
51 void slotGroupsFilter(void);
52 void slotGroupsSelection(void);
53 void slotGroupCheckBoxChanged(bool state, int row);
54
55private:
56 void fillGroupsList(void);
57 std::string tolower(std::string s);
58 bool hasSuccessful(const std::string &response);
59 void readGroupsList(void);
60
61 ot::LineEdit* m_filterGroups;
62 ManageAccessTable * m_groupsList;
63 ot::CheckBox * m_showGroupsWithAccessOnly;
64
65 std::string m_authServerURL;
66 std::string m_projectName;
67
68 std::list<std::string> m_groupList;
69 std::map<std::string, bool> m_groupHasAccess;
70
71 ManageAccess() = delete;
72 ManageAccess(ManageAccess&) = delete;
73 ManageAccess& operator = (ManageAccess&) = delete;
74};
Definition ManageAccess.h:42
void slotGroupsFilter(void)
Definition ManageAccess.cpp:235
void slotGroupsSelection(void)
Definition ManageAccess.cpp:240
void slotGroupCheckBoxChanged(bool state, int row)
Definition ManageAccess.cpp:245
virtual ~ManageAccess()
Definition ManageAccess.cpp:222
void slotShowGroupsWithAccessOnly(void)
Definition ManageAccess.cpp:230
Definition ManageAccess.h:13
ManageAccessTable()
Definition ManageAccess.cpp:27
void Clear(void)
Definition ManageAccess.cpp:62
virtual void mouseMoveEvent(QMouseEvent *_event) override
Definition ManageAccess.cpp:74
void addRow(const std::array< QTableWidgetItem *, 2 > &_columns)
Definition ManageAccess.cpp:51
virtual ~ManageAccessTable()
Definition ManageAccess.cpp:47
void getSelectedItems(QTableWidgetItem *&first, QTableWidgetItem *&second)
Definition ManageAccess.cpp:131
virtual void leaveEvent(QEvent *_event) override
Definition ManageAccess.cpp:100
Definition CheckBox.h:17
Definition Dialog.h:19
Definition LineEdit.h:17
Definition Table.h:22
Definition Connector.h:8