Пример #1
0
    def __init__(self, controls):
        self.controls = controls
        box = Gtk.VBox(False, 0)
        box.hide()

        '''static_icon'''
        self.static_icon = IconBlock(_("Icon"), controls, FC().static_icon_entry)

        """dynamic icons"""
        self.play_icon = IconBlock(_("Play"), controls, FC().play_icon_entry)
        self.pause_icon = IconBlock(_("Pause"), controls, FC().pause_icon_entry)
        self.stop_icon = IconBlock(_("Stop"), controls, FC().stop_icon_entry)
        self.radio_icon = IconBlock(_("Radio"), controls, FC().radio_icon_entry)

        self.tray_icon_button = Gtk.CheckButton(label=_("Show tray icon"), use_underline=True)
        self.hide_in_tray_on_start = Gtk.CheckButton(label=_("Hide player in tray on start"), use_underline=True)
        #self.tray_icon_button.connect("clicked", self.on_show_tray_icon)

        self.close_button = Gtk.RadioButton(group=None, label=_("On close window - close player"))

        self.hide_button = Gtk.RadioButton(group=self.close_button, label=_("On close window - hide player"))
        self.hide_button.connect("toggled", self.on_show_tray_icon)

        self.minimize_button = Gtk.RadioButton(group=self.close_button, label=_("On close window - minimize player"))

        """system icon"""
        self.static_tray_icon = ChooseDecorator(None, FrameDecorator(_("System Icon Static"), self.static_icon))

        """dynamic icons"""
        line = VBoxDecorator(self.play_icon,
                             self.pause_icon,
                             self.stop_icon,
                             self.radio_icon)

        self.icon_controls = ChooseDecorator(self.static_tray_icon.get_radio_button(), FrameDecorator(_("System Icons Dynamic"), line))

        """disc image icon"""
        image = ImageBase(ICON_BLANK_DISK, 30)
        self.change_tray_icon = ChooseDecorator(self.static_tray_icon.get_radio_button(), FrameDecorator(_("Disc cover image"), image))

        self.notifier = Gtk.CheckButton(_("Notification pop-up"))
        self.notifier.connect("toggled", self.on_toggle)

        self.n_time = self.notify_time()

        box.pack_start(self.hide_in_tray_on_start, False, True, 0)
        box.pack_start(self.tray_icon_button, False, True, 0)
        box.pack_start(self.close_button, False, True, 0)
        box.pack_start(self.hide_button, False, True, 0)
        box.pack_start(self.minimize_button, False, True, 0)

        box.pack_start(self.static_tray_icon, True, True, 0)
        box.pack_start(self.icon_controls, True, True, 0)
        box.pack_start(self.change_tray_icon, False, False, 0)

        notifier_box = Gtk.VBox()
        notifier_box.pack_start(self.notifier, False, False, 0)
        notifier_box.pack_start(self.n_time, False, False, 0)
        box.pack_start(FrameDecorator(_("Notification"), notifier_box), False, False, 0)
        self.widget = box
