def activate(self): if os.path.exists(os.path.join(USER_PLUGIN_PATH, "mojepolskieradio.glade")): self.gladefile = utils.load_ui_file(os.path.join(USER_PLUGIN_PATH, "mojepolskieradio.glade")) elif os.path.exists(os.path.join(SYSTEM_PLUGIN_PATH, "mojepolskieradio.glade")): self.gladefile = utils.load_ui_file(os.path.join(SYSTEM_PLUGIN_PATH, "mojepolskieradio.glade")) else: self.log.error('Error initializing MojePolskieRadio plugin: mojepolskieradio.glade not found') self.window = self.gladefile.get_object('dialog1') if (self.window): self.gladefile.connect_signals(self)
def __init__(self): gladefile = utils.load_ui_file("configGui.glade") self.wTree = gladefile self.dialog = self.wTree.get_object("guiChooserDialog") self.rb_systray = self.wTree.get_object("rb_systray") self.rb_appindicator = self.wTree.get_object("rb_appindicator") self.log = logging.getLogger('radiotray')
def activate(self): self.eventSubscriber.bind(EventManager.SONG_CHANGED, self.on_song_changed) gladepath = "" gladefile = "history.glade" userpath = os.path.join(USER_PLUGIN_PATH, gladefile) systempath = os.path.join(SYSTEM_PLUGIN_PATH, gladefile) if os.path.exists(userpath): gladepath = userpath elif os.path.exists(systempath): gladepath = systempath else: self.log.error( 'Error initializing History plugin: history.glade not found') Gdk.threads_enter() self.gladefile = utils.load_ui_file(gladepath) self.text = self.gladefile.get_object('textview1') self.window = self.gladefile.get_object("dialog1") self.last_title = 'none' if (self.window): self.gladefile.connect_signals(self) Gdk.threads_leave()
def activate(self): self.eventSubscriber.bind(EventManager.SONG_CHANGED, self.on_song_changed) if os.path.exists(os.path.join(USER_PLUGIN_PATH, "history.glade")): self.gladefile = utils.load_ui_file(os.path.join(USER_PLUGIN_PATH, "history.glade")) elif os.path.exists(os.path.join(SYSTEM_PLUGIN_PATH, "history.glade")): self.gladefile = utils.load_ui_file(os.path.join(SYSTEM_PLUGIN_PATH, "history.glade")) else: self.log.error('Error initializing History plugin: history.glade not found') self.text = self.gladefile.get_object('textview1') self.window = self.gladefile.get_object("dialog1") self.last_title = 'none' if (self.window): #dic = { "on_close_clicked" : self.on_close_clicked} self.gladefile.connect_signals(self)
def __init__(self, pluginManager, cfgProvider): self.pluginManager = pluginManager self.cfgProvider = cfgProvider self.log = logging.getLogger('radiotray') # load glade and get gui objects gladefile = utils.load_ui_file("configPlugins.glade") self.wTree = gladefile self.window = self.wTree.get_object("dialog1") self.list = self.wTree.get_object("treeview1") # set icon self.window.set_icon_from_file(APP_ICON_ON) # load plugin data liststore = self.load_data() self.list.set_model(liststore) # config plugins view cell1 = gtk.CellRendererToggle() cell1.set_property('activatable', True) cell1.set_activatable(True) cell1.set_property('mode', gtk.CELL_RENDERER_MODE_ACTIVATABLE) cell1.connect( 'toggled', self.on_toggle, liststore ) tvcolumn1 = gtk.TreeViewColumn(_('Active'), cell1) tvcolumn1.add_attribute( cell1, "active", 0) cell2 = gtk.CellRendererText() tvcolumn2 = gtk.TreeViewColumn(_('Name'), cell2, text=1) self.list.append_column(tvcolumn1) self.list.append_column(tvcolumn2) if (self.window): dic = { "on_close_clicked" : self.on_close_clicked} self.wTree.connect_signals(self) self.window.show()
def __init__(self, pluginManager, cfgProvider): self.pluginManager = pluginManager self.cfgProvider = cfgProvider self.log = logging.getLogger('radiotray') # load glade and get gui objects gladefile = utils.load_ui_file("configPlugins.glade") self.wTree = gladefile self.window = self.wTree.get_object("dialog1") self.list = self.wTree.get_object("treeview1") # set icon self.window.set_icon_from_file(APP_ICON_ON) # load plugin data liststore = self.load_data() self.list.set_model(liststore) # config plugins view cell1 = Gtk.CellRendererToggle() cell1.set_property('activatable', True) cell1.set_activatable(True) cell1.set_property('mode', Gtk.CellRendererMode.ACTIVATABLE) cell1.connect('toggled', self.on_toggle, liststore) tvcolumn1 = Gtk.TreeViewColumn(_('Active'), cell1) tvcolumn1.add_attribute(cell1, "active", 0) cell2 = Gtk.CellRendererText() tvcolumn2 = Gtk.TreeViewColumn(_('Name'), cell2, text=1) self.list.append_column(tvcolumn1) self.list.append_column(tvcolumn2) if (self.window): dic = {"on_close_clicked": self.on_close_clicked} self.wTree.connect_signals(self) self.window.show()
def activate(self): self.eventSubscriber.bind(EventManager.SONG_CHANGED, self.on_song_changed) gladepath = "" gladefile = "history.glade" userpath = os.path.join(USER_PLUGIN_PATH, gladefile) systempath = os.path.join(SYSTEM_PLUGIN_PATH, gladefile) if os.path.exists(userpath): gladepath = userpath elif os.path.exists(systempath): gladepath = systempath else: self.log.error('Error initializing History plugin: history.glade not found') Gdk.threads_enter() self.gladefile = utils.load_ui_file(gladepath) self.text = self.gladefile.get_object('textview1') self.window = self.gladefile.get_object("dialog1") self.last_title = 'none' if (self.window): self.gladefile.connect_signals(self) Gdk.threads_leave()
def __init__(self, dataProvider, updateFunc, standalone=False): self.dataProvider = dataProvider self.updateFunc = updateFunc self.standalone = standalone self.log = logging.getLogger('radiotray') # get gui objects gladefile = utils.load_ui_file("configBookmarks.glade") self.wTree = gladefile self.window = self.wTree.get_object("window1") self.list = self.wTree.get_object("treeview1") # edit bookmark self.nameEntry = self.wTree.get_object("nameEntry") self.nameEntryLabel = self.wTree.get_object("label1") self.urlEntry = self.wTree.get_object("urlEntry") self.urlEntryLabel = self.wTree.get_object("label2") self.config = self.wTree.get_object("editBookmark") self.radioGroup = self.wTree.get_object("radioGroup") self.radioGroupLabel = self.wTree.get_object("label8") # edit group self.configGroup = self.wTree.get_object("editGroup") self.groupNameEntry = self.wTree.get_object("groupNameEntry") self.parentGroup = self.wTree.get_object("parentGroup") self.parentGroupLabel = self.wTree.get_object("label4") # separator move self.sepMove = self.wTree.get_object("sepMove") self.sepGroup = self.wTree.get_object("sepGroup") # set icon self.window.set_icon_from_file(APP_ICON_ON) self.config.set_icon_from_file(APP_ICON_ON) self.configGroup.set_icon_from_file(APP_ICON_ON) self.sepMove.set_icon_from_file(APP_ICON_ON) # populate list of radios self.load_data() # config tree ui cell = gtk.CellRendererText() tvcolumn = gtk.TreeViewColumn(_('Radio Name'), cell) self.list.append_column(tvcolumn) tvcolumn.add_attribute(cell, 'text', 0) # config combo ui cell2 = gtk.CellRendererText() self.parentGroup.pack_start(cell2, True) self.parentGroup.add_attribute(cell2, 'text', 0) # config add radio group combo ui cell4 = gtk.CellRendererText() self.radioGroup.pack_start(cell4, True) self.radioGroup.add_attribute(cell4, 'text', 0) # separator new group combo ui cell3 = gtk.CellRendererText() self.sepGroup.pack_start(cell3, True) self.sepGroup.add_attribute(cell3, 'text', 0) # connect events if (self.window): dic = { "on_newBookmarkButton_clicked" : self.on_add_bookmark_clicked, "on_newSeparatorButton_clicked" : self.on_add_separator_clicked, "on_editBookmarkButton_clicked" : self.on_edit_bookmark_clicked, "on_delBookmarkButton_clicked" : self.on_remove_bookmark_clicked, "on_close_clickedButton_clicked" : self.on_close_clicked, "on_nameEntry_activated" : self.on_nameEntry_activated, "on_urlEntry_activated" : self.on_urlEntry_activated, "on_newGroupButton_clicked" : self.on_newGroupButton_clicked} self.wTree.connect_signals(self) # enable drag and drop support self.list.enable_model_drag_source( gtk.gdk.BUTTON1_MASK, [drop_yes], gtk.gdk.ACTION_MOVE) self.list.enable_model_drag_dest( [drop_yes], gtk.gdk.ACTION_MOVE) self.list.connect("drag-data-received", self.onDragDataReceived) self.list.connect("drag-motion", self.onDragMotion) # Connect row activation with bookmarks conf self.list.connect("row-activated", self.on_row_activated)
def __init__(self, dataProvider, updateFunc, standalone=False): self.dataProvider = dataProvider self.updateFunc = updateFunc self.standalone = standalone self.log = logging.getLogger('radiotray') # get gui objects gladefile = utils.load_ui_file("configBookmarks.glade") self.wTree = gladefile self.window = self.wTree.get_object("window1") self.list = self.wTree.get_object("treeview1") # edit bookmark self.nameEntry = self.wTree.get_object("nameEntry") self.nameEntryLabel = self.wTree.get_object("label1") self.urlEntry = self.wTree.get_object("urlEntry") self.urlEntryLabel = self.wTree.get_object("label2") self.config = self.wTree.get_object("editBookmark") self.radioGroup = self.wTree.get_object("radioGroup") self.radioGroupLabel = self.wTree.get_object("label8") # edit group self.configGroup = self.wTree.get_object("editGroup") self.groupNameEntry = self.wTree.get_object("groupNameEntry") self.parentGroup = self.wTree.get_object("parentGroup") self.parentGroupLabel = self.wTree.get_object("label4") # separator move self.sepMove = self.wTree.get_object("sepMove") self.sepGroup = self.wTree.get_object("sepGroup") # set icon self.window.set_icon_from_file(APP_ICON_ON) self.config.set_icon_from_file(APP_ICON_ON) self.configGroup.set_icon_from_file(APP_ICON_ON) self.sepMove.set_icon_from_file(APP_ICON_ON) # populate list of radios self.load_data() # config tree ui cell = Gtk.CellRendererText() tvcolumn = Gtk.TreeViewColumn(_('Radio Name'), cell) self.list.append_column(tvcolumn) tvcolumn.add_attribute(cell, 'text', 0) # config combo ui cell2 = Gtk.CellRendererText() self.parentGroup.pack_start(cell2, True) self.parentGroup.add_attribute(cell2, 'text', 0) # config add radio group combo ui cell4 = Gtk.CellRendererText() self.radioGroup.pack_start(cell4, True) self.radioGroup.add_attribute(cell4, 'text', 0) # separator new group combo ui cell3 = Gtk.CellRendererText() self.sepGroup.pack_start(cell3, True) self.sepGroup.add_attribute(cell3, 'text', 0) # connect events if (self.window): dic = { "on_newBookmarkButton_clicked": self.on_add_bookmark_clicked, "on_newSeparatorButton_clicked": self.on_add_separator_clicked, "on_editBookmarkButton_clicked": self.on_edit_bookmark_clicked, "on_delBookmarkButton_clicked": self.on_remove_bookmark_clicked, "on_close_clickedButton_clicked": self.on_close_clicked, "on_nameEntry_activated": self.on_nameEntry_activated, "on_urlEntry_activated": self.on_urlEntry_activated, "on_newGroupButton_clicked": self.on_newGroupButton_clicked } self.wTree.connect_signals(self) # enable drag and drop support self.list.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK, [], Gdk.DragAction.MOVE) self.list.enable_model_drag_dest([], Gdk.DragAction.MOVE) print "config" self.list.drag_dest_add_text_targets() self.list.drag_source_add_text_targets() self.list.connect("drag_data_received", self.onDragDataReceived) self.list.connect("drag_data_get", self.onDataGet) # Connect row activation with bookmarks conf self.list.connect("row-activated", self.on_row_activated)