1 /***************************************************************************
2 * Copyright (C) 2005-2016 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 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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
39 IdentityEditWidget(QWidget *parent = 0);
47 void displayIdentity(CertIdentity *id, CertIdentity *saveId = 0);
48 void saveToIdentity(CertIdentity *id);
51 void setSslState(SslState state);
52 void showAdvanced(bool advanced);
56 virtual bool eventFilter(QObject *watched, QEvent *event);
60 void requestEditSsl();
61 void widgetHasChanged();
64 void on_addNick_clicked();
65 void on_deleteNick_clicked();
66 void on_renameNick_clicked();
67 void on_nickUp_clicked();
68 void on_nickDown_clicked();
71 void on_clearOrLoadKeyButton_clicked();
72 void on_clearOrLoadCertButton_clicked();
74 void setWidgetStates();
77 void sslDragEnterEvent(QDragEnterEvent *event);
78 void sslDropEvent(QDropEvent *event, bool isCert);
82 Ui::IdentityEditWidget ui;
86 QSslKey keyByFilename(const QString &filename);
87 void showKeyState(const QSslKey &key);
88 QSslCertificate certByFilename(const QString &filename);
89 void showCertState(const QSslCertificate &cert);
92 bool testHasChanged();
96 class NickEditDlg : public QDialog
101 NickEditDlg(const QString &oldnick, const QStringList &existing = QStringList(), QWidget *parent = 0);
103 QString nick() const;
106 void on_nickEdit_textChanged(const QString &);
112 QStringList existing;
116 #endif //IDENTITYEDITWIDGET_H