• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | List of all members
TDEConfigDialog Class Reference

#include <tdeconfigdialog.h>

Inheritance diagram for TDEConfigDialog:
KDialogBase KDialog

Signals

void widgetModified ()
 
void settingsChanged ()
 
void settingsChanged (const char *dialogName)
 
- Signals inherited from KDialogBase
void helpClicked ()
 
void defaultClicked ()
 
void user3Clicked ()
 
void user2Clicked ()
 
void user1Clicked ()
 
void applyClicked ()
 
void tryClicked ()
 
void okClicked ()
 
void yesClicked ()
 
void noClicked ()
 
void cancelClicked ()
 
void closeClicked ()
 
void apply ()
 
void backgroundChanged ()
 
void hidden ()
 
void finished ()
 
void aboutToShowDetails ()
 
void aboutToShowPage (TQWidget *page)
 
- Signals inherited from KDialog
void layoutHintChanged ()
 

Public Member Functions

 TDEConfigDialog (TQWidget *parent, const char *name, TDEConfigSkeleton *config, DialogType dialogType=IconList, int dialogButtons=Default|Ok|Apply|Cancel|Help, ButtonCode defaultButton=Ok, bool modal=false)
 
 ~TDEConfigDialog ()
 
void addPage (TQWidget *page, const TQString &itemName, const TQString &pixmapName, const TQString &header=TQString::null, bool manage=true)
 
void addPage (TQWidget *page, TDEConfigSkeleton *config, const TQString &itemName, const TQString &pixmapName, const TQString &header=TQString::null)
 
virtual void show ()
 
