Esempio n. 1
0
    def __init__(self, buddy):
        TrayIcon.__init__(self, icon_name='computer-xo',
                          xo_color=buddy.get_color())

        self._buddy = buddy
        self.set_palette_invoker(FrameWidgetInvoker(self))
        self.palette_invoker.cache_palette = False
Esempio n. 2
0
    def __init__(self, buddy):
        TrayIcon.__init__(self,
                          icon_name='computer-xo',
                          xo_color=buddy.get_color())

        self._buddy = buddy
        self.set_palette_invoker(FrameWidgetInvoker(self))
        self.palette_invoker.cache_palette = False
Esempio n. 3
0
 def __init__(self):
     client = gconf.client_get_default()
     self._color = XoColor(client.get_string('/desktop/sugar/user/color'))
     TrayIcon.__init__(self, icon_name=_ICON_NAME, xo_color=self._color)
     self.set_palette_invoker(FrameWidgetInvoker(self))
     self._manager = speech.get_speech_manager()
     self._icon_widget.connect('button-release-event',
                               self.__button_release_event_cb)
Esempio n. 4
0
    def __init__(self):
        """ Create the icon that represents the touchpad. """
        icon_name = STATUS_ICON[_read_touchpad_mode()]

        client = gconf.client_get_default()
        color = XoColor(client.get_string('/desktop/sugar/user/color'))
        TrayIcon.__init__(self, icon_name=icon_name, xo_color=color)

        self.set_palette_invoker(FrameWidgetInvoker(self))
        self.connect('button-release-event', self.__button_release_event_cb)
Esempio n. 5
0
    def __init__(self, speed, address):
        client = gconf.client_get_default()
        color = xocolor.XoColor(client.get_string('/desktop/sugar/user/color'))

        TrayIcon.__init__(self, icon_name=self._ICON_NAME, xo_color=color)

        self.set_palette_invoker(FrameWidgetInvoker(self))
        self._palette = WiredPalette()
        self.set_palette(self._palette)
        self._palette.set_group_id('frame')
        self._palette.set_connected(speed, address)
Esempio n. 6
0
    def __init__(self, battery):
        client = gconf.client_get_default()
        self._color = XoColor(client.get_string('/desktop/sugar/user/color'))

        TrayIcon.__init__(self, icon_name=_ICON_NAME, xo_color=self._color)

        self.set_palette_invoker(FrameWidgetInvoker(self))

        self._model = DeviceModel(battery)
        self.palette = BatteryPalette(glib.markup_escape_text(_('My Battery')))
        self.palette.set_group_id('frame')
        self._model.connect('updated',
                            self.__battery_status_changed_cb)
        self._update_info()
Esempio n. 7
0
    def __init__(self):
        client = gconf.client_get_default()
        self._color = XoColor(client.get_string('/desktop/sugar/user/color'))

        TrayIcon.__init__(self, icon_name=_ICON_NAME, xo_color=self._color)

        self.set_palette_invoker(FrameWidgetInvoker(self))

        self._model = DeviceModel()
        self._model.connect('notify::level', self.__speaker_status_changed_cb)
        self._model.connect('notify::muted', self.__speaker_status_changed_cb)

        self.connect('expose-event', self.__expose_event_cb)

        self._icon_widget.connect('button-release-event',
                                  self.__button_release_event_cb)

        self._update_info()
Esempio n. 8
0
    def __init__(self, device):
        self._connection_time_handler = None
        self._connection_timestamp = 0

        client = gconf.client_get_default()
        color = xocolor.XoColor(client.get_string('/desktop/sugar/user/color'))

        TrayIcon.__init__(self, icon_name=self._ICON_NAME, xo_color=color)

        self._bus = dbus.SystemBus()
        self._device = device
        self._palette = None
        self.set_palette_invoker(FrameWidgetInvoker(self))

        self._bus.add_signal_receiver(self.__state_changed_cb,
                                      signal_name='StateChanged',
                                      path=self._device.object_path,
                                      dbus_interface=network.NM_DEVICE_IFACE)
        self._bus.add_signal_receiver(self.__ppp_stats_changed_cb,
                                      signal_name='PppStats',
                                      path=self._device.object_path,
                                      dbus_interface=network.NM_MODEM_IFACE)
Esempio n. 9
0
    def __init__(self, mount):

        self._mount = mount

        icon_name = None
        icon_theme = gtk.icon_theme_get_default()
        for icon_name in self._mount.get_icon().props.names:
            icon_info = icon_theme.lookup_icon(icon_name,
                                               gtk.ICON_SIZE_LARGE_TOOLBAR, 0)
            if icon_info is not None:
                break

        if icon_name is None:
            icon_name = 'drive'

        # TODO: retrieve the colors from the owner of the device
        client = gconf.client_get_default()
        color = XoColor(client.get_string('/desktop/sugar/user/color'))

        TrayIcon.__init__(self, icon_name=icon_name, xo_color=color)

        self.set_palette_invoker(FrameWidgetInvoker(self))

        self.connect('button-release-event', self.__button_release_event_cb)
Esempio n. 10
0
vbox.pack_start(tray, False)
tray.show()

theme_icons = gtk.icon_theme_get_default().list_icons()

for i in range(0, 100):
    button = TrayButton(icon_name=theme_icons[i])
    tray.add_item(button)
    button.show()

tray = HTray()
vbox.pack_start(tray, False)
tray.show()

for i in range(0, 10):
    icon = TrayIcon(icon_name=theme_icons[i])
    tray.add_item(icon)
    icon.show()

hbox = gtk.HBox()

tray = VTray()
hbox.pack_start(tray, False)
tray.show()

for i in range(0, 100):
    button = TrayButton(icon_name=theme_icons[i])
    tray.add_item(button)
    button.show()

tray = VTray()