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();
107 Ui::IdentitiesDlg ui;
109 QMap<QString, QString> nameMapping;
110 QString lastIdentity;
112 QString checkValidity();
113 VarMap createDefaultIdentity();
114 QString getCurIdentity();
115 void updateWidgets();
116 void updateIdentity(QString);
119 class NickEditDlg : public QDialog {
123 NickEditDlg(QWidget *parent, QString nick = QString());
128 void textChanged(QString);
135 class IdentitiesEditDlg : public QDialog {
139 IdentitiesEditDlg(QWidget *parent, VarMap identities, QMap<QString, QString> mapping, VarMap templ);
141 VarMap getIdentities() { return identities; }
142 QMap<QString, QString> getMapping() { return mapping; }
145 void selectionChanged();
148 void duplicateIdentity();
149 void renameIdentity();
150 void deleteIdentity();
153 Ui::IdentitiesEditDlg ui;
156 VarMap identTemplate;
157 QMap<QString, QString> mapping;
162 class RenameIdentityDlg : public QDialog {
166 RenameIdentityDlg(QWidget *parent, QList<QString> reserved, QString name = QString());
171 void textChanged(QString);
175 QList<QString> reserved;