コード例 #1
0
    def _init_onscrdisp_tab(self):
        # ----------------------------------------------------------------
        # The "OSD" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)

        page.new_section(_('Onscreen display'))

        page.add_row(
            Gtk.Label(label=_('Timeout:')),
            self._create_pref_spinner(
                'osd timeout', 1.0, 0.5, 30.0, 0.5, 2.0, 1,
                _('Erase OSD after timeout, in seconds.')))

        page.add_row(
            Gtk.Label(label=_('Max font size:')),
            self._create_pref_spinner(
                'osd max font size', 1, 8, 60, 1, 10, 0,
                _('Font size in OSD, hard limited from 8 to 60.')))

        page.add_row(Gtk.Label(label=_('Font color:')),
                     self._create_color_button('osd color'))

        page.add_row(Gtk.Label(label=_('Background color:')),
                     self._create_color_button('osd bg color'))

        return page
コード例 #2
0
    def _init_animation_tab(self):
        # ----------------------------------------------------------------
        # The "Animation" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)

        page.new_section(_('Animated images'))

        page.add_row(Gtk.Label(label=_('Animation mode')),
                     self._create_animation_mode_combobox())

        page.add_row(
            self._create_pref_check_button(
                _('Using background from the animation'),
                'animation background',
                _('Using background from the animation,\n'
                  'or follow the setting of Appearance -> Background')))

        page.add_row(
            self._create_pref_check_button(
                _('Enable transform on animation'), 'animation transform',
                _('Enable scale, rotate, flip and enhance operation on animation'
                  )))

        return page
コード例 #3
0
    def _init_display_tab(self):
        # ----------------------------------------------------------------
        # The "Display" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)

        page.new_section(_('Fullscreen'))

        page.add_row(self._create_pref_check_button(
            _('Use fullscreen by default'),
            'default fullscreen', None))

        page.add_row(self._create_pref_check_button(
            _('Automatically hide all toolbars in fullscreen'),
            'hide all in fullscreen', None))

        page.new_section(_('Fit to size mode'))

        page.add_row(Gtk.Label(label=_('Fit to width or height:')),
            self._create_fitmode_control())

        page.add_row(Gtk.Label(label=_('Fixed size for this mode:')),
            self._create_pref_spinner('fit to size px',
            1, 10, 10000, 10, 50, 0, None))

        page.new_section(_('Slideshow'))

        page.add_row(Gtk.Label(label=_('Slideshow delay (in seconds):')),
            self._create_pref_spinner('slideshow delay',
            1000.0, 0.01, 3600.0, 0.1, 1, 2, None))

        page.add_row(Gtk.Label(label=_('Slideshow step (in pixels):')),
            self._create_pref_spinner('number of pixels to scroll per slideshow event',
            1, -500, 500, 1, 1, 0,
            _('Specify the number of pixels to scroll while in slideshow mode. A positive value will scroll forward, a negative value will scroll backwards, and a value of 0 will cause the slideshow to always flip to a new page.')))

        page.add_row(self._create_pref_check_button(
            _('During a slideshow automatically open the next archive'),
            'slideshow can go to next archive',
            _('While in slideshow mode allow the next archive to automatically be opened.')))

        page.new_section(_('Rotation'))

        page.add_row(self._create_pref_check_button(
            _('Automatically rotate images according to their metadata'),
            'auto rotate from exif',
            _('Automatically rotate images when an orientation is specified in the image metadata, such as in an Exif tag.')))

        page.new_section(_('Image quality'))

        page.add_row(Gtk.Label(label=_('Scaling mode')),
            self._create_scaling_quality_combobox())

        page.new_section(_('Advanced filters'))

        page.add_row(Gtk.Label(label=_('Apply a high-quality scaling filter (main viewing area only):')),
            self._create_pil_scaling_filter_combobox())

        return page
コード例 #4
0
    def _init_keyhandler_tab(self):
        # ----------------------------------------------------------------
        # The "Keyhandler" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)

        page.new_section(_('Keyhandler'))

        page.add_row(Gtk.Label(label=_('Key handler:')),
                     self._create_keyhandler_cmd_entry())

        page.add_row(
            Gtk.Label(label=_('Key handler timeout (in millisecond):')),
            self._create_pref_spinner(
                'keyhandler timeout', 1, 0, 30000, 1, 100, 0,
                _('Key handler will be closed if no key input.')))

        page.add_row(
            Gtk.Label(label=_('Key handler close delay (in millisecond):')),
            self._create_pref_spinner(
                'keyhandler close delay', 1, 0, 30000, 1, 100, 0,
                _('Key handler will show input before closed.')))

        page.add_row(
            self._create_pref_check_button(
                _('Show result of key handler'), 'keyhandler show result',
                _('Show command, stdin/stdout/stderr and return code of key handler.'
                  )))

        page.new_section(_('Hints'))

        page.add_row(
            Gtk.Label(
                label=_('Key handler will be called as such command line:')))
        page.add_row(
            _codeview('<keyhandler> <keystr> <imagepath> <archivepath>'))
        page.add_row(Gtk.Label())
        page.add_row(Gtk.Label(label=_('<keyhandler> could have arguments:')))
        page.add_row(_codeview('python3 "/absolute path to keyhandler.py"'))
        page.add_row(
            Gtk.Label(label=_('<keystr> is a emacs-like key string:')))
        page.add_row(_codeview('<mask1>-<mask2>-...-<keyname>'))
        page.add_row(Gtk.Label(label=_('Recognized masks in order:')))
        page.add_row(
            _codeview('''C - Ctrl
M - Mod1, normally the 'Alt' key
S - Super, normally the 'Windows' key
F - Shift, only appeared if not used to translate characters'''))
        page.add_row(
            Gtk.Label(label=_(
                '<imagepath>/<archivepath> is the absolute path to the opened image/archive,\nor an empty string if no image/archive opened.'
            )))
        page.add_row(Gtk.Label())
        page.add_row(
            Gtk.Label(label=_(
                'There is a example in the source tree, named as "keyhandler-example.sh".'
            )))

        return page
コード例 #5
0
    def _init_advanced_tab(self):
        # ----------------------------------------------------------------
        # The "Advanced" tab.
        # ----------------------------------------------------------------

        page = preferences_page._PreferencePage(None)

        page.new_section(_('File order'))

        page.add_row(gtk.Label(_('Sort files and directories by:')),
                     self._create_sort_by_control())

        page.add_row(gtk.Label(_('Sort archives by:')),
                     self._create_archive_sort_by_control())

        page.new_section(_('Extraction and cache'))

        page.add_row(
            gtk.Label(_('Maximum number of concurrent extraction threads:')),
            self._create_pref_spinner(
                'max extract threads', 1, 1, 16, 1, 4, 0,
                _('Set the maximum number of concurrent threads for formats that support it.'
                  )))

        page.add_row(
            self._create_pref_check_button(
                _('Store thumbnails for opened files'), 'create thumbnails',
                _('Store thumbnails for opened files according to the freedesktop.org specification. These thumbnails are shared by many other applications, such as most file managers.'
                  )))

        page.add_row(
            gtk.Label(_('Maximum number of pages to store in the cache:')),
            self._create_pref_spinner(
                'max pages to cache', 1, -1, 500, 1, 3, 0,
                _('Set the max number of pages to cache. A value of -1 will cache the entire archive.'
                  )))

        page.new_section(_('Magnifying Lens'))

        page.add_row(
            gtk.Label(_('Magnifying lens size (in pixels):')),
            self._create_pref_spinner(
                'lens size', 1, 50, 400, 1, 10, 0,
                _('Set the size of the magnifying lens. It is a square with a side of this many pixels.'
                  )))

        page.add_row(
            gtk.Label(_('Magnification factor:')),
            self._create_pref_spinner(
                'lens magnification', 1, 1.1, 10.0, 0.1, 1.0, 1,
                _('Set the magnification factor of the magnifying lens.')))

        page.new_section(_('Comments'))

        page.add_row(gtk.Label(_('Comment extensions:')),
                     self._create_extensions_entry())

        return page
コード例 #6
0
    def _init_advanced_tab(self):
        # ----------------------------------------------------------------
        # The "Advanced" tab.
        # ----------------------------------------------------------------

        page = preferences_page._PreferencePage(None)

        page.new_section(_('File order'))

        page.add_row(gtk.Label(_('Sort files and directories by:')),
            self._create_sort_by_control())

        page.add_row(gtk.Label(_('Sort archives by:')),
            self._create_archive_sort_by_control())

        page.new_section(_('Extraction and cache'))

        page.add_row(gtk.Label(_('Maximum number of concurrent extraction threads:')),
            self._create_pref_spinner('max extract threads',
            1, 1, 16, 1, 4, 0,
            _('Set the maximum number of concurrent threads for formats that support it.')))

        page.add_row(self._create_pref_check_button(
            _('Store thumbnails for opened files'),
            'create thumbnails',
            _('Store thumbnails for opened files according to the freedesktop.org specification. These thumbnails are shared by many other applications, such as most file managers.')))

        page.add_row(gtk.Label(_('Maximum number of pages to store in the cache:')),
            self._create_pref_spinner('max pages to cache',
            1, -1, 500, 1, 3, 0,
            _('Set the max number of pages to cache. A value of -1 will cache the entire archive.')))

        page.new_section(_('Magnifying Lens'))

        page.add_row(gtk.Label(_('Magnifying lens size (in pixels):')),
            self._create_pref_spinner('lens size',
            1, 50, 400, 1, 10, 0,
            _('Set the size of the magnifying lens. It is a square with a side of this many pixels.')))

        page.add_row(gtk.Label(_('Magnification factor:')),
            self._create_pref_spinner('lens magnification',
            1, 1.1, 10.0, 0.1, 1.0, 1,
            _('Set the magnification factor of the magnifying lens.')))

        page.new_section(_('Comments'))

        page.add_row(gtk.Label(_('Comment extensions:')),
            self._create_extensions_entry())

        page.new_section(_('Animated images'))

        page.add_row(gtk.Label(_('Animation mode:')),
            self._create_animation_mode_combobox())

        return page
