1 /***************************************************************************
2 * Copyright (C) 2005-08 by the Quassel Project *
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) version 3. *
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 IDENTITYEDITWIDGET_H
22 #define IDENTITYEDITWIDGET_H
24 #include "ui_identityeditwidget.h"
25 #include "ui_nickeditdlg.h"
28 #include <QSslCertificate>
32 #include "clientidentity.h"
34 class IdentityEditWidget : public QWidget {
38 IdentityEditWidget(QWidget *parent = 0);
46 void displayIdentity(CertIdentity *id, CertIdentity *saveId = 0);
47 void saveToIdentity(CertIdentity *id);
50 void setSslState(SslState state);
54 virtual bool eventFilter(QObject *watched, QEvent *event);
58 void requestEditSsl();
59 void widgetHasChanged();
62 void on_addNick_clicked();
63 void on_deleteNick_clicked();
64 void on_renameNick_clicked();
65 void on_nickUp_clicked();
66 void on_nickDown_clicked();
69 void on_clearOrLoadKeyButton_clicked();
70 void on_clearOrLoadCertButton_clicked();
72 void setWidgetStates();
75 void sslDragEnterEvent(QDragEnterEvent *event);
76 void sslDropEvent(QDropEvent *event, bool isCert);
80 Ui::IdentityEditWidget ui;
84 QSslKey keyByFilename(const QString &filename);
85 void showKeyState(const QSslKey &key);
86 QSslCertificate certByFilename(const QString &filename);
87 void showCertState(const QSslCertificate &cert);
90 bool testHasChanged();
93 class NickEditDlg : public QDialog {
97 NickEditDlg(const QString &oldnick, const QStringList &existing = QStringList(), QWidget *parent = 0);
102 void on_nickEdit_textChanged(const QString &);
108 QStringList existing;
112 #endif //IDENTITYEDITWIDGET_H