1
from __future__ import print_function
2
from __future__ import division
3
from __future__ import absolute_import
4
from __future__ import unicode_literals
1
6
from blueman.main.PluginManager import StopException
2
7
from blueman.Functions import *
3
8
from blueman.plugins.AppletPlugin import AppletPlugin
8
13
class StatusIcon(AppletPlugin, Gtk.StatusIcon):
9
14
__unloadable__ = False
12
def on_entry_changed(self, entry, ic, image):
14
if ic.has_icon(self.get_option("icon")):
15
icon = Gtk.STOCK_APPLY
17
icon = Gtk.STOCK_CANCEL
19
image.set_from_stock(icon, Gtk.IconSize.LARGE_TOOLBAR)
22
GObject.source_remove(self.timeout)
24
self.timeout = GObject.timeout_add(1000, lambda: self.IconShouldChange())
26
def widget_decorator(self, widget, name, options):
27
entry = widget.get_children()[1]
30
completion = Gtk.EntryCompletion()
31
entry.set_completion(completion)
33
liststore = Gtk.ListStore(GObject.TYPE_STRING)
35
completion.set_model(liststore)
37
completion.set_text_column(0)
39
ic = Gtk.IconTheme.get_default()
40
icons = ic.list_icons("Applications")
44
if ic.has_icon(self.get_option("icon")):
45
icon = Gtk.STOCK_APPLY
47
icon = Gtk.STOCK_CANCEL
49
image.set_from_stock(icon, Gtk.IconSize.LARGE_TOOLBAR)
51
widget.pack_start(image, True, 0, 0)
52
entry.connect("changed", self.on_entry_changed, ic, image)
54
__options__ = {"icon": {"type": str,
56
"name": _("Icon Name"),
57
"desc": _("Custom icon to use for the notification area"),
58
"decorator": widget_decorator
15
__icon__ = "blueman-tray"
147
102
self.QueryVisibility()
149
104
def on_status_icon_resized(self):
150
self.icon = "blueman"
152
#p = GdkPixbuf.Pixbuf(GdkPixbuf.Colorspace.RGB, True, 8, 22, 22)
156
#self.pixbuf.copy_area(0, 0, self.pixbuf.props.width, self.pixbuf.props.height, p, 5, 0)
105
self.icon = "blueman-tray"
159
107
ic = Gtk.IconTheme.get_default()
161
109
def callback(inst, ret):