コード例 #7
0
    def _init_display_tab(self):
        # ----------------------------------------------------------------
        # The "Display" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)

        page.new_section(_('Fullscreen'))

        page.add_row(self._create_pref_check_button(
            _('Use fullscreen by default'),
            'default fullscreen', None))

        page.add_row(self._create_pref_check_button(
            _('Automatically hide all toolbars in fullscreen'),
            'hide all in fullscreen', None))

        page.new_section(_('Fit to size mode'))

        page.add_row(gtk.Label(_('Fit to width or height:')),
            self._create_fitmode_control())

        page.add_row(gtk.Label(_('Fixed size for this mode:')),
            self._create_pref_spinner('fit to size px',
            1, 10, 10000, 10, 50, 0, None))

        page.new_section(_('Slideshow'))

        page.add_row(gtk.Label(_('Slideshow delay (in seconds):')),
            self._create_pref_spinner('slideshow delay',
            1000.0, 0.01, 3600.0, 0.1, 1, 2, None))

        page.add_row(gtk.Label(_('Slideshow step (in pixels):')),
            self._create_pref_spinner('number of pixels to scroll per slideshow event',
            1, -500, 500, 1, 1, 0,
            _('Specify the number of pixels to scroll while in slideshow mode. A positive value will scroll forward, a negative value will scroll backwards, and a value of 0 will cause the slideshow to always flip to a new page.')))

        page.add_row(self._create_pref_check_button(
            _('During a slideshow automatically open the next archive'),
            'slideshow can go to next archive',
            _('While in slideshow mode allow the next archive to automatically be opened.')))

        page.new_section(_('Rotation'))

        page.add_row(self._create_pref_check_button(
            _('Automatically rotate images according to their metadata'),
            'auto rotate from exif',
            _('Automatically rotate images when an orientation is specified in the image metadata, such as in an Exif tag.')))

        page.new_section(_('Image quality'))

        page.add_row(gtk.Label(_('Scaling mode')),
            self._create_scaling_quality_combobox())

        return page
コード例 #8
0
ファイル: preferences_dialog.py プロジェクト: Gosha/mcomix
    def _init_advanced_tab(self):
        # ----------------------------------------------------------------
        # The "Advanced" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)

        page.new_section(_("User interface"))
        label = gtk.Label(_("Language (needs restart):"))
        language_box = self._create_language_control()
        page.add_row(label, language_box)

        esc_quits = gtk.CheckButton(_("Escape key closes program"))
        esc_quits.set_active(prefs["escape quits"])
        esc_quits.connect("toggled", self._check_button_cb, "escape quits")
        esc_quits.set_tooltip_text(
            _("When active, the ESC key closes the program, instead of only " "disabling fullscreen mode.")
        )
        page.add_row(esc_quits)

        page.new_section(_("File order"))

        label = gtk.Label(_("Sort files and directories by:"))
        page.add_row(label, self._create_sort_by_control())

        label = gtk.Label(_("Sort archives by:"))
        page.add_row(label, self._create_archive_sort_by_control())

        page.new_section(_("Cache"))

        create_thumbs_button = gtk.CheckButton(_("Store thumbnails for opened files"))
        create_thumbs_button.set_active(prefs["create thumbnails"])
        create_thumbs_button.connect("toggled", self._check_button_cb, "create thumbnails")
        create_thumbs_button.set_tooltip_text(
            _(
                "Store thumbnails for opened files according to the freedesktop.org specification. These thumbnails are shared by many other applications, such as most file managers."
            )
        )
        page.add_row(create_thumbs_button)

        label = gtk.Label(_("Maximum number of pages to store in the cache:"))
        adjustment = gtk.Adjustment(prefs["max pages to cache"], -1, 500, 1, 3)
        cache_spinner = gtk.SpinButton(adjustment, digits=0)
        cache_spinner.connect("value-changed", self._spinner_cb, "max pages to cache")
        cache_spinner.set_tooltip_text(
            _("Set the max number of pages to cache. A value of -1 will cache the entire archive.")
        )
        page.add_row(label, cache_spinner)

        page.new_section(_("Magnifying Lens"))

        label = gtk.Label(_("Magnifying lens size (in pixels):"))
        adjustment = gtk.Adjustment(prefs["lens size"], 50, 400, 1, 10)
        lens_size_spinner = gtk.SpinButton(adjustment)
        lens_size_spinner.connect("value_changed", self._spinner_cb, "lens size")
        lens_size_spinner.set_tooltip_text(
            _("Set the size of the magnifying lens. It is a square with a side of this many pixels.")
        )
        page.add_row(label, lens_size_spinner)
        label = gtk.Label(_("Magnification factor:"))
        adjustment = gtk.Adjustment(prefs["lens magnification"], 1.1, 10.0, 0.1, 1.0)
        lens_magnification_spinner = gtk.SpinButton(adjustment, digits=1)
        lens_magnification_spinner.connect("value_changed", self._spinner_cb, "lens magnification")
        lens_magnification_spinner.set_tooltip_text(_("Set the magnification factor of the magnifying lens."))
        page.add_row(label, lens_magnification_spinner)

        page.new_section(_("Comments"))
        label = gtk.Label(_("Comment extensions:"))
        extensions_entry = gtk.Entry()
        extensions_entry.set_size_request(200, -1)
        extensions_entry.set_text(", ".join(prefs["comment extensions"]))
        extensions_entry.connect("activate", self._entry_cb)
        extensions_entry.connect("focus_out_event", self._entry_cb)
        extensions_entry.set_tooltip_text(
            _("Treat all files found within archives, that have one of these file endings, as comments.")
        )
        page.add_row(label, extensions_entry)

        return page
コード例 #9
0
ファイル: preferences_dialog.py プロジェクト: Gosha/mcomix
    def _init_display_tab(self):
        # ----------------------------------------------------------------
        # The "Display" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)
        page.new_section(_("Fullscreen"))

        fullscreen_button = gtk.CheckButton(_("Use fullscreen by default"))
        fullscreen_button.set_active(prefs["default fullscreen"])
        fullscreen_button.connect("toggled", self._check_button_cb, "default fullscreen")
        page.add_row(fullscreen_button)

        hide_in_fullscreen_button = gtk.CheckButton(_("Automatically hide all toolbars in fullscreen"))
        hide_in_fullscreen_button.set_active(prefs["hide all in fullscreen"])
        hide_in_fullscreen_button.connect("toggled", self._check_button_cb, "hide all in fullscreen")
        page.add_row(hide_in_fullscreen_button)

        page.new_section(_("Fit to size mode"))

        fitside_label = gtk.Label(_("Fit to width or height:"))
        fitmode = self._create_fitmode_control()
        page.add_row(fitside_label, fitmode)

        fitsize_label = gtk.Label(_("Fixed size for this mode:"))
        adjustment = gtk.Adjustment(prefs["fit to size px"], 10, 10000, 10, 50)
        fitsize_spinner = gtk.SpinButton(adjustment, digits=0)
        fitsize_spinner.set_size_request(80, -1)
        fitsize_spinner.connect("value-changed", self._spinner_cb, "fit to size px")
        page.add_row(fitsize_label, fitsize_spinner)

        page.new_section(_("Slideshow"))
        label = gtk.Label(_("Slideshow delay (in seconds):"))
        adjustment = gtk.Adjustment(prefs["slideshow delay"] / 1000.0, 0.01, 3600.0, 0.1, 1)
        delay_spinner = gtk.SpinButton(adjustment, digits=2)
        delay_spinner.set_size_request(80, -1)
        delay_spinner.connect("value_changed", self._spinner_cb, "slideshow delay")
        page.add_row(label, delay_spinner)

        label = gtk.Label(_("Slideshow step (in pixels):"))
        adjustment = gtk.Adjustment(prefs["number of pixels to scroll per slideshow event"], -500, 500, 1, 1)
        slideshow_step_spinner = gtk.SpinButton(adjustment, digits=0)
        slideshow_step_spinner.set_size_request(80, -1)
        slideshow_step_spinner.connect(
            "value_changed", self._spinner_cb, "number of pixels to scroll per slideshow event"
        )
        slideshow_step_spinner.set_tooltip_text(
            _(
                "Specify the number of pixels to scroll while in slideshow mode. A positive value will scroll forward, a negative value will scroll backwards, and a value of 0 will cause the slideshow to always flip to a new page."
            )
        )
        page.add_row(label, slideshow_step_spinner)

        slideshow_auto_open_button = gtk.CheckButton(_("During a slideshow automatically open the next archive"))
        slideshow_auto_open_button.set_active(prefs["slideshow can go to next archive"])
        slideshow_auto_open_button.connect("toggled", self._check_button_cb, "slideshow can go to next archive")
        slideshow_auto_open_button.set_tooltip_text(
            _("While in slideshow mode allow the next archive to automatically be opened.")
        )
        page.add_row(slideshow_auto_open_button)

        page.new_section(_("Rotation"))
        auto_rotate_button = gtk.CheckButton(_("Automatically rotate images according to their metadata"))
        auto_rotate_button.set_active(prefs["auto rotate from exif"])
        auto_rotate_button.connect("toggled", self._check_button_cb, "auto rotate from exif")
        auto_rotate_button.set_tooltip_text(
            _(
                "Automatically rotate images when an orientation is specified in the image metadata, such as in an Exif tag."
            )
        )
        page.add_row(auto_rotate_button)

        page.new_section(_("Image quality"))
        label = gtk.Label(_("Scaling mode"))
        scaling_box = self._create_scaling_quality_combobox()
        scaling_box.set_tooltip_text(
            _(
                "Changes how images are scaled. Slower algorithms result in higher quality resizing, but longer page loading times."
            )
        )
        page.add_row(label, scaling_box)

        return page
