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

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

Inheritance diagram for BacklogSettingsPage:
Collaboration diagram for BacklogSettingsPage:

Public Slots

void save ()
void load ()
void defaults ()

Signals

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

Public Member Functions

 BacklogSettingsPage (QWidget *parent=0)
QString settingsKey () const
 The key this settings page stores its values under.
bool hasDefaults () const
 Derived classes need to define this and return true if they have default settings.
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 widgetHasChanged ()

Private Attributes

Ui::BacklogSettingsPage ui

Detailed Description

Definition at line 29 of file backlogsettingspage.h.

Constructor & Destructor Documentation

BacklogSettingsPage ( QWidget *  parent = 0)

Definition at line 26 of file backlogsettingspage.cpp.

References SettingsPage::initAutoWidgets(), ui, and widgetHasChanged().

Member Function Documentation

QString settingsKey ( ) const
inlinevirtual

The key this settings page stores its values under.

This needs to be overriden to enable automatic loading/saving/hasChanged checking of widgets. The child widgets' values will be stored in client settings under this key. Every widget that should be automatically handled needs to have a settingsKey property set, and should also provide a defaultValue property. You can return an empty string (as opposed to a null string) to use the config root as a base, and you can override this key for individual widgets by prefixing their SettingsKey with /.

Reimplemented from SettingsPage.

Definition at line 36 of file backlogsettingspage.h.

bool hasDefaults ( ) const
virtual

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 40 of file backlogsettingspage.cpp.

void save ( )
slot

Definition at line 65 of file backlogsettingspage.cpp.

References BacklogSettings::setRequesterType(), and ui.

void load ( )
slot

Definition at line 54 of file backlogsettingspage.cpp.

References BacklogSettings::requesterType(), and ui.

void defaults ( )
slot

Definition at line 46 of file backlogsettingspage.cpp.

References ui.

void widgetHasChanged ( )
privateslot

Definition at line 75 of file backlogsettingspage.cpp.

References SettingsPage::setChangedState(), and ui.

Referenced by BacklogSettingsPage().

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 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

Ui::BacklogSettingsPage ui
private

Definition at line 48 of file backlogsettingspage.h.

Referenced by BacklogSettingsPage(), defaults(), load(), save(), and widgetHasChanged().


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