KDE 4.4 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

KStartupInfo Class Reference

from PyKDE4.kdeui import *

Inherits: QObject

Detailed Description

Class for manipulating the application startup notification.

This class can be used to send information about started application, change the information and receive this information. For detailed description, see kdelibs/kdecore/README.kstartupinfo.

You usually don't need to use this class for sending the notification information, as KDE libraries should do this when an application is started (e.g. KRun class).

For receiving the startup notification info, create an instance and connect to its slots. It will automatically detect started applications and when they are ready.

See also:
KStartupInfoId
See also:
KStartupInfoData

Author:
Lubos Lunak <l.lunak@kde.org>


Enumerations

<anonymous> { CleanOnCantDetect, DisableKWinModule, AnnounceSilenceChanges }
startup_t { NoMatch, Match, CantDetect }

Signals

 gotNewStartup (KStartupInfoId id, KStartupInfoData data)
 gotRemoveStartup (KStartupInfoId id, KStartupInfoData data)
 gotStartupChange (KStartupInfoId id, KStartupInfoData data)

Methods

 __init__ (self, int flags, QObject parent=0)
 __init__ (self, KStartupInfo a0)
 appStarted (self)
 appStarted (self, QByteArray startup_id)
KStartupInfo.startup_t checkStartup (self, WId w)
KStartupInfo.startup_t checkStartup (self, WId w, KStartupInfoId id)
KStartupInfo.startup_t checkStartup (self, WId w, KStartupInfoData data)
KStartupInfo.startup_t checkStartup (self, WId w, KStartupInfoId id, KStartupInfoData data)
QByteArray createNewStartupId (self)
KStartupInfoId currentStartupIdEnv (self)
 customEvent (self, QEvent e_P)
 disableAutoAppStartedSending (self, bool disable=1)
 gotNewStartup (self, KStartupInfoId id, KStartupInfoData data)
 gotRemoveStartup (self, KStartupInfoId id, KStartupInfoData data)
 gotStartupChange (self, KStartupInfoId id, KStartupInfoData data)
 handleAutoAppStartedSending (self)
 resetStartupEnv (self)
bool sendChange (self, KStartupInfoId id, KStartupInfoData data)
bool sendFinish (self, KStartupInfoId id)
bool sendFinish (self, KStartupInfoId id, KStartupInfoData data)
bool sendStartup (self, KStartupInfoId id, KStartupInfoData data)
 setNewStartupId (self, QWidget window, QByteArray startup_id)
 setTimeout (self, long secs)
 setWindowStartupId (self, WId window, QByteArray id)
 silenceStartup (self, bool silence)
QByteArray windowStartupId (self, WId w)

Method Documentation

__init__ (  self,
int  flags,
QObject  parent=0
)
__init__ (  self,
KStartupInfo  a0
)
appStarted (   self )

Sends explicit notification that the startup notification with id startup_id should end.

appStarted (  self,
QByteArray  startup_id
)

Sends explicit notification that the startup notification with id startup_id should end.

KStartupInfo.startup_t checkStartup (  self,
WId  w
)

Checks if the given windows matches any existing startup notification, and if yes, returns the identification in id and notification data in data.

Parameters:
w  the window id to check
id  if found, the id of the startup notification will be written here
data  if found, the data of the startup notification will be written here

Returns:
the result of the operation

KStartupInfo.startup_t checkStartup (  self,
WId  w,
KStartupInfoId  id
)

Checks if the given windows matches any existing startup notification, and if yes, returns the identification in id and notification data in data.

Parameters:
w  the window id to check
id  if found, the id of the startup notification will be written here
data  if found, the data of the startup notification will be written here

Returns:
the result of the operation

KStartupInfo.startup_t checkStartup (  self,
WId  w,
KStartupInfoData  data
)

Checks if the given windows matches any existing startup notification, and if yes, returns the identification in id and notification data in data.

Parameters:
w  the window id to check
id  if found, the id of the startup notification will be written here
data  if found, the data of the startup notification will be written here

Returns:
the result of the operation

KStartupInfo.startup_t checkStartup (  self,
WId  w,
KStartupInfoId  id,
KStartupInfoData  data
)

Checks if the given windows matches any existing startup notification, and if yes, returns the identification in id and notification data in data.

Parameters:
w  the window id to check
id  if found, the id of the startup notification will be written here
data  if found, the data of the startup notification will be written here

Returns:
the result of the operation

QByteArray createNewStartupId (   self )

Creates and returns new startup id. The id includes properly setup user timestamp.

KStartupInfoId currentStartupIdEnv (   self )