コード例 #10
0
ファイル: preferences_dialog.py プロジェクト: Gosha/mcomix
    def _init_behaviour_tab(self):
        # ----------------------------------------------------------------
        # The "Behaviour" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)
        page.new_section(_("Scroll"))
        smart_space_button = gtk.CheckButton(_("Use smart scrolling"))
        smart_space_button.set_active(prefs["smart scroll"])
        smart_space_button.connect("toggled", self._check_button_cb, "smart scroll")
        smart_space_button.set_tooltip_text(
            _(
                "With this preference set, the space key and mouse wheel "
                "do not only scroll down or up, but also sideways and so "
                "try to follow the natural reading order of the comic book."
            )
        )
        page.add_row(smart_space_button)

        flip_with_wheel_button = gtk.CheckButton(_("Flip pages when scrolling off the edges of the page"))
        flip_with_wheel_button.set_active(prefs["flip with wheel"])
        flip_with_wheel_button.connect("toggled", self._check_button_cb, "flip with wheel")
        flip_with_wheel_button.set_tooltip_text(
            _(
                'Flip pages when scrolling "off the page" with the scroll wheel or with the arrow keys. It takes n consecutive "steps" with the scroll wheel or the arrow keys for the pages to be flipped.'
            )
        )
        page.add_row(flip_with_wheel_button)

        auto_open_next_button = gtk.CheckButton(_("Automatically open the next archive"))
        auto_open_next_button.set_active(prefs["auto open next archive"])
        auto_open_next_button.connect("toggled", self._check_button_cb, "auto open next archive")
        auto_open_next_button.set_tooltip_text(
            _(
                "Automatically open the next archive in the directory when flipping past the last page, or the previous archive when flipping past the first page."
            )
        )
        page.add_row(auto_open_next_button)

        auto_open_dir_button = gtk.CheckButton(_("Automatically open next directory"))
        auto_open_dir_button.set_active(prefs["auto open next directory"])
        auto_open_dir_button.connect("toggled", self._check_button_cb, "auto open next directory")
        auto_open_dir_button.set_tooltip_text(
            _(
                "Automatically open the first file in the next sibling directory when flipping past the last page of the last file in a directory, or the previous directory when flipping past the first page of the first file."
            )
        )
        page.add_row(auto_open_dir_button)

        label = gtk.Label(_("Number of pixels to scroll per arrow key press:"))
        adjustment = gtk.Adjustment(prefs["number of pixels to scroll per key event"], 1, 500, 1, 3)
        scroll_key_spinner = gtk.SpinButton(adjustment, digits=0)
        scroll_key_spinner.connect("value_changed", self._spinner_cb, "number of pixels to scroll per key event")
        scroll_key_spinner.set_tooltip_text(
            _("Set the number of pixels to scroll on a page when using the arrow keys.")
        )
        page.add_row(label, scroll_key_spinner)

        label = gtk.Label(_("Number of pixels to scroll per mouse wheel turn:"))
        adjustment = gtk.Adjustment(prefs["number of pixels to scroll per mouse wheel event"], 1, 500, 1, 3)
        scroll_key_spinner = gtk.SpinButton(adjustment, digits=0)
        scroll_key_spinner.connect(
            "value_changed", self._spinner_cb, "number of pixels to scroll per mouse wheel event"
        )
        scroll_key_spinner.set_tooltip_text(_("Set the number of pixels to scroll on a page when using a mouse wheel."))
        page.add_row(label, scroll_key_spinner)

        smart_scroll_label = gtk.Label(_("Fraction of page to scroll " "per space key press (in percent):"))
        adjustment = gtk.Adjustment(int(prefs["smart scroll percentage"] * 100), 1, 100, 1, 5)
        spinner = gtk.SpinButton(adjustment, digits=0)
        spinner.connect("value-changed", self._spinner_cb, "smart scroll percentage")
        spinner.set_tooltip_text(
            _("Sets the percentage by which the page " "will be scrolled down or up when the space key is pressed.")
        )
        page.add_row(smart_scroll_label, spinner)

        label = gtk.Label(_('Number of "steps" to take before flipping the page:'))
        adjustment = gtk.Adjustment(prefs["number of key presses before page turn"], 1, 100, 1, 3)
        flipping_spinner = gtk.SpinButton(adjustment, digits=0)
        flipping_spinner.connect("value_changed", self._spinner_cb, "number of key presses before page turn")
        flipping_spinner.set_tooltip_text(
            _(
                'Set the number of "steps" needed to flip to the next or previous page.  Less steps will allow for very fast page turning but you might find yourself accidentally turning pages.'
            )
        )
        page.add_row(label, flipping_spinner)

        page.new_section(_("Double page mode"))

        step_length_button = gtk.CheckButton(_("Flip two pages in double page mode"))
        step_length_button.set_active(prefs["double step in double page mode"])
        step_length_button.connect("toggled", self._check_button_cb, "double step in double page mode")
        step_length_button.set_tooltip_text(
            _("Flip two pages, instead of one, each time we flip pages in double page mode.")
        )
        page.add_row(step_length_button)

        label = gtk.Label(_("Show only one page where appropriate:"))
        doublepage_control = self._create_doublepage_as_one_control()
        doublepage_control.set_tooltip_text(
            _(
                "When showing the first page of an archive, or an image's width "
                "exceeds its height, only a single page will be displayed."
            )
        )
        page.add_row(label, doublepage_control)
        page.new_section(_("Files"))

        auto_open_last_button = gtk.CheckButton(_("Automatically open the last viewed file on startup"))
        auto_open_last_button.set_active(prefs["auto load last file"])
        auto_open_last_button.connect("toggled", self._check_button_cb, "auto load last file")
        auto_open_last_button.set_tooltip_text(
            _("Automatically open, on startup, the file that was open when MComix was last closed.")
        )
        page.add_row(auto_open_last_button)

        store_recent_label = gtk.Label(_("Store information about recently opened files:"))
        store_recent_box = self._create_store_recent_combobox()
        store_recent_box.set_tooltip_text(
            _("Add information about all files opened from within MComix to the shared recent files list.")
        )
        page.add_row(store_recent_label, store_recent_box)

        return page
コード例 #11
0
ファイル: preferences_dialog.py プロジェクト: drdrpyan/mcomix
    def _init_appearance_tab(self):
        # ----------------------------------------------------------------
        # The "Appearance" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)

        page.new_section(_("User interface"))
        label = gtk.Label(_("Language (needs restart):"))
        language_box = self._create_language_control()
        page.add_row(label, language_box)

        esc_quits = gtk.CheckButton(_("Escape key closes program"))
        esc_quits.set_active(prefs["escape quits"])
        esc_quits.connect("toggled", self._check_button_cb, "escape quits")
        esc_quits.set_tooltip_text(
            _("When active, the ESC key closes the program, instead of only " "disabling fullscreen mode.")
        )
        page.add_row(esc_quits)

        page.new_section(_("Background"))

        fixed_bg_button = gtk.RadioButton(None, _("Use this colour as background:"))
        fixed_bg_button.set_tooltip_text(_("Always use this selected colour as the background colour."))
        fixed_bg_button.connect("toggled", self._check_button_cb, "color box bg")
        bg_color_button = gtk.ColorButton(gtk.gdk.Color(*prefs["bg colour"]))
        bg_color_button.connect("color_set", self._color_button_cb, "bg colour")

        page.add_row(fixed_bg_button, bg_color_button)

        dynamic_bg_button = gtk.RadioButton(fixed_bg_button, _("Use dynamic background colour"))
        dynamic_bg_button.set_active(prefs["smart bg"])
        dynamic_bg_button.connect("toggled", self._check_button_cb, "smart bg")
        dynamic_bg_button.set_tooltip_text(_("Automatically pick a background colour that fits the viewed image."))

        page.add_row(dynamic_bg_button)

        page.new_section(_("Thumbnails"))

        thumb_fixed_bg_button = gtk.RadioButton(None, _("Use this colour as the thumbnail background:"))
        thumb_fixed_bg_button.set_tooltip_text(_("Always use this selected colour as the thumbnail background colour."))
        thumb_fixed_bg_button.connect("toggled", self._check_button_cb, "color box thumb bg")
        thumb_bg_color_button = gtk.ColorButton(gtk.gdk.Color(*prefs["thumb bg colour"]))
        thumb_bg_color_button.connect("color_set", self._color_button_cb, "thumb bg colour")

        page.add_row(thumb_fixed_bg_button, thumb_bg_color_button)

        thumb_dynamic_bg_button = gtk.RadioButton(thumb_fixed_bg_button, _("Use dynamic background colour"))
        thumb_dynamic_bg_button.set_active(prefs["smart thumb bg"])
        thumb_dynamic_bg_button.set_tooltip_text(
            _("Automatically use the colour that fits the viewed image for the thumbnail background.")
        )
        thumb_dynamic_bg_button.connect("toggled", self._check_button_cb, "smart thumb bg")

        page.add_row(thumb_dynamic_bg_button)

        thumb_number_button = gtk.CheckButton(_("Show page numbers on thumbnails"))
        thumb_number_button.set_active(prefs["show page numbers on thumbnails"])
        thumb_number_button.connect("toggled", self._check_button_cb, "show page numbers on thumbnails")
        page.add_row(thumb_number_button)

        thumb_as_preview_icon = gtk.CheckButton(_("Use archive thumbnail as application icon"))
        thumb_as_preview_icon.set_tooltip_text(
            _(
                "By enabling this setting, the first page of a book will be used as application icon instead of the standard icon."
            )
        )
        thumb_as_preview_icon.set_active(prefs["archive thumbnail as icon"])
        thumb_as_preview_icon.connect("toggled", self._check_button_cb, "archive thumbnail as icon")
        page.add_row(thumb_as_preview_icon)

        label = gtk.Label(_("Thumbnail size (in pixels):"))
        adjustment = gtk.Adjustment(prefs["thumbnail size"], 20, 500, 1, 10)
        thumb_size_spinner = gtk.SpinButton(adjustment)
        thumb_size_spinner.connect("value_changed", self._spinner_cb, "thumbnail size")
        page.add_row(label, thumb_size_spinner)

        page.new_section(_("Transparency"))
        checkered_bg_button = gtk.CheckButton(_("Use checkered background for transparent images"))
        checkered_bg_button.set_active(prefs["checkered bg for transparent images"])
        checkered_bg_button.connect("toggled", self._check_button_cb, "checkered bg for transparent images")
        checkered_bg_button.set_tooltip_text(
            _(
                "Use a grey checkered background for transparent images. If this preference is unset, the background is plain white instead."
            )
        )
        page.add_row(checkered_bg_button)

        return page
