コード例 #1
0
ファイル: wicd-client.py プロジェクト: zeph/wicd
        def update_tray_icon(self, state=None, info=None):
            """ Updates the tray icon and current connection status. """
            if not DBUS_AVAIL:
                return False

            if not state or not info:
                [state, info] = daemon.GetConnectionStatus()

            # should this state change display a notification?
            self.should_notify = (can_use_notify()
                                  and self.last_state != state)

            self.last_state = state

            if state == misc.WIRED:
                self.set_wired_state(info)
            elif state == misc.WIRELESS:
                self.set_wireless_state(info)
            elif state == misc.CONNECTING:
                self.set_connecting_state(info)
            elif state in (misc.SUSPENDED, misc.NOT_CONNECTED):
                self.set_not_connected_state(info)
            else:
                print('Invalid state returned!!!')
                return False
            return True
コード例 #2
0
ファイル: wicd-client.py プロジェクト: benquach16/wicd
        def update_tray_icon(self, state=None, info=None):
            """ Updates the tray icon and current connection status. """
            if not DBUS_AVAIL:
                return False

            if not state or not info:
                [state, info] = daemon.GetConnectionStatus()

            # should this state change display a notification?
            self.should_notify = (can_use_notify() and
                                  self.last_state != state)

            self.last_state = state

            if state == misc.WIRED:
                self.set_wired_state(info)
            elif state == misc.WIRELESS:
                self.set_wireless_state(info)
            elif state == misc.CONNECTING:
                self.set_connecting_state(info)
            elif state in (misc.SUSPENDED, misc.NOT_CONNECTED):
                self.set_not_connected_state(info)
            else:
                print 'Invalid state returned!!!'
                return False
            return True