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);
51 void showAdvanced(bool advanced);
55 virtual bool eventFilter(QObject *watched, QEvent *event);
59 void requestEditSsl();
60 void widgetHasChanged();
63 void on_addNick_clicked();
64 void on_deleteNick_clicked();
65 void on_renameNick_clicked();
66 void on_nickUp_clicked();
67 void on_nickDown_clicked();
70 void on_clearOrLoadKeyButton_clicked();
71 void on_clearOrLoadCertButton_clicked();
73 void setWidgetStates();
76 void sslDragEnterEvent(QDragEnterEvent *event);
77 void sslDropEvent(QDropEvent *event, bool isCert);
81 Ui::IdentityEditWidget ui;
85 QSslKey keyByFilename(const QString &filename);
86 void showKeyState(const QSslKey &key);
87 QSslCertificate certByFilename(const QString &filename);
88 void showCertState(const QSslCertificate &cert);
91 bool testHasChanged();
94 class NickEditDlg : public QDialog {
98 NickEditDlg(const QString &oldnick, const QStringList &existing = QStringList(), QWidget *parent = 0);
100 QString nick() const;
103 void on_nickEdit_textChanged(const QString &);
109 QStringList existing;
113 #endif //IDENTITYEDITWIDGET_H