KDE 4.2 PyKDE API Reference

- KDE's Python API

# KNotificationRestrictions Class Reference

`from PyKDE4.kdeui import *`

Inherits: QObject

## Detailed Description

KNotificationRestrictions provides a simple mechanism to avoid disruptions during full screen presentations or other use cases where the screensaver or desktop notifcations are inappropriate.

Using KNotificationRestrictions is quite straightforward: create an instance of KNotificationRestrictions, passing in the set of or'd flags representing the services that should be prevented from interrupting the user. When done (for instance when the presentation is complete) simply delete the KNotificationRestrictions object.

Example: to ensure the screensaver does not turn on during a presentation:

     void MyApp.doPresentation()
     {
       KNotificationRestrictions restrict(KNotificationRestrictions.ScreenSaver);
       // show presentation
     }

## Enumerations

Service | { NoServices, ScreenSaver, MessagingPopups, Notifications, CriticalNotifications, NonCriticalServices, AllServices } Typesafe wrapper: Services

## Methods

| __init__ (self, KNotificationRestrictions.Services control=KNotificationRestrictions.NonCriticalServices, QObject parent=0)

## Method Documentation

__init__ | ( | self, |
|  | KNotificationRestrictions.Services | control=KNotificationRestrictions.NonCriticalServices,
|  | QObject | parent=0
| ) |  |  |

Constructs a new service for restrict some services.

Parameters:

  | control | the services to be restricted
  | parent | the parent of this object

## Enumeration Documentation

Service

The baseline "don't disable anything" value.

Note:
  It is necessary to wrap members of this enumeration in a `Services` instance when passing them to a method as group of flags. For example: `Services( NoServices | ScreenSaver)`

Enumerator:

  NoServices = 0 |
  ScreenSaver = 1 |
  MessagingPopups = 2 |
  Notifications = 4 |
  CriticalNotifications = 8 |
  NonCriticalServices = ScreenSaver|MessagingPopups|Notifications |
  AllServices = NonCriticalServices|CriticalNotifications |