X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fidentitiessettingspage.h;h=be0e9460eb1fa47e98bc0787a8a39dfc30eb4a35;hp=c0c862bc149107970187dca954cf808ebd16c107;hb=9d54503555534a2c554f09a33df6afa33d6308ec;hpb=48ed2b53aeb10bcbda6cdc46696bf649c0f6e670 diff --git a/src/qtui/settingspages/identitiessettingspage.h b/src/qtui/settingspages/identitiessettingspage.h index c0c862bc..be0e9460 100644 --- a/src/qtui/settingspages/identitiessettingspage.h +++ b/src/qtui/settingspages/identitiessettingspage.h @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-2014 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * (at your option) version 3. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -15,35 +15,39 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef _IDENTITIESSETTINGSPAGE_H_ -#define _IDENTITIESSETTINGSPAGE_H_ +#ifndef IDENTITIESSETTINGSPAGE_H +#define IDENTITIESSETTINGSPAGE_H -#include "identity.h" +#include "clientidentity.h" #include "settingspage.h" +#include "identityeditwidget.h" + #include "ui_identitiessettingspage.h" #include "ui_createidentitydlg.h" #include "ui_saveidentitiesdlg.h" -#include "ui_nickeditdlg.h" class QAbstractItemModel; -class IdentitiesSettingsPage : public SettingsPage { - Q_OBJECT +class IdentitiesSettingsPage : public SettingsPage +{ + Q_OBJECT - public: +public: IdentitiesSettingsPage(QWidget *parent = 0); + virtual inline bool needsCoreConnection() const { return true; } + bool aboutToSave(); - public slots: +public slots: void save(); void load(); - private slots: +private slots: void coreConnectionStateChanged(bool); void clientIdentityCreated(IdentityId); void clientIdentityUpdated(); @@ -55,85 +59,74 @@ class IdentitiesSettingsPage : public SettingsPage { void on_deleteIdentity_clicked(); void on_renameIdentity_clicked(); - void on_addNick_clicked(); - void on_deleteNick_clicked(); - void on_renameNick_clicked(); - void on_nickUp_clicked(); - void on_nickDown_clicked(); - +#ifdef HAVE_SSL + void continueUnsecured(); +#endif void widgetHasChanged(); void setWidgetStates(); - private: +private: Ui::IdentitiesSettingsPage ui; - QHash identities; + QHash identities; IdentityId currentId; - QList changedIdentities; // for setting the widget changed state + QList changedIdentities; // for setting the widget changed state QList deletedIdentities; - void insertIdentity(Identity *identity); + bool _editSsl; + + void insertIdentity(CertIdentity *identity); void removeIdentity(Identity *identity); void renameIdentity(IdentityId id, const QString &newName); - void displayIdentity(Identity *, bool dontsave = false); - void saveToIdentity(Identity *); + +#ifdef HAVE_SSL + QSslKey keyByFilename(const QString &filename); + void showKeyState(const QSslKey &key); + QSslCertificate certByFilename(const QString &filename); + void showCertState(const QSslCertificate &cert); +#endif bool testHasChanged(); }; -class CreateIdentityDlg : public QDialog { - Q_OBJECT - public: +// ============================== +// Various Dialogs +// ============================== +class CreateIdentityDlg : public QDialog +{ + Q_OBJECT + +public: CreateIdentityDlg(QAbstractItemModel *model, QWidget *parent = 0); QString identityName() const; IdentityId duplicateId() const; - private slots: +private slots: void on_identityName_textChanged(const QString &text); - private: +private: Ui::CreateIdentityDlg ui; }; -class SaveIdentitiesDlg : public QDialog { - Q_OBJECT - public: - SaveIdentitiesDlg(const QList &toCreate, const QList &toUpdate, const QList &toRemove, QWidget *parent = 0); +class SaveIdentitiesDlg : public QDialog +{ + Q_OBJECT + +public: + SaveIdentitiesDlg(const QList &toCreate, const QList &toUpdate, const QList &toRemove, QWidget *parent = 0); - private slots: +private slots: void clientEvent(); - private: +private: Ui::SaveIdentitiesDlg ui; - //QList toCreate, toUpdate; - //QList toRemove; - int numevents, rcvevents; - }; -class NickEditDlg : public QDialog { - Q_OBJECT - - public: - NickEditDlg(const QString &oldnick, const QStringList &existing = QStringList(), QWidget *parent = 0); - - QString nick() const; - - private slots: - void on_nickEdit_textChanged(const QString &); - - private: - Ui::NickEditDlg ui; - - QString oldNick; - QStringList existing; - -}; #endif