KStartupInfoData

KDE 4.5 PyKDE API Reference

- KDE's Python API

# KStartupInfoData Class Reference

`from PyKDE4.kdeui import *`

## Detailed Description

Class representing data about an application startup notification.

Such data include the icon of the starting application, the desktop on which the application should start, the binary name of the application, etc.

See also:
  KStartupInfo

See also:
  KStartupInfoId

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

## Enumerations
TriState | { Yes, No, Unknown }
## Methods
| __init__ (self)
| __init__ (self, KStartupInfoData data)
| __init__ (self, QString txt)
QByteArray | WMClass (self)
| addPid (self, int pid)
QString | applicationId (self)
QString | bin (self)
QString | description (self)
int | desktop (self)
QString | findDescription (self)
QString | findIcon (self)
QString | findName (self)
QByteArray | findWMClass (self)
QByteArray | hostname (self)
QString | icon (self)
bool | is_pid (self, int pid)
int | launchedBy (self)
QString | name (self)
[int] | pids (self)
int | screen (self)
| setApplicationId (self, QString desktop)
| setBin (self, QString bin)
| setDescription (self, QString descr)
| setDesktop (self, int desktop)
| setHostname (self, QByteArray hostname=QByteArray())
| setIcon (self, QString icon)
| setLaunchedBy (self, int window)
| setName (self, QString name)
| setScreen (self, int screen)
| setSilent (self, KStartupInfoData.TriState state)
| setTimestamp (self, long time)
| setWMClass (self, QByteArray wmclass)
| setXinerama (self, int xinerama)
KStartupInfoData.TriState | silent (self)
long | timestamp (self)
| update (self, KStartupInfoData data)
int | xinerama (self)

## Method Documentation

__init__ | ( |  | self ) |

Constructor. Initializes all the data to their default empty values.

__init__ | ( | self, |
|  | KStartupInfoData | data
| ) |  |  |

Copy constructor.

__init__ | ( | self, |
|  | QString | txt
| ) |  |  |

QByteArray WMClass | ( |  | self ) |

Returns the WM_CLASS value for the startup notification, or empty if not available.

Returns:
  the WM_CLASS value for the startup notification, or empty if not set

addPid | ( | self, |
|  | int | pid
| ) |  |  |

Adds a PID to the list of processes that belong to the startup notification. It may be used to increase the chance that the windows created by the starting application will be detected correctly, and also for detecting if the application has quit without creating any window.

Parameters:

  | pid | the PID to add

QString applicationId | ( |  | self ) |

The .desktop file used to initiate this startup notification, or empty. This information should be used only to identify the application, not to read any additional information.

Since:
  4.5

QString bin | ( |  | self ) |

Returns the binary name of the starting application

Returns:
  the new binary name of the application

QString description | ( |  | self ) |

Returns the name of the startup notification, or empty if not available.

Returns:
  the name of the startup notificaiton, or an empty string if not set.

int desktop | ( |  | self ) |

Returns the desktop for the startup notification.

Returns:
  the desktop for the startup notification

QString findDescription | ( |  | self ) |

Returns the description of the startup notification. If it's not available, it returns name().

Returns:
  the description of the startup notification

QString findIcon | ( |  | self ) |

Returns the icon of the startup notification, and if it's not available, tries to get it from the binary name.

Returns:
  the name of the startup notification's icon, or the name of the binary if not set

QString findName | ( |  | self ) |

Returns the name of the startup notification. If it's not available, it tries to use other information (binary name).

Returns:
  the name of the startup notification

QByteArray findWMClass | ( |  | self ) |

Returns the WM_CLASS value for the startup notification, or binary name if not available.

Returns:
  the WM_CLASS value for the startup notification, or the binary name if not set

QByteArray hostname | ( |  | self ) |

Returns the hostname for the startup notification.

Returns:
  the hostname

QString icon | ( |  | self ) |

Returns the icon of the startup notification, or empty if not available.

Returns:
  the name of the icon, or an empty string if not set.

bool is_pid | ( | self, |
|  | int | pid
| ) |  |  |

Checks whether the given pid is in the list of PIDs for starup notification.

