Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
CoreAccountSettingsPage Class Reference

#include </tmp/quassel/src/qtui/settingspages/coreaccountsettingspage.h>

Inheritance diagram for CoreAccountSettingsPage:
Collaboration diagram for CoreAccountSettingsPage:

Public Slots

void save ()
void load ()
void setSelectedAccount (AccountId accId)
void setStandAlone (bool)
virtual void defaults ()
 Restore defaults, overriding any changes the user might have made in the dialog.

Signals

void connectToCore (AccountId accId)
void changed (bool hasChanged)
 Emitted whenever the widget state changes.

Public Member Functions

 CoreAccountSettingsPage (QWidget *parent=0)
bool hasDefaults () const
 Derived classes need to define this and return true if they have default settings.
bool isStandAlone () const
AccountId selectedAccount () const
virtual QString category () const
 The category of this settings page.
virtual QString title () const
 The title of this settings page.
virtual bool needsCoreConnection () const
 Whether the settingspage needs a core connection to be selectable.
bool hasChanged () const
 Check if there are changes in the page, compared to the state saved in permanent storage.
virtual bool aboutToSave ()
 Called immediately before save() is called.

Static Public Member Functions

static bool hasChanged (QCheckBox *box)
static bool hasChanged (QComboBox *box)
static bool hasChanged (QSpinBox *box)
static void load (QCheckBox *box, bool checked)
 sets checked state depending on and stores the value for later comparision
static void load (QComboBox *box, int index)
static void load (QSpinBox *box, int value)

Protected Slots

void changed ()
 Calling this slot is equivalent to calling setChangedState(true).
void setChangedState (bool hasChanged=true)
 This should be called whenever the widget state changes from unchanged to change or the other way round.

Protected Member Functions

void initAutoWidgets ()
virtual QVariant loadAutoWidgetValue (const QString &widgetName)
virtual void saveAutoWidgetValue (const QString &widgetName, const QVariant &value)

Private Slots

void on_addAccountButton_clicked ()
void on_editAccountButton_clicked ()
void on_deleteAccountButton_clicked ()
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)

Private Member Functions

CoreAccountModelmodel () const
FilteredCoreAccountModelfilteredModel () const
void editAccount (const QModelIndex &)
bool testHasChanged ()
QString settingsKey () const

Private Attributes

Ui::CoreAccountSettingsPage ui
CoreAccountModel_model
FilteredCoreAccountModel_filteredModel
AccountId _lastAccountId
AccountId _lastAutoConnectId
bool _standalone

Detailed Description

Definition at line 36 of file coreaccountsettingspage.h.

Constructor & Destructor Documentation

Member Function Documentation

bool hasDefaults ( ) const
inlinevirtual

Derived classes need to define this and return true if they have default settings.

If this method returns true, the "Restore Defaults" button in the SettingsDlg is enabled. You also need to provide an implementation of defaults() then.

The default implementation returns false.

Reimplemented from SettingsPage.

Definition at line 43 of file coreaccountsettingspage.h.

bool isStandAlone ( ) const
inline

Definition at line 44 of file coreaccountsettingspage.h.

References _standalone.

Referenced by on_accountView_doubleClicked().

AccountId selectedAccount ( ) const
void setSelectedAccount ( AccountId  accId)
slot

Definition at line 141 of file coreaccountsettingspage.cpp.

References filteredModel(), model(), and ui.

Referenced by CoreConnectDlg::CoreConnectDlg().

void setStandAlone ( bool  standalone)
slot

Definition at line 56 of file coreaccountsettingspage.cpp.

References _standalone.

Referenced by CoreConnectDlg::CoreConnectDlg().

void connectToCore ( AccountId  accId)
signal
void on_addAccountButton_clicked ( )
privateslot
void on_editAccountButton_clicked ( )
privateslot

Definition at line 160 of file coreaccountsettingspage.cpp.

References editAccount(), and ui.

void on_deleteAccountButton_clicked ( )
privateslot
void on_accountView_doubleClicked ( const QModelIndex &  index)
privateslot
void setWidgetStates ( )
privateslot
void rowsAboutToBeRemoved ( const QModelIndex &  index,
int  start,
int  end 
)
privateslot
void rowsInserted ( const QModelIndex &  index,
int  start,
int  end 
)
privateslot
void editAccount ( const QModelIndex &  index)
private
bool testHasChanged ( )
private

Definition at line 226 of file coreaccountsettingspage.cpp.

References Client::coreAccountModel(), model(), and ui.

Referenced by widgetHasChanged().

QString settingsKey ( ) const
inlineprivate

Definition at line 85 of file coreaccountsettingspage.h.

