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

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

Inheritance diagram for BufferViewSettingsPage:
Collaboration diagram for BufferViewSettingsPage:

Public Slots

void save ()
void load ()
void reset ()
virtual void defaults ()
 Restore defaults, overriding any changes the user might have made in the dialog.

Signals

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

Public Member Functions

 BufferViewSettingsPage (QWidget *parent=0)
 ~BufferViewSettingsPage ()
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.
virtual QString settingsKey () const
 The key this settings page stores its values under.
virtual bool hasDefaults () const
 Derived classes need to define this and return true if they have default settings.
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 coreConnectionStateChanged (bool state)
void addBufferView (BufferViewConfig *config)
void addBufferView (int bufferViewId)
void bufferViewDeleted ()
void newBufferView (const QString &bufferViewName)
void updateBufferView ()
void enableStatusBuffers (int networkIdx)
void on_addBufferView_clicked ()
void on_renameBufferView_clicked ()
void on_deleteBufferView_clicked ()
void bufferViewSelectionChanged (const QItemSelection &current, const QItemSelection &previous)
void widgetHasChanged ()

Private Member Functions

int listPos (BufferViewConfig *config)
BufferViewConfigbufferView (int listPos)
bool selectBufferViewById (int bufferViewId)
BufferViewConfigcloneConfig (BufferViewConfig *config)
BufferViewConfigconfigForDisplay (BufferViewConfig *config)
void loadConfig (BufferViewConfig *config)
void saveConfig (BufferViewConfig *config)
bool testHasChanged ()

Private Attributes

Ui::BufferViewSettingsPage ui
bool _ignoreWidgetChanges
bool _useBufferViewHint
int _bufferViewHint
QList< BufferViewConfig * > _newBufferViews
QList< int > _deleteBufferViews
QHash< BufferViewConfig
*, BufferViewConfig * > 
_changedBufferViews

Detailed Description

Definition at line 32 of file bufferviewsettingspage.h.

Constructor & Destructor Documentation

Definition at line 75 of file bufferviewsettingspage.cpp.

References reset().

Member Function Documentation

void coreConnectionStateChanged ( bool  state)
privateslot
void addBufferView ( BufferViewConfig config)
privateslot
void addBufferView ( int  bufferViewId)
privateslot
void bufferViewDeleted ( )
privateslot

Definition at line 225 of file bufferviewsettingspage.cpp.

References ui.

Referenced by addBufferView().

void updateBufferView ( )
privateslot
void enableStatusBuffers ( int  networkIdx)
privateslot

Definition at line 322 of file bufferviewsettingspage.cpp.

References ui.

Referenced by BufferViewSettingsPage().

void on_deleteBufferView_clicked ( )
privateslot
void bufferViewSelectionChanged ( const QItemSelection &  current,
const QItemSelection &  previous 
)
privateslot

Definition at line 414 of file bufferviewsettingspage.cpp.

References bufferView(), configForDisplay(), loadConfig(), and ui.

Referenced by BufferViewSettingsPage().

void widgetHasChanged ( )
privateslot
int listPos ( BufferViewConfig config)
private

Definition at line 267 of file bufferviewsettingspage.cpp.

References ui.

Referenced by newBufferView(), on_renameBufferView_clicked(), and updateBufferView().

BufferViewConfig * bufferView ( int  listPos)
private
bool selectBufferViewById ( int  bufferViewId)
private

Definition at line 291 of file bufferviewsettingspage.cpp.

References BufferViewConfig::bufferViewId(), and ui.

Referenced by addBufferView(), and load().

BufferViewConfig * configForDisplay ( BufferViewConfig config)
private

Definition at line 564 of file bufferviewsettingspage.cpp.

References _changedBufferViews.

Referenced by bufferViewSelectionChanged().

bool testHasChanged ( )
private
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().

virtual QString settingsKey ( ) const
inlinevirtualinherited

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 in BacklogSettingsPage.

Definition at line 85 of file settingspage.h.

Referenced by SettingsPage::autoWidgetSettingsKey().

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

bool _ignoreWidgetChanges
private

Definition at line 65 of file bufferviewsettingspage.h.

Referenced by load(), loadConfig(), and widgetHasChanged().

bool _useBufferViewHint
private

Definition at line 66 of file bufferviewsettingspage.h.

Referenced by load(), reset(), and save().

int _bufferViewHint
private

Definition at line 67 of file bufferviewsettingspage.h.

Referenced by load(), and save().

QList<BufferViewConfig *> _newBufferViews
private
QList<int> _deleteBufferViews
private

Definition at line 73 of file bufferviewsettingspage.h.

Referenced by on_deleteBufferView_clicked(), reset(), and save().

QHash<BufferViewConfig *, BufferViewConfig *> _changedBufferViews
private

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