ConfigWidgetProxy Class Reference
This class can be used to implement demand-loading of config pages. More...
#include <configwidgetproxy.h>
Inheritance diagram for ConfigWidgetProxy:


Signals | |
void | insertConfigWidget (const KDialogBase *dlg, QWidget *page, unsigned int pagenumber) |
The proxy emits this signal to notify the client that a specific config page has been requested. | |
Public Member Functions | |
ConfigWidgetProxy (KDevCore *core) | |
virtual | ~ConfigWidgetProxy () |
void | createGlobalConfigPage (QString const &title, unsigned int pagenumber, QString const &icon="kdevelop") |
Tell the proxy you want a page in the Global Settings. | |
void | createProjectConfigPage (QString const &title, unsigned int pagenumber, QString const &icon="kdevelop") |
Tell the proxy you want a page in the Project Settings. | |
void | removeConfigPage (int pagenumber) |
Remove a config page from the proxy. | |
Private Types | |
typedef QMap< unsigned int, QPair< QString, QString > > | TitleMap |
typedef QMap< QWidget *, int > | PageMap |
Private Slots | |
void | slotConfigWidget (KDialogBase *) |
void | slotProjectConfigWidget (KDialogBase *) |
void | slotConfigWidgetDestroyed () |
void | slotAboutToShowPage (QWidget *page) |
Private Attributes | |
TitleMap | _globalTitleMap |
TitleMap | _projectTitleMap |
PageMap | _pageMap |
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 BOOKMARKSETTINGSPAGE 1
_configProxy = new ConfigWidgetProxy( core() ); _configProxy->createProjectConfigPage( i18n("Bookmarks"), BOOKMARKSETTINGSPAGE ); connect( _configProxy, SIGNAL(insertConfigWidget(const QObject*, QWidget*, unsigned int )), this, SLOT(insertConfigWidget(const QObject*, QWidget*, unsigned int )) );
... ...
void BookmarksPart::insertConfigWidget( QObject const * dlg, QWidget * page, unsigned int pagenumber ) { if ( pagenumber == BOOKMARKSETTINGSPAGE ) { BookmarkSettings * w = new BookmarkSettings( this, page ); connect( dlg, SIGNAL(okClicked()), w, SLOT(slotAccept()) ); } }
Note that this replaces the typical KDevPlugin configWidget() and projectConfigWidget() slots.
Definition at line 64 of file configwidgetproxy.h.
Member Typedef Documentation
|
Definition at line 109 of file configwidgetproxy.h. |
|
Definition at line 108 of file configwidgetproxy.h. |
Constructor & Destructor Documentation
|
Definition at line 35 of file configwidgetproxy.cpp. References slotConfigWidget(), and slotProjectConfigWidget(). |
|
Definition at line 41 of file configwidgetproxy.cpp. |
Member Function Documentation
|
Tell the proxy you want a page in the Global Settings.
Definition at line 44 of file configwidgetproxy.cpp. References _globalTitleMap. Referenced by DocTreeViewPart::DocTreeViewPart(), and DocumentationPart::DocumentationPart(). |
|
Tell the proxy you want a page in the Project Settings.
Definition at line 49 of file configwidgetproxy.cpp. References _projectTitleMap. Referenced by DocTreeViewPart::DocTreeViewPart(), and DocumentationPart::DocumentationPart(). |
|
The proxy emits this signal to notify the client that a specific config page has been requested.
Referenced by slotAboutToShowPage(). |
|
Remove a config page from the proxy. Next time the settings dialog opens, this page will not be available.
Definition at line 54 of file configwidgetproxy.cpp. References _globalTitleMap, and _projectTitleMap. |
|
Definition at line 91 of file configwidgetproxy.cpp. References _pageMap, and insertConfigWidget(). Referenced by slotConfigWidget(), and slotProjectConfigWidget(). |
|
Definition at line 60 of file configwidgetproxy.cpp. References _globalTitleMap, _pageMap, KDialogBase::addVBoxPage(), slotAboutToShowPage(), and slotConfigWidgetDestroyed(). Referenced by ConfigWidgetProxy(). |
|
Definition at line 86 of file configwidgetproxy.cpp. References _pageMap. Referenced by slotConfigWidget(), and slotProjectConfigWidget(). |
|
Definition at line 73 of file configwidgetproxy.cpp. References _pageMap, _projectTitleMap, KDialogBase::addVBoxPage(), slotAboutToShowPage(), and slotConfigWidgetDestroyed(). Referenced by ConfigWidgetProxy(). |
Member Data Documentation
|
Definition at line 111 of file configwidgetproxy.h. Referenced by createGlobalConfigPage(), removeConfigPage(), and slotConfigWidget(). |
|
Definition at line 113 of file configwidgetproxy.h. Referenced by slotAboutToShowPage(), slotConfigWidget(), slotConfigWidgetDestroyed(), and slotProjectConfigWidget(). |
|
Definition at line 112 of file configwidgetproxy.h. Referenced by createProjectConfigPage(), removeConfigPage(), and slotProjectConfigWidget(). |
The documentation for this class was generated from the following files:
- lib/util/configwidgetproxy.h
- lib/util/configwidgetproxy.cpp