X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fcoreaccountsettingspage.h;h=77c97007705f8bf7db906315a91b011a15f25904;hp=831ab5ee0b5620305d86553cf5cf622f00146eca;hb=cc6e7c08709c4e761e2fd9c2e322751015497003;hpb=9fc57dc2c000e80fb8bd746a090e2e8210e1278e diff --git a/src/qtui/settingspages/coreaccountsettingspage.h b/src/qtui/settingspages/coreaccountsettingspage.h index 831ab5ee..77c97007 100644 --- a/src/qtui/settingspages/coreaccountsettingspage.h +++ b/src/qtui/settingspages/coreaccountsettingspage.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -21,11 +21,11 @@ #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" @@ -38,16 +38,16 @@ class CoreAccountSettingsPage : public SettingsPage Q_OBJECT public: - CoreAccountSettingsPage(QWidget *parent = 0); + 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(); + void save() override; + void load() override; void setSelectedAccount(AccountId accId); void setStandAlone(bool); @@ -59,33 +59,32 @@ 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: 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 // ======================================== @@ -94,23 +93,29 @@ class CoreAccountEditDlg : public QDialog Q_OBJECT public: - CoreAccountEditDlg(const CoreAccount &account, QWidget *parent = 0); + CoreAccountEditDlg(const CoreAccount& account, QWidget* parent = nullptr); 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(); private: Ui::CoreAccountEditDlg ui; CoreAccount _account; + enum ProxyType + { + NoProxy, + SystemProxy, + ManualProxy + }; }; - // ======================================== // FilteredCoreAccountModel // ======================================== @@ -121,14 +126,13 @@ 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; }; - #endif