def __adapter_toggled(self, widget):
        if self.my_bluetooth.adapter == None:
            return

        self.this.hide_menu()
        self.my_bluetooth.adapter.set_powered(widget.get_active())
        if widget.get_active():
            self.tray_icon.set_icon_theme("enable")
            permanent_settings.set_powered(True)
        else:
            self.tray_icon.set_icon_theme("enable_disconnect")
            permanent_settings.set_powered(False)
        self.tray_icon.emit("popup-menu-event", TrayBluetoothPlugin.__class__) # Hacked by hualet :)
Пример #2
0
    def __adapter_toggled(self, widget):
        if self.my_bluetooth.adapter == None:
            return

        self.this.hide_menu()
        self.my_bluetooth.adapter.set_powered(widget.get_active())
        if widget.get_active():
            self.tray_icon.set_icon_theme("enable")
            permanent_settings.set_powered(True)
        else:
            self.tray_icon.set_icon_theme("enable_disconnect")
            permanent_settings.set_powered(False)
        self.tray_icon.emit(
            "popup-menu-event",
            TrayBluetoothPlugin.__class__)  # Hacked by hualet :)
    def __toggled(self, widget, object):
        if self.my_bluetooth.adapter == None:
            return

        if object == "enable_open":
            self.__set_enable_open(widget.get_active())
            permanent_settings.set_powered(widget.get_active())
            self.my_bluetooth.adapter.set_powered(widget.get_active())
            return

        if object == "search":
            self.is_discoverable = widget.get_active()
            self.my_bluetooth.adapter.set_discoverable(self.is_discoverable)
            self.search_timeout_label.set_child_visible(self.is_discoverable)
            if self.is_discoverable:
                self.periodic_timer = PerodicTimer(self, 1)
            else:
                self.periodic_timer.stop()
            return
    def __toggled(self, widget, object):
        if self.my_bluetooth.adapter == None:
            return

        if object == "enable_open":
            self.__set_enable_open(widget.get_active())
            permanent_settings.set_powered(widget.get_active())
            self.my_bluetooth.adapter.set_powered(widget.get_active())
            return

        if object == "search":
            self.is_discoverable = widget.get_active()
            self.my_bluetooth.adapter.set_discoverable(self.is_discoverable)
            self.search_timeout_label.set_child_visible(self.is_discoverable)
            if self.is_discoverable:
                self.periodic_timer = PerodicTimer(self, 1)
            else:
                self.periodic_timer.stop()
            return