1 /***************************************************************************
2 * Copyright (C) 2005-2018 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 = nullptr);
48 void displayIdentity(CertIdentity* id, CertIdentity* saveId = nullptr);
49 void saveToIdentity(CertIdentity* id);
52 void setSslState(SslState state);
53 void showAdvanced(bool advanced);
57 bool eventFilter(QObject* watched, QEvent* event) override;
61 void requestEditSsl();
62 void widgetHasChanged();
65 void on_addNick_clicked();
66 void on_deleteNick_clicked();
67 void on_renameNick_clicked();
68 void on_nickUp_clicked();
69 void on_nickDown_clicked();
72 void on_clearOrLoadKeyButton_clicked();
73 void on_clearOrLoadCertButton_clicked();
75 void setWidgetStates();
78 void sslDragEnterEvent(QDragEnterEvent* event);
79 void sslDropEvent(QDropEvent* event, bool isCert);
83 Ui::IdentityEditWidget ui;
87 QSslKey keyByFilename(const QString& filename);
88 void showKeyState(const QSslKey& key);
89 QSslCertificate certByFilename(const QString& filename);
90 void showCertState(const QSslCertificate& cert);
93 bool testHasChanged();
96 class NickEditDlg : public QDialog
101 NickEditDlg(const QString& oldnick, QStringList existing = QStringList(), QWidget* parent = nullptr);
103 QString nick() const;
106 void on_nickEdit_textChanged(const QString&);
112 QStringList existing;
115 #endif // IDENTITYEDITWIDGET_H