コード例 #12
0
    def _init_appearance_tab(self):
        # ----------------------------------------------------------------
        # The "Appearance" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)

        page.new_section(_('User interface'))

        page.add_row(gtk.Label(_('Language (needs restart):')),
            self._create_language_control())

        page.add_row(self._create_pref_check_button(
            _('Escape key closes program'), 'escape quits',
            _('When active, the ESC key closes the program, instead of only '
              'disabling fullscreen mode.')))

        page.new_section(_('Background'))

        fixed_bg_button, dynamic_bg_button = self._create_binary_pref_radio_buttons(
            _('Use this colour as background:'),
            'color box bg',
            _('Always use this selected colour as the background colour.'),
            _('Use dynamic background colour'),
            'smart bg',
            _('Automatically pick a background colour that fits the viewed image.'))
        page.add_row(fixed_bg_button, self._create_color_button('bg colour'))
        page.add_row(dynamic_bg_button)

        page.new_section(_('Thumbnails'))

        thumb_fixed_bg_button, thumb_dynamic_bg_button = self._create_binary_pref_radio_buttons(
            'Use this colour as the thumbnail background:',
            'color box thumb bg',
            _('Always use this selected colour as the thumbnail background colour.'),
            'Use dynamic background colour',
            'smart thumb bg',
            _('Automatically use the colour that fits the viewed image for the thumbnail background.'))
        page.add_row(thumb_fixed_bg_button, self._create_color_button('thumb bg colour'))
        page.add_row(thumb_dynamic_bg_button)

        page.add_row(self._create_pref_check_button(
            _('Show page numbers on thumbnails'),
            'show page numbers on thumbnails', None))

        page.add_row(self._create_pref_check_button(
            _('Use archive thumbnail as application icon'),
            'archive thumbnail as icon',
            _('By enabling this setting, the first page of a book will be used as application icon instead of the standard icon.')))

        page.add_row(gtk.Label(_('Thumbnail size (in pixels):')),
            self._create_pref_spinner('thumbnail size',
            1, 20, 500, 1, 10, 0, None))

        page.new_section(_('Transparency'))

        page.add_row(self._create_pref_check_button(
            _('Use checkered background for transparent images'),
            'checkered bg for transparent images',
            _('Use a grey checkered background for transparent images. If this preference is unset, the background is plain white instead.')))

        return page
コード例 #13
0
    def _init_behaviour_tab(self):
        # ----------------------------------------------------------------
        # The "Behaviour" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)

        page.new_section(_('Scroll'))

        page.add_row(self._create_pref_check_button(
            _('Use smart scrolling'),
            'smart scroll',
            _('With this preference set, the space key and mouse wheel '
              'do not only scroll down or up, but also sideways and so '
              'try to follow the natural reading order of the comic book.')))

        page.add_row(self._create_pref_check_button(
            _('Flip pages when scrolling off the edges of the page'),
            'flip with wheel',
            _('Flip pages when scrolling "off the page" with the scroll wheel or with the arrow keys. It takes n consecutive "steps" with the scroll wheel or the arrow keys for the pages to be flipped.')))

        page.add_row(self._create_pref_check_button(
            _('Automatically open the next archive'),
            'auto open next archive',
            _('Automatically open the next archive in the directory when flipping past the last page, or the previous archive when flipping past the first page.')))

        page.add_row(self._create_pref_check_button(
            _('Automatically open next directory'),
            'auto open next directory',
            _('Automatically open the first file in the next sibling directory when flipping past the last page of the last file in a directory, or the previous directory when flipping past the first page of the first file.')))

        page.add_row(gtk.Label(_('Number of pixels to scroll per arrow key press:')),
            self._create_pref_spinner('number of pixels to scroll per key event',
            1, 1, 500, 1, 3, 0,
            _('Set the number of pixels to scroll on a page when using the arrow keys.')))

        page.add_row(gtk.Label(_('Number of pixels to scroll per mouse wheel turn:')),
            self._create_pref_spinner('number of pixels to scroll per mouse wheel event',
            1, 1, 500, 1, 3, 0,
            _('Set the number of pixels to scroll on a page when using a mouse wheel.')))

        page.add_row(gtk.Label(_('Fraction of page to scroll '
            'per space key press (in percent):')),
            self._create_pref_spinner('smart scroll percentage',
            0.01, 1, 100, 1, 5, 0,
            _('Sets the percentage by which the page '
            'will be scrolled down or up when the space key is pressed.')))

        page.add_row(gtk.Label(_('Number of "steps" to take before flipping the page:')),
            self._create_pref_spinner('number of key presses before page turn',
            1, 1, 100, 1, 3, 0,
            _('Set the number of "steps" needed to flip to the next or previous page.  Less steps will allow for very fast page turning but you might find yourself accidentally turning pages.')))

        page.new_section(_('Double page mode'))

        page.add_row(self._create_pref_check_button(
            _('Flip two pages in double page mode'),
            'double step in double page mode',
            _('Flip two pages, instead of one, each time we flip pages in double page mode.')))

        page.add_row(gtk.Label(_('Show only one page where appropriate:')),
            self._create_doublepage_as_one_control())

        page.new_section(_('Files'))

        page.add_row(self._create_pref_check_button(
            _('Automatically open the last viewed file on startup'),
            'auto load last file',
            _('Automatically open, on startup, the file that was open when MComix was last closed.')))

        page.add_row(gtk.Label(_('Store information about recently opened files:')),
            self._create_store_recent_combobox())

        return page
コード例 #14
0
    def _init_behaviour_tab(self):
        # ----------------------------------------------------------------
        # The "Behaviour" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)
        page.new_section(_('Scroll'))
        smart_space_button = gtk.CheckButton(
            _('Use smart space key scrolling'))
        smart_space_button.set_active(prefs['smart space scroll'])
        smart_space_button.connect('toggled', self._check_button_cb,
                                   'smart space scroll')
        smart_space_button.set_tooltip_text(
            _('Use smart scrolling with the space key. Normally the space key scrolls only right down (or up when shift is pressed), but with this preference set it also scrolls sideways and so tries to follow the natural reading order of the comic book.'
              ))
        page.add_row(smart_space_button)

        flip_with_wheel_button = gtk.CheckButton(
            _('Flip pages when scrolling off the edges of the page'))
        flip_with_wheel_button.set_active(prefs['flip with wheel'])
        flip_with_wheel_button.connect('toggled', self._check_button_cb,
                                       'flip with wheel')
        flip_with_wheel_button.set_tooltip_text(
            _('Flip pages when scrolling "off the page" with the scroll wheel or with the arrow keys. It takes n consecutive "steps" with the scroll wheel or the arrow keys for the pages to be flipped.'
              ))
        page.add_row(flip_with_wheel_button)

        auto_open_next_button = gtk.CheckButton(
            _('Automatically open the next archive'))
        auto_open_next_button.set_active(prefs['auto open next archive'])
        auto_open_next_button.connect('toggled', self._check_button_cb,
                                      'auto open next archive')
        auto_open_next_button.set_tooltip_text(
            _('Automatically open the next archive in the directory when flipping past the last page, or the previous archive when flipping past the first page.'
              ))
        page.add_row(auto_open_next_button)

        auto_open_dir_button = gtk.CheckButton(
            _('Automatically open next directory'))
        auto_open_dir_button.set_active(prefs['auto open next directory'])
        auto_open_dir_button.connect('toggled', self._check_button_cb,
                                     'auto open next directory')
        auto_open_dir_button.set_tooltip_text(
            _('Automatically open the first file in the next sibling directory when flipping past the last page of the last file in a directory, or the previous directory when flipping past the first page of the first file.'
              ))
        page.add_row(auto_open_dir_button)

        label = gtk.Label(_('Number of pixels to scroll per arrow key press:'))
        adjustment = gtk.Adjustment(
            prefs['number of pixels to scroll per key event'], 1, 500, 1, 3)
        scroll_key_spinner = gtk.SpinButton(adjustment, digits=0)
        scroll_key_spinner.connect('value_changed', self._spinner_cb,
                                   'number of pixels to scroll per key event')
        scroll_key_spinner.set_tooltip_text(
            _('Set the number of pixels to scroll on a page when using the arrow keys.'
              ))
        page.add_row(label, scroll_key_spinner)

        label = gtk.Label(
            _('Number of pixels to scroll per mouse wheel turn:'))
        adjustment = gtk.Adjustment(
            prefs['number of pixels to scroll per mouse wheel event'], 1, 500,
            1, 3)
        scroll_key_spinner = gtk.SpinButton(adjustment, digits=0)
        scroll_key_spinner.connect(
            'value_changed', self._spinner_cb,
            'number of pixels to scroll per mouse wheel event')
        scroll_key_spinner.set_tooltip_text(
            _('Set the number of pixels to scroll on a page when using a mouse wheel.'
              ))
        page.add_row(label, scroll_key_spinner)

        label = gtk.Label(
            _('Number of "steps" to take before flipping the page:'))
        adjustment = gtk.Adjustment(
            prefs['number of key presses before page turn'], 1, 100, 1, 3)
        flipping_spinner = gtk.SpinButton(adjustment, digits=0)
        flipping_spinner.connect('value_changed', self._spinner_cb,
                                 'number of key presses before page turn')
        flipping_spinner.set_tooltip_text(
            _('Set the number of "steps" needed to flip to the next or previous page.  Less steps will allow for very fast page turning but you might find yourself accidentally turning pages.'
              ))
        page.add_row(label, flipping_spinner)

        page.new_section(_('Double page mode'))

        step_length_button = gtk.CheckButton(
            _('Flip two pages in double page mode'))
        step_length_button.set_active(prefs['double step in double page mode'])
        step_length_button.connect('toggled', self._check_button_cb,
                                   'double step in double page mode')
        step_length_button.set_tooltip_text(
            _('Flip two pages, instead of one, each time we flip pages in double page mode.'
              ))
        page.add_row(step_length_button)

        label = gtk.Label(_('Show only one page where appropriate:'))
        doublepage_control = self._create_doublepage_as_one_control()
        doublepage_control.set_tooltip_text(
            _("When showing the first page of an archive, or an image's width "
              "exceeds its height, only a single page will be displayed."))
        page.add_row(label, doublepage_control)
        page.new_section(_('Files'))

        auto_open_last_button = gtk.CheckButton(
            _('Automatically open the last viewed file on startup'))
        auto_open_last_button.set_active(prefs['auto load last file'])
        auto_open_last_button.connect('toggled', self._check_button_cb,
                                      'auto load last file')
        auto_open_last_button.set_tooltip_text(
            _('Automatically open, on startup, the file that was open when MComix was last closed.'
              ))
        page.add_row(auto_open_last_button)

        store_recent_label = gtk.Label(
            _('Store information about recently opened files:'))
        store_recent_box = self._create_store_recent_combobox()
        store_recent_box.set_tooltip_text(
            _('Add information about all files opened from within MComix to the shared recent files list.'
              ))
        page.add_row(store_recent_label, store_recent_box)

        return page