- Public Member Functions inherited from KDialogBase
 KDialogBase (TQWidget *parent=0, const char *name=0, bool modal=true, const TQString &caption=TQString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
 
 KDialogBase (int dialogFace, const TQString &caption, int buttonMask, ButtonCode defaultButton, TQWidget *parent=0, const char *name=0, bool modal=true, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
 
 KDialogBase (KDialogBase::DialogType dialogFace, WFlags f, TQWidget *parent=0, const char *name=0, bool modal=true, const TQString &caption=TQString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
 
 KDialogBase (const TQString &caption, int buttonMask=Yes|No|Cancel, ButtonCode defaultButton=Yes, ButtonCode escapeButton=Cancel, TQWidget *parent=0, const char *name=0, bool modal=true, bool separator=false, const KGuiItem &yes=KStdGuiItem::yes(), const KGuiItem &no=KStdGuiItem::no(), const KGuiItem &cancel=KStdGuiItem::cancel())
 
 ~KDialogBase ()
 
void setButtonBoxOrientation (int orientation)
 
void setEscapeButton (ButtonCode id)
 
virtual void adjustSize ()
 
virtual TQSize sizeHint () const
 
virtual TQSize minimumSizeHint () const
 
TQFrame * plainPage ()
 
TQFrame * addPage (const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
TQFrame * addPage (const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
TQVBox * addVBoxPage (const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
TQVBox * addVBoxPage (const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
TQHBox * addHBoxPage (const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
TQHBox * addHBoxPage (const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
TQGrid * addGridPage (int n, Orientation dir, const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
TQGrid * addGridPage (int n, Orientation dir, const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
void setFolderIcon (const TQStringList &path, const TQPixmap &pixmap)
 
TQFrame * makeMainWidget ()
 
TQVBox * makeVBoxMainWidget ()
 
TQHBox * makeHBoxMainWidget ()
 
TQGrid * makeGridMainWidget (int n, Orientation dir)
 
void enableButtonSeparator (bool state)
 
void showButton (ButtonCode id, bool state)
 
void showButtonOK (bool state)
 
void showButtonApply (bool state)
 
void showButtonCancel (bool state)
 
bool showPage (int index)
 
int activePageIndex () const
 
int pageIndex (TQWidget *widget) const
 
void setMainWidget (TQWidget *widget)
 
TQWidget * mainWidget ()
 
void disableResize ()
 
void setInitialSize (const TQSize &s, bool noResize=false)
 
void incInitialSize (const TQSize &s, bool noResize=false)
 
TQSize configDialogSize (const TQString &groupName) const
 
TQSize configDialogSize (TDEConfig &config, const TQString &groupName) const
 
void saveDialogSize (const TQString &groupName, bool global=false)
 
void saveDialogSize (TDEConfig &config, const TQString &groupName, bool global=false) const
 
void setButtonOK (const KGuiItem &item=KStdGuiItem::ok())
 
void setButtonOKText (const TQString &text=TQString::null, const TQString &tooltip=TQString::null, const TQString &quickhelp=TQString::null) TDE_DEPRECATED
 
void setButtonApply (const KGuiItem &item=KStdGuiItem::apply())
 
void setButtonApplyText (const TQString &text=TQString::null, const TQString &tooltip=TQString::null, const TQString &quickhelp=TQString::null) TDE_DEPRECATED
 
void setButtonCancel (const KGuiItem &item=KStdGuiItem::cancel())
 
void setButtonCancelText (const TQString &text=TQString::null, const TQString &tooltip=TQString::null, const TQString &quickhelp=TQString::null) TDE_DEPRECATED
 
void setButtonText (ButtonCode id, const TQString &text)
 
void setButtonTip (ButtonCode id, const TQString &text)
 
void setButtonWhatsThis (ButtonCode id, const TQString &text)
 
void setButtonGuiItem (ButtonCode id, const KGuiItem &item)
 
void setTreeListAutoResize (bool state)
 
void setShowIconsInTreeList (bool state)
 
void setRootIsDecorated (bool state)
 
void unfoldTreeList (bool persist=false)
 
void addWidgetBelowList (TQWidget *widget)
 
void addButtonBelowList (const TQString &text, TQObject *recv, const char *slot)
 
void addButtonBelowList (const KGuiItem &guiitem, TQObject *recv, const char *slot)
 
void setIconListAllVisible (bool state)
 
void showTile (bool state)
 
void getBorderWidths (int &ulx, int &uly, int &lrx, int &lry) const TDE_DEPRECATED
 
TQRect getContentsRect () const TDE_DEPRECATED
 
TQSize calculateSize (int w, int h) const
 
TQString helpLinkText () const
 
TQPushButton * actionButton (ButtonCode id)
 
- Public Member Functions inherited from KDialog
 KDialog (TQWidget *parent=0, const char *name=0, bool modal=false, WFlags f=0)
 

Static Public Member Functions

static TDEConfigDialog * exists (const char *name)
 
static bool showDialog (const char *name)
 
- Static Public Member Functions inherited from KDialogBase
static bool haveBackgroundTile ()
 
static const TQPixmap * backgroundTile ()
 
static const TQPixmap * getBackgroundTile () TDE_DEPRECATED
 
static void setBackgroundTile (const TQPixmap *pix)
 
- Static Public Member Functions inherited from KDialog
static int marginHint ()
 
static int spacingHint ()
 
static void resizeLayout (TQWidget *widget, int margin, int spacing)
 
static void resizeLayout (TQLayoutItem *lay, int margin, int spacing)
 
static void centerOnScreen (TQWidget *widget, int screen=-1)
 
static bool avoidArea (TQWidget *widget, const TQRect &area, int screen=-1)
 

Protected Slots

virtual void updateSettings ()
 
virtual void updateWidgets ()
 
virtual void updateWidgetsDefault ()
 
void updateButtons ()
 
void settingsChangedSlot ()
 
- Protected Slots inherited from KDialogBase
virtual void slotHelp ()
 
virtual void slotDefault ()
 
virtual void slotDetails ()
 
virtual void slotUser3 ()
 
virtual void slotUser2 ()
 
virtual void slotUser1 ()
 
virtual void slotOk ()
 
virtual void slotApply ()
 
virtual void slotTry ()
 
virtual void slotYes ()
 
virtual void slotNo ()
 
virtual void slotCancel ()
 
virtual void slotClose ()
 
virtual void applyPressed ()
 
void updateGeometry ()
 
void slotDelayedDestruct ()
 

Protected Member Functions

virtual bool hasChanged ()
 
virtual bool isDefault ()
 
- Protected Member Functions inherited from KDialogBase
virtual void keyPressEvent (TQKeyEvent *e)
 
virtual void hideEvent (TQHideEvent *)
 
virtual void closeEvent (TQCloseEvent *e)
 
virtual void virtual_hook (int id, void *data)
 
virtual void keyPressEvent (TQKeyEvent *)
 
virtual void virtual_hook (int id, void *data)
 

Additional Inherited Members

- Public Types inherited from KDialogBase
enum  ButtonCode {
  Help = 0x00000001 , Default = 0x00000002 , Ok = 0x00000004 , Apply = 0x00000008 ,
  Try = 0x00000010 , Cancel = 0x00000020 , Close = 0x00000040 , User1 = 0x00000080 ,
  User2 = 0x00000100 , User3 = 0x00000200 , No = 0x00000080 , Yes = 0x00000100 ,
  Details = 0x00000400 , Filler = 0x40000000 , Stretch = 0x80000000 , NoDefault
}
 
enum  ActionButtonStyle {
  ActionStyle0 =0 , ActionStyle1 , ActionStyle2 , ActionStyle3 ,
  ActionStyle4 , ActionStyleMAX
}
 
enum  DialogType {
  TreeList = KJanusWidget::TreeList , Tabbed = KJanusWidget::Tabbed , Plain = KJanusWidget::Plain , Swallow = KJanusWidget::Swallow ,
  IconList = KJanusWidget::IconList
}
 
- Public Slots inherited from KDialogBase
void enableButton (ButtonCode id, bool state)
 
void enableButtonOK (bool state)
 
void enableButtonApply (bool state)
 
void enableButtonCancel (bool state)
 
void enableLinkedHelp (bool state)
 
void delayedDestruct ()
 
void setHelpLinkText (const TQString &text)
 
void setHelp (const TQString &anchor, const TQString &appname=TQString::null)
 
void helpClickedSlot (const TQString &)
 
void setDetails (bool showDetails)
 
void setDetailsWidget (TQWidget *detailsWidget)
 
void updateBackground ()
 
void cancel ()
 
- Public Slots inherited from KDialog
virtual void polish ()
 
virtual void setCaption (const TQString &caption)
 
virtual void setPlainCaption (const TQString &caption)
 

Detailed Description

Standard KDE configuration dialog class.

The TDEConfigDialog class provides an easy and uniform means of displaying a settings dialog using KDialogBase, TDEConfigDialogManager and a TDEConfigSkeleton derived settings class.

TDEConfigDialog handles the enabling and disabling of buttons, creation of the dialog, and deletion of the widgets. Because of TDEConfigDialogManager, this class also manages: restoring the settings, reseting them to the default values, and saving them. This requires that the names of the widgets corresponding to configuration entries have to have the same name plus an additional "kcfg_" prefix. For example the widget named "kcfg_MyOption" would be associated with the configuration entry "MyOption".

Here is an example usage of TDEConfigDialog:

void KCoolApp::showSettings(){
if(TDEConfigDialog::showDialog("settings"))
return;
TDEConfigDialog *dialog = new TDEConfigDialog(this, "settings", MySettings::self(), KDialogBase::IconList);
dialog->addPage(new General(0, "General"), i18n("General") );
dialog->addPage(new Appearance(0, "Style"), i18n("Appearance") );
connect(dialog, TQ_SIGNAL(settingsChanged()), mainWidget, TQ_SLOT(loadSettings()));
connect(dialog, TQ_SIGNAL(settingsChanged()), this, TQ_SLOT(loadSettings()));
dialog->show();
}
KDialogBase::mainWidget
TQWidget * mainWidget()
Returns the main widget if any.
Definition: kdialogbase.cpp:1464
TDEConfigDialog
Standard KDE configuration dialog class.
Definition: tdeconfigdialog.h:72
TDEConfigDialog::addPage
void addPage(TQWidget *page, const TQString &itemName, const TQString &pixmapName, const TQString &header=TQString::null, bool manage=true)
Adds page to the dialog and to TDEConfigDialogManager.
Definition: tdeconfigdialog.cpp:86
TDEConfigDialog::show
virtual void show()
Show the dialog.
Definition: tdeconfigdialog.cpp:214
TDEConfigDialog::showDialog
static bool showDialog(const char *name)
Attempts to show the dialog with the name 'name'.
Definition: tdeconfigdialog.cpp:166
TDEConfigDialog::TDEConfigDialog
TDEConfigDialog(TQWidget *parent, const char *name, TDEConfigSkeleton *config, DialogType dialogType=IconList, int dialogButtons=Default|Ok|Apply|Cancel|Help, ButtonCode defaultButton=Ok, bool modal=false)
Definition: tdeconfigdialog.cpp:49
TDEConfigDialog::settingsChanged
void settingsChanged()
One or more of the settings have been permanently changed such as if the user clicked on the Apply or...

Other than the above code, each class that has settings in the dialog should have a loadSettings() type slot to read settings and perform any necessary changes.

Please note that using the setMainWidget method inherited from KDialogBase currently yields broken behaviour at runtime; use addPage() instead.

See also
TDEConfigSkeleton
Author
Waldo Bastian basti.nosp@m.an@k.nosp@m.de.or.nosp@m.g
Since
3.2

Definition at line 72 of file tdeconfigdialog.h.

Constructor & Destructor Documentation

◆ TDEConfigDialog()

TDEConfigDialog::TDEConfigDialog ( TQWidget *  parent,
const char *  name,
TDEConfigSkeleton *  config,
DialogType  dialogType = IconList,
int  dialogButtons = Default|Ok|Apply|Cancel|Help,
ButtonCode  defaultButton = Ok,
bool  modal = false 
)
Parameters
parent- The parent of this object. Even though the class deletes itself the parent should be set so the dialog can be centered with the application on the screen.
name- The name of this object. The name is used in determining if there can be more than one dialog at a time. Use names such as: "Font Settings" or "Color Settings" and not just "Settings" in applications where there is more than one dialog.
dialogType- Type used in creating the dialog. See KDialogBase
config- Config object containing settings.
dialogButtons- Buttons that should show up on the dialog.
defaultButtondefault button that is choosen by hitting the enter key.
modal- Whether the dialog should be modal. To prevent more than one non-modal settings dialog from showing the static function showDialog() can be used in determining if the settings dialog already exists before creating a new TDEConfigDialog object.

Definition at line 49 of file tdeconfigdialog.cpp.

◆ ~TDEConfigDialog()

TDEConfigDialog::~TDEConfigDialog ( )

Deconstructor, removes name from the list of open dialogs.

Deletes private class.

See also
exists()

Definition at line 80 of file tdeconfigdialog.cpp.

Member Function Documentation

◆ addPage() [1/2]

void TDEConfigDialog::addPage ( TQWidget *  page,
const TQString &  itemName,
const TQString &  pixmapName,
const TQString &  header = TQString::null,
bool  manage = true 
)

Adds page to the dialog and to TDEConfigDialogManager.

When an application is done adding pages show() should be called to display the dialog. Note that after you call show() you can not add any more pages to the dialog.

Parameters
page- Pointer to the page that is to be added to the dialog. This object is reparented.
itemName- Name of the page.
pixmapName- Name of the pixmap that should be used if needed.
header- Header text use in the list modes. Ignored in Tabbed mode. If empty, the itemName text is used when needed.
manage- Whether TDEConfigDialogManager should manage the page or not.

Definition at line 86 of file tdeconfigdialog.cpp.

◆ addPage() [2/2]

void TDEConfigDialog::addPage ( TQWidget *  page,
TDEConfigSkeleton *  config,
const TQString &  itemName,
const TQString &  pixmapName,
const TQString &  header = TQString::null 
)

Adds page to the dialog that is managed by a custom TDEConfigDialogManager.

This is useful for dialogs that contain settings spread over more than one configuration file and thus have/need more than one TDEConfigSkeleton. When an application is done adding pages show() should be called to display the dialog. Note that after you call show() you can not add any more pages to the dialog.

Parameters
page- Pointer to the page that is to be added to the dialog. This object is reparented.
config- Config object containing corresponding settings.
itemName- Name of the page.
pixmapName- Name of the pixmap that should be used if needed.
header- Header text use in the list modes. Ignored in Tabbed mode. If empty, the itemName text is used when needed.

Definition at line 97 of file tdeconfigdialog.cpp.

◆ exists()

TDEConfigDialog * TDEConfigDialog::exists ( const char *  name)
static

See if a dialog with the name 'name' already exists.

See also
showDialog()
Parameters
name- Dialog name to look for.
Returns
Pointer to widget or NULL if it does not exist.

Definition at line 161 of file tdeconfigdialog.cpp.

◆ hasChanged()

virtual bool TDEConfigDialog::hasChanged ( )
inlineprotectedvirtual

Returns whether the current state of the dialog is different from the current configutation.

Virtual function for custom additions.

Definition at line 233 of file tdeconfigdialog.h.

◆ isDefault()

virtual bool TDEConfigDialog::isDefault ( )
inlineprotectedvirtual

Returns whether the current state of the dialog is the same as the default configuration.

Definition at line 239 of file tdeconfigdialog.h.

◆ settingsChanged [1/2]

void TDEConfigDialog::settingsChanged ( )
signal

One or more of the settings have been permanently changed such as if the user clicked on the Apply or Ok button.

◆ settingsChanged [2/2]

void TDEConfigDialog::settingsChanged ( const char *  dialogName)
signal

One or more of the settings have been permanently changed such as if the user clicked on the Apply or Ok button.

This signal is useful when using TDEConfigDialog to configure items in a list. When emitted the main class would then know what item in the list was actually changed.

Parameters
dialogNamethe name of the dialog.

◆ settingsChangedSlot

void TDEConfigDialog::settingsChangedSlot ( )
protectedslot

Some setting was changed.

Emit the signal with the dialogs name

Definition at line 206 of file tdeconfigdialog.cpp.

◆ show()

void TDEConfigDialog::show ( void  )
virtual

Show the dialog.

Definition at line 214 of file tdeconfigdialog.cpp.

◆ showDialog()

bool TDEConfigDialog::showDialog ( const char *  name)
static

Attempts to show the dialog with the name 'name'.

See also
exists()
Parameters
name- The name of the dialog to show.
Returns
True if the dialog 'name' exists and was shown.

Definition at line 166 of file tdeconfigdialog.cpp.

◆ updateButtons

void TDEConfigDialog::updateButtons ( )
protectedslot

Updates the Apply and Default buttons.

Definition at line 174 of file tdeconfigdialog.cpp.

◆ updateSettings

void TDEConfigDialog::updateSettings ( )
protectedvirtualslot

Update the settings from the dialog.

Virtual function for custom additions.

Example use: User clicks Ok or Apply button in a configure dialog.

Definition at line 246 of file tdeconfigdialog.cpp.

◆ updateWidgets

void TDEConfigDialog::updateWidgets ( )
protectedvirtualslot

Update the dialog based on the settings.

Virtual function for custom additions.

Example use: Initialisation of dialog. Example use: User clicks Reset button in a configure dialog.

Definition at line 250 of file tdeconfigdialog.cpp.

◆ updateWidgetsDefault

void TDEConfigDialog::updateWidgetsDefault ( )
protectedvirtualslot

Update the dialog based on the default settings.

Virtual function for custom additions.

Example use: User clicks Defaults button in a configure dialog.

Definition at line 254 of file tdeconfigdialog.cpp.

◆ widgetModified

void TDEConfigDialog::widgetModified ( )
signal

A widget in the dialog was modified.


The documentation for this class was generated from the following files:
  • tdeconfigdialog.h
  • tdeconfigdialog.cpp

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.4
This website is maintained by Timothy Pearson.