Esempio n. 1
0
    def __init__(self):
        check_single_instance("blueman-tray")

        applet = AppletService()

        main_loop = GLib.MainLoop()

        Gio.bus_watch_name(Gio.BusType.SESSION, 'org.blueman.Applet',
                           Gio.BusNameWatcherFlags.NONE, None,
                           lambda _connection, _name: main_loop.quit())

        indicator_name = applet.GetStatusIconImplementation()
        logging.info('Using indicator "%s"' % indicator_name)
        indicator_class = getattr(
            import_module('blueman.main.indicators.' + indicator_name),
            indicator_name)
        self.indicator = indicator_class(applet.GetIconName(),
                                         self._activate_menu_item,
                                         self._activate_status_icon)

        applet.connect('g-signal', self.on_signal)

        self.indicator.set_text(applet.GetText())
        self.indicator.set_visibility(applet.GetVisibility())
        self.indicator.set_menu(applet.GetMenu())

        main_loop.run()
Esempio n. 2
0
    def __init__(self):
        super().__init__(
            title=_("Local Services"),
            name="BluemanServices",
            icon_name="blueman",
            border_width=5

        )

        grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL, visible=True, row_spacing=10)
        self.add(grid)

        self.box = Gtk.Box(Gtk.Orientation.HORIZONTAL, vexpand=True, visible=True)
        grid.add(self.box)

        button_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, halign=Gtk.Align.END, visible=True)
        grid.add(button_box)

        self.b_apply = Gtk.Button("_Apply", receives_default=True, use_underline=True, sensitive=False, visible=True,
                                  width_request=80)
        button_box.add(self.b_apply)

        self.viewport = Gtk.Viewport(visible=True, width_request=120)

        self.box.add(self.viewport)

        self.connect("delete-event", Gtk.main_quit)

        self.Config = Config("org.blueman.general")

        check_single_instance("blueman-services", lambda time: self.present_with_time(time))

        data = [
            {"id": "icon_name", "type": str, "renderer": Gtk.CellRendererPixbuf(stock_size=Gtk.IconSize.DND),
             "render_attrs": {"icon_name": 0}},
            {"id": "caption", "type": str, "renderer": Gtk.CellRendererText(), "render_attrs": {"markup": 1},
             "view_props": {"expand": True}},
            {"id": "id", "type": str},
        ]

        self.List = ls = GenericList(data, headers_visible=False, visible=True)

        ls.selection.connect("changed", self.on_selection_changed)

        self.viewport.add(ls)

        self.load_plugins()

        ls.selection.select_path(self.Config["services-last-item"])

        self.b_apply.connect("clicked", self.on_apply_clicked)

        self.show()
Esempio n. 3
0
    def __init__(self):
        super().__init__(
            title=_("Local Services"),
            name="BluemanServices",
            icon_name="blueman",
            border_width=5

        )

        grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL, visible=True, row_spacing=10)
        self.add(grid)

        self.box = Gtk.Box(Gtk.Orientation.HORIZONTAL, vexpand=True, visible=True)
        grid.add(self.box)

        button_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, halign=Gtk.Align.END, visible=True)
        grid.add(button_box)

        self.b_apply = Gtk.Button("_Apply", receives_default=True, use_underline=True, sensitive=False, visible=True,
                                  width_request=80)
        button_box.add(self.b_apply)

        self.viewport = Gtk.Viewport(visible=True, width_request=120)

        self.box.add(self.viewport)

        self.connect("delete-event", Gtk.main_quit)

        self.Config = Config("org.blueman.general")

        check_single_instance("blueman-services", lambda time: self.present_with_time(time))

        data = [
            {"id": "icon_name", "type": str, "renderer": Gtk.CellRendererPixbuf(stock_size=Gtk.IconSize.DND),
             "render_attrs": {"icon_name": 0}},
            {"id": "caption", "type": str, "renderer": Gtk.CellRendererText(), "render_attrs": {"markup": 1},
             "view_props": {"expand": True}},
            {"id": "id", "type": str},
        ]

        self.List = ls = GenericList(data, headers_visible=False, visible=True)

        ls.selection.connect("changed", self.on_selection_changed)

        self.viewport.add(ls)

        self.load_plugins()

        ls.selection.select_path(self.Config["services-last-item"])

        self.b_apply.connect("clicked", self.on_apply_clicked)

        self.show()
