servatrice/cockatrice/src/tab_admin.h
ebbit1q c874f201c3 add a bunch of parents to dialogs (#3658)
* add a bunch of parents to dialogs

works on #3651

* use game as parent instead

* add more parents

* fix create token dialog modality

* add parent to game information window

* replace a bunch of nullptrs with the magic of sed

* add parent to tip of the day and counters

* reorder game ptr

* set parent for life counter

* clangify
2019-03-26 14:54:47 -04:00

60 lines
1.2 KiB
C++

#ifndef TAB_ADMIN_H
#define TAB_ADMIN_H
#include "tab.h"
#include <QDialog>
class AbstractClient;
class QGroupBox;
class QPushButton;
class QSpinBox;
class QLineEdit;
class ShutdownDialog : public QDialog
{
Q_OBJECT
private:
QLineEdit *reasonEdit;
QSpinBox *minutesEdit;
public:
ShutdownDialog(QWidget *parent = nullptr);
QString getReason() const;
int getMinutes() const;
};
class TabAdmin : public Tab
{
Q_OBJECT
private:
bool locked;
AbstractClient *client;
bool fullAdmin;
QPushButton *updateServerMessageButton, *shutdownServerButton, *reloadConfigButton;
QGroupBox *adminGroupBox;
QPushButton *unlockButton, *lockButton;
signals:
void adminLockChanged(bool lock);
private slots:
void actUpdateServerMessage();
void actShutdownServer();
void actReloadConfig();
void actUnlock();
void actLock();
public:
TabAdmin(TabSupervisor *_tabSupervisor, AbstractClient *_client, bool _fullAdmin, QWidget *parent = nullptr);
void retranslateUi();
QString getTabText() const
{
return tr("Administration");
}
bool getLocked() const
{
return locked;
}
};
#endif