Пример #2
0
    def __init__(self, controls):
        self.controls = controls

        box = gtk.VBox(False, 0)
        box.hide()
        """save to"""
        hbox = gtk.HBox(False, 5)

        self.online_dir = gtk.FileChooserButton("set place")
        self.online_dir.set_action(gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER)
        self.online_dir.connect("current-folder-changed",
                                self.on_change_folder)
        self.online_dir.show()

        hbox.pack_start(gtk.Label(_("Save music to folder:")), False, True, 0)
        hbox.pack_start(self.online_dir, True, True, 0)
        """automatic save"""
        self.automatic_save_checkbutton = gtk.CheckButton(
            label=_("Automatic music save"), use_underline=True)
        """download threads"""
        thbox = gtk.HBox(False, 5)

        tab_label = gtk.Label(_("Download in threads"))
        tab_label.show()

        adjustment = gtk.Adjustment(value=1,
                                    lower=1,
                                    upper=10,
                                    step_incr=1,
                                    page_incr=1,
                                    page_size=0)
        self.threads_count = gtk.SpinButton(adjustment)
        self.threads_count.show()

        thbox.pack_start(tab_label, False, False)
        thbox.pack_start(self.threads_count, False, True)
        """disc cover size"""
        cbox = gtk.HBox(False, 5)
        cbox.show()

        tab_label = gtk.Label(_("Disc cover size:"))
        tab_label.show()

        adjustment = gtk.Adjustment(value=1,
                                    lower=100,
                                    upper=350,
                                    step_incr=20,
                                    page_incr=50,
                                    page_size=0)
        self.image_size_spin = gtk.SpinButton(adjustment)
        self.image_size_spin.show()

        cbox.pack_start(tab_label, False, False)
        cbox.pack_start(self.image_size_spin, False, True)
        """notification"""
        self.check_new_version = gtk.CheckButton(
            label=_("Check for new foobnix release on start"),
            use_underline=True)
        self.check_new_version.show()

        demo = gtk.Button(_("Show new foobnix release avaliable demo dialog"))
        demo.connect(
            "clicked",
            lambda *a: info_dialog_with_link_and_donate("foobnix [version]"))
        demo.show()
        """background image"""

        catbox = gtk.HBox(False, 5)

        self.bg_image = IconBlock("", controls,
                                  FC().background_image,
                                  FC().background_image_themes)

        self.is_show = gtk.CheckButton(label=_("Enable theme image"),
                                       use_underline=True)

        catbox.pack_start(self.is_show, False, True, 0)
        catbox.pack_start(self.bg_image, True, True, 0)
        """menu position"""
        pbox = gtk.HBox(False, 5)
        pbox.show()

        label = gtk.Label(_("Menu type: "))

        self.old_style = gtk.RadioButton(None, _("Old Style (Menu Bar)"))

        self.new_style = gtk.RadioButton(self.old_style,
                                         _("New Style (Button)"))

        pbox.pack_start(label, False, False, 0)
        pbox.pack_start(self.new_style, False, True, 0)
        pbox.pack_start(self.old_style, False, False, 0)

        o_r_box = gtk.HBox(False, 5)
        o_r_box.show()

        o_r_label = gtk.Label(_("Order-Repeat Switcher Style:"))

        self.buttons = gtk.RadioButton(None, _("Toggle Buttons"))

        self.labels = gtk.RadioButton(self.buttons, _("Text Labels"))

        o_r_box.pack_start(o_r_label, False, False, 0)
        o_r_box.pack_start(self.buttons, False, True, 0)
        o_r_box.pack_start(self.labels, False, False, 0)
        """opacity"""
        obox = gtk.HBox(False, 5)
        obox.show()

        tab_label = gtk.Label(_("Opacity:"))
        tab_label.show()

        adjustment = gtk.Adjustment(value=1,
                                    lower=20,
                                    upper=100,
                                    step_incr=1,
                                    page_incr=1,
                                    page_size=0)
        self.opacity_size = gtk.SpinButton(adjustment)
        self.opacity_size.connect("value-changed", self.on_chage_opacity)
        self.opacity_size.show()

        obox.pack_start(tab_label, False, False, 0)
        obox.pack_start(self.opacity_size, False, True, 0)

        self.fmgrs_combo = self.fmgr_combobox()
        hcombobox = gtk.HBox(False, 5)
        hcombobox.pack_start(
            gtk.Label(_('Choose your preferred file manager:')), False, False)
        hcombobox.pack_start(self.fmgrs_combo, False, False)

        self.disable_screensaver = gtk.CheckButton(
            label=_("Disable Xscreensaver"), use_underline=True)

        self.net_ping = gtk.CheckButton(label=_("Enable Network Checker"),
                                        use_underline=True)
        """packaging"""
        box.pack_start(hbox, False, True, 0)
        box.pack_start(self.automatic_save_checkbutton, False, True, 0)
        box.pack_start(thbox, False, True, 0)
        box.pack_start(cbox, False, True, 0)
        box.pack_start(self.check_new_version, False, True, 0)
        box.pack_start(demo, False, False, 0)
        box.pack_start(catbox, False, False, 0)
        box.pack_start(pbox, False, False, 0)
        box.pack_start(o_r_box, False, False, 0)
        box.pack_start(obox, False, False, 0)
        box.pack_start(hcombobox, False, False, 0)
        box.pack_start(self.disable_screensaver)
        box.pack_start(self.net_ping)

        self.widget = box