KDE 4.6 PyKDE API Reference

- KDE's Python API

# KCModuleProxy Class Reference

`from PyKDE4.kutils import *`

Inherits: QWidget → QObject

## Detailed Description

Encapsulates a KCModule for embedding.

KCModuleProxy is a wrapper for KCModule intended for cases where modules are to be displayed. It ensures layout is consistent and in general takes care of the details needed for making a module available in an interface. A KCModuleProxy can be treated as a QWidget, without worrying about the details specific for modules such as library loading. KCModuleProxy is not a sub class of KCModule but its API closely resembles KCModule's.\n Usually, an instance is created by passing one of the constructors a KService.Ptr, KCModuleInfo or simply the name of the module and then added to the layout as any other widget. When the user has changed the module, changed(bool) as well as changed(KCModuleProxy *) is emitted. KCModuleProxy does not take care of prompting for saving - if the object is deleted while changes is not saved the changes will be lost. changed() returns true if changes are unsaved. KCModuleProxy does not take care of authorization of KCModules. KCModuleProxy implements lazy loading, meaning the library will not be loaded or any other initialization done before its show() function is called. This means modules will only be loaded when they are actually needed as well as it is possible to load many KCModuleProxy without any speed penalty.

KCModuleProxy should be used in all cases where modules are embedded in order to promote code efficiency and usability consistency.

Author:
  Frans Englich <frans.englich@telia.com>

Author:
  Matthias Kretz <kretz@kde.org>

## Signals

| changed (bool state)
| changed (KCModuleProxy mod)
| childClosed ()
| quickHelpChanged ()

## Methods

| __init__ (self, KCModuleInfo info, QWidget parent=0, QStringList args=QStringList())
| __init__ (self, QString serviceName, QWidget parent=0, QStringList args=QStringList())
| __init__ (self, KSharedPtr<KService> service, QWidget parent=0, QStringList args=QStringList())
KAboutData | aboutData (self)
KCModule.Buttons | buttons (self)
bool | changed (self)
KComponentData | componentData (self)
QString | dbusPath (self)
QString | dbusService (self)
| defaults (self)
| deleteClient (self)
| load (self)
QSize | minimumSizeHint (self)
KCModuleInfo | moduleInfo (self)
QString | quickHelp (self)
KCModule | realModule (self)
QString | rootOnlyMessage (self)
| save (self)
| showEvent (self, QShowEvent a0)
bool | useRootOnlyMessage (self)

## Signal Documentation

changed | ( | bool | state
| ) |  |  |

This is emitted in the same situations as in the one above. Practical when several KCModuleProxys are loaded.

Signal syntax:
  `QObject.connect(source, SIGNAL("changed(bool)"), target_slot)`

changed | ( | KCModuleProxy | mod
| ) |  |  |

This is emitted in the same situations as in the one above. Practical when several KCModuleProxys are loaded.

Signal syntax:
  `QObject.connect(source, SIGNAL("changed(KCModuleProxy*)"), target_slot)`

childClosed | ( |  | ) |

When a module running with root privileges and exits, returns to normal mode, the childClosed() signal is emitted.

Signal syntax:
  `QObject.connect(source, SIGNAL("childClosed()"), target_slot)`

quickHelpChanged | ( |  | ) |

Signal syntax:
  `QObject.connect(source, SIGNAL("quickHelpChanged()"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | KCModuleInfo | info,
|  | QWidget | parent=0,
|  | QStringList | args=QStringList()
| ) |  |  |

Constructs a KCModuleProxy from a KCModuleInfo class.

Parameters:

  | info | The KCModuleInfo to construct the module from.
  | parent | the parent QWidget.
  | args | This is used in the implementation and is internal. Use the default.

__init__ | ( | self, |
|  | QString | serviceName,
|  | QWidget | parent=0,
|  | QStringList | args=QStringList()
| ) |  |  |

Constructs a KCModuleProxy from a module's service name, which is equivalent to the desktop file for the kcm without the ".desktop" part. Otherwise equal to the one above.

Parameters:

  | serviceName | The module's service name to construct from.
  | parent | the parent QWidget.
  | args | This is used in the implementation and is internal. Use the default.

__init__ | ( | self, |
|  | KSharedPtr<KService> | service,
|  | QWidget | parent=0,
|  | QStringList | args=QStringList()
| ) |  |  |

Constructs a KCModuleProxy from KService. Otherwise equal to the one above.

Parameters:

  | service | The KService to construct from.
  | parent | the parent QWidget.
  | args | This is used in the implementation and is internal. Use the default.

KAboutData aboutData | ( |  | self ) |

Returns:
  the module's aboutData()

KCModule.Buttons buttons | ( |  | self ) |

Returns:
  what buttons the module needs

bool changed | ( |  | self ) |

This is emitted in the same situations as in the one above. Practical when several KCModuleProxys are loaded.

KComponentData componentData | ( |  | self ) |

Returns the embedded KCModule's KComponentData.

Returns:
  The module's KComponentData.

Deprecated:

QString dbusPath | ( |  | self ) |

Returns the DBUS Path

QString dbusService | ( |  | self ) |

Returns the DBUS Service name

defaults | ( |  | self ) |

Calling it will cause the contained module to load its default values.

deleteClient | ( |  | self ) |

Calling this, results in deleting the contained module, and unregistering from DCOP. A similar result is achieved by deleting the KCModuleProxy itself.

load | ( |  | self ) |

Calling it will cause the contained module to run its load() routine.

QSize minimumSizeHint | ( |  | self ) |

Returns the recommended minimum size for the widget

KCModuleInfo moduleInfo | ( |  | self ) |

Returns:
  a KCModuleInfo for the encapsulated module

QString quickHelp | ( |  | self ) |

Returns:
  the module's quickHelp();

KCModule realModule | ( |  | self ) |

Access to the actual module. However, if the module is running in root mode, see rootMode(), this function returns a NULL pointer, since the module is in another process. It may also return NULL if anything goes wrong.

Returns:
  the encapsulated module.

QString rootOnlyMessage | ( |  | self ) |

Returns:
  The module's custom root message, if it has one

Deprecated:

save | ( |  | self ) |

Calling it will cause the contained module to run its save() routine.

If the module was not modified, it will not be asked to save.

showEvent | ( | self, |
|  | QShowEvent | a0
| ) |  |  |

Reimplemented for internal purposes. Makes sure the encapsulated module is loaded before the show event is taken care of.

bool useRootOnlyMessage | ( |  | self ) |

Returns:
  If the module is a root module.

Deprecated: