def __init__(self, session, arg):
     """constructor"""
     gtk.ToggleButton.__init__(self)
     self.set_tooltip_text(_('Enable/Disable Music Plugin'))
     music_image = utils.gtk_ico_image_load(gui.theme.emote_theme.emote_to_path('(8)', True),
         gtk.ICON_SIZE_MENU)
     self.set_image(music_image)
     self.set_relief(gtk.RELIEF_NONE)
     self.connect('toggled', self._on_button_toggled)
     self.music = extension.get_instance('listening to')
     self.set_active(self.music.is_running())
Exemple #2
0
 def __init__(self, session, arg):
     """constructor"""
     gtk.ToggleButton.__init__(self)
     self.set_tooltip_text(_('Enable/Disable Music Plugin'))
     music_image = utils.gtk_ico_image_load(
         gui.theme.emote_theme.emote_to_path('(8)', True),
         gtk.ICON_SIZE_MENU)
     self.set_image(music_image)
     self.set_relief(gtk.RELIEF_NONE)
     self.connect('toggled', self._on_button_toggled)
     self.music = extension.get_instance('listening to')
     self.set_active(self.music.is_running())
 def __init__(self, userpanel, arg):
     """constructor"""
     gtk.ToggleButton.__init__(self)
     self.session = userpanel.session
     music_image = utils.gtk_ico_image_load(gui.theme.emote_theme.emote_to_path('(8)', True),
         gtk.ICON_SIZE_MENU)
     self.set_image(music_image)
     self.set_relief(gtk.RELIEF_NONE)
     self.connect('toggled', self._on_button_toggled)
     self.music = extension.get_instance('listening to')
     enabled = self.session.config.get_or_set('music_enabled', False)
     self.set_active(enabled)
     if hasattr(extension, "subscribe"):
         extension.subscribe(self._on_extension_changed, 'listening to')