コード例 #15
0
ファイル: preferences_dialog.py プロジェクト: brambg/mcomix
    def _init_advanced_tab(self):
        # ----------------------------------------------------------------
        # The "Advanced" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)

        page.new_section(_('User interface language'))
        label = gtk.Label(_('Language (needs restart):'))
        language_box = self._create_language_control()
        page.add_row(label, language_box)

        page.new_section(_('File order'))

        label = gtk.Label(_('Order files by:'))
        page.add_row(label, self._create_sort_by_control())

        page.new_section(_('Cache'))

        create_thumbs_button = gtk.CheckButton(
            _('Store thumbnails for opened files'))
        create_thumbs_button.set_active(prefs['create thumbnails'])
        create_thumbs_button.connect('toggled', self._check_button_cb,
            'create thumbnails')
        create_thumbs_button.set_tooltip_text(
            _('Store thumbnails for opened files according to the freedesktop.org specification. These thumbnails are shared by many other applications, such as most file managers.'))
        page.add_row(create_thumbs_button)

        delay_thumbs_button = gtk.CheckButton(
            _('Delay thumbnail generation'))
        delay_thumbs_button.set_tooltip_text(
            _('Thumbnails are generated only when required, instead of directly after opening a new file.'))
        delay_thumbs_button.set_active(prefs['delay thumbnails'])
        delay_thumbs_button.connect('toggled', self._check_button_cb,
            'delay thumbnails')
        page.add_row(delay_thumbs_button)

        label = gtk.Label(_('Maximum number of pages to store in the cache:'))
        adjustment = gtk.Adjustment(prefs['max pages to cache'], -1, 500, 1, 3)
        cache_spinner = gtk.SpinButton(adjustment, digits=0)
        cache_spinner.connect('value-changed', self._spinner_cb,
                                            'max pages to cache')
        cache_spinner.set_tooltip_text(
            _('Set the max number of pages to cache. A value of -1 will cache the entire archive.'))
        page.add_row(label, cache_spinner)

        page.new_section(_('Magnifying Lens'))

        label = gtk.Label(_('Magnifying lens size (in pixels):'))
        adjustment = gtk.Adjustment(prefs['lens size'], 50, 400, 1, 10)
        lens_size_spinner = gtk.SpinButton(adjustment)
        lens_size_spinner.connect('value_changed', self._spinner_cb,
            'lens size')
        lens_size_spinner.set_tooltip_text(
            _('Set the size of the magnifying lens. It is a square with a side of this many pixels.'))
        page.add_row(label, lens_size_spinner)
        label = gtk.Label(_('Magnification factor:'))
        adjustment = gtk.Adjustment(prefs['lens magnification'], 1.1, 10.0,
            0.1, 1.0)
        lens_magnification_spinner = gtk.SpinButton(adjustment, digits=1)
        lens_magnification_spinner.connect('value_changed', self._spinner_cb,
            'lens magnification')
        lens_magnification_spinner.set_tooltip_text(
            _('Set the magnification factor of the magnifying lens.'))
        page.add_row(label, lens_magnification_spinner)

        page.new_section(_('Comments'))
        label = gtk.Label(_('Comment extensions:'))
        extensions_entry = gtk.Entry()
        extensions_entry.set_size_request(200, -1)
        extensions_entry.set_text(', '.join(prefs['comment extensions']))
        extensions_entry.connect('activate', self._entry_cb)
        extensions_entry.connect('focus_out_event', self._entry_cb)
        extensions_entry.set_tooltip_text(
            _('Treat all files found within archives, that have one of these file endings, as comments.'))
        page.add_row(label, extensions_entry)

        return page
コード例 #16
0
ファイル: preferences_dialog.py プロジェクト: brambg/mcomix
    def _init_behaviour_tab(self):
        # ----------------------------------------------------------------
        # The "Behaviour" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)
        page.new_section(_('Scroll'))
        smart_space_button = gtk.CheckButton(
            _('Use smart space key scrolling'))
        smart_space_button.set_active(prefs['smart space scroll'])
        smart_space_button.connect('toggled', self._check_button_cb,
            'smart space scroll')
        smart_space_button.set_tooltip_text(
            _('Use smart scrolling with the space key. Normally the space key scrolls only right down (or up when shift is pressed), but with this preference set it also scrolls sideways and so tries to follow the natural reading order of the comic book.'))
        page.add_row(smart_space_button)

        flip_with_wheel_button = gtk.CheckButton(
            _('Flip pages when scrolling off the edges of the page'))
        flip_with_wheel_button.set_active(prefs['flip with wheel'])
        flip_with_wheel_button.connect('toggled', self._check_button_cb,
            'flip with wheel')
        flip_with_wheel_button.set_tooltip_text(
            _('Flip pages when scrolling "off the page" with the scroll wheel or with the arrow keys. It takes n consecutive "steps" with the scroll wheel or the arrow keys for the pages to be flipped.'))
        page.add_row(flip_with_wheel_button)

        auto_open_next_button = gtk.CheckButton(
            _('Automatically open the next archive'))
        auto_open_next_button.set_active(prefs['auto open next archive'])
        auto_open_next_button.connect('toggled', self._check_button_cb,
            'auto open next archive')
        auto_open_next_button.set_tooltip_text(
            _('Automatically open the next archive in the directory when flipping past the last page, or the previous archive when flipping past the first page.'))
        page.add_row(auto_open_next_button)

        auto_open_dir_button = gtk.CheckButton(
            _('Automatically open next directory'))
        auto_open_dir_button.set_active(prefs['auto open next directory'])
        auto_open_dir_button.connect('toggled', self._check_button_cb,
            'auto open next directory')
        auto_open_dir_button.set_tooltip_text(
            _('Automatically open the first file in the next sibling directory when flipping past the last page of the last file in a directory, or the previous directory when flipping past the first page of the first file.'))
        page.add_row(auto_open_dir_button)

        label = gtk.Label(_('Number of pixels to scroll per arrow key press:'))
        adjustment = gtk.Adjustment(prefs['number of pixels to scroll per key event'], 1, 500, 1, 3)
        scroll_key_spinner = gtk.SpinButton(adjustment, digits=0)
        scroll_key_spinner.connect('value_changed', self._spinner_cb,
            'number of pixels to scroll per key event')
        scroll_key_spinner.set_tooltip_text(
            _('Set the number of pixels to scroll on a page when using the arrow keys.'))
        page.add_row(label, scroll_key_spinner)

        label = gtk.Label(_('Number of pixels to scroll per mouse wheel turn:'))
        adjustment = gtk.Adjustment(prefs['number of pixels to scroll per mouse wheel event'], 1, 500, 1, 3)
        scroll_key_spinner = gtk.SpinButton(adjustment, digits=0)
        scroll_key_spinner.connect('value_changed', self._spinner_cb,
            'number of pixels to scroll per mouse wheel event')
        scroll_key_spinner.set_tooltip_text(
            _('Set the number of pixels to scroll on a page when using a mouse wheel.'))
        page.add_row(label, scroll_key_spinner)

        label = gtk.Label(_('Number of "steps" to take before flipping the page:'))
        adjustment = gtk.Adjustment(prefs['number of key presses before page turn'], 1, 100, 1, 3)
        flipping_spinner = gtk.SpinButton(adjustment, digits=0)
        flipping_spinner.connect('value_changed', self._spinner_cb,
            'number of key presses before page turn')
        flipping_spinner.set_tooltip_text(
            _('Set the number of "steps" needed to flip to the next or previous page.  Less steps will allow for very fast page turning but you might find yourself accidentally turning pages.'))
        page.add_row(label, flipping_spinner)

        page.new_section(_('Double page mode'))

        step_length_button = gtk.CheckButton(
            _('Flip two pages in double page mode'))
        step_length_button.set_active(prefs['double step in double page mode'])
        step_length_button.connect('toggled', self._check_button_cb,
            'double step in double page mode')
        step_length_button.set_tooltip_text(
            _('Flip two pages, instead of one, each time we flip pages in double page mode.'))
        page.add_row(step_length_button)

        label = gtk.Label(_('Show only one page where appropriate:'))
        doublepage_control = self._create_doublepage_as_one_control()
        doublepage_control.set_tooltip_text(
            _("When showing the first page of an archive, or an image's width "
              "exceeds its height, only a single page will be displayed."))
        page.add_row(label, doublepage_control)
        page.new_section(_('Files'))

        auto_open_last_button = gtk.CheckButton(
            _('Automatically open the last viewed file on startup'))
        auto_open_last_button.set_active(prefs['auto load last file'])
        auto_open_last_button.connect('toggled', self._check_button_cb,
            'auto load last file')
        auto_open_last_button.set_tooltip_text(
            _('Automatically open, on startup, the file that was open when MComix was last closed.'))
        page.add_row(auto_open_last_button)

        store_recent_label = gtk.Label(
            _('Store information about recently opened files:'))
        store_recent_box = self._create_store_recent_combobox()
        store_recent_box.set_tooltip_text(
            _('Add information about all files opened from within MComix to the shared recent files list.'))
        page.add_row(store_recent_label, store_recent_box)

        return page
