def on_load(self): AppletPlugin.add_method(self.on_rfcomm_connected) AppletPlugin.add_method(self.on_rfcomm_disconnect) AppletPlugin.add_method(self.rfcomm_connect_handler) AppletPlugin.add_method(self.service_connect_handler) AppletPlugin.add_method(self.service_disconnect_handler)
def on_load(self, applet): gtk.StatusIcon.__init__(self) self.lines = {} self.pixbuf = None self.connect("size-changed", self.on_status_icon_resized) self.SetTextLine(0, _("Bluetooth Enabled")) AppletPlugin.add_method(self.on_query_status_icon_visibility) AppletPlugin.add_method(self.on_status_icon_pixbuf_ready)
def on_load(self): AppletPlugin.add_method(self.on_rfcomm_connected) AppletPlugin.add_method(self.on_rfcomm_disconnect) AppletPlugin.add_method(self.rfcomm_connect_handler) AppletPlugin.add_method(self.service_connect_handler) AppletPlugin.add_method(self.service_disconnect_handler) self._add_dbus_method("QueryPlugins", (), "as", self.parent.Plugins.get_loaded) self._add_dbus_method("QueryAvailablePlugins", (), "as", lambda: list(self.parent.Plugins.get_classes())) self._add_dbus_method("SetPluginConfig", ("s", "b"), "", self.parent.Plugins.set_config) self._add_dbus_method("ConnectService", ("o", "s"), "", self.connect_service, is_async=True) self._add_dbus_method("DisconnectService", ("o", "s", "d"), "", self._disconnect_service, is_async=True) self._add_dbus_method("OpenPluginDialog", (), "", self._open_plugin_dialog)
def on_load(self, applet): Gtk.StatusIcon.__init__(self) self.lines = {} self.set_title('blueman') self.SetTextLine(0, _("Bluetooth Enabled")) AppletPlugin.add_method(self.on_query_status_icon_visibility) AppletPlugin.add_method(self.on_status_icon_query_icon) ic = Gtk.IconTheme.get_default() ic.connect("changed", self.on_icon_theme_changed) self.on_status_icon_resized()
def on_load(self, applet): GObject.GObject.__init__(self) self.lines = {} self.pixbuf = None self.timeout = None #self.connect("size-changed", self.on_status_icon_resized) self.SetTextLine(0, _("Bluetooth Enabled")) AppletPlugin.add_method(self.on_query_status_icon_visibility) AppletPlugin.add_method(self.on_status_icon_query_icon) ic = Gtk.IconTheme.get_default() ic.connect("changed", self.on_icon_theme_changed) self.on_status_icon_resized()
def on_load(self, applet): self.Applet = applet AppletPlugin.add_method(self.on_rfcomm_connected) AppletPlugin.add_method(self.on_rfcomm_disconnect) AppletPlugin.add_method(self.rfcomm_connect_handler) AppletPlugin.add_method(self.service_connect_handler) AppletPlugin.add_method(self.on_device_disconnect) self.add_dbus_method(self.ServiceProxy, in_signature="sosas", async_callbacks=("ok", "err")) self.add_dbus_method(self.CreateDevice, in_signature="ssbu", async_callbacks=("_ok", "err")) self.add_dbus_method(self.CancelDeviceCreation, in_signature="ss", async_callbacks=("ok", "err")) self.add_dbus_method(self.RfcommConnect, in_signature="ss", out_signature="s", async_callbacks=("ok", "err")) self.add_dbus_method(self.RfcommDisconnect, in_signature="ss", out_signature="") self.add_dbus_method(self.RefreshServices, in_signature="s", out_signature="", async_callbacks=("ok", "err")) self.add_dbus_method(self.QueryPlugins, in_signature="", out_signature="as") self.add_dbus_method(self.QueryAvailablePlugins, in_signature="", out_signature="as") self.add_dbus_method(self.SetPluginConfig, in_signature="sb", out_signature="") self.add_dbus_method(self.DisconnectDevice, in_signature="o", out_signature="", async_callbacks=("ok", "err"))
def on_load(self, applet): AppletPlugin.add_method(self.on_bluetooth_power_state_changed) self.Applet = applet self.item = create_menuitem(_("<b>Bluetooth Off</b>"), get_icon("gtk-stop", 16)) self.item.get_child().set_markup(_("<b>Turn Bluetooth Off</b>")) self.item.props.tooltip_text = _("Turn off all adapters") self.item.connect("activate", lambda x: self.on_bluetooth_toggled()) dbus.SystemBus().add_signal_receiver(self.adapter_property_changed, "PropertyChanged", "org.bluez.Adapter", "org.bluez", path_keyword="path") self.Applet.Plugins.Menu.Register(self, self.item, 0) self.Applet.DbusSvc.add_method(self.SetBluetoothStatus, in_signature="b", out_signature="") self.Applet.DbusSvc.add_method(self.GetBluetoothStatus, in_signature="", out_signature="b") self.BluetoothStatusChanged = self.Applet.DbusSvc.add_signal("BluetoothStatusChanged", signature="b") self.bluetooth_off = False self.state_change_deferred = -1
def on_load(self): AppletPlugin.add_method(self.on_power_state_query) AppletPlugin.add_method(self.on_power_state_change_requested) AppletPlugin.add_method(self.on_power_state_changed) self.item = self.parent.Plugins.Menu.add( self, 0, text=_("<b>Turn Bluetooth _Off</b>"), markup=True, icon_name="blueman-disabled", tooltip=_("Turn off all adapters"), callback=self.on_bluetooth_toggled) self.adapter_state = True self.current_state = True self.request_in_progress = False self.STATE_ON = 2 self.STATE_OFF = 1 self.STATE_OFF_FORCED = 0 self._add_dbus_signal("BluetoothStatusChanged", "b") self._add_dbus_method("SetBluetoothStatus", ("b", ), "", self.request_power_state) self._add_dbus_method("GetBluetoothStatus", (), "b", self.get_bluetooth_status)
def on_load(self, applet): AppletPlugin.add_method(self.on_power_state_query) AppletPlugin.add_method(self.on_power_state_change_requested) AppletPlugin.add_method(self.on_power_state_changed) self.Applet = applet self.item = create_menuitem("Should be overwritten", get_icon("blueman-disabled", 16)) self.item.get_child().get_children()[1].set_markup_with_mnemonic( _("<b>Turn Bluetooth _Off</b>")) self.item.props.tooltip_text = _("Turn off all adapters") self.item.connect("activate", lambda x: self.on_bluetooth_toggled()) self.Applet.Plugins.Menu.Register(self, self.item, 0) self.adapter_state = True self.current_state = True self.request_in_progress = False self.STATE_ON = 2 self.STATE_OFF = 1 self.STATE_OFF_FORCED = 0
def on_load(self, applet): AppletPlugin.add_method(self.on_power_state_query) AppletPlugin.add_method(self.on_power_state_change_requested) AppletPlugin.add_method(self.on_power_state_changed) self.Applet = applet self.item = create_menuitem("Should be overwritten", get_icon("blueman-disabled", 16)) self.item.get_child().get_children()[1].set_markup_with_mnemonic(_("<b>Bluetooth _Off</b>")) self.item.props.tooltip_text = _("Turn off all adapters") self._any_adapter = Bluez.Adapter() self._any_adapter.connect_signal('property-changed', self._on_adapter_property_changed) self.item.connect("activate", lambda x: self.on_bluetooth_toggled()) self.Applet.Plugins.Menu.Register(self, self.item, 0) self.adapter_state = True self.current_state = True self.request_in_progress = False self.STATE_ON = 2 self.STATE_OFF = 1 self.STATE_OFF_FORCED = 0
def on_load(self): GObject.GObject.__init__(self) self.lines = {0: _("Bluetooth Enabled")} AppletPlugin.add_method(self.on_query_status_icon_implementation) AppletPlugin.add_method(self.on_query_status_icon_visibility) AppletPlugin.add_method(self.on_status_icon_query_icon) self.query_visibility(emit=False) self.parent.Plugins.connect('plugin-loaded', self._on_plugins_changed) self.parent.Plugins.connect('plugin-unloaded', self._on_plugins_changed)
def on_load(self, applet): AppletPlugin.add_method(self.on_power_state_query) AppletPlugin.add_method(self.on_power_state_change_requested) AppletPlugin.add_method(self.on_power_state_changed) self.add_dbus_method(self.SetBluetoothStatus, in_signature="b", out_signature="") self.add_dbus_method(self.GetBluetoothStatus, in_signature="", out_signature="b") self.BluetoothStatusChanged = self.add_dbus_signal( "BluetoothStatusChanged", signature="b") self.Applet = applet self.item = create_menuitem(_("<b>Bluetooth Off</b>"), get_icon("gtk-stop", 16)) self.item.get_child().set_markup(_("<b>Turn Bluetooth Off</b>")) self.item.props.tooltip_text = _("Turn off all adapters") self.signals = SignalTracker() self.signals.Handle("dbus", dbus.SystemBus(), self.adapter_property_changed, "PropertyChanged", "org.bluez.Adapter", "org.bluez", path_keyword="path") self.signals.Handle(self.item, "activate", lambda x: self.on_bluetooth_toggled()) self.Applet.Plugins.Menu.Register(self, self.item, 0) self.adapter_state = True self.current_state = True self.power_changeable = True self.request_in_progress = False self.STATE_ON = 2 self.STATE_OFF = 1 self.STATE_OFF_FORCED = 0 gobject.idle_add(self.UpdatePowerState)
def on_load(self): AppletPlugin.add_method(self.on_power_state_query) AppletPlugin.add_method(self.on_power_state_change_requested) AppletPlugin.add_method(self.on_power_state_changed) self.item = self.parent.Plugins.Menu.add(self, 0, text=_("<b>Turn Bluetooth _Off</b>"), markup=True, icon_name="blueman-disabled", tooltip=_("Turn off all adapters"), callback=self.on_bluetooth_toggled) self.adapter_state = True self.current_state = True self.request_in_progress = False self.STATE_ON = 2 self.STATE_OFF = 1 self.STATE_OFF_FORCED = 0
def on_load(self, applet): AppletPlugin.add_method(self.on_power_state_query) AppletPlugin.add_method(self.on_power_state_change_requested) AppletPlugin.add_method(self.on_power_state_changed) self.add_dbus_method(self.SetBluetoothStatus, in_signature="b", out_signature="") self.add_dbus_method(self.GetBluetoothStatus, in_signature="", out_signature="b") self.BluetoothStatusChanged = self.add_dbus_signal( "BluetoothStatusChanged", signature="b") self.Applet = applet self.item = create_menuitem(_("<b>Bluetooth Off</b>"), get_icon("gtk-stop", 16)) self.item.get_child().set_markup(_("<b>Turn Bluetooth Off</b>")) self.item.props.tooltip_text = _("Turn off all adapters") self.signals = SignalTracker() self.signals.Handle("dbus", dbus.SystemBus(), self.adapter_property_changed, "PropertyChanged", "org.bluez.Adapter", "org.bluez", path_keyword="path") self.signals.Handle(self.item, "activate", lambda x: self.on_bluetooth_toggled()) self.Applet.Plugins.Menu.Register(self, self.item, 0) self.adapter_state = True self.current_state = True self.power_changeable = True self.request_in_progress = False self.STATE_ON = 2 self.STATE_OFF = 1 self.STATE_OFF_FORCED = 0
def on_load(self, applet): AppletPlugin.add_method(self.on_power_state_query) AppletPlugin.add_method(self.on_power_state_change_requested) AppletPlugin.add_method(self.on_power_state_changed) self.add_dbus_method(self.SetBluetoothStatus, in_signature="b", out_signature="") self.add_dbus_method(self.GetBluetoothStatus, in_signature="", out_signature="b") self.BluetoothStatusChanged = self.add_dbus_signal( "BluetoothStatusChanged", signature="b") self.Applet = applet self.item = create_menuitem("Should be overwritten", get_icon("blueman-disabled", 16)) self.item.get_child().get_children()[1].set_markup_with_mnemonic(_("<b>Bluetooth _Off</b>")) self.item.props.tooltip_text = _("Turn off all adapters") self.signals = SignalTracker() self.signals.Handle('bluez', Bluez.Adapter(), self.adapter_property_changed, "PropertyChanged", path_keyword="path") self.signals.Handle(self.item, "activate", lambda x: self.on_bluetooth_toggled()) self.Applet.Plugins.Menu.Register(self, self.item, 0) self.adapter_state = True self.current_state = True self.power_changeable = True self.request_in_progress = False self.STATE_ON = 2 self.STATE_OFF = 1 self.STATE_OFF_FORCED = 0
def on_load(self): GObject.GObject.__init__(self) self.lines = {0: _("Bluetooth Enabled")} AppletPlugin.add_method(self.on_query_status_icon_implementation) AppletPlugin.add_method(self.on_query_status_icon_visibility) AppletPlugin.add_method(self.on_status_icon_query_icon) self.query_visibility(emit=False) self.parent.Plugins.connect('plugin-loaded', self._on_plugins_changed) self.parent.Plugins.connect('plugin-unloaded', self._on_plugins_changed) self._add_dbus_method("GetVisibility", (), "b", lambda: self.visible) self._add_dbus_signal("VisibilityChanged", "b") self._add_dbus_signal("TextChanged", "s") self._add_dbus_method("GetText", (), "s", self._get_text) self._add_dbus_signal("IconNameChanged", "s") self._add_dbus_method("GetStatusIconImplementation", (), "s", self._get_status_icon_implementation) self._add_dbus_method("GetIconName", (), "s", self._get_icon_name) self._add_dbus_method("Activate", (), "", lambda: self.emit("activate"))
def on_load(self, applet): AppletPlugin.add_method(self.on_power_state_query) AppletPlugin.add_method(self.on_power_state_change_requested) AppletPlugin.add_method(self.on_power_state_changed) self.Applet = applet self.item = create_menuitem("<b>Turn Bluetooth _Off</b>", "blueman-disabled") self.item.props.tooltip_text = _("Turn off all adapters") self.item.connect("activate", lambda x: self.on_bluetooth_toggled()) self.Applet.Plugins.Menu.Register(self, self.item, 0) self.adapter_state = True self.current_state = True self.request_in_progress = False self.STATE_ON = 2 self.STATE_OFF = 1 self.STATE_OFF_FORCED = 0
def on_load(self, applet): AppletPlugin.add_method(self.on_ppp_connected)
def on_load(self, applet): self.Applet = applet AppletPlugin.add_method(self.on_rfcomm_connected) AppletPlugin.add_method(self.on_rfcomm_disconnect) AppletPlugin.add_method(self.rfcomm_connect_handler) AppletPlugin.add_method(self.service_connect_handler) AppletPlugin.add_method(self.service_disconnect_handler) AppletPlugin.add_method(self.on_device_disconnect)