Example #1
0
    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
Example #2
0
    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
Example #3
0
    def top_row(self):

        box = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0)
        box.show()

        self.on = Gtk.ToggleButton.new_with_label(_("Enable EQ"))
        self.on.set_tooltip_text(_("To enable EQ set ON"))
        self.on.connect("toggled", self.on_enable_eq)
        self.on.show()

        auto = Gtk.ToggleButton.new_with_label(_("Auto"))
        auto.show()

        empt = empty()
        empt.set_size_request(65, -1)
        auto.show()
        self.combo.show()

        save = Gtk.Button.new_with_label(_("Save"))
        save.connect("clicked", self.on_save)

        save.show()

        resButton = ImageButton("view-refresh")
        resButton.connect("clicked", self.on_restore_defaults)
        resButton.set_tooltip_text(_("Restore defaults presets"))

        box.pack_start(self.on, False, False, 0)
        box.pack_start(empt, False, True, 0)
        box.pack_start(self.combo, False, True, 0)
        box.pack_start(save, False, True, 0)
        box.pack_start(Gtk.Label.new(None), True, True, 0)
        box.pack_start(resButton, False, True, 0)

        return box
Example #4
0
 def __init__(self, controls):
     Gtk.HBox.__init__(self, False)
     self.pack_start(Gtk.SeparatorToolItem.new(), False, False, 0)
     self.pack_start(ImageButton(Gtk.STOCK_MEDIA_STOP, controls.state_stop, _("Stop")), False, False, 0)
     self.pack_start(ImageButton(Gtk.STOCK_MEDIA_PLAY, controls.state_play, _("Play")), False, False, 0)
     self.pack_start(ImageButton(Gtk.STOCK_MEDIA_PAUSE, controls.state_play_pause, _("Pause")), False, False, 0)
     self.pack_start(ImageButton(Gtk.STOCK_MEDIA_PREVIOUS, controls.prev, _("Previous")), False, False, 0)
     self.pack_start(ImageButton(Gtk.STOCK_MEDIA_NEXT, controls.next, _("Next")), False, False, 0)
     self.pack_start(Gtk.SeparatorToolItem.new(), False, False, 0)
Example #5
0
 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
Example #6
0
    def __init__(self, controls):
        Gtk.ToggleButton.__init__(self)
        self.controls = controls

        rec_image = ImageButton("media-record", size=Gtk.IconSize.BUTTON)
        rec_image.show()
        self.add(rec_image)
        self.set_relief(Gtk.ReliefStyle.NONE)
        self.set_focus_on_click(False)
        self.connect("toggled", self.on_toggle)
        self.set_tooltip_text(_("Record radio"))
        self.set_no_show_all(True)
        self.hide()
Example #7
0
    def __init__(self, controls):
        Gtk.ToggleButton.__init__(self)
        self.controls = controls

        rec_image = ImageButton("media-record", size=Gtk.IconSize.BUTTON)
        rec_image.show()
        self.add(rec_image)
        self.set_relief(Gtk.ReliefStyle.NONE)
        self.set_focus_on_click(False)
        self.connect("toggled", self.on_toggle)
        self.set_tooltip_text(_("Record radio"))
        self.set_no_show_all(True)
        self.hide()
Example #8
0
 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.IconSize.BUTTON)
     add_button.show()
     add_button.get_image().set_size_request(24, 22)
     self.set_action_widget(add_button, Gtk.PackType.START)
     self.default_angle = 0
     self.navig = False if isinstance(self, NoteTabControl) else True
Example #9
0
File: top.py Project: Lomir/foobnix
    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
Example #10
0
File: top.py Project: kagel/foobnix
    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
Example #11
0
    def top_row(self):
        
        box = gtk.HBox(False, 0)
        box.show()
        
        self.on = gtk.ToggleButton(_("Enable EQ"))
        self.on.set_tooltip_text(_("To enable EQ set ON"))
        self.on.connect("toggled", self.on_enable_eq)
        #on.set_size_request(30,-1)        
        self.on.show()
        
        auto = gtk.ToggleButton(_("Auto"))
        #auto.set_size_request(50,-1)
        auto.show()
        
        empt = empty()
        empt.set_size_request(65, -1)
        
        #auto.set_size_request(50,-1)
        auto.show()
        

        #combo = gtk.ComboBoxEntry()
        #self.combo.set_size_request(240, -1)
        self.combo.show()
        
        save = gtk.Button(_("Save"))
        save.connect("clicked", self.on_save)
        
        save.show()
        
        
        resButton = ImageButton(gtk.STOCK_REFRESH)
        resButton.connect("clicked", self.on_restore_defaults)
        resButton.set_tooltip_text(_("Restore defaults presets"))
        
        box.pack_start(self.on, False, False, 0)
        #box.pack_start(auto, False, True, 0)
        box.pack_start(empt, False, True, 0)        
        box.pack_start(self.combo, False, True, 0)        
        box.pack_start(save, False, True, 0)
        box.pack_start(gtk.Label(), True, True, 0)
        box.pack_start(resButton, False, True, 0)
        
        return box
Example #12
0
    def __init__ (self, controls):
        PopupTrayWindow.__init__(self, controls)
        #self.modify_bg(Gtk.StateType.NORMAL, self.get_colormap().alloc_color("gray23"))
        vbox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)

        playcontrols = PlaybackControls(controls)
        playcontrols.pack_start(ImageButton("application-exit", controls.quit, _("Exit")), False, False, 0)
        playcontrols.pack_start(ImageButton("", self.hide, _("Close Popup")), False, False, 0)

        self.poopup_text = Gtk.Label.new(None)
        self.set_text("Foobnix")
        self.poopup_text.set_line_wrap(True)

        vbox.pack_start(playcontrols, False, False, 0)
        vbox.pack_start(self.poopup_text, False, False, 0)
        self.add(vbox)
        self.show_all()
        self.hide()
Example #13
0
    def __init__(self, controls, on_hide_callback):
        self.controls = controls
        ChildTopWindow.__init__(self, "movie")
        self.set_hide_on_escape(False)
        self.on_hide_callback = on_hide_callback
        ## TODO: check it
        ##self.set_flags(Gtk.CAN_FOCUS)
        self.layout = Gtk.VBox(False)
        self.set_property("skip-taskbar-hint", True)
        self.set_keep_above(True)
        self.draw = AdvancedDrawingArea(controls)
        self.draw.action_function = on_hide_callback
        self.set_resizable(True)
        self.set_border_width(0)

        self.layout.pack_start(self.draw, True, False, 0)

        self.text_label = Gtk.Label("foobnix")
        self.volume_button = Gtk.VolumeButton()
        self.volume_button.connect("value-changed", self.volume_changed)

        line = Gtk.HBox(False)
        line.pack_start(
            ImageButton(Gtk.STOCK_FULLSCREEN, on_hide_callback,
                        _("Exit Fullscrean")), False, False, 0)
        line.pack_start(PlaybackControls(controls), False, False, 0)
        line.pack_start(controls.seek_bar_movie, True, False, 0)
        line.pack_start(Gtk.SeparatorToolItem.new(), False, False, 0)
        line.pack_start(self.text_label, False, False, 0)
        line.pack_start(Gtk.SeparatorToolItem.new(), False, False, 0)
        line.pack_start(self.volume_button, False, False, 0)
        line.show_all()

        control_panel = Gtk.Window(Gtk.WindowType.POPUP)
        control_panel.set_size_request(800, -1)
        control_panel.add(line)

        self.add(self.layout)

        self.draw.connect("enter-notify-event",
                          lambda *a: GLib.idle_add(control_panel.hide))

        def my_event(w, e):
            if e.y > Gdk.screen_height() - 5:  #@UndefinedVariable

                def safe_task():
                    control_panel.show()
                    control_panel.set_size_request(Gdk.screen_width(),
                                                   -1)  #@UndefinedVariable
                    control_panel.move(0,
                                       Gdk.screen_height() -
                                       control_panel.get_allocation().height
                                       )  #@UndefinedVariable

                GLib.idle_add(safe_task)

        self.connect("motion-notify-event", my_event)
Example #14
0
 def __init__(self, controls):
     Gtk.Box.__init__(self,
                      orientation=Gtk.Orientation.HORIZONTAL,
                      spacing=0)
     self.pack_start(Gtk.SeparatorToolItem.new(), False, False, 0)
     self.pack_start(
         ImageButton("media-playback-stop", controls.state_stop, _("Stop")),
         False, False, 0)
     self.pack_start(
         ImageButton("media-playback-start", controls.state_play,
                     _("Play")), False, False, 0)
     self.pack_start(
         ImageButton("media-playback-pause", controls.state_play_pause,
                     _("Pause")), False, False, 0)
     self.pack_start(
         ImageButton("go-previous", controls.prev, _("Previous")), False,
         False, 0)
     self.pack_start(ImageButton("go-next", controls.next, _("Next")),
                     False, False, 0)
     self.pack_start(Gtk.SeparatorToolItem.new(), False, False, 0)
Example #15
0
    def __init__(self, controls):
        PopupTrayWindow.__init__(self, controls)
        self.modify_bg(gtk.STATE_NORMAL,
                       self.get_colormap().alloc_color("gray23"))
        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()
        self.set_text("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()
Example #16
0
    def top_row(self):

        box = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0)
        box.show()

        self.on = Gtk.ToggleButton.new_with_label(_("Enable EQ"))
        self.on.set_tooltip_text(_("To enable EQ set ON"))
        self.on.connect("toggled", self.on_enable_eq)
        self.on.show()

        auto = Gtk.ToggleButton.new_with_label(_("Auto"))
        auto.show()

        empt = empty()
        empt.set_size_request(65, -1)
        auto.show()
        self.combo.show()

        save = Gtk.Button.new_with_label(_("Save"))
        save.connect("clicked", self.on_save)

        save.show()

        resButton = ImageButton("view-refresh")
        resButton.connect("clicked", self.on_restore_defaults)
        resButton.set_tooltip_text(_("Restore defaults presets"))

        box.pack_start(self.on, False, False, 0)
        box.pack_start(empt, False, True, 0)
        box.pack_start(self.combo, False, True, 0)
        box.pack_start(save, False, True, 0)
        box.pack_start(Gtk.Label.new(None), True, True, 0)
        box.pack_start(resButton, False, True, 0)

        return box
Example #17
0
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)
Example #18
0
    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()
Example #19
0
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)
Example #20
0
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)
Example #21
0
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)
Example #22
0
File: top.py Project: kagel/foobnix
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)
Example #23
0
    def __init__(self, controls, on_hide_callback):
        self.controls = controls
        ChildTopWindow.__init__(self, "movie")
        self.set_hide_on_escape(False)
        self.on_hide_callback = on_hide_callback

        self.layout = gtk.VBox(False)

        self.drow = AdvancedDrawingArea(controls)
        self.drow.action_function = on_hide_callback
        self.set_resizable(True)
        self.set_border_width(0)

        self.layout.pack_start(self.drow, True)

        self.text_label = gtk.Label("foobnix")
        self.volume_button = gtk.VolumeButton()
        self.volume_button.connect("value-changed", self.volume_changed)

        line = gtk.HBox(False)

        line.pack_start(
            ImageButton(gtk.STOCK_FULLSCREEN, on_hide_callback,
                        _("Exit Fullscrean")), False)
        line.pack_start(PlaybackControls(controls), False)
        line.pack_start(controls.seek_bar_movie, True)
        line.pack_start(gtk.SeparatorToolItem(), False)
        line.pack_start(self.text_label, False)
        line.pack_start(gtk.SeparatorToolItem(), False)
        line.pack_start(self.volume_button, False)

        self.layout.pack_start(line, False)

        self.add(self.layout)
        self.set_opacity(1)

        def my_event(w, e):
            if e.y > gtk.gdk.screen_height() - 50:  #@UndefinedVariable
                line.show()
            else:
                line.hide()

        self.connect("motion-notify-event", my_event)
Example #24
0
 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.IconSize.BUTTON)
     add_button.show()
     add_button.get_image().set_size_request(24, 22)
     self.set_action_widget(add_button, Gtk.PackType.START)
     self.default_angle = 0
     self.navig = False if isinstance(self, NoteTabControl) else True
Example #25
0
    def top_row(self):
        
        box = gtk.HBox(False, 0)
        box.show()
        
        self.on = gtk.ToggleButton(_("Enable EQ"))
        self.on.set_tooltip_text(_("To enable EQ set ON"))
        self.on.connect("toggled", self.on_enable_eq)
        #on.set_size_request(30,-1)        
        self.on.show()
        
        auto = gtk.ToggleButton(_("Auto"))
        #auto.set_size_request(50,-1)
        auto.show()
        
        empt = empty()
        empt.set_size_request(65, -1)
        
        #auto.set_size_request(50,-1)
        auto.show()
        

        #combo = gtk.ComboBoxEntry()
        #self.combo.set_size_request(240, -1)
        self.combo.show()
        
        save = gtk.Button(_("Save"))
        save.connect("clicked", self.on_save)
        
        save.show()
        
        
        resButton = ImageButton(gtk.STOCK_REFRESH)
        resButton.connect("clicked", self.on_restore_defaults)
        resButton.set_tooltip_text(_("Restore defaults presets"))
        
        box.pack_start(self.on, False, False, 0)
        #box.pack_start(auto, False, True, 0)
        box.pack_start(empt, False, True, 0)        
        box.pack_start(self.combo, False, True, 0)        
        box.pack_start(save, False, True, 0)
        box.pack_start(gtk.Label(), True, True, 0)
        box.pack_start(resButton, False, True, 0)
        
        return box