コード例 #17
0
    def _init_behaviour_tab(self):
        # ----------------------------------------------------------------
        # The "Behaviour" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)

        page.new_section(_('Scroll'))

        page.add_row(
            self._create_pref_check_button(
                _('Use smart scrolling'), 'smart scroll',
                _('With this preference set, the space key and mouse wheel '
                  'do not only scroll down or up, but also sideways and so '
                  'try to follow the natural reading order of the comic book.')
            ))

        page.add_row(
            self._create_pref_check_button(
                _('Flip pages when scrolling off the edges of the page'),
                'flip with wheel',
                _('Flip pages when scrolling "off the page" with the scroll wheel or with the arrow keys. It takes n consecutive "steps" with the scroll wheel or the arrow keys for the pages to be flipped.'
                  )))

        page.add_row(
            self._create_pref_check_button(
                _('Automatically open the next archive'),
                'auto open next archive',
                _('Automatically open the next archive in the directory when flipping past the last page, or the previous archive when flipping past the first page.'
                  )))

        page.add_row(
            self._create_pref_check_button(
                _('Automatically open next directory'),
                'auto open next directory',
                _('Automatically open the first file in the next sibling directory when flipping past the last page of the last file in a directory, or the previous directory when flipping past the first page of the first file.'
                  )))

        page.add_row(
            self._create_pref_check_button(
                _('Dive into subdirectories (restart required)'),
                'dive into subdir',
                _('Dive into subdirectories when opening directory.')))

        page.add_row(
            Gtk.Label(
                label=_('Number of pixels to scroll per arrow key press:')),
            self._create_pref_spinner(
                'number of pixels to scroll per key event', 1, 1, 500, 1, 3, 0,
                _('Set the number of pixels to scroll on a page when using the arrow keys.'
                  )))

        page.add_row(
            Gtk.Label(
                label=_('Number of pixels to scroll per mouse wheel turn:')),
            self._create_pref_spinner(
                'number of pixels to scroll per mouse wheel event', 1, 1, 500,
                1, 3, 0,
                _('Set the number of pixels to scroll on a page when using a mouse wheel.'
                  )))

        page.add_row(
            Gtk.Label(label=_('Fraction of page to scroll '
                              'per space key press (in percent):')),
            self._create_pref_spinner(
                'smart scroll percentage', 0.01, 1, 100, 1, 5, 0,
                _('Sets the percentage by which the page '
                  'will be scrolled down or up when the space key is pressed.')
            ))

        page.add_row(
            Gtk.Label(label=_(
                'Number of "steps" to take before flipping the page:')),
            self._create_pref_spinner(
                'number of key presses before page turn', 1, 1, 100, 1, 3, 0,
                _('Set the number of "steps" needed to flip to the next or previous page.  Less steps will allow for very fast page turning but you might find yourself accidentally turning pages.'
                  )))

        page.new_section(_('Double page mode'))

        page.add_row(
            self._create_pref_check_button(
                _('Flip two pages in double page mode'),
                'double step in double page mode',
                _('Flip two pages, instead of one, each time we flip pages in double page mode.'
                  )))

        page.add_row(
            Gtk.Label(label=_('Show only one page where appropriate:')),
            self._create_doublepage_as_one_control())

        page.new_section(_('Files'))

        page.add_row(
            self._create_pref_check_button(
                _('Automatically open the last viewed file on startup'),
                'auto load last file',
                _('Automatically open, on startup, the file that was open when MComix was last closed.'
                  )))

        page.add_row(
            Gtk.Label(
                label=_('Store information about recently opened files:')),
            self._create_store_recent_combobox())

        if constants.PORTABLE_MODE:
            page.add_row(
                self._create_pref_check_button(
                    _('Accept file(s) from anywhere'),
                    'portable allow abspath',
                    _('Accept file(s) from anywhere to be seved in bookmark and library. If not, only files(s) in the same disk with mcomix will be accepted.'
                      )))

        return page
コード例 #18
0
    def _init_display_tab(self):
        # ----------------------------------------------------------------
        # The "Display" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)
        page.new_section(_('Fullscreen'))

        fullscreen_button = gtk.CheckButton(_('Use fullscreen by default'))
        fullscreen_button.set_active(prefs['default fullscreen'])
        fullscreen_button.connect('toggled', self._check_button_cb,
                                  'default fullscreen')
        page.add_row(fullscreen_button)

        hide_in_fullscreen_button = gtk.CheckButton(
            _('Automatically hide all toolbars in fullscreen'))
        hide_in_fullscreen_button.set_active(prefs['hide all in fullscreen'])
        hide_in_fullscreen_button.connect('toggled', self._check_button_cb,
                                          'hide all in fullscreen')
        page.add_row(hide_in_fullscreen_button)

        page.new_section(_('Slideshow'))
        label = gtk.Label(_('Slideshow delay (in seconds):'))
        adjustment = gtk.Adjustment(prefs['slideshow delay'] / 1000.0, 0.01,
                                    3600.0, 0.1, 1)
        delay_spinner = gtk.SpinButton(adjustment, digits=2)
        delay_spinner.set_size_request(80, -1)
        delay_spinner.connect('value_changed', self._spinner_cb,
                              'slideshow delay')
        page.add_row(label, delay_spinner)

        label = gtk.Label(_('Slideshow step (in pixels):'))
        adjustment = gtk.Adjustment(
            prefs['number of pixels to scroll per slideshow event'], -500, 500,
            1, 1)
        slideshow_step_spinner = gtk.SpinButton(adjustment, digits=0)
        slideshow_step_spinner.set_size_request(80, -1)
        slideshow_step_spinner.connect(
            'value_changed', self._spinner_cb,
            'number of pixels to scroll per slideshow event')
        slideshow_step_spinner.set_tooltip_text(
            _('Specify the number of pixels to scroll while in slideshow mode. A positive value will scroll forward, a negative value will scroll backwards, and a value of 0 will cause the slideshow to always flip to a new page.'
              ))
        page.add_row(label, slideshow_step_spinner)

        slideshow_auto_open_button = gtk.CheckButton(
            _('During a slideshow automatically open the next archive'))
        slideshow_auto_open_button.set_active(
            prefs['slideshow can go to next archive'])
        slideshow_auto_open_button.connect('toggled', self._check_button_cb,
                                           'slideshow can go to next archive')
        slideshow_auto_open_button.set_tooltip_text(
            _('While in slideshow mode allow the next archive to automatically be opened.'
              ))
        page.add_row(slideshow_auto_open_button)

        page.new_section(_('Rotation'))
        auto_rotate_button = gtk.CheckButton(
            _('Automatically rotate images according to their metadata'))
        auto_rotate_button.set_active(prefs['auto rotate from exif'])
        auto_rotate_button.connect('toggled', self._check_button_cb,
                                   'auto rotate from exif')
        auto_rotate_button.set_tooltip_text(
            _('Automatically rotate images when an orientation is specified in the image metadata, such as in an Exif tag.'
              ))
        page.add_row(auto_rotate_button)

        return page
