Beispiel #1
0
    def setupSaver(self):
        if not self.saver:
            self.saver = QSystemScreenSaver(self)

        saverEnabled = self.saver.screenSaverInhibited()
        self.saverInhibitedCheckBox.clicked.connect(self.setSaverEnabled)
        self.saverInhibitedCheckBox.setChecked(saverEnabled)
Beispiel #2
0
 def setSaverEnabled(self, b):
     if b:
         if not self.saver:
             self.saver = QSystemScreenSaver(self)
         if self.saver.setScreenSaverInhibit():
             pass
     else:
         del self.saver
         self.saver = None
Beispiel #3
0
    def pauseScreenBlanking(self):
        """
        inhibit screen blanking
        """
        from QtMobility.SystemInfo import QSystemScreenSaver

        if self.qScreenSaver:
            QSystemScreenSaver.setScreenSaverInhibit(self.qScreenSaver)
        else:
            self.qScreenSaver = QSystemScreenSaver()
Beispiel #4
0
    def __init__(self, *args, **kwargs):
        DeviceModule.__init__(self, *args, **kwargs)
        self.rotationObject = None
        # start the N900 specific automatic GUI rotation support
        self.done = False

        #osso app name
        self.ossoAppName = 'modrana'

        # screen blanking related
        self.bus = dbus.SystemBus()
        self.mceRequest = self.bus.get_object('com.nokia.mce',
                                              '/com/nokia/mce/request')
        self.mceSignal = self.bus.get_object('com.nokia.mce',
                                             '/com/nokia/mce/signal')
        self.mceSignalInterface = dbus.Interface(self.mceSignal,
                                                 'com.nokia.mce.signal')
        self.mceSignalInterface.connect_to_signal(
            "display_status_ind", self.screenStateChangedCallback)
        self.log.info("DBUS initialized")

        # Internet connectivity related

        # status from the Internet Connectivity Daemon
        self._connectivityStatusICD = constants.OFFLINE
        self.conicConnection = None

        # Mainloop for headless location support
        self.mainloop = None

        if gs.GUIString == "GTK":
            # liblocation
            self.lControl = None
            self.lDevice = None
            """location starting is handled by mod_location
            in its firstTime call"""

            # libconic
            self._conicConnect()

            # we handle notifications only for the GTK GUI
            self.modrana.notificationTriggered.connect(
                self._dispatchNotificationCB)

        elif gs.GUIString == "QML":
            self.log.info("N900 Qt screen saver controller created")
            self.qScreenSaver = QSystemScreenSaver()

        # the old Python 2.5 based urllib3 has a bit different logging,
        # so we need to make it shut up here
        urllib3_logger = logging.getLogger("core.backports.urllib3_python25")
        urllib3_logger.setLevel(logging.ERROR)

        self.log.info("N900 device specific module initialized")
Beispiel #5
0
 def setupScreenSaver(self):
     self.saverInfo = QSystemScreenSaver(self)
     self._screenSaverInhibited = self.saverInfo.screenSaverInhibited()
Beispiel #6
0
 def __init__(self, *args, **kwargs):
     DeviceModule.__init__(self, *args, **kwargs)
     # create the screen-saver controller
     self.qScreenSaver = QSystemScreenSaver()