1 #ifndef TAB_ADMIN_H 2 #define TAB_ADMIN_H 3 4 #include "tab.h" 5 6 #include <QDialog> 7 8 class AbstractClient; 9 10 class QGroupBox; 11 class QPushButton; 12 class QSpinBox; 13 class QLineEdit; 14 15 class ShutdownDialog : public QDialog 16 { 17 Q_OBJECT 18 private: 19 QLineEdit *reasonEdit; 20 QSpinBox *minutesEdit; 21 22 public: 23 ShutdownDialog(QWidget *parent = nullptr); 24 QString getReason() const; 25 int getMinutes() const; 26 }; 27 28 class TabAdmin : public Tab 29 { 30 Q_OBJECT 31 private: 32 bool locked; 33 AbstractClient *client; 34 bool fullAdmin; 35 QPushButton *updateServerMessageButton, *shutdownServerButton, *reloadConfigButton; 36 QGroupBox *adminGroupBox; 37 QPushButton *unlockButton, *lockButton; 38 signals: 39 void adminLockChanged(bool lock); 40 private slots: 41 void actUpdateServerMessage(); 42 void actShutdownServer(); 43 void actReloadConfig(); 44 45 void actUnlock(); 46 void actLock(); 47 48 public: 49 TabAdmin(TabSupervisor *_tabSupervisor, AbstractClient *_client, bool _fullAdmin, QWidget *parent = nullptr); 50 void retranslateUi(); getTabText()51 QString getTabText() const 52 { 53 return tr("Administration"); 54 } getLocked()55 bool getLocked() const 56 { 57 return locked; 58 } 59 }; 60 61 #endif 62