コード例 #19
0
    def _init_advanced_tab(self):
        # ----------------------------------------------------------------
        # The "Advanced" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)

        page.new_section(_('User interface language'))
        label = gtk.Label(_('Language (needs restart):'))
        language_box = self._create_language_control()
        page.add_row(label, language_box)

        page.new_section(_('File order'))

        label = gtk.Label(_('Order files by:'))
        page.add_row(label, self._create_sort_by_control())

        page.new_section(_('Cache'))

        create_thumbs_button = gtk.CheckButton(
            _('Store thumbnails for opened files'))
        create_thumbs_button.set_active(prefs['create thumbnails'])
        create_thumbs_button.connect('toggled', self._check_button_cb,
                                     'create thumbnails')
        create_thumbs_button.set_tooltip_text(
            _('Store thumbnails for opened files according to the freedesktop.org specification. These thumbnails are shared by many other applications, such as most file managers.'
              ))
        page.add_row(create_thumbs_button)

        delay_thumbs_button = gtk.CheckButton(_('Delay thumbnail generation'))
        delay_thumbs_button.set_tooltip_text(
            _('Thumbnails are generated only when required, instead of directly after opening a new file.'
              ))
        delay_thumbs_button.set_active(prefs['delay thumbnails'])
        delay_thumbs_button.connect('toggled', self._check_button_cb,
                                    'delay thumbnails')
        page.add_row(delay_thumbs_button)

        label = gtk.Label(_('Maximum number of pages to store in the cache:'))
        adjustment = gtk.Adjustment(prefs['max pages to cache'], -1, 500, 1, 3)
        cache_spinner = gtk.SpinButton(adjustment, digits=0)
        cache_spinner.connect('value-changed', self._spinner_cb,
                              'max pages to cache')
        cache_spinner.set_tooltip_text(
            _('Set the max number of pages to cache. A value of -1 will cache the entire archive.'
              ))
        page.add_row(label, cache_spinner)

        page.new_section(_('Magnifying Lens'))

        label = gtk.Label(_('Magnifying lens size (in pixels):'))
        adjustment = gtk.Adjustment(prefs['lens size'], 50, 400, 1, 10)
        lens_size_spinner = gtk.SpinButton(adjustment)
        lens_size_spinner.connect('value_changed', self._spinner_cb,
                                  'lens size')
        lens_size_spinner.set_tooltip_text(
            _('Set the size of the magnifying lens. It is a square with a side of this many pixels.'
              ))
        page.add_row(label, lens_size_spinner)
        label = gtk.Label(_('Magnification factor:'))
        adjustment = gtk.Adjustment(prefs['lens magnification'], 1.1, 10.0,
                                    0.1, 1.0)
        lens_magnification_spinner = gtk.SpinButton(adjustment, digits=1)
        lens_magnification_spinner.connect('value_changed', self._spinner_cb,
                                           'lens magnification')
        lens_magnification_spinner.set_tooltip_text(
            _('Set the magnification factor of the magnifying lens.'))
        page.add_row(label, lens_magnification_spinner)

        page.new_section(_('Comments'))
        label = gtk.Label(_('Comment extensions:'))
        extensions_entry = gtk.Entry()
        extensions_entry.set_size_request(200, -1)
        extensions_entry.set_text(', '.join(prefs['comment extensions']))
        extensions_entry.connect('activate', self._entry_cb)
        extensions_entry.connect('focus_out_event', self._entry_cb)
        extensions_entry.set_tooltip_text(
            _('Treat all files found within archives, that have one of these file endings, as comments.'
              ))
        page.add_row(label, extensions_entry)

        return page
コード例 #20
0
    def _init_appearance_tab(self):
        # ----------------------------------------------------------------
        # The "Appearance" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(80)
        page.new_section(_('Background'))

        fixed_bg_button = gtk.RadioButton(None,
                                          _('Use this colour as background:'))
        fixed_bg_button.set_tooltip_text(
            _('Always use this selected colour as the background colour.'))
        fixed_bg_button.connect('toggled', self._check_button_cb,
                                'color box bg')
        bg_color_button = gtk.ColorButton(gtk.gdk.Color(*prefs['bg colour']))
        bg_color_button.connect('color_set', self._color_button_cb,
                                'bg colour')

        page.add_row(fixed_bg_button, bg_color_button)

        dynamic_bg_button = gtk.RadioButton(fixed_bg_button,
                                            _('Use dynamic background colour'))
        dynamic_bg_button.set_active(prefs['smart bg'])
        dynamic_bg_button.connect('toggled', self._check_button_cb, 'smart bg')
        dynamic_bg_button.set_tooltip_text(
            _('Automatically pick a background colour that fits the viewed image.'
              ))

        page.add_row(dynamic_bg_button)

        page.new_section(_('Thumbnails'))

        thumb_fixed_bg_button = gtk.RadioButton(
            None, _('Use this colour as the thumbnail background:'))
        thumb_fixed_bg_button.set_tooltip_text(
            _('Always use this selected colour as the thumbnail background colour.'
              ))
        thumb_fixed_bg_button.connect('toggled', self._check_button_cb,
                                      'color box thumb bg')
        thumb_bg_color_button = gtk.ColorButton(
            gtk.gdk.Color(*prefs['thumb bg colour']))
        thumb_bg_color_button.connect('color_set', self._color_button_cb,
                                      'thumb bg colour')

        page.add_row(thumb_fixed_bg_button, thumb_bg_color_button)

        thumb_dynamic_bg_button = gtk.RadioButton(
            thumb_fixed_bg_button, _('Use dynamic background colour'))
        thumb_dynamic_bg_button.set_active(prefs['smart thumb bg'])
        thumb_dynamic_bg_button.set_tooltip_text(
            _('Automatically use the colour that fits the viewed image for the thumbnail background.'
              ))
        thumb_dynamic_bg_button.connect('toggled', self._check_button_cb,
                                        'smart thumb bg')

        page.add_row(thumb_dynamic_bg_button)

        thumb_number_button = gtk.CheckButton(
            _('Show page numbers on thumbnails'))
        thumb_number_button.set_active(
            prefs['show page numbers on thumbnails'])
        thumb_number_button.connect('toggled', self._check_button_cb,
                                    'show page numbers on thumbnails')
        page.add_row(thumb_number_button)

        thumb_as_preview_icon = gtk.CheckButton(
            _('Use archive thumbnail as application icon'))
        thumb_as_preview_icon.set_tooltip_text(
            _('By enabling this setting, the first page of a book will be used as application icon instead of the standard icon.'
              ))
        thumb_as_preview_icon.set_active(prefs['archive thumbnail as icon'])
        thumb_as_preview_icon.connect('toggled', self._check_button_cb,
                                      'archive thumbnail as icon')
        page.add_row(thumb_as_preview_icon)

        label = gtk.Label(_('Thumbnail size (in pixels):'))
        adjustment = gtk.Adjustment(prefs['thumbnail size'], 20, 500, 1, 10)
        thumb_size_spinner = gtk.SpinButton(adjustment)
        thumb_size_spinner.connect('value_changed', self._spinner_cb,
                                   'thumbnail size')
        page.add_row(label, thumb_size_spinner)

        page.new_section(_('Transparency'))
        checkered_bg_button = gtk.CheckButton(
            _('Use checkered background for transparent images'))
        checkered_bg_button.set_active(
            prefs['checkered bg for transparent images'])
        checkered_bg_button.connect('toggled', self._check_button_cb,
                                    'checkered bg for transparent images')
        checkered_bg_button.set_tooltip_text(
            _('Use a grey checkered background for transparent images. If this preference is unset, the background is plain white instead.'
              ))
        page.add_row(checkered_bg_button)

        return page
コード例 #21
0
ファイル: preferences_dialog.py プロジェクト: brambg/mcomix
    def _init_display_tab(self):
        # ----------------------------------------------------------------
        # The "Display" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)
        page.new_section(_('Fullscreen'))

        fullscreen_button = gtk.CheckButton(_('Use fullscreen by default'))
        fullscreen_button.set_active(prefs['default fullscreen'])
        fullscreen_button.connect('toggled', self._check_button_cb,
            'default fullscreen')
        page.add_row(fullscreen_button)

        hide_in_fullscreen_button = gtk.CheckButton(
            _('Automatically hide all toolbars in fullscreen'))
        hide_in_fullscreen_button.set_active(prefs['hide all in fullscreen'])
        hide_in_fullscreen_button.connect('toggled', self._check_button_cb,
            'hide all in fullscreen')
        page.add_row(hide_in_fullscreen_button)

        page.new_section(_('Slideshow'))
        label = gtk.Label(_('Slideshow delay (in seconds):'))
        adjustment = gtk.Adjustment(prefs['slideshow delay'] / 1000.0,
            0.01, 3600.0, 0.1, 1)
        delay_spinner = gtk.SpinButton(adjustment, digits=2)
        delay_spinner.set_size_request(80, -1)
        delay_spinner.connect('value_changed', self._spinner_cb,
            'slideshow delay')
        page.add_row(label, delay_spinner)

        label = gtk.Label(_('Slideshow step (in pixels):'))
        adjustment = gtk.Adjustment(prefs['number of pixels to scroll per slideshow event'],
            -500, 500, 1, 1)
        slideshow_step_spinner = gtk.SpinButton(adjustment, digits=0)
        slideshow_step_spinner.set_size_request(80, -1)
        slideshow_step_spinner.connect('value_changed', self._spinner_cb,
            'number of pixels to scroll per slideshow event')
        slideshow_step_spinner.set_tooltip_text(
            _('Specify the number of pixels to scroll while in slideshow mode. A positive value will scroll forward, a negative value will scroll backwards, and a value of 0 will cause the slideshow to always flip to a new page.'))
        page.add_row(label, slideshow_step_spinner)

        slideshow_auto_open_button = gtk.CheckButton(
            _('During a slideshow automatically open the next archive'))
        slideshow_auto_open_button.set_active(prefs['slideshow can go to next archive'])
        slideshow_auto_open_button.connect('toggled', self._check_button_cb,
            'slideshow can go to next archive')
        slideshow_auto_open_button.set_tooltip_text(
            _('While in slideshow mode allow the next archive to automatically be opened.'))
        page.add_row(slideshow_auto_open_button)

        page.new_section(_('Rotation'))
        auto_rotate_button = gtk.CheckButton(
            _('Automatically rotate images according to their metadata'))
        auto_rotate_button.set_active(prefs['auto rotate from exif'])
        auto_rotate_button.connect('toggled', self._check_button_cb,
            'auto rotate from exif')
        auto_rotate_button.set_tooltip_text(
            _('Automatically rotate images when an orientation is specified in the image metadata, such as in an Exif tag.'))
        page.add_row(auto_rotate_button)

        return page