Returns:
  true if the given pid is in the list of PIDs for the startup notification

int launchedBy | ( |  | self ) |

The toplevel window of the application that caused this startup notification, 0 if unknown.

QString name | ( |  | self ) |

Returns the name of the startup notification, or empty if not available.

Returns:
  the name of the startup notification, or an empty string if not set.

[int] pids | ( |  | self ) |

Returns all PIDs for the startup notification.

Returns:
  the list of all PIDs

int screen | ( |  | self ) |

The X11 screen on which the startup notification is happening, -1 if unknown.

setApplicationId | ( | self, |
|  | QString | desktop
| ) |  |  |

Sets the .desktop file that was used to initiate the startup notification.

Since:
  4.5

setBin | ( | self, |
|  | QString | bin
| ) |  |  |

Sets the binary name of the application ( e.g. 'kcontrol' ).

Parameters:

  | bin | the new binary name of the application

setDescription | ( | self, |
|  | QString | descr
| ) |  |  |

Sets the description for the notification (e.g. 'Launching Control Center'). I.e. name() describes what is being started, while description() is the actual action performed by the starting.

setDesktop | ( | self, |
|  | int | desktop
| ) |  |  |

Sets the desktop for the startup notification ( i.e. the desktop on which the starting application should appear ).

Parameters:

  | desktop | the desktop for the startup notification

setHostname | ( | self, |
|  | QByteArray | hostname=QByteArray()
| ) |  |  |

Sets the hostname on which the application is starting. It's necessary to set it if PIDs are set.

Parameters:

  | hostname | the application's hostname. If it's a null string, the current hostname is used

setIcon | ( | self, |
|  | QString | icon
| ) |  |  |

Sets the icon for the startup notification ( e.g. 'kcontrol' )

Parameters:

  | icon | the name of the icon

setLaunchedBy | ( | self, |
|  | int | window
| ) |  |  |

Sets the toplevel window of the application that caused this startup notification.

Parameters:

  | window | window ID of the toplevel window that is responsible for this startup

setName | ( | self, |
|  | QString | name
| ) |  |  |

Sets the name for the notification (e.g. 'Control Center')

setScreen | ( | self, |
|  | int | screen
| ) |  |  |

Sets the X11 screen on which the startup notification should happen. This is usually not necessary to set, as it's set by default to QX11Info.screen().

setSilent | ( | self, |
|  | KStartupInfoData.TriState | state
| ) |  |  |

Sets whether the visual feedback for this startup notification should be silenced (temporarily suspended).

setTimestamp | ( | self, |
|  | long | time
| ) |  |  |

Obsolete:
  Timestamp is already assigned in KStartupInfoId.initId(). Sets timestamp for the startup notification. The timestamp is expressed as XServer time, and is used to prevent activation of the matching window if user interaction took place after this timestamp. Value -1 means no timestamp set, value 0 means that the window should not be activated.

setWMClass | ( | self, |
|  | QByteArray | wmclass
| ) |  |  |

Sets a WM_CLASS value for the startup notification, it may be used for increasing the chance that the windows created by the starting application will be detected correctly.

Parameters:

  | wmclass | the WM_CLASS value for the startup notification

setXinerama | ( | self, |
|  | int | xinerama
| ) |  |  |

Sets the Xinerama screen for the startup notification ( i.e. the screeen on which the starting application should appear ).

Parameters:

  | xinerama | the Xinerama screen for the startup notification

KStartupInfoData.TriState silent | ( |  | self ) |

Return the silence status for the startup notification.

Returns:
  KStartupInfoData.Yes if visual feedback is silenced

long timestamp | ( |  | self ) |

Obsolete:
  Use KStartupInfoId.timestamp(). Return the timestamp for the startup notification, or -1 if no timestamp is set.

update | ( | self, |
|  | KStartupInfoData | data
| ) |  |  |

Updates the notification data from the given data. Some data, such as the desktop or the name, won't be rewritten if already set.

Parameters:

  | data | the data to update

int xinerama | ( |  | self ) |

The Xinerama screen for the startup notification, -1 if unknown.

## Enumeration Documentation

TriState

Enumerator:

  Yes |
  No |
  Unknown |