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

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

Inheritance diagram for NetworksSettingsPage:
Collaboration diagram for NetworksSettingsPage:

Public Slots

void save ()
void load ()
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

 NetworksSettingsPage (QWidget *parent=0)
virtual bool needsCoreConnection () const
 Whether the settingspage needs a core connection to be selectable.
bool aboutToSave ()
 Called immediately before save() is called.
virtual QString category () const
 The category of this settings page.
virtual QString title () const
 The title of this settings page.
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.

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 ()
void setWidgetStates ()
void coreConnectionStateChanged (bool)
void networkConnectionStateChanged (Network::ConnectionState state)
void networkConnectionError (const QString &msg)
void displayNetwork (NetworkId)
void setItemState (NetworkId, QListWidgetItem *item=0)
void clientNetworkAdded (NetworkId)
void clientNetworkRemoved (NetworkId)
void clientNetworkUpdated ()
void clientIdentityAdded (IdentityId)
void clientIdentityRemoved (IdentityId)
void clientIdentityUpdated ()
void on_networkList_itemSelectionChanged ()
void on_addNetwork_clicked ()
void on_deleteNetwork_clicked ()
void on_renameNetwork_clicked ()
void on_editIdentities_clicked ()
void on_serverList_itemSelectionChanged ()
void on_addServer_clicked ()
void on_deleteServer_clicked ()
void on_editServer_clicked ()
void on_upServer_clicked ()
void on_downServer_clicked ()

Private Member Functions

void reset ()
bool testHasChanged ()
QListWidgetItem * insertNetwork (NetworkId)
QListWidgetItem * insertNetwork (const NetworkInfo &info)
QListWidgetItem * networkItem (NetworkId) const
void saveToNetworkInfo (NetworkInfo &)
IdentityId defaultIdentity () const

Private Attributes

Ui::NetworksSettingsPage ui
NetworkId currentId
QHash< NetworkId, NetworkInfonetworkInfos
bool _ignoreWidgetChanges
QIcon connectedIcon
QIcon connectingIcon
QIcon disconnectedIcon

Detailed Description

Definition at line 36 of file networkssettingspage.h.

Constructor & Destructor Documentation

Member Function Documentation

virtual bool needsCoreConnection ( ) const
inlinevirtual

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 from SettingsPage.

Definition at line 43 of file networkssettingspage.h.

bool aboutToSave ( )
virtual

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 from SettingsPage.

Definition at line 177 of file networkssettingspage.cpp.

References currentId, networkInfos, saveToNetworkInfo(), and NetworkInfo::serverList.

void load ( )
slot
void coreConnectionStateChanged ( bool  state)
privateslot

Definition at line 308 of file networkssettingspage.cpp.

References load().

Referenced by NetworksSettingsPage().

void networkConnectionStateChanged ( Network::ConnectionState  state)
privateslot

Definition at line 427 of file networkssettingspage.cpp.

References Network::networkId(), setItemState(), and setWidgetStates().

Referenced by clientNetworkAdded().

void networkConnectionError ( const QString &  msg)
privateslot

Definition at line 442 of file networkssettingspage.cpp.

Referenced by clientNetworkAdded().

void clientNetworkAdded ( NetworkId  id)
privateslot
void clientNetworkRemoved ( NetworkId  id)
privateslot
void clientNetworkUpdated ( )
privateslot
void clientIdentityAdded ( IdentityId  id)
privateslot
void clientIdentityUpdated ( )
privateslot

Definition at line 340 of file networkssettingspage.cpp.

References Identity::id(), Identity::identityName, SignedId::toInt(), and ui.

Referenced by clientIdentityAdded().

void on_networkList_itemSelectionChanged ( )
privateslot
void on_deleteNetwork_clicked ( )
privateslot
void on_renameNetwork_clicked ( )
privateslot
void on_editIdentities_clicked ( )
privateslot

Definition at line 761 of file networkssettingspage.cpp.

void on_serverList_itemSelectionChanged ( )
privateslot

Definition at line 695 of file networkssettingspage.cpp.

References setWidgetStates().

void on_addServer_clicked ( )
privateslot
void on_deleteServer_clicked ( )
privateslot

Definition at line 728 of file networkssettingspage.cpp.

References currentId, displayNetwork(), networkInfos, ui, and widgetHasChanged().

void on_editServer_clicked ( )
privateslot
void on_upServer_clicked ( )
privateslot
void on_downServer_clicked ( )
privateslot
void reset ( )
private

Definition at line 169 of file networkssettingspage.cpp.

References currentId, networkInfos, and ui.

Referenced by load().

bool testHasChanged ( )
private
QListWidgetItem * insertNetwork ( NetworkId  id)
private
QListWidgetItem * insertNetwork ( const NetworkInfo info)
private
QListWidgetItem * networkItem ( NetworkId  id) const
private

Definition at line 376 of file networkssettingspage.cpp.

References ui.

Referenced by setItemState().

IdentityId defaultIdentity ( ) const
private

Definition at line 768 of file networkssettingspage.cpp.

References Client::identityIds().

Referenced by clientIdentityRemoved(), and on_addNetwork_clicked().

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

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 93 of file networkssettingspage.h.

Referenced by displayNetwork(), NetworksSettingsPage(), and widgetHasChanged().

QIcon connectedIcon
private

Definition at line 98 of file networkssettingspage.h.

Referenced by NetworksSettingsPage(), and setItemState().

QIcon connectingIcon
private

Definition at line 98 of file networkssettingspage.h.

Referenced by NetworksSettingsPage(), and setItemState().

QIcon disconnectedIcon
private

Definition at line 98 of file networkssettingspage.h.

Referenced by insertNetwork(), NetworksSettingsPage(), and setItemState().


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