X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fidentitiessettingspage.h;h=11f4e438a539fa87d812addc5c15a00e00757b53;hp=27be75c889d1206d7b63e480d7f18c6f2b81e078;hb=HEAD;hpb=8e56bbef20a6d13a05fa20ba85ff54e4a5817ee1 diff --git a/src/qtui/settingspages/identitiessettingspage.h b/src/qtui/settingspages/identitiessettingspage.h index 27be75c8..168e9374 100644 --- a/src/qtui/settingspages/identitiessettingspage.h +++ b/src/qtui/settingspages/identitiessettingspage.h @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005-09 by the Quassel Project * + * Copyright (C) 2005-2022 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,114 +15,110 @@ * 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 +#pragma once #include "clientidentity.h" -#include "settingspage.h" - #include "identityeditwidget.h" +#include "settingspage.h" -#include "ui_identitiessettingspage.h" #include "ui_createidentitydlg.h" +#include "ui_identitiessettingspage.h" #include "ui_saveidentitiesdlg.h" class QAbstractItemModel; -class IdentitiesSettingsPage : public SettingsPage { - Q_OBJECT +class IdentitiesSettingsPage : public SettingsPage +{ + Q_OBJECT public: - IdentitiesSettingsPage(QWidget *parent = 0); + IdentitiesSettingsPage(QWidget* parent = nullptr); + + inline bool needsCoreConnection() const override { return true; } - bool aboutToSave(); + bool aboutToSave() override; public slots: - void save(); - void load(); + void save() final override; + void load() final override; private slots: - void coreConnectionStateChanged(bool); - void clientIdentityCreated(IdentityId); - void clientIdentityUpdated(); - void clientIdentityRemoved(IdentityId); + void coreConnectionStateChanged(bool); + void clientIdentityCreated(IdentityId); + void clientIdentityUpdated(); + void clientIdentityRemoved(IdentityId); - void on_identityList_currentIndexChanged(int index); + void on_identityList_currentIndexChanged(int index); - void on_addIdentity_clicked(); - void on_deleteIdentity_clicked(); - void on_renameIdentity_clicked(); + void on_addIdentity_clicked(); + void on_deleteIdentity_clicked(); + void on_renameIdentity_clicked(); -#ifdef HAVE_SSL - void continueUnsecured(); -#endif - void widgetHasChanged(); - void setWidgetStates(); + void continueUnsecured(); + void widgetHasChanged(); + void setWidgetStates(); private: - Ui::IdentitiesSettingsPage ui; + Ui::IdentitiesSettingsPage ui; - QHash identities; - IdentityId currentId; + QHash identities; + IdentityId currentId; - QList changedIdentities; // for setting the widget changed state - QList deletedIdentities; + QList changedIdentities; // for setting the widget changed state + QList deletedIdentities; - bool _editSsl; + bool _editSsl{false}; - void insertIdentity(CertIdentity *identity); - void removeIdentity(Identity *identity); - void renameIdentity(IdentityId id, const QString &newName); + void insertIdentity(CertIdentity* identity); + void removeIdentity(Identity* identity); + void renameIdentity(IdentityId id, const QString& newName); -#ifdef HAVE_SSL - QSslKey keyByFilename(const QString &filename); - void showKeyState(const QSslKey &key); - QSslCertificate certByFilename(const QString &filename); - void showCertState(const QSslCertificate &cert); -#endif + QSslKey keyByFilename(const QString& filename); + void showKeyState(const QSslKey& key); + QSslCertificate certByFilename(const QString& filename); + void showCertState(const QSslCertificate& cert); - bool testHasChanged(); + bool testHasChanged(); }; // ============================== // Various Dialogs // ============================== -class CreateIdentityDlg : public QDialog { - Q_OBJECT +class CreateIdentityDlg : public QDialog +{ + Q_OBJECT public: - CreateIdentityDlg(QAbstractItemModel *model, QWidget *parent = 0); + CreateIdentityDlg(QAbstractItemModel* model, QWidget* parent = nullptr); - QString identityName() const; - IdentityId duplicateId() const; + QString identityName() const; + IdentityId duplicateId() const; private slots: - void on_identityName_textChanged(const QString &text); + void on_identityName_textChanged(const QString& text); private: - Ui::CreateIdentityDlg ui; + Ui::CreateIdentityDlg ui; }; - - -class SaveIdentitiesDlg : public QDialog { - Q_OBJECT +class SaveIdentitiesDlg : public QDialog +{ + Q_OBJECT public: - SaveIdentitiesDlg(const QList &toCreate, const QList &toUpdate, const QList &toRemove, QWidget *parent = 0); + SaveIdentitiesDlg(const QList& toCreate, + const QList& toUpdate, + const QList& toRemove, + QWidget* parent = nullptr); private slots: - void clientEvent(); + void clientEvent(); private: - Ui::SaveIdentitiesDlg ui; + Ui::SaveIdentitiesDlg ui; - int numevents, rcvevents; + int numevents, rcvevents; }; - - - -#endif