コード例 #1
0
    def __on_active_device_signal_changed(self, sender, strength):
        norm_strength = normalize_strength(strength)
        self.set_var("wwan.signal", norm_strength)
        nm_norm_strength = normalize_strength(strength, use_nm_levels=True)
        tooltip = self.__wwan_tooltips[nm_norm_strength]
        self.set_var('wwan.signal.description', tooltip)

        connection_type = self.device_dialer.nmGetConnectionType()
        if connection_type == 'GSM':
            self.set_var('app.connection.signal', norm_strength)
            self.set_var('app.connection.signal.description', tooltip)
コード例 #2
0
ファイル: ThemedDock.py プロジェクト: calabozo/tgcmlinux
    def __on_active_device_signal_changed (self, sender, strength):
        norm_strength = normalize_strength(strength)
        self.set_var("wwan.signal", norm_strength)
        nm_norm_strength = normalize_strength(strength, use_nm_levels = True)
        tooltip = self.__wwan_tooltips[nm_norm_strength]
        self.set_var('wwan.signal.description', tooltip)

        connection_type = self.device_dialer.nmGetConnectionType()
        if connection_type == 'GSM':
            self.set_var('app.connection.signal', norm_strength)
            self.set_var('app.connection.signal.description', tooltip)
コード例 #3
0
ファイル: ThemedDock.py プロジェクト: calabozo/tgcmlinux
 def __aap_strength_listener(self, properties):
     if self._wifi_aap is not False:
         try:
             norm_strength = normalize_strength(self._wifi_aap['Strength'])
             self.set_var('app.connection.signal', norm_strength)
         except Exception:
             pass
コード例 #4
0
 def __aap_strength_listener(self, properties):
     if self._wifi_aap is not False:
         try:
             norm_strength = normalize_strength(self._wifi_aap['Strength'])
             self.set_var('app.connection.signal', norm_strength)
         except Exception:
             pass
コード例 #5
0
 def __update_signal_strength(self, signal_quality = None):
     entry_refresh_need = False
     if signal_quality is None:
         signal_quality = self._device.get_SignalQuality()
     signal_strength = normalize_strength(signal_quality)
     if signal_strength != self._cached_signal_strength:
         self._cached_signal_strength = signal_strength
         entry_refresh_need = True
     return entry_refresh_need
コード例 #6
0
 def __update_signal_strength(self, signal_quality=None):
     entry_refresh_need = False
     if signal_quality is None:
         signal_quality = self._device.get_SignalQuality()
     signal_strength = normalize_strength(signal_quality)
     if signal_strength != self._cached_signal_strength:
         self._cached_signal_strength = signal_strength
         entry_refresh_need = True
     return entry_refresh_need
コード例 #7
0
    def __update_signal_strength_status(self, net_connected):
        connection_type = self.device_dialer.nmGetConnectionType()
        if connection_type == "ETHERNET":
            if net_connected:
                self.set_var("lan.signal", 1)
            else:
                self.set_var("lan.signal", 0)
        elif connection_type == "WIRELESS":
            try:
                wifi_aap = self.device_manager.get_wifi_device(
                ).get_active_access_point()
                strength = wifi_aap['Strength']

                norm_strength = normalize_strength(strength)
                self.set_var("app.connection.signal", norm_strength)

                nm_norm_strength = normalize_strength(strength,
                                                      use_nm_levels=True)
                tooltip = self.__wifi_tooltips[nm_norm_strength]
                self.set_var('app.connection.signal.description', tooltip)
                self.set_var('wifi.signal.description', tooltip)
            except TypeError:
                # Seems that sometimes D-Bus throws some exceptions. There is very little
                # to do here, except to capture the exception and pray there is not anything
                # more broken.
                pass
        elif connection_type == "GSM":
            main_device = self.device_manager.get_main_device()
            if (main_device != None):
                strength = main_device.get_SignalQuality()
                norm_strength = normalize_strength(strength)
                self.set_var("app.connection.signal", norm_strength)
                self.set_var("wwan.signal", norm_strength)

                nm_norm_strength = normalize_strength(strength,
                                                      use_nm_levels=True)
                tooltip = self.__wwan_tooltips[nm_norm_strength]
                self.set_var('app.connection.signal.description', tooltip)
                self.set_var('wwan.signal.description', tooltip)
コード例 #8
0
ファイル: ThemedDock.py プロジェクト: calabozo/tgcmlinux
    def __update_signal_strength_status(self, net_connected):
        connection_type = self.device_dialer.nmGetConnectionType()
        if connection_type == "ETHERNET":
            if net_connected:
                self.set_var("lan.signal", 1)
            else:
                self.set_var("lan.signal", 0)
        elif connection_type == "WIRELESS":
            try:
                wifi_aap = self.device_manager.get_wifi_device().get_active_access_point()
                strength = wifi_aap['Strength']

                norm_strength = normalize_strength(strength)
                self.set_var("app.connection.signal", norm_strength)

                nm_norm_strength = normalize_strength(strength, use_nm_levels = True)
                tooltip = self.__wifi_tooltips[nm_norm_strength]
                self.set_var('app.connection.signal.description', tooltip)
                self.set_var('wifi.signal.description', tooltip)
            except TypeError:
                # Seems that sometimes D-Bus throws some exceptions. There is very little
                # to do here, except to capture the exception and pray there is not anything
                # more broken.
                pass
        elif connection_type == "GSM":
            main_device=self.device_manager.get_main_device()
            if (main_device!=None):
                strength = main_device.get_SignalQuality()
                norm_strength = normalize_strength(strength)
                self.set_var("app.connection.signal", norm_strength)
                self.set_var("wwan.signal", norm_strength)

                nm_norm_strength = normalize_strength(strength, use_nm_levels = True)
                tooltip = self.__wwan_tooltips[nm_norm_strength]
                self.set_var('app.connection.signal.description', tooltip)
                self.set_var('wwan.signal.description', tooltip)
コード例 #9
0
 def get_strength(self):
     return normalize_strength(self._best_strength)
コード例 #10
0
    def __active_dev_signal_status_changed_cb(self, mcontroller, signal):
        self.__t_signal_strength = normalize_strength(signal, use_nm_levels=True)
        self.__update_device_info()

        self.connection_logger.register_wwan_signal_change(signal)
        self.emit('active_device_signal_changed', signal)
コード例 #11
0
 def get_strength(self):
     return normalize_strength(self._best_strength)