Testing changelog with mantis
[quassel.git] / gui / serverlist.h
1 /***************************************************************************
2  *   Copyright (C) 2005 by The Quassel Team                                *
3  *   devel@quassel-irc.org                                                 *
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; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19  ***************************************************************************/
20
21 #ifndef _SERVERLIST_H_
22 #define _SERVERLIST_H_
23
24 #include <QtGui>
25 #include <QMap>
26 #include <QList>
27 #include <QVariant>
28 #include "global.h"
29
30 #include "ui_serverlistdlg.h"
31 #include "ui_networkeditdlg.h"
32 #include "ui_servereditdlg.h"
33
34 class ServerListDlg : public QDialog {
35   Q_OBJECT
36
37   public:
38     ServerListDlg(QWidget *parent);
39     virtual ~ServerListDlg();
40
41     bool showOnStartup();
42
43   public slots:
44     void editIdentities(bool end = false);
45     //virtual void reject() { exit(0); }
46     virtual void accept();
47
48   signals:
49     void requestConnect(QStringList networks);
50
51   private slots:
52     void updateButtons();
53     void on_showOnStartup_stateChanged(int);
54     void on_addButton_clicked();
55     void on_editButton_clicked();
56     void on_deleteButton_clicked();
57
58   private:
59     Ui::ServerListDlg ui;
60
61     void updateNetworkTree();
62     //VarMap networks;
63     //VarMap identities;  <-- this is now stored in global
64 };
65
66 class NetworkEditDlg : public QDialog {
67   Q_OBJECT
68
69   public:
70     NetworkEditDlg(QWidget *parent, VarMap network);
71
72     VarMap getNetwork() { return network; }
73   public slots:
74     virtual void accept();
75
76   private slots:
77     void on_networkName_textChanged(QString);
78     void on_addServer_clicked();
79     void on_editServer_clicked();
80     void on_deleteServer_clicked();
81     void on_upServer_clicked();
82     void on_downServer_clicked();
83     void on_editIdentities_clicked();
84
85     void updateWidgets();
86     void updateServerButtons();
87   private:
88     Ui::NetworkEditDlg ui;
89
90     VarMap network;
91     //VarMap identities;
92     QString oldName;
93
94     VarMap createDefaultNetwork();
95     QString checkValidity();
96 };
97
98 class ServerEditDlg : public QDialog {
99   Q_OBJECT
100
101   public:
102     ServerEditDlg(QWidget *parent, VarMap server = VarMap());
103
104     VarMap getServer();
105
106   private slots:
107     void on_serverAddress_textChanged();
108
109   private:
110     Ui::ServerEditDlg ui;
111
112 };
113
114 #endif