mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
[Move refactor] Move tabs to interface/widgets (#6235)
* Move tabs to interface/widgets. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
d9c65d4ae0
commit
b8983f27ab
134 changed files with 111 additions and 112 deletions
75
cockatrice/src/interface/widgets/tabs/tab_admin.h
Normal file
75
cockatrice/src/interface/widgets/tabs/tab_admin.h
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/**
|
||||
* @file tab_admin.h
|
||||
* @ingroup ServerTabs
|
||||
* @brief TODO: Document this.
|
||||
*/
|
||||
|
||||
#ifndef TAB_ADMIN_H
|
||||
#define TAB_ADMIN_H
|
||||
|
||||
#include "tab.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <libcockatrice/protocol/pb/commands.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response.pb.h>
|
||||
|
||||
class AbstractClient;
|
||||
|
||||
class QGroupBox;
|
||||
class QPushButton;
|
||||
class QSpinBox;
|
||||
class QLineEdit;
|
||||
|
||||
class ShutdownDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
QLineEdit *reasonEdit;
|
||||
QSpinBox *minutesEdit;
|
||||
|
||||
public:
|
||||
explicit 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, *grantReplayAccessButton,
|
||||
*activateUserButton;
|
||||
QGroupBox *adminGroupBox, *moderatorGroupBox;
|
||||
QPushButton *unlockButton, *lockButton;
|
||||
QLineEdit *replayIdToGrant, *userToActivate;
|
||||
signals:
|
||||
void adminLockChanged(bool lock);
|
||||
private slots:
|
||||
void actUpdateServerMessage();
|
||||
void actShutdownServer();
|
||||
void actReloadConfig();
|
||||
void actGrantReplayAccess();
|
||||
void actForceActivateUser();
|
||||
void grantReplayAccessProcessResponse(const Response &response);
|
||||
void activateUserProcessResponse(const Response &response);
|
||||
|
||||
void actUnlock();
|
||||
void actLock();
|
||||
|
||||
public:
|
||||
TabAdmin(TabSupervisor *_tabSupervisor, AbstractClient *_client, bool _fullAdmin);
|
||||
void retranslateUi() override;
|
||||
QString getTabText() const override
|
||||
{
|
||||
return tr("Administration");
|
||||
}
|
||||
bool getLocked() const
|
||||
{
|
||||
return locked;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue