class TopWidgets(FControl, LoadSave, Gtk.Box): def __init__(self, controls): FControl.__init__(self, controls) Gtk.Box.__init__(self, orientation=Gtk.Orientation.HORIZONTAL, spacing=0) self.old_menu = MenuBarWidget(controls) self.pack_start(self.old_menu.widget, False, False, 0) menu_icon = "open-menu" if not icon_exists("open-menu"): menu_icon = "open-menu-symbolic" if not icon_exists("open-menu-symbolic"): menu_icon = "application-menu" self.new_menu_button = ImageButton(menu_icon, tooltip_text=_("Menu")) self.new_menu_button.connect("button-press-event", self.on_button_press) self.pack_start(self.new_menu_button, False, False, 0) self.pack_start(controls.playback, False, False, 0) self.pack_start(controls.os, False, False, 0) self.pack_start(controls.volume, False, False, 0) self.pack_start(Gtk.SeparatorToolItem.new(), False, False, 0) self.pack_start(controls.record, False, False, 0) self.pack_start(controls.seek_bar, True, True, 0) """menu init""" menu = Popup() decorator = MenuStyleDecorator() MenuBarWidget(self.controls, menu) menu.add_separator() pref_icon = "gtk-preferences" if icon_exists("gtk-preferences") else "preferences-system" menu.add_item(_("Preferences"), pref_icon, self.controls.show_preferences) menu.add_separator() menu.add_item(_("Quit"), "application-exit", self.controls.quit) decorator.apply(menu) self.menu = menu def update_menu_style(self): if FC().menu_style == "new": self.old_menu.widget.hide() self.new_menu_button.show() else: self.old_menu.widget.show() self.new_menu_button.hide() def on_save(self): self.controls.volume.on_save() self.old_menu.on_save() def on_load(self): self.controls.volume.on_load() self.old_menu.on_load() self.controls.os.on_load() self.update_menu_style() def on_button_press(self, w, e): self.menu.show(e)
class TopWidgets(FControl, LoadSave, Gtk.Box): def __init__(self, controls): FControl.__init__(self, controls) Gtk.Box.__init__(self, orientation=Gtk.Orientation.HORIZONTAL, spacing=0) self.old_menu = MenuBarWidget(controls) self.pack_start(self.old_menu.widget, False, False, 0) self.new_menu_button = ImageButton("preferences-system", tooltip_text=_("Settings")) self.new_menu_button.connect("button-press-event", self.on_button_press) self.pack_start(self.new_menu_button, False, False, 0) self.pack_start(controls.playback, False, False, 0) self.pack_start(controls.os, False, False, 0) self.pack_start(controls.volume, False, False, 0) self.pack_start(Gtk.SeparatorToolItem.new(), False, False, 0) self.pack_start(controls.record, False, False, 0) self.pack_start(controls.seek_bar, True, True, 0) """menu init""" menu = Popup() decorator = MenuStyleDecorator() MenuBarWidget(self.controls, menu) menu.add_separator() menu.add_item(_("Preferences"), "preferences-system", self.controls.show_preferences) menu.add_separator() menu.add_item(_("Quit"), "application-exit", self.controls.quit) decorator.apply(menu) self.menu = menu def update_menu_style(self): if FC().menu_style == "new": self.old_menu.widget.hide() self.new_menu_button.show() else: self.old_menu.widget.show() self.new_menu_button.hide() def on_save(self): self.controls.volume.on_save() self.old_menu.on_save() def on_load(self): self.controls.volume.on_load() self.old_menu.on_load() self.controls.os.on_load() self.update_menu_style() def on_button_press(self, w, e): self.menu.show(e)
class TopWidgets(FControl, LoadSave, gtk.HBox): 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 update_menu_style(self): if FC().menu_style == "new": self.old_menu.widget.hide() self.new_menu_button.show() else: self.old_menu.widget.show() self.new_menu_button.hide() def on_save(self): self.controls.volume.on_save() self.old_menu.on_save() def on_load(self): self.controls.volume.on_load() self.old_menu.on_load() self.controls.os.on_load() self.update_menu_style() def on_button_press(self, w, e): self.menu.show(e)
class TopWidgets(FControl, LoadSave, Gtk.HBox): 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, 0) 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, 0) self.pack_start(controls.playback, False, False, 0) self.pack_start(controls.os, False, False, 0) self.pack_start(controls.volume, False, False, 0) self.pack_start(Gtk.SeparatorToolItem.new(), False, False, 0) self.pack_start(controls.record, False, False, 0) self.pack_start(controls.seek_bar, True, True, 0) """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 update_menu_style(self): if FC().menu_style == "new": self.old_menu.widget.hide() self.new_menu_button.show() else: self.old_menu.widget.show() self.new_menu_button.hide() def on_save(self): self.controls.volume.on_save() self.old_menu.on_save() def on_load(self): self.controls.volume.on_load() self.old_menu.on_load() self.controls.os.on_load() self.update_menu_style() def on_button_press(self, w, e): self.menu.show(e)
class TopWidgets(FControl, LoadSave, Gtk.HBox): 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, 0) self.new_menu_button = ImageButton("preferences-system", tooltip_text=_("Settings")) self.new_menu_button.connect("button-press-event", self.on_button_press) self.pack_start(self.new_menu_button, False, False, 0) self.pack_start(controls.playback, False, False, 0) self.pack_start(controls.os, False, False, 0) self.pack_start(controls.volume, False, False, 0) self.pack_start(Gtk.SeparatorToolItem.new(), False, False, 0) self.pack_start(controls.record, False, False, 0) self.pack_start(controls.seek_bar, True, True, 0) """menu init""" menu = Popup() decorator = MenuStyleDecorator() MenuBarWidget(self.controls, menu) menu.add_separator() menu.add_item(_("Preferences"), "preferences-system", self.controls.show_preferences) menu.add_separator() menu.add_item(_("Quit"), "application-exit", self.controls.quit) decorator.apply(menu) self.menu = menu def update_menu_style(self): if FC().menu_style == "new": self.old_menu.widget.hide() self.new_menu_button.show() else: self.old_menu.widget.show() self.new_menu_button.hide() def on_save(self): self.controls.volume.on_save() self.old_menu.on_save() def on_load(self): self.controls.volume.on_load() self.old_menu.on_load() self.controls.os.on_load() self.update_menu_style() def on_button_press(self, w, e): self.menu.show(e)