• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Utility Library
 

KDevelop Utility Library

Signals | Public Member Functions | List of all members
ConfigWidgetProxy Class Reference

#include <configwidgetproxy.h>

Inherits TQObject.

Signals

void insertConfigWidget (const KDialogBase *dlg, TQWidget *page, unsigned int pagenumber)
 

Public Member Functions

 ConfigWidgetProxy (KDevCore *core)
 
void createGlobalConfigPage (TQString const &title, unsigned int pagenumber, TQString const &icon="tdevelop")
 
void createProjectConfigPage (TQString const &title, unsigned int pagenumber, TQString const &icon="tdevelop")
 
void removeConfigPage (int pagenumber)
 

Detailed Description

This class can be used to implement demand-loading of config pages.

In order to avoid the potentially heavy and unneccessary creation of a config page that might not be needed, this class can be used to delay the config page creation until the user explicitly asks for it.

A typical case looks like this:

#define GLOBALDOC_OPTIONS 1
#define PROJECTDOC_OPTIONS 2
_configProxy = new ConfigWidgetProxy( core() );
_configProxy->createGlobalConfigPage( i18n("My Part"), GLOBALDOC_OPTIONS, info()->icon() );
_configProxy->createProjectConfigPage( i18n("My Part"), PROJECTDOC_OPTIONS, info()->icon() );
connect( _configProxy, TQT_SIGNAL(insertConfigWidget(const TQObject*, TQWidget*, unsigned int )),
this, TQT_SLOT(insertConfigWidget(const TQObject*, TQWidget*, unsigned int )) );
...
...
void MyPart::insertConfigWidget( TQObject const * dlg, TQWidget * page, unsigned int pagenumber )
{
if ( pagenumber == PROJECTDOC_OPTIONS ) {
MyPartGlobalSettings * w = new MyPartGlobalSettings( this, page );
connect( dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(slotAccept()) );
} else if ( pagenumber == PROJECTDOC_OPTIONS ) {
MyPartProjectSettings * w = new MyPartProjectSettings( this, page );
connect( dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(slotAccept()) );
}
}

Note that this replaces the functionality of typical KDevCore::configWidget() and KDevCore::projectConfigWidget() slots.

Definition at line 71 of file configwidgetproxy.h.

Constructor & Destructor Documentation

◆ ConfigWidgetProxy()

ConfigWidgetProxy::ConfigWidgetProxy ( KDevCore *  core)

Constructor.

Parameters
coreAn instance of KDevelop Core.

Definition at line 35 of file configwidgetproxy.cpp.

Member Function Documentation

◆ createGlobalConfigPage()

void ConfigWidgetProxy::createGlobalConfigPage ( TQString const &  title,
unsigned int  pagenumber,
TQString const &  icon = "tdevelop" 
)

Tells the proxy you want a page in the Global Settings.

Parameters
titleThe title of the config page, shown in the settings dialog.
pagenumberA per-proxy unique identifier, used when responding to insertConfigWidget() signal.
iconThe name of the icon to use.

Definition at line 44 of file configwidgetproxy.cpp.

◆ createProjectConfigPage()

void ConfigWidgetProxy::createProjectConfigPage ( TQString const &  title,
unsigned int  pagenumber,
TQString const &  icon = "tdevelop" 
)

Tells the proxy you want a page in the Project Settings.

Parameters
titleThe title of the config page, shown in the settings dialog.
pagenumberA per-proxy unique identifier, used when responding to insertConfigWidget() signal.
iconThe name of the icon to use.

Definition at line 49 of file configwidgetproxy.cpp.

◆ insertConfigWidget

void ConfigWidgetProxy::insertConfigWidget ( const KDialogBase *  dlg,
TQWidget *  page,
unsigned int  pagenumber 
)
signal

The proxy emits this signal to notify the client that a specific config page has been requested.

Parameters
dlgThe settings dialog. The client should connect to its okClicked() signal.
pageThe setting page. The client should use this as parent to the config widget.
pagenumberThe identifier set in createGlobalConfigPage() or createProjectConfigPage(). Identifies the requested config page.

◆ removeConfigPage()

void ConfigWidgetProxy::removeConfigPage ( int  pagenumber)

Removes a config page from the proxy.

Next time the settings dialog opens, this page will not be available.

Parameters
pagenumberThe identifier set in createGlobalConfigPage() or createProjectConfigPage().

Definition at line 54 of file configwidgetproxy.cpp.


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

KDevelop Utility Library

Skip menu "KDevelop Utility Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

KDevelop Utility Library

Skip menu "KDevelop Utility Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Utility Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.