1 /*
2  * Hedgewars, a free turn based strategy game
3  * Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; version 2 of the License
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  */
18 
19 #ifndef PAGE_ADMIN_H
20 #define PAGE_ADMIN_H
21 
22 #include "AbstractPage.h"
23 
24 class QTableWidget;
25 
26 class PageAdmin : public AbstractPage
27 {
28         Q_OBJECT
29 
30     public:
31         PageAdmin(QWidget* parent = 0);
32 
33     public slots:
34         void serverMessageNew(const QString & str);
35         void serverMessageOld(const QString & str);
36         void protocol(int proto);
37         void setBansList(const QStringList & bans);
38 
39     signals:
40         void setServerMessageNew(const QString & str);
41         void setServerMessageOld(const QString & str);
42         void setProtocol(int proto);
43         void askServerVars();
44         void clearAccountsCache();
45         void bansListRequest();
46         void removeBan(const QString &);
47         void banIP(const QString & ip, const QString & reason, int seconds);
48         void banNick(const QString & nick, const QString & reason, int seconds);
49 
50     protected:
51         QLayout * bodyLayoutDefinition();
52         void connectSignals();
53 
54     private:
55         QLineEdit * leServerMessageNew;
56         QLineEdit * leServerMessageOld;
57         QPushButton * pbSetSM;
58         QPushButton * pbAsk;
59         QSpinBox * sbProtocol;
60         QTextBrowser * tb;
61         QPushButton * pbClearAccountsCache;
62         QTableWidget * twBans;
63 
64     private slots:
65         void smChanged();
66         void onAddClicked();
67         void onRemoveClicked();
68         void onRefreshClicked();
69 };
70 
71 #endif
72