OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ManageGroups.h
Go to the documentation of this file.
1#pragma once
2
3// OpenTwin header
5#include "OTWidgets/Table.h"
6#include "OTWidgets/Dialog.h"
7
8namespace ot { class LineEdit; }
9namespace ot { class CheckBox; }
10namespace ot { class PushButton; }
11
13 Q_OBJECT
15public:
17 ManageGroupsTable(int _row, int _column);
18 virtual ~ManageGroupsTable();
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>> m_dataRowItems;
38
39 int m_selectedRow;
40
41};
42
43class AddGroupDialog : public ot::Dialog {
44 Q_OBJECT
47public:
48 AddGroupDialog(const std::string &authServerURL);
49 virtual ~AddGroupDialog();
50
51 QString groupName(void) const;
52
53private Q_SLOTS:
54 void slotConfirm();
55
56private:
57 bool hasError(const std::string &response);
58
59 ot::LineEdit* m_input;
60 std::string m_authServerURL;
61};
62
64 Q_OBJECT
67public:
68 RenameGroupDialog(const std::string &groupName, const std::string &authServerURL);
69 virtual ~RenameGroupDialog();
70
71 QString groupName(void) const;
72
73Q_SIGNALS:
74 void isClosing(void);
75
76private Q_SLOTS:
77 void slotConfirm();
78
79private:
80 bool hasSuccessful(const std::string& _response);
81
82 bool m_confirmed;
83 bool m_cancelClose;
84 std::string m_groupToRename;
85
86 ot::LineEdit* m_input;
87
88 std::string m_authServerURL;
89};
90
91class ManageGroups : public ot::Dialog {
92 Q_OBJECT
93
94public:
95 ManageGroups(const std::string &authServerURL);
96 virtual ~ManageGroups();
97
98public Q_SLOTS:
99 void slotAddGroup(void);
100 void slotRenameGroup(void);
101 void slotChangeGroupOwner(void);
102 void slotDeleteGroup(void);
103 void slotShowMembersOnly(void);
104 void slotGroupFilter(void);
105 void slotMemberFilter(void);
106 void slotGroupsSelection(void);
107 void slotMemberCheckBoxChanged(bool state, int row);
108
109private:
110 void fillGroupsList(void);
111 void fillMembersList(void);
112 void readUserList(void);
113 std::string tolower(std::string s);
114 bool hasSuccessful(const std::string &response);
115
116 ot::LineEdit* m_filterGroups;
117 ot::LineEdit* m_filterMembers;
118 ManageGroupsTable * m_groupsList;
119 ManageGroupsTable * m_membersList;
120 ot::CheckBox* m_showMembersOnly;
121
122 ot::PushButton* m_btnRename;
123 ot::PushButton* m_btnOwner;
124 ot::PushButton* m_btnDelete;
125
126 std::string m_authServerURL;
127
128 std::list<std::string> m_userList;
129 std::map<std::string, bool> m_userInGroup;
130
131 ManageGroups() = delete;
132 ManageGroups(ManageGroups&) = delete;
133 ManageGroups& operator = (ManageGroups&) = delete;
134};
135
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NODEFAULT(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:22
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
Definition ManageGroups.h:43
virtual ~AddGroupDialog()
Definition ManageGroups.cpp:182
QString groupName(void) const
Definition ManageGroups.cpp:186
AddGroupDialog(const std::string &authServerURL)
Definition ManageGroups.cpp:146
Definition ManageGroups.h:91
void slotShowMembersOnly(void)
Definition ManageGroups.cpp:577
void slotRenameGroup(void)
Definition ManageGroups.cpp:501
void slotGroupsSelection(void)
Definition ManageGroups.cpp:589
void slotMemberCheckBoxChanged(bool state, int row)
Definition ManageGroups.cpp:593
void slotMemberFilter(void)
Definition ManageGroups.cpp:585
virtual ~ManageGroups()
Definition ManageGroups.cpp:483
void slotAddGroup(void)
Definition ManageGroups.cpp:491
void slotChangeGroupOwner(void)
Definition ManageGroups.cpp:518
void slotGroupFilter(void)
Definition ManageGroups.cpp:581
void slotDeleteGroup(void)
Definition ManageGroups.cpp:536
Definition ManageGroups.h:12
virtual ~ManageGroupsTable()
Definition ManageGroups.cpp:48
ManageGroupsTable()
Definition ManageGroups.cpp:28
void Clear(void)
Definition ManageGroups.cpp:63
virtual void leaveEvent(QEvent *_event) override
Definition ManageGroups.cpp:101
virtual void mouseMoveEvent(QMouseEvent *_event) override
Definition ManageGroups.cpp:75
void getSelectedItems(QTableWidgetItem *&_first, QTableWidgetItem *&_second)
Definition ManageGroups.cpp:132
void addRow(const std::array< QTableWidgetItem *, 2 > &_columns)
Definition ManageGroups.cpp:52
Definition ManageGroups.h:63
RenameGroupDialog(const std::string &groupName, const std::string &authServerURL)
Definition ManageGroups.cpp:236
virtual ~RenameGroupDialog()
Definition ManageGroups.cpp:274
void isClosing(void)
QString groupName(void) const
Definition ManageGroups.cpp:278
Definition CheckBox.h:17
Definition Dialog.h:19
Definition LineEdit.h:17
Definition PushButton.h:17
Definition Table.h:22
Definition Connector.h:8