コード例 #22
0
    def _init_advanced_tab(self):
        # ----------------------------------------------------------------
        # The "Advanced" tab.
        # ----------------------------------------------------------------

        page = preferences_page._PreferencePage(None)

        page.new_section(_('File order'))

        page.add_row(Gtk.Label(label=_('Sort files and directories by:')),
                     self._create_sort_by_control())

        page.add_row(Gtk.Label(label=_('Sort archives by:')),
                     self._create_archive_sort_by_control())

        page.new_section(_('File detection'))

        page.add_row(
            self._create_pref_check_button(
                _('Detect image file(s) by mimetypes'), 'check image mimetype',
                _('Detect image file(s) by mimetypes.')))

        page.add_row(
            self._create_pref_check_button(
                _('Try loading FLIF file(s) (restart required)'),
                'try FLIF support',
                _('Try loading FLIF files if flif_dec or flif library is found in system.\n'
                  'Since the official reference is still not stable, mcomix may failed to load FLIF even if library found.'
                  )))

        page.new_section(_('Extraction and cache'))

        page.add_row(
            Gtk.Label(
                label=_('Maximum number of concurrent extraction threads:')),
            self._create_pref_spinner(
                'max extract threads', 1, 0, constants.CPU_COUNT, 1, 4, 0,
                _('Set the maximum number of concurrent threads for formats that support it (0 to use all available cores).'
                  )))

        page.add_row(
            self._create_pref_check_button(
                _('Store thumbnails for opened files'), 'create thumbnails',
                _('Store thumbnails for opened files according to the freedesktop.org specification. These thumbnails are shared by many other applications, such as most file managers.'
                  )))

        page.add_row(
            Gtk.Label(label=_('Temporary directory (restart required)')),
            self._create_pref_path_chooser('temporary directory',
                                           folder=True,
                                           default=None))

        page.add_row(
            Gtk.Label(
                label=_('Maximum number of pages to store in the cache:')),
            self._create_pref_spinner(
                'max pages to cache', 1, -1, 500, 1, 3, 0,
                _('Set the max number of pages to cache. A value of -1 will cache the entire archive.'
                  )))

        if sys.platform == 'linux':
            page.add_row(
                self._create_pref_check_button(
                    _('Mount tar and squashfs.'), 'mount',
                    _('Mount tar and squashfs by using archivemount or squashfuse.'
                      )))

        page.new_section(_('Magnifying Lens'))

        page.add_row(
            Gtk.Label(label=_('Magnifying lens size (in pixels):')),
            self._create_pref_spinner(
                'lens size', 1, 50, 400, 1, 10, 0,
                _('Set the size of the magnifying lens. It is a square with a side of this many pixels.'
                  )))

        page.add_row(
            Gtk.Label(label=_('Magnification factor:')),
            self._create_pref_spinner(
                'lens magnification', 1, 1.1, 10.0, 0.1, 1.0, 1,
                _('Set the magnification factor of the magnifying lens.')))

        page.new_section(_('Comments'))

        page.add_row(Gtk.Label(label=_('Comment extensions:')),
                     self._create_extensions_entry())

        return page
コード例 #23
0
ファイル: preferences_dialog.py プロジェクト: brambg/mcomix
    def _init_appearance_tab(self):
        # ----------------------------------------------------------------
        # The "Appearance" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(80)
        page.new_section(_('Background'))

        fixed_bg_button = gtk.RadioButton(None,
            _('Use this colour as background:'))
        fixed_bg_button.set_tooltip_text(
            _('Always use this selected colour as the background colour.'))
        fixed_bg_button.connect('toggled', self._check_button_cb, 'color box bg')
        bg_color_button = gtk.ColorButton(gtk.gdk.Color(*prefs['bg colour']))
        bg_color_button.connect('color_set', self._color_button_cb, 'bg colour')

        page.add_row(fixed_bg_button, bg_color_button)

        dynamic_bg_button = gtk.RadioButton(fixed_bg_button,
            _('Use dynamic background colour'))
        dynamic_bg_button.set_active(prefs['smart bg'])
        dynamic_bg_button.connect('toggled', self._check_button_cb, 'smart bg')
        dynamic_bg_button.set_tooltip_text(
            _('Automatically pick a background colour that fits the viewed image.'))

        page.add_row(dynamic_bg_button)

        page.new_section(_('Thumbnails'))

        thumb_fixed_bg_button = gtk.RadioButton(None,
            _('Use this colour as the thumbnail background:'))
        thumb_fixed_bg_button.set_tooltip_text(
            _('Always use this selected colour as the thumbnail background colour.'))
        thumb_fixed_bg_button.connect('toggled', self._check_button_cb, 'color box thumb bg')
        thumb_bg_color_button = gtk.ColorButton(gtk.gdk.Color(*prefs['thumb bg colour']))
        thumb_bg_color_button.connect('color_set', self._color_button_cb, 'thumb bg colour')

        page.add_row(thumb_fixed_bg_button, thumb_bg_color_button)

        thumb_dynamic_bg_button = gtk.RadioButton(thumb_fixed_bg_button,
            _('Use dynamic background colour'))
        thumb_dynamic_bg_button.set_active(prefs['smart thumb bg'])
        thumb_dynamic_bg_button.set_tooltip_text(
            _('Automatically use the colour that fits the viewed image for the thumbnail background.'))
        thumb_dynamic_bg_button.connect('toggled', self._check_button_cb, 'smart thumb bg')

        page.add_row(thumb_dynamic_bg_button)

        thumb_number_button = gtk.CheckButton(
            _('Show page numbers on thumbnails'))
        thumb_number_button.set_active(
            prefs['show page numbers on thumbnails'])
        thumb_number_button.connect('toggled', self._check_button_cb,
            'show page numbers on thumbnails')
        page.add_row(thumb_number_button)

        thumb_as_preview_icon = gtk.CheckButton(
            _('Use archive thumbnail as application icon'))
        thumb_as_preview_icon.set_tooltip_text(
            _('By enabling this setting, the first page of a book will be used as application icon instead of the standard icon.'))
        thumb_as_preview_icon.set_active(
            prefs['archive thumbnail as icon'])
        thumb_as_preview_icon.connect('toggled', self._check_button_cb,
            'archive thumbnail as icon')
        page.add_row(thumb_as_preview_icon)

        label = gtk.Label(_('Thumbnail size (in pixels):'))
        adjustment = gtk.Adjustment(prefs['thumbnail size'], 20, 500, 1, 10)
        thumb_size_spinner = gtk.SpinButton(adjustment)
        thumb_size_spinner.connect('value_changed', self._spinner_cb,
            'thumbnail size')
        page.add_row(label, thumb_size_spinner)

        page.new_section(_('Transparency'))
        checkered_bg_button = gtk.CheckButton(
            _('Use checkered background for transparent images'))
        checkered_bg_button.set_active(
            prefs['checkered bg for transparent images'])
        checkered_bg_button.connect('toggled', self._check_button_cb,
            'checkered bg for transparent images')
        checkered_bg_button.set_tooltip_text(
            _('Use a grey checkered background for transparent images. If this preference is unset, the background is plain white instead.'))
        page.add_row(checkered_bg_button)

        return page
コード例 #24
0
    def _init_appearance_tab(self):
        # ----------------------------------------------------------------
        # The "Appearance" tab.
        # ----------------------------------------------------------------
        page = preferences_page._PreferencePage(None)

        page.new_section(_('User interface'))

        page.add_row(Gtk.Label(label=_('Language (needs restart):')),
                     self._create_language_control())

        page.add_row(
            self._create_pref_check_button(
                _('Escape key closes program'), 'escape quits',
                _('When active, the ESC key closes the program, instead of only '
                  'disabling fullscreen mode.')))

        page.add_row(Gtk.Label(label=_('User theme')),
                     self._create_pref_path_chooser('userstyle', default=None))

        page.new_section(_('Background'))

        fixed_bg_button, dynamic_bg_button = self._create_binary_pref_radio_buttons(
            _('Use this colour as background:'), 'color box bg',
            _('Always use this selected colour as the background colour.'),
            _('Use dynamic background colour'), 'smart bg',
            _('Automatically pick a background colour that fits the viewed image.'
              ))
        page.add_row(fixed_bg_button, self._create_color_button('bg colour'))
        page.add_row(dynamic_bg_button)

        page.new_section(_('Thumbnails'))

        thumb_fixed_bg_button, thumb_dynamic_bg_button = self._create_binary_pref_radio_buttons(
            'Use this colour as the thumbnail background:',
            'color box thumb bg',
            _('Always use this selected colour as the thumbnail background colour.'
              ), 'Use dynamic background colour', 'smart thumb bg',
            _('Automatically use the colour that fits the viewed image for the thumbnail background.'
              ))
        page.add_row(thumb_fixed_bg_button,
                     self._create_color_button('thumb bg colour'))
        page.add_row(thumb_dynamic_bg_button)

        page.add_row(
            self._create_pref_check_button(
                _('Show page numbers on thumbnails'),
                'show page numbers on thumbnails', None))

        page.add_row(
            self._create_pref_check_button(
                _('Use archive thumbnail as application icon'),
                'archive thumbnail as icon',
                _('By enabling this setting, the first page of a book will be used as application icon instead of the standard icon.'
                  )))

        page.add_row(
            Gtk.Label(label=_('Thumbnail size (in pixels):')),
            self._create_pref_spinner('thumbnail size', 1, 20, 500, 1, 10, 0,
                                      None))

        page.add_row(
            Gtk.Label(label=_('Maximum number of thumbnail threads:')),
            self._create_pref_spinner(
                'max thumbnail threads', 1, 0, constants.CPU_COUNT, 1, 4, 0,
                _('Set the maximum number of thumbnail generation threads (0 to use all available cores).'
                  )))

        page.new_section(_('Transparency'))

        page.add_row(
            self._create_pref_check_button(
                _('Use checkered background for transparent images'),
                'checkered bg for transparent images',
                _('Use a grey checkered background for transparent images. If this preference is unset, the background is plain white instead.'
                  )))

        return page