virtual QString category ( ) const
inlinevirtualinherited

The category of this settings page.

Definition at line 66 of file settingspage.h.

References SettingsPage::_category.

Referenced by SettingsDlg::registerSettingsPage().

virtual QString title ( ) const
inlinevirtualinherited

The title of this settings page.

Definition at line 69 of file settingspage.h.

References SettingsPage::_title.

Referenced by SettingsDlg::registerSettingsPage(), and SettingsPageDlg::SettingsPageDlg().

virtual bool needsCoreConnection ( ) const
inlinevirtualinherited

Whether the settingspage needs a core connection to be selectable.

This is a hint for the settingspage dialog. Do not rely on the settingspage not being visible if disconnected, and care about disabling it yourself.

Reimplemented in IgnoreListSettingsPage, NetworksSettingsPage, IdentitiesSettingsPage, AliasesSettingsPage, and ConnectionSettingsPage.

Definition at line 75 of file settingspage.h.

Referenced by SettingsDlg::setItemState().

bool hasChanged ( QCheckBox *  box)
staticinherited

Definition at line 58 of file settingspage.cpp.

bool hasChanged ( QComboBox *  box)
staticinherited

Definition at line 71 of file settingspage.cpp.

bool hasChanged ( QSpinBox *  box)
staticinherited

Definition at line 84 of file settingspage.cpp.

virtual bool aboutToSave ( )
inlinevirtualinherited

Called immediately before save() is called.

Derived classes should return false if saving is not possible (e.g. the current settings are invalid).

Returns
false, if the SettingsPage cannot be saved in its current state.

Reimplemented in NetworksSettingsPage, and IdentitiesSettingsPage.

Definition at line 102 of file settingspage.h.

void load ( QCheckBox *  box,
bool  checked 
)
staticinherited

sets checked state depending on and stores the value for later comparision

Definition at line 51 of file settingspage.cpp.

Referenced by NotificationsSettingsPage::load(), SettingsPageDlg::reload(), SettingsDlg::reload(), SettingsPageDlg::SettingsPageDlg(), SettingsPageDlg::undoChanges(), and SettingsDlg::undoChanges().

void load ( QComboBox *  box,
int  index 
)
staticinherited

Definition at line 64 of file settingspage.cpp.

void load ( QSpinBox *  box,
int  value 
)
staticinherited

Definition at line 77 of file settingspage.cpp.

void defaults ( )
virtualslotinherited

Restore defaults, overriding any changes the user might have made in the dialog.

This baseclass implementation loads the defaults of the autoWidgets (if available), so be sure to call it if you use this feature in your settingsPage!

Reimplemented in IndicatorNotificationBackend::ConfigWidget, SnoreNotificationBackend::ConfigWidget, SystrayNotificationBackend::ConfigWidget, DockManagerNotificationBackend::ConfigWidget, PhononNotificationBackend::ConfigWidget, TaskbarNotificationBackend::ConfigWidget, and OSXNotificationBackend::ConfigWidget.

Definition at line 228 of file settingspage.cpp.

References SettingsPage::_autoWidgets, SettingsPage::autoWidgetHasChanged(), and SettingsPage::autoWidgetPropertyName().

Referenced by NotificationsSettingsPage::defaults(), SettingsPageDlg::loadDefaults(), and SettingsDlg::loadDefaults().

void changed ( bool  hasChanged)
signalinherited

Emitted whenever the widget state changes.

QVariant loadAutoWidgetValue ( const QString &  widgetName)
protectedvirtualinherited

Definition at line 238 of file settingspage.cpp.

Referenced by SettingsPage::load().

void saveAutoWidgetValue ( const QString &  widgetName,
const QVariant &  value 
)
protectedvirtualinherited

Definition at line 245 of file settingspage.cpp.

Referenced by SettingsPage::save().

Member Data Documentation

CoreAccountModel* _model
private

Definition at line 73 of file coreaccountsettingspage.h.

Referenced by CoreAccountSettingsPage(), and model().

FilteredCoreAccountModel* _filteredModel
private

Definition at line 75 of file coreaccountsettingspage.h.

Referenced by CoreAccountSettingsPage(), and filteredModel().

AccountId _lastAccountId
private

Definition at line 78 of file coreaccountsettingspage.h.

Referenced by rowsAboutToBeRemoved(), and rowsInserted().

AccountId _lastAutoConnectId
private

Definition at line 78 of file coreaccountsettingspage.h.

Referenced by rowsAboutToBeRemoved(), and rowsInserted().

bool _standalone
private

Definition at line 79 of file coreaccountsettingspage.h.

Referenced by isStandAlone(), and setStandAlone().


The documentation for this class was generated from the following files: