|
|
KControlApplication is the common base for setup applications.
It provides a tab dialog and functionality common to most setup programs.
See also: KControlDialog, KConfigWidget
KControlApplication ( int& argc, char** argv, const QCString& _name ) |
Creates the setup application.
The constructor scans the command line arguments. If there is a single argument, "-init", the function init() is called and the application terminates. Otherwise the setup dialog is created and inkoved.
Parameters:
argc | Number of commandline arguments |
argv | Commandline arguments |
_name | Name of the application |
~KControlApplication () |
Destructor. Cleans up.
int exec () |
Starts the application if runGUI() is enabled, otherwise calls init()
Control modules should use this function instead of QApplication::exec(). Keep in mind that exec() is not virtual.
void setTitle ( const QString& _title ) |
Sets the title of the dialog.
It's not possible to set the title within the constructor, because we need the application to get the translator and it would mean a lot of effort to do it without the one in kapp.
Parameters:
_title | Text to be shown in the dialogs titlebar |
bool runGUI () |
Determines if the setup dialog has to be run.
The setup dialog has to be run if the application has not been invoked with a single commandline argument containing "-init".
QStrList* getPageList () |
Returns the tabbed dialog object, normally a KControlDialog object.
/** Returns the list of pages to show.
Returns: Pointer to a QStrList obejct or NULL if no special pages choosen.
void addPage ( QWidget* _page, const QString& _name, const QString& _help_name ) |
Adds a new page to the dialog.
Parameters:
_page | Pointer to a widget, that shall be added as page. |
_name | Name of the page. |
_help_name | Name of the help page for this page. |
void init () |
This function is called at startup of the KDE desktop to initialize persistent settings of the module.
This function must be overriden by all setup application that want to have persistent settings.
Do not forget to add a line "Init=yourControlModule -init" tn the dotdesktop file of your module. Otherwise the system can't find you.
void apply () |
This function is called to apply the settings currently selected in the dialog.
This function must be overriden by all setup applications.
void help () |
This function is called when the help button is pressed.
The default behaviour is to call
kapp->invokeHTMLHelp("kcontrol/$(appname)/$(help_name).html","");
void defaultValues () |
This function is called when the user presses the default button.
This function must be overriden by all setup application.
KControlDialog* dialog |
Pointer to the KControlDialog object.
QStrList* pages |
Pointer to QStrList object for all pages that shall be shown or NULL if all shall be shown.