def __init__(self, controls, collback): self.collback = collback FControl.__init__(self, controls) ChildTopWindow.__init__(self, _("Equalizer")) self.eq_lines = [] for label in EQUALIZER_LABLES: self.eq_lines.append(EqLine(label, self.on_collback)) lbox = gtk.VBox(False, 0) lbox.show() self.combo = gtk.combo_box_entry_new_text() self.combo.connect("changed", self.on_combo_chage) lbox.pack_start(self.top_row(), False, False, 0) lbox.pack_start(self.middle_lines_box(), False, False, 0) self.add(lbox) self.models = [] self.default_models = []
def __init__(self, controls): FControl.__init__(self, controls) gtk.VBox.__init__(self, False, 0) self.perspectivs = { LEFT_PERSPECTIVE_NAVIGATION: controls.tabhelper, LEFT_PERSPECTIVE_RADIO: controls.radio.scroll, LEFT_PERSPECTIVE_VIRTUAL: controls.virtual.scroll, LEFT_PERSPECTIVE_INFO: controls.info_panel, LEFT_PERSPECTIVE_LASTFM: controls.lastfm_integration.scroll, LEFT_PERSPECTIVE_VK: controls.vk_integration.scroll } self.buttons = PerspectiveButtonControlls(self.activate_perspective, controls) self.buttons.show_all() self.add_button = ButtonStockText(_("Add Folder(s) in tree"), gtk.STOCK_ADD) self.add_button.connect("clicked", lambda *a: controls.tree.add_folder()) self.pack_start(self.add_button, False, False) for widget in self.perspectivs.values(): self.pack_start(widget, True, True) self.pack_start(controls.filter, False, False) self.pack_start(self.buttons, False, False)
def __init__(self, controls): FControl.__init__(self, controls) gtk.HBox.__init__(self, False, 0) self.old_menu = MenuBarWidget(controls) self.pack_start(self.old_menu.widget, False, False) self.new_menu_button = ImageButton(gtk.STOCK_PREFERENCES) self.new_menu_button.connect("button-press-event", self.on_button_press) self.pack_start(self.new_menu_button, False, False) self.pack_start(controls.playback, False, False) self.pack_start(controls.os, False, False) self.pack_start(controls.volume, False, False) self.pack_start(gtk.SeparatorToolItem(), False, False) self.pack_start(controls.seek_bar, True, True) self.show_all() """menu init""" menu = Popup() decorator = MenuStyleDecorator() MenuBarWidget(self.controls, menu) menu.add_separator() menu.add_item(_("Preferences"), gtk.STOCK_PREFERENCES, self.controls.show_preferences) menu.add_separator() menu.add_item(_("Quit"), gtk.STOCK_QUIT, self.controls.quit) decorator.apply(menu) self.menu = menu
def __init__(self, controls, seek_bar_movie=None): FControl.__init__(self, controls) self.seek_bar_movie =seek_bar_movie gtk.Alignment.__init__(self, xalign=0.5, yalign=0.5, xscale=1.0, yscale=1.0) self.set_padding(padding_top=7, padding_bottom=7, padding_left=0, padding_right=7) self.tooltip = gtk.Window(gtk.WINDOW_POPUP) self.tooltip.set_position(gtk.WIN_POS_CENTER) self.tooltip_label = gtk.Label() self.tooltip.add(self.tooltip_label) self.progresbar = gtk.ProgressBar() self.progresbar.set_text("00:00 / 00:00") try: self.progresbar.set_has_tooltip(True) except: pass self.progresbar.connect("leave-notify-event", lambda *a: self.tooltip.hide()) self.progresbar.connect("motion-notify-event", self.on_pointer_motion) event = gtk.EventBox() event.add(self.progresbar) event.connect("button-press-event", self.on_seek) self.add(event) self.show_all() self.tooltip.hide()
def __init__(self, controls): FControl.__init__(self, controls) self.controls = controls bbox = gtk.VBox(False, 0) bbox.pack_start(controls.notetabs, True, True) bbox.pack_start(controls.movie_window, False, False) center_box = gtk.VBox(False, 0) center_box.pack_start(controls.searchPanel, False, False) center_box.pack_start(bbox, True, True) self.hpaned_left = gtk.HPaned() self.hpaned_left.connect("motion-notify-event", self.on_save_and_normilize_columns) self.hpaned_left.pack1(child=controls.perspective, resize=True, shrink=True) self.hpaned_left.pack2(child=center_box, resize=True, shrink=True) self.hpaned_right = gtk.HPaned() self.hpaned_right.connect("motion-notify-event", self.on_save_and_normilize_columns) self.hpaned_right.pack1(child=self.hpaned_left, resize=True, shrink=True) self.hpaned_right.pack2(child=controls.coverlyrics, shrink=False) vbox = gtk.VBox(False, 0) vbox.pack_start(controls.top_panel, False, False) vbox.pack_start(self.hpaned_right, True, True) vbox.pack_start(controls.statusbar, False, True) vbox.show_all() #controls.main_window.connect("configure-event", self.on_change_window_size) #if pull sides of window controls.main_window.connect("size-allocate", self.on_allocate_window_size) #if maximize and restore window controls.main_window.add(vbox)
def __init__(self, controls): FControl.__init__(self, controls) vbox = gtk.VBox(False, 0) vbox.pack_start(controls.top_panel, False, False) center_box = gtk.VBox(False, 0) # self.hpaned_right = gtk.HPaned() bbox = gtk.VBox(False, 0) bbox.pack_start(controls.notetabs, True, True) bbox.pack_start(controls.movie_window, False, False) # self.hpaned_right.pack1(child=bbox, resize=True, shrink=True) # self.hpaned_right.pack2(child=controls.info_panel, resize=True, shrink=True) center_box.pack_start(controls.searchPanel, False, False) center_box.pack_start(bbox, True, True) self.hpaned_left = gtk.HPaned() self.hpaned_left.pack1(child=controls.perspective, resize=True, shrink=True) self.hpaned_left.pack2(child=center_box, resize=True, shrink=True) self.hpaned_left.show_all() vbox.pack_start(self.hpaned_left, True, True) vbox.pack_start(controls.statusbar, False, True) vbox.show_all() controls.main_window.add(vbox)
def __init__(self, controls): FilterTreeControls.__init__(self, controls) FTreeModel.__init__(self) FControl.__init__(self, controls) self.get_selection().set_mode(gtk.SELECTION_MULTIPLE) self.set_enable_tree_lines(True) """model config""" self.model = gtk.TreeStore(*FTreeModel().types()) """filter config""" self.filter_model = self.model.filter_new() self.filter_model.set_visible_column(self.visible[0]) self.set_model(self.filter_model) """connectors""" self.connect("button-press-event", self.on_button_press) self.connect("key-release-event", self.on_key_release) self.connect("row-expanded", self.on_row_expanded) self.connect('button_press_event', self.on_multi_button_press) self.connect('button_release_event', self.on_multi_button_release) self.count_index = 0 self.set_reorderable(False) self.set_headers_visible(False) self.set_type_plain() self.active_UUID = -1 self.defer_select = False self.scroll = gtk.ScrolledWindow() self.scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.scroll.add(self)
def __init__(self, controls): FControl.__init__(self, controls) gtk.VBox.__init__(self, False, 0) self.perspectivs = { LEFT_PERSPECTIVE_NAVIGATION:controls.tabhelper, LEFT_PERSPECTIVE_RADIO:controls.radio.scroll, LEFT_PERSPECTIVE_VIRTUAL:controls.virtual.scroll, LEFT_PERSPECTIVE_INFO:controls.info_panel, LEFT_PERSPECTIVE_LASTFM:controls.lastfm_integration.scroll, LEFT_PERSPECTIVE_VK:controls.vk_integration.scroll } self.buttons = PerspectiveButtonControlls(self.activate_perspective, controls) self.buttons.show_all() self.add_button = ButtonStockText(_("Add Folder(s) in tree"), gtk.STOCK_ADD) self.add_button.connect("clicked", lambda * a :controls.tree.add_folder()) self.pack_start(self.add_button, False, False) for widget in self.perspectivs.values(): self.pack_start(widget, True, True) self.pack_start(controls.filter, False, False) self.pack_start(self.buttons, False, False)
def __init__(self, controls): FControl.__init__(self, controls) gtk.HBox.__init__(self, False, 0) self.old_menu = MenuBarWidget(controls) self.pack_start(self.old_menu.widget, False, False) self.new_menu_button = ImageButton(gtk.STOCK_PREFERENCES) self.new_menu_button.connect("button-press-event", self.on_button_press) self.pack_start(self.new_menu_button, False, False) self.pack_start(controls.playback, False, False) self.pack_start(controls.os, False, False) self.pack_start(controls.volume, False, False) self.pack_start(gtk.SeparatorToolItem(), False, False) self.pack_start(controls.record, False, False) self.pack_start(controls.seek_bar, True, True) """menu init""" menu = Popup() decorator = MenuStyleDecorator() MenuBarWidget(self.controls, menu) menu.add_separator() menu.add_item(_("Preferences"), gtk.STOCK_PREFERENCES, self.controls.show_preferences) menu.add_separator() menu.add_item(_("Quit"), gtk.STOCK_QUIT, self.controls.quit) decorator.apply(menu) self.menu = menu
def __init__(self, controls): FControl.__init__(self, controls) bbox = gtk.VBox(False, 0) bbox.pack_start(controls.notetabs, True, True) bbox.pack_start(controls.movie_window, False, False) center_box = gtk.VBox(False, 0) center_box.pack_start(controls.searchPanel, False, False) center_box.pack_start(bbox, True, True) self.hpaned_left = gtk.HPaned() self.hpaned_left.connect("motion-notify-event", self.on_save_and_normilize_columns) self.hpaned_left.pack1(child=controls.perspective, resize=True, shrink=True) self.hpaned_left.pack2(child=center_box, resize=True, shrink=True) self.hpaned_right = gtk.HPaned() self.hpaned_right.connect("motion-notify-event", self.on_save_and_normilize_columns) self.hpaned_right.pack1(child=self.hpaned_left, resize=True, shrink=True) self.hpaned_right.pack2(child=controls.coverlyrics, resize=True, shrink=True) vbox = gtk.VBox(False, 0) vbox.pack_start(controls.top_panel, False, False) vbox.pack_start(self.hpaned_right, True, True) vbox.pack_start(controls.statusbar, False, True) vbox.show_all() controls.main_window.add(vbox)
def __init__(self, controls): gtk.HBox.__init__(self, False, 0) FControl.__init__(self, controls) self.entry = gtk.Entry() self.entry.connect("key-release-event", self.on_key_press) self.search_func = self.controls.filter_by_file file_search = ToggleImageButton(gtk.STOCK_FILE, func=self.set_search_by, param=self.controls.filter_by_file) file_search.set_tooltip_text(_("File search")) file_search.set_active(True) folder_search = ToggleImageButton(gtk.STOCK_DIRECTORY, func=self.set_search_by, param=self.controls.filter_by_folder) folder_search.set_tooltip_text(_("Folder search")) self.list = [file_search, folder_search] OneActiveToggledButton(self.list) """search button""" search = tab_close_button(func=self.on_filter, stock=gtk.STOCK_FIND) self.pack_start(file_search, False, False) self.pack_start(folder_search, False, False) self.pack_start(self.entry, True, True) self.pack_start(search, False, False)
def __init__(self, controls): gtk.VBox.__init__(self, False, 0) FControl.__init__(self, controls) self.controls = controls label = gtk.Label() label.set_markup("<b>%s:</b>" % _("Search music online")) #self.set_label_widget(label) #self.set_border_width(0) """default search function""" self.search_function = self.controls.search_top_tracks self.buttons = [] self.pack_start(self.search_line(), False, False, 0) #self.pack_start(controls.search_progress, False, False, 0) self.show_all() """search on enter""" for button in self.buttons: button.connect("key-press-event", self.on_search_key_press) """only one button active""" OneActiveToggledButton(self.buttons)
def __init__(self, controls): FControl.__init__(self, controls) MyToolbar.__init__(self) self.add_separator() self.add_button("Stop", gtk.STOCK_MEDIA_STOP, controls.state_stop, None) self.add_button("Play", gtk.STOCK_MEDIA_PLAY, controls.state_play, None) self.add_button("Pause", gtk.STOCK_MEDIA_PAUSE, controls.state_pause, None) self.add_button("Previous", gtk.STOCK_MEDIA_PREVIOUS, controls.prev, None) self.add_button("Next", gtk.STOCK_MEDIA_NEXT, controls.next, None) self.add_separator()
def __init__(self, controls): FControl.__init__(self, controls) box = gtk.VBox(False, 0) box.hide() box.pack_start(self.tabs_mode(), False, True, 0) box.pack_start(self.dirs(), False, True, 0) box.pack_start(self.formats(), False, True, 0) box.pack_start(self.gap(), False, True, 0) self.widget = box
def __init__(self, controls): FControl.__init__(self, controls) gtk.ProgressBar.__init__(self) self.set_size_request(20, -1) # self.hide() self.set_pulse_step(0.2) self.set_fraction(0) self.flag = True self.started = False self.set_text("...")
def __init__(self, controls): gtk.Notebook.__init__(self) FControl.__init__(self, controls) self.controls = controls self.set_properties("tab-expand", True) self.set_scrollable(True) self.save_lock = threading.Lock() self.connect("page-reordered", self.reorder_callback) add_button = ImageButton(gtk.STOCK_ADD, func=self.on_add_button_click, size=gtk.ICON_SIZE_BUTTON) add_button.show() self.set_action_widget(add_button, gtk.PACK_START) self.default_angle = 0 self.navig = False if isinstance(self, NoteTabControl) else True
def __init__(self, controls): FControl.__init__(self, controls) gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL) self.set_title("Foobnix " + FOOBNIX_VERSION) self.set_position(gtk.WIN_POS_CENTER) self.set_resizable(True) self.connect("delete-event", self.hide_window) self.connect("configure-event", self.on_configure_event) self.connect("key-press-event", self.on_key_press) self.set_icon(self.controls.trayicon.get_pixbuf()) self.set_opacity(FC().window_opacity)
def __init__(self, controls, object_path=MPRIS_ROOT_PATH): FControl.__init__(self, controls) try: bus = dbus.SessionBus() bus_name = dbus.service.BusName(DBUS_NAME, bus=bus) dbus.service.Object.__init__(self, bus_name, object_path) self._player = MprisPlayer(controls) #dbus_interface = dbus_interface = 'org.gnome.SettingsDaemon.MediaKeys' mm_object = bus.get_object('org.gnome.SettingsDaemon', '/org/gnome/SettingsDaemon/MediaKeys') mm_object.GrabMediaPlayerKeys("MyMultimediaThingy", 0, dbus_interface=dbus_interface) mm_object.connect_to_signal('MediaPlayerKeyPressed', self.on_mediakey) except Exception, e: logging.error("DBUS Initialization Error" + str(e))
def __init__(self, controls): FControl.__init__(self, controls) gtk.Frame.__init__(self) self.set_label_widget(notetab_label(self.hide)) self.set_label_align(1.0, 0.0) self.set_border_width(0) self.smallscree_area = AdvancedDrawingArea(controls) self.smallscree_area.action_function = self.on_full_screen self.add(self.smallscree_area) self.fullscrean_area = FullScreanArea(controls, self.on_small_screen) self.out = None self.set_out(self.smallscree_area)
def __init__(self, controls): FControl.__init__(self, controls) gtk.Alignment.__init__(self, xalign=0.5, yalign=0.5, xscale=1.0, yscale=1.0) self.set_padding(padding_top=7, padding_bottom=7, padding_left=0, padding_right=7) self.progresbar = gtk.ProgressBar() self.progresbar.set_text("00:00 / 00:00") event = gtk.EventBox() event.connect("button-press-event", self.on_seek) event.add(self.progresbar) self.add(event) self.show_all()
def __init__(self, controls): FControl.__init__(self, controls) box = gtk.VBox(False, 0) box.hide() box.pack_start(self.tabs_mode(), False, True, 0) box.pack_start(self.dirs(), False, True, 0) box.pack_start(self.formats(), False, True, 0) self.widget = box uhbox = gtk.HBox() ulabel = gtk.Label(_("Update library on start (more slow) ")) self.update_on_start = gtk.CheckButton() #self.update_on_start.show() uhbox.pack_start(ulabel, False, True, 0) uhbox.pack_start(self.update_on_start) box.pack_start(uhbox, False, True, 0) box.pack_start(self.gap(), False, True, 0)
def __init__(self, controls): FControl.__init__(self, controls) box = gtk.VBox(False, 0) box.hide() box.pack_start(self.tabs_mode(), False, True, 0) box.pack_start(self.dirs(), False, True, 0) box.pack_start(self.formats(), False, True, 0) self.widget = box uhbox = gtk.HBox() ulabel = gtk.Label(_("Update library on start (more slow) ")) self.update_on_start = gtk.CheckButton() uhbox.pack_start(ulabel, False, True, 0) uhbox.pack_start(self.update_on_start) box.pack_start(uhbox, False, True, 0) box.pack_start(self.gap(), False, True, 0)
def __init__(self, controls): FControl.__init__(self, controls) gtk.Frame.__init__(self) self.set_label_widget(notetab_label(self.hide)) self.set_label_align(1.0, 0.0) self.set_border_width(0) self.smallscree_area = AdvancedDrawingArea(controls) self.smallscree_area.action_function = self.on_full_screen self.add(self.smallscree_area) self.fullscrean_area = FullScreanArea(controls, self.on_small_screen) for state in (gtk.STATE_NORMAL, gtk.STATE_PRELIGHT, gtk.STATE_ACTIVE, gtk.STATE_SELECTED, gtk.STATE_INSENSITIVE): self.smallscree_area.modify_bg(state, self.smallscree_area.get_colormap().alloc_color("black")) self.fullscrean_area.drow.modify_bg(state, self.fullscrean_area.get_colormap().alloc_color("black")) self.out = None self.set_out(self.smallscree_area)
def __init__(self, controls): FControl.__init__(self, controls) gtk.StatusIcon.__init__(self) self.hide() ImageBase.__init__(self, ICON_FOOBNIX, 150) self.popup_menu = PopupWindowMenu(self.controls) self.connect("activate", self.on_activate) self.connect("popup-menu", self.on_popup_menu) try: self.set_has_tooltip(True) self.tooltip = gtk.Tooltip() self.set_tooltip("Foobnix music player") self.connect("query-tooltip", self.on_query_tooltip) self.connect("button-press-event", self.on_button_press) self.connect("scroll-event", self.controls.volume.on_scroll_event) except Exception, e: logging.warn("On debian it doesn't work" + str(e))
def __init__(self, controls): FControl.__init__(self, controls) self.controls = controls bbox = gtk.VBox(False, 0) bbox.pack_start(controls.notetabs, True, True) bbox.pack_start(controls.movie_window, False, False) center_box = gtk.VBox(False, 0) center_box.pack_start(controls.searchPanel, False, False) center_box.pack_start(bbox, True, True) self.hpaned_left = gtk.HPaned() self.hpaned_left.connect("motion-notify-event", self.on_save_and_normilize_columns) self.hpaned_left.pack1(child=controls.perspective, resize=True, shrink=True) self.hpaned_left.pack2(child=center_box, resize=True, shrink=True) self.hpaned_right = gtk.HPaned() self.hpaned_right.connect("motion-notify-event", self.on_save_and_normilize_columns) self.hpaned_right.pack1(child=self.hpaned_left, resize=True, shrink=True) self.hpaned_right.pack2(child=controls.coverlyrics, shrink=False) vbox = gtk.VBox(False, 0) vbox.pack_start(controls.top_panel, False, False) vbox.pack_start(self.hpaned_right, True, True) vbox.pack_start(controls.statusbar, False, True) vbox.show_all() #controls.main_window.connect("configure-event", self.on_change_window_size) #if pull sides of window controls.main_window.connect( "size-allocate", self.on_allocate_window_size) #if maximize and restore window controls.main_window.add(vbox)
def __init__(self, controls, seek_bar_movie=None): FControl.__init__(self, controls) self.seek_bar_movie = seek_bar_movie gtk.Alignment.__init__(self, xalign=0.5, yalign=0.5, xscale=1.0, yscale=1.0) self.set_padding(padding_top=7, padding_bottom=7, padding_left=0, padding_right=7) self.tooltip = gtk.Window(gtk.WINDOW_POPUP) self.tooltip.set_position(gtk.WIN_POS_CENTER) self.tooltip_label = gtk.Label() self.tooltip.add(self.tooltip_label) self.progresbar = gtk.ProgressBar() self.progresbar.set_text("00:00 / 00:00") try: self.progresbar.set_has_tooltip(True) except: pass self.progresbar.connect("leave-notify-event", lambda *a: self.tooltip.hide()) self.progresbar.connect("motion-notify-event", self.on_pointer_motion) event = gtk.EventBox() event.add(self.progresbar) event.connect("button-press-event", self.on_seek) self.add(event) self.show_all() self.tooltip.hide()
def __init__(self, controls): FControl.__init__(self, controls) gtk.Window. __init__(self, gtk.WINDOW_POPUP) self.set_position(gtk.WIN_POS_MOUSE) self.connect("leave-notify-event", self.on_leave_window) vbox = gtk.VBox(False, 0) playcontrols = PlaybackControls(controls) playcontrols.pack_start(ImageButton(gtk.STOCK_QUIT, controls.quit, _("Exit"))) playcontrols.pack_start(ImageButton(gtk.STOCK_OK, self.hide, _("Close Popup"))) self.poopup_text = gtk.Label("Foobnix") self.poopup_text.set_line_wrap(True) vbox.pack_start(playcontrols, False, False) vbox.pack_start(self.poopup_text, False, False) self.add(vbox) self.show_all() self.hide()
def __init__(self, controls): gtk.HBox.__init__(self, False, 0) FControl.__init__(self, controls) label_m = EventLabel(text="‒", func=self.volume_down) adjustment = gtk.Adjustment(value=1, lower=0, upper=self.MAX_VALUE, step_incr=0, page_incr=0, page_size=0) self.volume_scale = gtk.HScale(adjustment) self.volume_scale.connect("value-changed", self.on_value_changed) self.volume_scale.connect("scroll-event", self.on_scroll_event) self.volume_scale.connect("button-press-event", self.on_volume_change) #self.volume_scale.connect("motion-notify-event", self.on_volume_change1) self.volume_scale.set_size_request(200, -1) self.volume_scale.set_update_policy(gtk.UPDATE_CONTINUOUS) self.volume_scale.set_digits(1) self.volume_scale.set_draw_value(False) label_p = EventLabel(text="+", func=self.volume_up) self.pack_start(label_m, False, False) self.pack_start(self.volume_scale, False, False) self.pack_start(label_p, False, False) self.show_all()
def __init__(self, controls): FControl.__init__(self, controls) gtk.Window.__init__(self, gtk.WINDOW_POPUP) self.set_position(gtk.WIN_POS_MOUSE) self.connect("leave-notify-event", self.on_leave_window) vbox = gtk.VBox(False, 0) playcontrols = PlaybackControls(controls) playcontrols.pack_start( ImageButton(gtk.STOCK_QUIT, controls.quit, _("Exit"))) playcontrols.pack_start( ImageButton(gtk.STOCK_OK, self.hide, _("Close Popup"))) self.poopup_text = gtk.Label("Foobnix") self.poopup_text.set_line_wrap(True) vbox.pack_start(playcontrols, False, False) vbox.pack_start(self.poopup_text, False, False) self.add(vbox) self.show_all() self.hide()
def __init__(self, controls): FControl.__init__(self, controls) gtk.Window.__init__(self, gtk.WINDOW_POPUP) self.set_position(gtk.WIN_POS_MOUSE) self.connect("leave-notify-event", self.on_leave_window)
def __init__(self, controls): gtk.Notebook.__init__(self) FControl.__init__(self, controls) self.controls = controls self.set_scrollable(True)
def __init__(self, controls): FControl.__init__(self, controls) LoadSave.__init__(self) self.eq_view = EqWindow(controls, self.on_eq_chaged) self.eq_view.hide()
def __init__(self, controls): FControl.__init__(self, controls) thread.start_new_thread(self.lazy_init, (True,) )
def __init__(self, controls, object_path=MPRIS_PLAYER_PATH): dbus.service.Object.__init__(self, dbus.SessionBus(), object_path) FControl.__init__(self, controls)
def __init__(self, controls): FControl.__init__(self, controls) gtk.Window. __init__(self, gtk.WINDOW_POPUP) self.set_position(gtk.WIN_POS_MOUSE) self.connect("leave-notify-event", self.on_leave_window)
def __init__(self, controls): FControl.__init__(self, controls) self.status = MediaPlayerStatus()
def __init__(self, controls): FControl.__init__(self, controls) self.number_inits = 0
def __init__(self, controls, parent=None): FControl.__init__(self, controls) """TOP menu constructor""" decorator = MenuStyleDecorator() if not parent: parent = TopMenuBar() top = parent """File""" file = top.add_submenu(_("_File")) file.add_image_item(_("Add File(s)"), gtk.STOCK_OPEN, self.controls.on_add_files) file.add_image_item(_("Add Folder(s)"), gtk.STOCK_OPEN, self.controls.on_add_folders) file.separator() file.add_image_item(_("Quit"), gtk.STOCK_QUIT, self.controls.quit) """View""" view = top.add_submenu(_("_View")) self.view_music_tree = view.add_ckeck_item(_("Left Panel"), FC().is_view_music_tree_panel) self.view_music_tree.connect("activate", lambda w: controls.set_visible_musictree_panel(w.get_active())) self.view_search_panel = view.add_ckeck_item(_("Search Panel")) self.view_search_panel.connect("activate", lambda w: controls.set_visible_search_panel(w.get_active())) view.separator() view.add_image_item(_("Equalizer"), None, self.controls.eq.show) view.add_image_item(_("Download Manager"), None, self.controls.dm.show) view.separator() view.add_image_item(_("Preferences"), gtk.STOCK_PREFERENCES, self.controls.show_preferences) """Playback""" playback = top.add_submenu(_("_Playback")) def set_random(flag=True): FC().is_order_random = flag logging.debug("set random" + str(flag)) controls.os.on_load() """Playback - Order""" order = playback.add_text_item(_("Order")) self.playback_order_linear = order.add_radio_item(_("Linear"), None, not FC().is_order_random) self.playback_order_linear.connect("activate", lambda w: set_random(False)) self.playback_order_random = order.add_radio_item(_("Random"), self.playback_order_linear, FC().is_order_random) self.playback_order_random.connect("activate", lambda w: set_random(True)) #order.separator() #order.add_image_item("Shuffle", gtk.STOCK_UNDELETE) """Playback - Repeat""" repeat = playback.add_text_item(_("Repeat")) self.lopping_all = repeat.add_radio_item(_("All"), None, FC().repeat_state == const.REPEAT_ALL) self.lopping_single = repeat.add_radio_item(_("Single"), self.lopping_all, FC().repeat_state == const.REPEAT_SINGLE) self.lopping_disable = repeat.add_radio_item(_("Disable"), self.lopping_all, FC().repeat_state == const.REPEAT_NO) def repeat_all(): FC().repeat_state = const.REPEAT_ALL logging.debug("set repeat_all") controls.os.on_load() def repeat_sigle(): FC().repeat_state = const.REPEAT_SINGLE logging.debug("set repeat_sigle") controls.os.on_load() def repeat_no(): FC().repeat_state = const.REPEAT_NO logging.debug("set repeat_no") controls.os.on_load() self.lopping_all.connect("activate", lambda * a:repeat_all()) self.lopping_single.connect("activate", lambda * a:repeat_sigle()) self.lopping_disable.connect("activate", lambda * a:repeat_no()) """Playlist View""" #playlist = playback.add_text_item("Playlist") #self.playlist_plain = playlist.add_radio_item("Plain (normal style)", None, FC().playlist_type == const.PLAYLIST_PLAIN) #self.playlist_tree = playlist.add_radio_item("Tree (apollo style)", self.playlist_plain , FC().playlist_type == const.PLAYLIST_TREE) #self.playlist_plain.connect("activate", lambda w: w.get_active() and controls.set_playlist_plain()) #self.playlist_tree.connect("activate", lambda w: w.get_active() and controls.set_playlist_tree()) """Help""" help = top.add_submenu(_("_Help")) help.add_image_item(_("About"), gtk.STOCK_ABOUT, self.show_about) help.separator() help.add_text_item(_("Project page"), lambda * a:open_link_in_browser(_("http://www.foobnix.com/news/eng")), None, False) help.add_image_item(_("Issue report"), gtk.STOCK_DIALOG_WARNING, lambda * a:open_link_in_browser("http://code.google.com/p/foobnix/issues/list")) help.separator() help.add_image_item(_("Donate Participate"), gtk.STOCK_DIALOG_QUESTION, lambda * a:open_link_in_browser(_("http://www.foobnix.com/donate/eng"))) #help.add_image_item("Help", gtk.STOCK_HELP) #top.decorate() decorator.apply(top) decorator.apply(file) decorator.apply(view) decorator.apply(playback) decorator.apply(repeat) decorator.apply(order) decorator.apply(help) self.widget = top self.on_load()
def __init__(self, controls): gtk.Frame.__init__(self) FControl.__init__(self, controls) self.album_label = gtk.Label() self.album_label.set_line_wrap(True) self.album_label.set_markup("<b></b>") self.set_label_widget(self.album_label) self.best_songs = SimpleTreeControl(_("Best Songs"), controls) self.best_songs.line_title = EventLabel(self.best_songs.get_title(), func=self.show_current, arg=self.best_songs, func1=self.show_best_songs) self.artists = SimpleTreeControl(_("Similar Artists"), controls) self.artists.line_title = EventLabel(self.artists.get_title(), func=self.show_current, arg=self.artists, func1=self.show_similar_artists) self.tracks = SimpleTreeControl(_("Similar Songs"), controls) self.tracks.line_title = EventLabel(self.tracks.get_title(), func=self.show_current, arg=self.tracks, func1=self.show_similar_tracks) self.tags = SimpleTreeControl(_("Similar Tags"), controls) self.tags.line_title = EventLabel(self.tags.get_title(), func=self.show_current, arg=self.tags, func1=self.show_similar_tags) self.lyrics = TextArea() lyric_title = _("Lyrics") self.lyrics.set_text("", lyric_title) self.lyrics.line_title = EventLabel(lyric_title, func=self.show_current, arg=self.lyrics, func1=self.show_similar_lyrics) """wiki""" wBox = gtk.VBox() wiki_title = _("Biography") self.wiki = TextArea() wBox.line_title = EventLabel(wiki_title, func=self.show_current, arg=wBox, func1=self.show_wiki_info) self.last_fm_label = gtk.LinkButton("http://www.last.fm", "last.fm") self.wiki_label = gtk.LinkButton("http://www.wikipedia.org", "wikipedia") self.wiki = TextArea() self.wiki.set_text("", wiki_title) wBox.pack_start(HBoxDecorator(self.last_fm_label, self.wiki_label), False, False) wBox.pack_start(self.wiki, True, True) wBox.scroll = wBox self.vpaned_small = gtk.VBox(False, 0) """image and similar artists""" ibox = gtk.HBox(False, 0) self.image = ImageBase(ICON_BLANK_DISK, FC().info_panel_image_size) lbox = gtk.VBox(False, 0) self.left_widget = [wBox, self.artists, self.tracks, self.tags, self.lyrics, self.best_songs] for l_widget in self.left_widget: lbox.pack_start(l_widget.line_title) ibox.pack_start(self.image, False, False) ibox.pack_start(lbox, True, True) """image and similar artists""" sbox = gtk.VBox(False, 0) for l_widget in self.left_widget: sbox.pack_start(l_widget.scroll, True, True) self.vpaned_small.pack_start(ibox, False, False) self.vpaned_small.pack_start(sbox, True, True) self.add(self.vpaned_small) self.hide_all() self.bean = None self.info_cache = InfoCache()
def __init__(self, controls): gtk.Frame.__init__(self) FControl.__init__(self, controls) self.album_label = gtk.Label() self.album_label.set_line_wrap(True) self.album_label.set_markup("<b></b>") self.set_label_widget(self.album_label) self.empty = TextArea() self.best_songs = SimpleTreeControl(_("Best Songs"), controls) self.best_songs.line_title = EventLabel(self.best_songs.get_title(), func=self.show_current, arg=self.best_songs, func1=self.show_best_songs) self.artists = SimpleTreeControl(_("Similar Artists"), controls) self.artists.line_title = EventLabel(self.artists.get_title(), func=self.show_current, arg=self.artists, func1=self.show_similar_artists) self.tracks = SimpleTreeControl(_("Similar Songs"), controls) self.tracks.line_title = EventLabel(self.tracks.get_title(), func=self.show_current, arg=self.tracks, func1=self.show_similar_tracks) self.tags = SimpleTreeControl(_("Similar Tags"), controls) self.tags.line_title = EventLabel(self.tags.get_title(), func=self.show_current, arg=self.tags, func1=self.show_similar_tags) self.lyrics = TextArea() lyric_title = _("Lyrics") self.lyrics.set_text("", lyric_title) self.lyrics.line_title = EventLabel(lyric_title, func=self.show_current, arg=self.lyrics, func1=self.show_similar_lyrics) """wiki""" wBox = gtk.VBox() wiki_title = _("About Artist") self.wiki = TextArea() wBox.line_title = EventLabel(wiki_title, func=self.show_current, arg=wBox, func1=self.show_wiki_info) self.last_fm_label = gtk.LinkButton("http://www.last.fm", "last.fm") self.wiki_label = gtk.LinkButton("http://www.wikipedia.org", "wikipedia") self.wiki = TextArea() self.wiki.set_text("", wiki_title) wBox.pack_start(HBoxDecorator(self.last_fm_label, self.wiki_label), False, False) wBox.pack_start(self.wiki, True, True) wBox.scroll = wBox self.vpaned_small = gtk.VBox(False, 0) """image and similar artists""" ibox = gtk.HBox(False, 0) self.image = ImageBase(ICON_BLANK_DISK, FC().info_panel_image_size) lbox = gtk.VBox(False, 0) self.left_widget = [ wBox, self.artists, self.tracks, self.tags, self.lyrics, self.best_songs ] for l_widget in self.left_widget: lbox.pack_start(l_widget.line_title) ibox.pack_start(self.image, False, False) ibox.pack_start(lbox, True, True) """image and similar artists""" sbox = gtk.VBox(False, 0) for l_widget in self.left_widget: sbox.pack_start(l_widget.scroll, True, True) sbox.pack_end(self.empty.scroll, True, True) self.vpaned_small.pack_start(ibox, False, False) self.vpaned_small.pack_start(sbox, True, True) self.add(self.vpaned_small) self.hide_all() self.bean = None self.info_cache = InfoCache()
def __init__(self, controls, parent=None): FControl.__init__(self, controls) """TOP menu constructor""" decorator = MenuStyleDecorator() if not parent: parent = TopMenuBar() top = parent """File""" file = top.add_submenu(_("_File")) file.add_image_item(_("Add File(s)"), gtk.STOCK_OPEN, self.controls.on_add_files) file.add_image_item(_("Add Folder(s)"), gtk.STOCK_OPEN, self.controls.on_add_folders) file.add_image_item(_("Save Playlist As"), gtk.STOCK_SAVE_AS, lambda: self.controls.notetabs.on_save_playlist(self.controls.notetabs.get_current_tree().scroll)) file.separator() file.add_image_item(_("Quit"), gtk.STOCK_QUIT, self.controls.quit) """View""" view = top.add_submenu(_("_View")) view.set_no_show_all(True) self.view_music_tree = view.add_check_item(_("Left Panel"), FC().is_view_music_tree_panel) self.view_music_tree.connect("activate", lambda w: controls.layout.set_visible_musictree_panel(w.get_active())) self.view_search_panel = view.add_check_item(_("Search Panel"), FC().is_view_search_panel) self.view_search_panel.connect("activate", lambda w: controls.layout.set_visible_search_panel(w.get_active())) self.view_cover_lyrics = view.add_check_item(_("Cover & Lyrics Panel"), FC().is_view_coverlyrics_panel) self.view_cover_lyrics.connect("activate", lambda w: controls.layout.set_visible_coverlyrics_panel(w.get_active())) separator1 = view.separator() #@UnusedVariable view.add_image_item(_("Equalizer"), None, self.controls.eq.show) view.add_image_item(_("Download Manager"), None, self.controls.dm.show) separator2 = view.separator() preferences_item = view.add_image_item(_("Preferences"), gtk.STOCK_PREFERENCES, self.controls.show_preferences) """if new style menu - remove preferences from View""" if not isinstance(parent, TopMenuBar): separator2.hide() preferences_item.hide() """Playback""" playback = top.add_submenu(_("_Playback")) def set_random(flag=True): FC().is_order_random = flag logging.debug("set random" + str(flag)) controls.os.on_load() """Playback - Order""" order = playback.add_text_item(_("Order")) self.playback_order_linear = order.add_radio_item(_("Linear"), None, not FC().is_order_random) self.playback_order_linear.connect("activate", lambda w: set_random(False)) self.playback_order_random = order.add_radio_item(_("Random"), self.playback_order_linear, FC().is_order_random) self.playback_order_random.connect("activate", lambda w: set_random(True)) """Playback - Repeat""" repeat = playback.add_text_item(_("Repeat")) self.lopping_all = repeat.add_radio_item(_("All"), None, FC().repeat_state == const.REPEAT_ALL) self.lopping_single = repeat.add_radio_item(_("Single"), self.lopping_all, FC().repeat_state == const.REPEAT_SINGLE) self.lopping_disable = repeat.add_radio_item(_("Disable"), self.lopping_all, FC().repeat_state == const.REPEAT_NO) def repeat_all(): FC().repeat_state = const.REPEAT_ALL logging.debug("set repeat_all") controls.os.on_load() def repeat_sigle(): FC().repeat_state = const.REPEAT_SINGLE logging.debug("set repeat_sigle") controls.os.on_load() def repeat_no(): FC().repeat_state = const.REPEAT_NO logging.debug("set repeat_no") controls.os.on_load() self.lopping_all.connect("activate", lambda * a:repeat_all()) self.lopping_single.connect("activate", lambda * a:repeat_sigle()) self.lopping_disable.connect("activate", lambda * a:repeat_no()) """Playlist View""" #playlist = playback.add_text_item("Playlist") #self.playlist_plain = playlist.add_radio_item("Plain (normal style)", None, FC().playlist_type == const.PLAYLIST_PLAIN) #self.playlist_tree = playlist.add_radio_item("Tree (apollo style)", self.playlist_plain , FC().playlist_type == const.PLAYLIST_TREE) #self.playlist_plain.connect("activate", lambda w: w.get_active() and controls.set_playlist_plain()) #self.playlist_tree.connect("activate", lambda w: w.get_active() and controls.set_playlist_tree()) """Help""" help = top.add_submenu(_("_Help")) help.add_image_item(_("About"), gtk.STOCK_ABOUT, self.show_about) help.separator() help.add_text_item(_("Project page"), lambda * a:open_link_in_browser(_("http://www.foobnix.com/news/eng")), None, False) help.add_image_item(_("Issue report"), gtk.STOCK_DIALOG_WARNING, lambda * a:open_link_in_browser("http://code.google.com/p/foobnix/issues/list")) help.separator() help.add_image_item(_("Donate Participate"), gtk.STOCK_DIALOG_QUESTION, lambda * a:open_link_in_browser(_("http://www.foobnix.com/donate/eng"))) #help.add_image_item("Help", gtk.STOCK_HELP) #top.decorate() decorator.apply(top) decorator.apply(file) decorator.apply(view) decorator.apply(playback) decorator.apply(repeat) decorator.apply(order) decorator.apply(help) self.widget = top self.on_load()
def __init__(self, controls): FControl.__init__(self, controls) self.number_inits = 0 self.lazy_init()
def __init__(self, controls): gtk.Statusbar.__init__(self) FControl.__init__(self, controls) self.show()