kpilot

ConduitConfigBase Class Reference

ConduitConfigBase is for configuration purposes. More...

#include <plugin.h>

Inheritance diagram for ConduitConfigBase:

List of all members.


Signals

void changed (bool)

Public Member Functions

virtual void commit ()=0
 ConduitConfigBase (QWidget *parent=0L, const char *n=0L)
QString conduitName () const
virtual bool isModified () const
virtual void load ()=0
virtual bool maybeSave ()
QWidgetwidget () const
virtual ~ConduitConfigBase ()

Static Public Member Functions

static QWidgetaboutPage (QWidget *parent, KAboutData *data=0L)
static void addAboutPage (QTabWidget *w, KAboutData *data=0L)

Protected Slots

void modified ()

Protected Member Functions

virtual QString maybeSaveText () const
void unmodified ()

Protected Attributes

QString fConduitName
bool fModified
QWidgetfWidget

Detailed Description

ConduitConfigBase is for configuration purposes.

ConduitConfigBase: this is an object (with a widget!) that is embedded in a dialog. This is the currently preferred form for configuration, and it's what is used in the KPilot conduit configuration dialog. The factory is asked for a "ConduitConfigBase" object.

NB. The reason that this is a QObject which needs to create a separate widget - instead of a QWidget subclass - has to do with layouting. If you make the widget with designer then the easiest thing to do is to use a grid layout there. Making ConduitConfigBase a QWidget subclass would require an additional layout here, which seems a little foolish.

Definition at line 78 of file plugin.h.


Constructor & Destructor Documentation

ConduitConfigBase::ConduitConfigBase ( QWidget parent = 0L,
const char *  n = 0L 
)

Constructor.

Creates a conduit configuration support object with the given parent parent and name (optional) n.

Definition at line 68 of file plugin.cc.

ConduitConfigBase::~ConduitConfigBase (  )  [virtual]

Destructor.

Definition at line 78 of file plugin.cc.


Member Function Documentation

QWidget * ConduitConfigBase::aboutPage ( QWidget parent,
KAboutData *  data = 0L 
) [static]

This creates the actual about widget.

Again, public & static so you can slap in an about widget wherever.

An about widget is created that shows the contributors to the application, along with copyright information and the application's icon. This widget can be used pretty much anywhere. Copied from KAboutDialog, mostly.

Parameters:
parent The widget that holds the about widget.
data The KAboutData that is used to populate the widget.

Definition at line 111 of file plugin.cc.

void ConduitConfigBase::addAboutPage ( QTabWidget w,
KAboutData *  data = 0L 
) [static]

This is the function that does the work of adding an about page to a tabwidget.

It is made public and static so that it can be used elsewhere wherever tabwidgets appear.

The about tab is created using aboutPage(). The new about widget is added to the tab widget w with the heading "About".

Parameters:
w The tab widget to which the about page is added.
data The KAboutData that is used.

Definition at line 253 of file plugin.cc.

void ConduitConfigBase::changed ( bool   )  [signal]

virtual void ConduitConfigBase::commit (  )  [pure virtual]

Load or save the config widget's settings in the given KConfig object; leave the group unchanged.

load() and commit() should both call unmodified() to indicate that the current settings match the on-disk ones.

Implemented in AbbrowserWidgetSetup, DOCWidgetConfig, KNotesConfigBase, MALWidgetSetup, PopMailWidgetConfig, SysInfoWidgetConfig, TimeWidgetConfig, VCalWidgetSetupBase, DeviceConfigPage, SyncConfigPage, BackupConfigPage, StartExitConfigPage, and ViewersConfigPage.

QString ConduitConfigBase::conduitName (  )  const [inline]

Definition at line 127 of file plugin.h.

virtual bool ConduitConfigBase::isModified ( void   )  const [inline, virtual]

This function is called to check whether the configuration of the conduit has changed -- and hence, whether the user needs to be prompted.

By default, this just returns fModified, but you can do more complicated things.

Reimplemented in SysInfoWidgetConfig.

Definition at line 97 of file plugin.h.

bool ConduitConfigBase::maybeSave (  )  [virtual]

Called when the object is to be hidden again and might need to save changed settings.

Should prompt the user and call commit() if needed. Override this function only if you need a very different kind of prompt window.

Returns false if the change is to be canceled. Returns true otherwise, whether or not the changes were saved.

Definition at line 97 of file plugin.cc.

QString ConduitConfigBase::maybeSaveText (  )  const [protected, virtual]

This function provides the string for the prompt used in maybeSave().

Override it to change the text.

Reimplemented in ConfigPage.

Definition at line 89 of file plugin.cc.

void ConduitConfigBase::modified (  )  [protected, slot]

Definition at line 83 of file plugin.cc.

void ConduitConfigBase::unmodified (  )  [inline, protected]

Definition at line 166 of file plugin.h.

QWidget* ConduitConfigBase::widget (  )  const [inline]

Accessor for the actual widget for the configuration.

Definition at line 103 of file plugin.h.


Member Data Documentation

Definition at line 170 of file plugin.h.

bool ConduitConfigBase::fModified [protected]

Definition at line 166 of file plugin.h.

Definition at line 169 of file plugin.h.


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