def Start(self):
        '''Start client side'''
        client_log.debug('[dbus] start client')

        if self._status >= constants.CLIENT_STATUS_STARTED:
            client_log.warn('[dbus] already started: %s' % self._status)
            return

        self.main_window = MainWindow()

        # Stop host service when main window is closed
        if not self.main_window:
            client_host.critical('[dbus] Failed to init main window!')
            self.Stop()
        self.main_window.windowClosed.connect(self.Stop)
        self.main_window.show()

        self.client_host = Client(self)
        self.client_host.start()

        self.StatusChanged(constants.CLIENT_STATUS_STARTED)

        # Init webserver-connection-timed-out timer
        QtCore.QTimer.singleShot(constants.WEBSERVER_CONNECTION_TIMEOUT,
                                 self.on_webserver_connection_timeout)

        screensaver_iface = ScreenSaver()
        if screensaver_iface.check():
            self.screensaver_iface = screensaver_iface
            self.screensaver_iface.inhibit()
    def Start(self):
        '''Start client side'''
        client_log.debug('[dbus] start client')

        if self._status >= constants.CLIENT_STATUS_STARTED:
            client_log.warn('[dbus] already started: %s' % self._status)
            return

        self.main_window = MainWindow()

        # Stop host service when main window is closed
        if not self.main_window:
            client_host.critical('[dbus] Failed to init main window!')
            self.Stop()
        self.main_window.windowClosed.connect(self.Stop)
        self.main_window.show()

        self.client_host = Client(self)
        self.client_host.start()

        self.StatusChanged(constants.CLIENT_STATUS_STARTED)

        # Init webserver-connection-timed-out timer
        QtCore.QTimer.singleShot(constants.WEBSERVER_CONNECTION_TIMEOUT,
                                 self.on_webserver_connection_timeout)

        screensaver_iface = ScreenSaver()
        if screensaver_iface.check():
            self.screensaver_iface = screensaver_iface
            self.screensaver_iface.inhibit()
Example #3
0
def send_message(msg):
    '''Send clipboard data to browser'''
    if not connection:
        client_log.debug('[clipboard] connection is uninitialized')
        return
    print('[clipboard] send message:', msg)
    connection.write_message(msg)
def send_message(msg):
    '''Send clipboard data to browser'''
    if not connection:
        client_log.debug('[clipboard] connection is uninitialized')
        return
    print('[clipboard] send message:', msg)
    connection.write_message(msg)
def main():
    client_dbus = ClientDBus()
    # FIXME: log service failed to dump log
    client_log.debug('Init client dbus: %s' % client_dbus)

    app = QtGui.QGuiApplication(sys.argv)
    app.exec()
def main():
    client_dbus = ClientDBus()
    # FIXME: log service failed to dump log
    client_log.debug('Init client dbus: %s' % client_dbus)

    app = QtGui.QGuiApplication(sys.argv)
    app.exec()
    def Stop(self):
        '''Stop client side'''
        client_log.debug('[dbus] stop client')
        self.StatusChanged(constants.CLIENT_STATUS_STOPPED)
        if self.client_host:
            self.client_host.stop()

        if self.screensaver_iface:
            self.screensaver_iface.uninhibit()

        self.kill()
    def Stop(self):
        '''Stop client side'''
        client_log.debug('[dbus] stop client')
        self.StatusChanged(constants.CLIENT_STATUS_STOPPED)
        if self.client_host:
            self.client_host.stop()

        if self.screensaver_iface:
            self.screensaver_iface.uninhibit()

        self.kill()
    def Stop(self):
        '''Stop client side'''
        client_log.debug('[dbus] stop client')
        self.StatusChanged(constants.CLIENT_STATUS_STOPPED)
        if self.client_host:
            self.client_host.stop()

        if self.screensaver_iface:
            self.screensaver_iface.uninhibit()

        # Kill qApp and dbus service after 1s
        QtCore.QTimer.singleShot(1000, self.kill)
    def Stop(self):
        '''Stop client side'''
        client_log.debug('[dbus] stop client')
        self.StatusChanged(constants.CLIENT_STATUS_STOPPED)
        if self.client_host:
            self.client_host.stop()

        if self.screensaver_iface:
            self.screensaver_iface.uninhibit()

        # Kill qApp and dbus service after 1s
        QtCore.QTimer.singleShot(1000, self.kill)
def main():
    if is_client_dbus_running():
        client_log.warn('[client] client side is running')
        return
#    if is_server_dbus_running():
#        client_log.warn('[client] server side is running')
#        return
    app = QtWidgets.QApplication(sys.argv)
    app.setApplicationName(_(APP_NAME))

    client_dbus = ClientDBus()
    # FIXME: log service failed to dump log
    client_log.debug('Init client dbus: %s' % client_dbus)

    app.exec()
Example #12
0
def main():
    if is_client_dbus_running():
        client_log.warn('[client] client side is running')
        return


#    if is_server_dbus_running():
#        client_log.warn('[client] server side is running')
#        return
    app = QtWidgets.QApplication(sys.argv)
    app.setApplicationName(_(APP_NAME))

    client_dbus = ClientDBus()
    # FIXME: log service failed to dump log
    client_log.debug('Init client dbus: %s' % client_dbus)

    app.exec()
Example #13
0
def send_message(msg):
    '''Send command message to browser'''
    if not connection:
        client_log.debug('[cmd] connection is uninitialized')
        return
    connection.write_message(msg)
def send_message(msg):
    """Send keyboard messages to browsesr"""
    if not connection:
        client_log.debug("[keyboard] connection is uninitialized")
        return
    connection.write_message(msg)
 def PropertiesChanged(self, interface, changed_properties,
                       invalidated_properties):
     client_log.debug(
         '[dbus] properties changed: %s:%s:%s' %
         (interface, changed_properties, invalidated_properties))
Example #16
0
def send_message(msg):
    '''Send mouse message to browser'''
    if not connection:
        client_log.debug('[mouse] connection uninitialized')
        return
    connection.write_message(msg)
 def PropertiesChanged(self, interface, changed_properties,
                       invalidated_properties):
     client_log.debug('[dbus] properties changed: %s:%s:%s' %
             (interface, changed_properties, invalidated_properties))
def send_message(msg):
    '''Send mouse message to browser'''
    if not connection:
        client_log.debug('[mouse] connection uninitialized')
        return
    connection.write_message(msg)
def send_message(msg):
    '''Send keyboard messages to browsesr'''
    if not connection:
        client_log.debug('[keyboard] connection is uninitialized')
        return
    connection.write_message(msg)