X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fcoreaccountsettingspage.h;h=3d59485f864bb6de221d6ac1fbc3a9b9792edfc3;hb=c1cf157116de7fc3da96203aa6f03c38c7ebb650;hp=f28e01f083e60ef6f56988838f59a08b2de6ef94;hpb=5f4f134e79286b24c4c1b906ad9897ff6ec32f82;p=quassel.git diff --git a/src/qtui/settingspages/coreaccountsettingspage.h b/src/qtui/settingspages/coreaccountsettingspage.h index f28e01f0..3d59485f 100644 --- a/src/qtui/settingspages/coreaccountsettingspage.h +++ b/src/qtui/settingspages/coreaccountsettingspage.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,17 +15,17 @@ * 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 COREACCOUNTSETTINGSPAGE_H_ #define COREACCOUNTSETTINGSPAGE_H_ +#include #include -#include "settingspage.h" - #include "coreaccount.h" +#include "settingspage.h" #include "ui_coreaccounteditdlg.h" #include "ui_coreaccountsettingspage.h" @@ -33,20 +33,21 @@ class CoreAccountModel; class FilteredCoreAccountModel; -class CoreAccountSettingsPage : public SettingsPage { - Q_OBJECT +class CoreAccountSettingsPage : public SettingsPage +{ + Q_OBJECT - public: - CoreAccountSettingsPage(QWidget *parent = 0); +public: + CoreAccountSettingsPage(QWidget* parent = nullptr); - inline bool hasDefaults() const { return false; } + inline bool hasDefaults() const override { return false; } inline bool isStandAlone() const { return _standalone; } AccountId selectedAccount() const; - public slots: - void save(); - void load(); +public slots: + void save() override; + void load() override; void setSelectedAccount(AccountId accId); void setStandAlone(bool); @@ -54,57 +55,65 @@ class CoreAccountSettingsPage : public SettingsPage { signals: void connectToCore(AccountId accId); - private slots: +private slots: void on_addAccountButton_clicked(); void on_editAccountButton_clicked(); void on_deleteAccountButton_clicked(); - void on_accountView_doubleClicked(const QModelIndex &index); + void on_accountView_doubleClicked(const QModelIndex& index); void setWidgetStates(); void widgetHasChanged(); - void rowsAboutToBeRemoved(const QModelIndex &index, int start, int end); - void rowsInserted(const QModelIndex &index, int start, int end); + void rowsAboutToBeRemoved(const QModelIndex& index, int start, int end); + void rowsInserted(const QModelIndex& index, int start, int end); - private: +private: Ui::CoreAccountSettingsPage ui; - CoreAccountModel *_model; - inline CoreAccountModel *model() const { return _model; } - FilteredCoreAccountModel *_filteredModel; - inline FilteredCoreAccountModel *filteredModel() const { return _filteredModel; } + CoreAccountModel* _model; + inline CoreAccountModel* model() const { return _model; } + FilteredCoreAccountModel* _filteredModel; + inline FilteredCoreAccountModel* filteredModel() const { return _filteredModel; } AccountId _lastAccountId, _lastAutoConnectId; - bool _standalone; + bool _standalone{false}; - void editAccount(const QModelIndex &); + void editAccount(const QModelIndex&); bool testHasChanged(); - inline QString settingsKey() const { return QString("CoreAccounts"); } + inline QString settingsKey() const override { return QString("CoreAccounts"); } }; // ======================================== // CoreAccountEditDlg // ======================================== -class CoreAccountEditDlg : public QDialog { - Q_OBJECT +class CoreAccountEditDlg : public QDialog +{ + Q_OBJECT public: - CoreAccountEditDlg(const CoreAccount &account, QWidget *parent = 0); + CoreAccountEditDlg(const CoreAccount& account, QWidget* parent = nullptr); - CoreAccount account(); + CoreAccount account(); private slots: - void on_hostName_textChanged(const QString &); - void on_accountName_textChanged(const QString &); - void on_user_textChanged(const QString &); + void on_hostName_textChanged(const QString&); + void on_accountName_textChanged(const QString&); + void on_user_textChanged(const QString&); + void on_radioButtonManualProxy_toggled(bool checked); - void setWidgetStates(); + void setWidgetStates(); private: - Ui::CoreAccountEditDlg ui; - CoreAccount _account; + Ui::CoreAccountEditDlg ui; + CoreAccount _account; + enum ProxyType + { + NoProxy, + SystemProxy, + ManualProxy + }; }; // ======================================== @@ -112,17 +121,18 @@ private: // ======================================== //! This filters out the internal account from the non-monolithic client's UI -class FilteredCoreAccountModel : public QSortFilterProxyModel { - Q_OBJECT +class FilteredCoreAccountModel : public QSortFilterProxyModel +{ + Q_OBJECT public: - FilteredCoreAccountModel(CoreAccountModel *model, QObject *parent = 0); + FilteredCoreAccountModel(CoreAccountModel* model, QObject* parent = nullptr); protected: - virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; + bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override; private: - AccountId _internalAccount; + AccountId _internalAccount; }; #endif