1 /***************************************************************************
2 * Copyright (C) 2005-2020 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 ***************************************************************************/
23 #include <QSslCertificate>
26 #include "clientidentity.h"
28 #include "ui_identityeditwidget.h"
29 #include "ui_nickeditdlg.h"
31 class IdentityEditWidget : public QWidget
36 IdentityEditWidget(QWidget* parent = nullptr);
45 void displayIdentity(CertIdentity* id, CertIdentity* saveId = nullptr);
46 void saveToIdentity(CertIdentity* id);
49 void setSslState(SslState state);
50 void showAdvanced(bool advanced);
53 bool eventFilter(QObject* watched, QEvent* event) override;
56 void requestEditSsl();
57 void widgetHasChanged();
60 void on_addNick_clicked();
61 void on_deleteNick_clicked();
62 void on_renameNick_clicked();
63 void on_nickUp_clicked();
64 void on_nickDown_clicked();
66 void on_clearOrLoadKeyButton_clicked();
67 void on_clearOrLoadCertButton_clicked();
68 void setWidgetStates();
70 void sslDragEnterEvent(QDragEnterEvent* event);
71 void sslDropEvent(QDropEvent* event, bool isCert);
74 Ui::IdentityEditWidget ui;
77 QSslKey keyByFilename(const QString& filename);
78 void showKeyState(const QSslKey& key);
79 QSslCertificate certByFilename(const QString& filename);
80 void showCertState(const QSslCertificate& cert);
82 bool testHasChanged();
85 class NickEditDlg : public QDialog
90 NickEditDlg(const QString& oldnick, QStringList existing = QStringList(), QWidget* parent = nullptr);
95 void on_nickEdit_textChanged(const QString&);
101 QStringList existing;