Esempio n. 4
0
    def __init__(self):
        check_single_instance("blueman-tray")

        applet = AppletService()

        main_loop = GLib.MainLoop()

        Gio.bus_watch_name(Gio.BusType.SESSION, 'org.blueman.Applet',
                           Gio.BusNameWatcherFlags.NONE, None, lambda _connection, _name: main_loop.quit())

        indicator_name = applet.GetStatusIconImplementation()
        logging.info('Using indicator "%s"' % indicator_name)
        indicator_class = getattr(import_module('blueman.main.indicators.' + indicator_name), indicator_name)
        self.indicator = indicator_class(applet.GetIconName(), self._activate_menu_item, self._activate_status_icon)

        applet.connect('g-signal', self.on_signal)

        self.indicator.set_text(applet.GetText())
        self.indicator.set_visibility(applet.GetVisibility())
        self.indicator.set_menu(applet.GetMenu())

        main_loop.run()
Esempio n. 5
0
    def __init__(self):
        super(BluemanServices, self).__init__(title=_("Local Services"))
        self.resize(520, 420)
        self.set_name("BluemanServices")
        self.set_position(Gtk.WindowPosition.CENTER)
        self.props.border_width = 5
        self.props.icon_name = "blueman"

        self.b_apply = self.add_button("_Apply", Gtk.ResponseType.APPLY)
        self.b_apply.props.receives_default = True
        self.b_apply.props.sensitive = False
        self.b_apply.props.use_underline = True

        self.b_close = self.add_button("_Close", Gtk.ResponseType.CLOSE)
        self.b_close.props.use_underline = True

        self.content_area = self.get_content_area()

        self.box = Gtk.Box(Gtk.Orientation.HORIZONTAL)
        self.box.props.vexpand = True
        self.box.props.visible = True

        self.viewport = Gtk.Viewport()
        self.viewport.props.visible = True
        self.viewport.props.width_request = 120

        self.box.add(self.viewport)
        self.content_area.add(self.box)

        self.connect("delete-event", Gtk.main_quit)

        self.Config = Config("org.blueman.general")

        check_single_instance("blueman-services", lambda time: self.Dialog.present_with_time(time))

        data = [
            {"id": "icon_name", "type": str, "renderer": Gtk.CellRendererPixbuf(stock_size=Gtk.IconSize.DND),
             "render_attrs": {"icon_name": 0}},
            {"id": "caption", "type": str, "renderer": Gtk.CellRendererText(), "render_attrs": {"markup": 1},
             "view_props": {"expand": True}},
            {"id": "id", "type": str},
        ]

        ls = GenericList(data)
        ls.props.headers_visible = False

        ls.selection.connect("changed", self.on_selection_changed)
        self.List = ls

        self.viewport.add(ls)
        ls.show()

        self.load_plugins()

        try:
            ls.selection.select_path(self.Config["services-last-item"])
        except:
            ls.selection.select_path(0)

        self.b_apply.connect("clicked", self.on_apply_clicked)
        self.b_close.connect("clicked", Gtk.main_quit)

        self.show()
Esempio n. 6
0
    def __init__(self):
        super(BluemanServices, self).__init__(title=_("Local Services"))
        self.resize(520, 420)
        self.set_name("BluemanServices")
        self.set_position(Gtk.WindowPosition.CENTER)
        self.props.border_width = 5
        self.props.icon_name = "blueman"

        self.b_apply = self.add_button("_Apply", Gtk.ResponseType.APPLY)
        self.b_apply.props.receives_default = True
        self.b_apply.props.sensitive = False
        self.b_apply.props.use_underline = True

        self.b_close = self.add_button("_Close", Gtk.ResponseType.CLOSE)
        self.b_close.props.use_underline = True

        self.content_area = self.get_content_area()

        self.box = Gtk.Box(Gtk.Orientation.HORIZONTAL)
        self.box.props.vexpand = True
        self.box.props.visible = True

        self.viewport = Gtk.Viewport()
        self.viewport.props.visible = True
        self.viewport.props.width_request = 120

        self.box.add(self.viewport)
        self.content_area.add(self.box)

        self.connect("delete-event", Gtk.main_quit)

        self.Config = Config("org.blueman.general")

        check_single_instance("blueman-services",
                              lambda time: self.Dialog.present_with_time(time))

        data = [
            {
                "id": "icon_name",
                "type": str,
                "renderer":
                Gtk.CellRendererPixbuf(stock_size=Gtk.IconSize.DND),
                "render_attrs": {
                    "icon_name": 0
                }
            },
            {
                "id": "caption",
                "type": str,
                "renderer": Gtk.CellRendererText(),
                "render_attrs": {
                    "markup": 1
                },
                "view_props": {
                    "expand": True
                }
            },
            {
                "id": "id",
                "type": str
            },
        ]

        ls = GenericList(data)
        ls.props.headers_visible = False

        ls.selection.connect("changed", self.on_selection_changed)
        self.List = ls

        self.viewport.add(ls)
        ls.show()

        self.load_plugins()

        ls.selection.select_path(self.Config["services-last-item"])

        self.b_apply.connect("clicked", self.on_apply_clicked)
        self.b_close.connect("clicked", Gtk.main_quit)

        self.show()