1 /***************************************************************************
2 * Copyright (C) 2005 by The Quassel Team *
3 * devel@quassel-irc.org *
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. *
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. *
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 ***************************************************************************/
21 #ifndef _SERVERLIST_H_
22 #define _SERVERLIST_H_
29 #include "ui_serverlistdlg.h"
30 #include "ui_identitiesdlg.h"
31 #include "ui_identitieseditdlg.h"
32 #include "ui_nickeditdlg.h"
33 #include "ui_networkeditdlg.h"
35 typedef QMap<QString, QVariant> VarMap;
37 class ServerListDlg : public QDialog {
41 ServerListDlg(QWidget *parent);
42 virtual ~ServerListDlg();
47 void editIdentities();
51 void on_showOnStartup_stateChanged(int);
52 void on_addButton_clicked();
59 void loadIdentities();
60 void storeIdentities();
66 class NetworkEditDlg : public QDialog {
70 NetworkEditDlg(QWidget *parent, VarMap network, VarMap identities);
73 Ui::NetworkEditDlg ui;
78 VarMap createDefaultNetwork();
81 class IdentitiesDlg : public QDialog {
85 IdentitiesDlg(QWidget *parent, VarMap identities);
87 VarMap getIdentities() { return identities; }
88 QMap<QString, QString> getNameMapping() { return nameMapping; }
91 virtual void accept();
94 void autoAwayChecked();
95 void identityChanged(QString);
96 void nickSelectionChanged();
104 void editIdentities();
106 void globalDataUpdated(QString);
109 Ui::IdentitiesDlg ui;
111 QMap<QString, QString> nameMapping;
112 QString lastIdentity;
114 QString checkValidity();
115 VarMap createDefaultIdentity();
116 QString getCurIdentity();
117 void updateWidgets();
118 void updateIdentity(QString);
121 class NickEditDlg : public QDialog {
125 NickEditDlg(QWidget *parent, QString nick = QString());
130 void textChanged(QString);
137 class IdentitiesEditDlg : public QDialog {
141 IdentitiesEditDlg(QWidget *parent, VarMap identities, QMap<QString, QString> mapping, VarMap templ);
143 VarMap getIdentities() { return identities; }
144 QMap<QString, QString> getMapping() { return mapping; }
147 void selectionChanged();
150 void duplicateIdentity();
151 void renameIdentity();
152 void deleteIdentity();
155 Ui::IdentitiesEditDlg ui;
158 VarMap identTemplate;
159 QMap<QString, QString> mapping;
164 class RenameIdentityDlg : public QDialog {
168 RenameIdentityDlg(QWidget *parent, QList<QString> reserved, QString name = QString());
173 void textChanged(QString);
177 QList<QString> reserved;