Returns the current startup notification identification for the current startup notification environment variable. Note that KApplication constructor unsets the variable and you have to use KApplication.startupId .

Returns:
the current startup notification identification

customEvent (  self,
QEvent  e_P
)

disableAutoAppStartedSending (  self,
bool  disable=1
)

By default, the startup notification is ended for the application after it shows its first toplevel window. If you app e.g. has several toplevel windows after its startup, you can disable the automatic handling, and call appStarted() manually after all toplevel windows have been shown.

gotNewStartup (  self,
KStartupInfoId  id,
KStartupInfoData  data
)

Emitted when a new startup notification is created (i.e. a new application is being started).

Parameters:
id  the notification identification
data  the notification data

Signal syntax:
QObject.connect(source, SIGNAL("gotNewStartup(const const KStartupInfoId&, const const KStartupInfoData&)"), target_slot)
gotRemoveStartup (  self,
KStartupInfoId  id,
KStartupInfoData  data
)

Emitted when a startup notification is removed (either because it was detected that the application is ready or because of a timeout).

Parameters:
id  the notification identification
data  the notification data

Signal syntax:
QObject.connect(source, SIGNAL("gotRemoveStartup(const const KStartupInfoId&, const const KStartupInfoData&)"), target_slot)
gotStartupChange (  self,
KStartupInfoId  id,
KStartupInfoData  data
)

Emitted when a startup notification changes.

Parameters:
id  the notification identification
data  the notification data

Signal syntax:
QObject.connect(source, SIGNAL("gotStartupChange(const const KStartupInfoId&, const const KStartupInfoData&)"), target_slot)
handleAutoAppStartedSending (   self )

Internal:

resetStartupEnv (   self )

Unsets the startup notification environment variable.

bool sendChange (  self,
KStartupInfoId  id,
KStartupInfoData  data
)

Sends given notification data about started application with the given startup identification. This is used for updating the notification info, if no notification for this identification exists, it's ignored.

Parameters:
id  the id of the application
data  the application's data

Returns:
true if successful, false otherwise
See also:
KStartupInfoId
See also:
KStartupInfoData

bool sendFinish (  self,
KStartupInfoId  id
)

Ends startup notification with the given identification and the given data ( e.g. PIDs of processes for this startup notification that exited ).

Parameters:
id  the id of the application
data  the application's data

Returns:
true if successful, false otherwise

bool sendFinish (  self,
KStartupInfoId  id,
KStartupInfoData  data
)

Ends startup notification with the given identification and the given data ( e.g. PIDs of processes for this startup notification that exited ).

Parameters:
id  the id of the application
data  the application's data

Returns:
true if successful, false otherwise

bool sendStartup (  self,
KStartupInfoId  id,
KStartupInfoData  data
)

Sends given notification data about started application with the given startup identification. If no notification for this identification exists yet, it is created, otherwise it's updated. Note that the name field in data is required.

Parameters:
id  the id of the application
data  the application's data

Returns:
true if successful, false otherwise
See also:
KStartupInfoId
See also:
KStartupInfoData

setNewStartupId (  self,
QWidget  window,
QByteArray  startup_id
)

Use this function if the application got a request with startup notification from outside (for example, when KUniqueApplication.newInstance() is called, or e.g. when khelpcenter opens new URL in its window). The window can be either an already existing and visible window, or a new one, before being shown. Note that this function is usually needed only when a window is reused.

setTimeout (  self,
long  secs
)

Sets the timeout for notifications, after this timeout a notification is removed.

Parameters:
secs  the new timeout in seconds

setWindowStartupId (  self,
WId  window,
QByteArray  id
)

Sets the startup notification window property on the given window.

Parameters:
window  the id of the window
id  the startup notification id

silenceStartup (  self,
bool  silence
)

If your application shows temporarily some window during its startup, for example a dialog, and only after closing it shows the main window, startup notification would normally be shown while the dialog is visible. To temporarily suspend and resume the notification, use this function. Note that this is cumulative, i.e. after suspending twice, you have to resume twice.

QByteArray windowStartupId (  self,
WId  w
)

Returns startup notification identification of the given window.

Parameters:
w  the id of the window

Returns:
the startup notification id. Can be null if not found.


Enumeration Documentation

anonymous
Enumerator:
CleanOnCantDetect 
DisableKWinModule 
AnnounceSilenceChanges 

startup_t
Enumerator:

  • Full Index

Modules

  • akonadi
  • dnssd
  • kdecore
  • kdeui
  • khtml
  • kio
  • knewstuff
  • kparts
  • kutils
  • nepomuk
  • phonon
  • plasma
  • polkitqt
  • solid
  • soprano
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal