示例#1
0
文件: about.py 项目: mxlcpu/nfoview
 def __init__(self, parent):
     GObject.GObject.__init__(self)
     self.set_title(_("About NFO Viewer"))
     self.set_transient_for(parent)
     self.set_authors(("Osmo Salomaa <*****@*****.**>", ))
     self.set_comments(_("Viewer for NFO files"))
     self.set_copyright("Copyright © 2005–2020 Osmo Salomaa")
     self.set_license_type(Gtk.License.GPL_3_0)
     self.set_logo_icon_name("io.otsaloma.nfoview")
     # TRANSLATORS: The application name "NFO Viewer" has been intentionally
     # marked as translatable. If you manage to translate the name in a
     # fluent manner, without changing the meaning, you may use that
     # translation at your discretion.
     self.set_program_name(_("NFO Viewer"))
     # TRANSLATORS: This is a special message that shouldn't be translated
     # literally. It is used in the about dialog to give credits to the
     # translators. Thus, you should translate it to your name and email
     # address. You can also include other translators who have contributed
     # to this translation; in that case, please write them on separate
     # lines seperated by newlines (\n).
     self.set_translator_credits(_("translator-credits"))
     self.set_version(nfoview.__version__)
     self.set_website("https://otsaloma.io/nfoview/")
     self.set_website_label(_("NFO Viewer Website"))
     self.set_wrap_license(True)
示例#2
0
 def __init__(self, parent):
     """Initialize an :class:`AboutDialog` instance."""
     GObject.GObject.__init__(self)
     self.set_title(_("About NFO Viewer"))
     self.set_transient_for(parent)
     self.set_authors(("Osmo Salomaa <*****@*****.**>",))
     self.set_comments(_("Viewer for NFO files"))
     self.set_copyright("Copyright © 2005–2016 Osmo Salomaa")
     self.set_license_type(Gtk.License.GPL_3_0)
     self.set_logo_icon_name("nfoview")
     # TRANSLATORS: The application name "NFO Viewer" has been intentionally
     # marked as translatable. If you manage to translate the name in a
     # fluent manner, without changing the meaning, you may use that
     # translation at your discretion.
     self.set_program_name(_("NFO Viewer"))
     # TRANSLATORS: This is a special message that shouldn't be translated
     # literally. It is used in the about dialog to give credits to the
     # translators. Thus, you should translate it to your name and email
     # address. You can also include other translators who have contributed
     # to this translation; in that case, please write them on separate
     # lines seperated by newlines (\n).
     self.set_translator_credits(_("translator-credits"))
     self.set_version(nfoview.__version__)
     self.set_website("http://otsaloma.io/nfoview/")
     self.set_website_label(_("NFO Viewer Website"))
     self.set_wrap_license(True)
示例#3
0
文件: export.py 项目: xoan/nfoview
 def __init__(self, parent):
     """Initialize an :class:`ExportImageDialog` instance."""
     GObject.GObject.__init__(self)
     self.set_title(_("Export Image"))
     self.set_transient_for(parent)
     self.set_action(Gtk.FileChooserAction.SAVE)
     self.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
     self.add_button(_("_Save"), Gtk.ResponseType.OK)
     self.set_do_overwrite_confirmation(True)
     self.set_select_multiple(False)
     self.set_default_response(Gtk.ResponseType.OK)
示例#4
0
 def __init__(self, parent):
     """Initialize an :class:`ExportImageDialog` instance."""
     GObject.GObject.__init__(self)
     self.set_title(_("Export Image"))
     self.set_transient_for(parent)
     self.set_action(Gtk.FileChooserAction.SAVE)
     self.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
     self.add_button(_("_Save"), Gtk.ResponseType.OK)
     self.set_do_overwrite_confirmation(True)
     self.set_select_multiple(False)
     self.set_default_response(Gtk.ResponseType.OK)
示例#5
0
 def __init__(self, parent):
     GObject.GObject.__init__(self)
     self.set_title(_("Export Image"))
     self.set_transient_for(parent)
     self.set_action(Gtk.FileChooserAction.SAVE)
     if Base is Gtk.FileChooserNative:
         self.set_cancel_label(_("_Cancel"))
         self.set_accept_label(_("_Save"))
     if Base is Gtk.FileChooserDialog:
         self.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
         self.add_button(_("_Save"), Gtk.ResponseType.OK)
         self.set_default_response(Gtk.ResponseType.OK)
     self.set_do_overwrite_confirmation(True)
     self.set_select_multiple(False)
示例#6
0
 def __init__(self, parent):
     GObject.GObject.__init__(self)
     self.set_title(_("Export Image"))
     self.set_transient_for(parent)
     self.set_action(Gtk.FileChooserAction.SAVE)
     if Base is Gtk.FileChooserNative:
         self.set_cancel_label(_("_Cancel"))
         self.set_accept_label(_("_Save"))
     if Base is Gtk.FileChooserDialog:
         self.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
         self.add_button(_("_Save"), Gtk.ResponseType.OK)
         self.set_default_response(Gtk.ResponseType.OK)
     self.set_do_overwrite_confirmation(True)
     self.set_select_multiple(False)
示例#7
0
class LightGreyOnDarkGray(ColorScheme):

    name         = "light-grey-on-dark-grey"
    label        = _("Light grey on dark grey")
    foreground   = "#f2f2f2"
    background   = "#666666"
    link         = "#aaaaff"
    visited_link = "#ffaaff"
示例#8
0
class DarkGreyOnLightGray(ColorScheme):

    name         = "dark-grey-on-light-grey"
    label        = _("Dark grey on light grey")
    foreground   = "#666666"
    background   = "#f2f2f2"
    link         = "#5555ff"
    visited_link = "#ff55ff"
示例#9
0
class Custom(ColorScheme):

    name         = "custom"
    label        = _("Custom")
    foreground   = nfoview.conf.foreground_color
    background   = nfoview.conf.background_color
    link         = nfoview.conf.link_color
    visited_link = nfoview.conf.visited_link_color
示例#10
0
class BlackOnWhite(ColorScheme):

    name         = "black-on-white"
    label        = _("Black on white")
    foreground   = "#000000"
    background   = "#ffffff"
    link         = "#0000ff"
    visited_link = "#ff00ff"
示例#11
0
class WhiteOnBlack(ColorScheme):

    name         = "white-on-black"
    label        = _("White on black")
    foreground   = "#ffffff"
    background   = "#000000"
    link         = "#aaaaff"
    visited_link = "#ffaaff"
示例#12
0
class GreyOnBlack(ColorScheme):

    name         = "grey-on-black"
    label        = _("Grey on black")
    foreground   = "#aaaaaa"
    background   = "#000000"
    link         = "#aaaaff"
    visited_link = "#ffaaff"
示例#13
0
文件: schemes.py 项目: xoan/nfoview
class WhiteOnBlack(ColorScheme):
    """Color scheme with white text on black background."""

    name = "white-on-black"
    label = _("White on black")
    foreground = "#ffffff"
    background = "#000000"
    link = "#aaaaff"
    visited_link = "#ffaaff"
示例#14
0
文件: schemes.py 项目: xoan/nfoview
class BlackOnWhite(ColorScheme):
    """Color scheme with black text on white background."""

    name = "black-on-white"
    label = _("Black on white")
    foreground = "#000000"
    background = "#ffffff"
    link = "#0000ff"
    visited_link = "#ff00ff"
示例#15
0
文件: schemes.py 项目: xoan/nfoview
class Custom(ColorScheme):
    """Color scheme with custom, user-chosen colors."""

    name = "custom"
    label = _("Custom")
    foreground = nfoview.conf.foreground_color
    background = nfoview.conf.background_color
    link = nfoview.conf.link_color
    visited_link = nfoview.conf.visited_link_color
示例#16
0
文件: schemes.py 项目: xoan/nfoview
class GreyOnBlack(ColorScheme):
    """Color scheme with grey text on black background."""

    name = "grey-on-black"
    label = _("Grey on black")
    foreground = "#aaaaaa"
    background = "#000000"
    link = "#aaaaff"
    visited_link = "#ffaaff"
示例#17
0
文件: open.py 项目: xoan/nfoview
 def __init__(self, parent):
     """Initialize an :class:`OpenDialog` instance."""
     GObject.GObject.__init__(self)
     self.set_title(_("Open"))
     self.set_transient_for(parent)
     self.set_action(Gtk.FileChooserAction.OPEN)
     self.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
     self.add_button(_("_Open"), Gtk.ResponseType.OK)
     self.set_select_multiple(True)
     self.set_default_response(Gtk.ResponseType.OK)
     file_filter = Gtk.FileFilter()
     file_filter.set_name(_("All files"))
     file_filter.add_pattern("*")
     self.add_filter(file_filter)
     file_filter = Gtk.FileFilter()
     file_filter.set_name(_("NFO files (*.nfo)"))
     file_filter.add_pattern("*.[Nn][Ff][Oo]")
     self.add_filter(file_filter)
     self.set_filter(file_filter)
示例#18
0
 def __init__(self, parent):
     """Initialize an :class:`OpenDialog` instance."""
     GObject.GObject.__init__(self)
     self.set_title(_("Open"))
     self.set_transient_for(parent)
     self.set_action(Gtk.FileChooserAction.OPEN)
     self.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
     self.add_button(_("_Open"), Gtk.ResponseType.OK)
     self.set_select_multiple(True)
     self.set_default_response(Gtk.ResponseType.OK)
     file_filter = Gtk.FileFilter()
     file_filter.set_name(_("All files"))
     file_filter.add_pattern("*")
     self.add_filter(file_filter)
     file_filter = Gtk.FileFilter()
     file_filter.set_name(_("NFO files (*.nfo)"))
     file_filter.add_pattern("*.[Nn][Ff][Oo]")
     self.add_filter(file_filter)
     self.set_filter(file_filter)
示例#19
0
class Default(ColorScheme):

    # https://gitlab.gnome.org/GNOME/gtk/blob/master/gtk/theme/Adwaita/_colors-public.scss
    # https://gitlab.gnome.org/GNOME/gtk/blob/master/gtk/theme/Adwaita/gtk-contained.css

    name         = "default"
    label        = _("System theme")
    foreground   = nfoview.util.lookup_color("theme_text_color", "#000000")
    background   = nfoview.util.lookup_color("theme_base_color", "#ffffff")
    link         = "#2a76c6"
    visited_link = "#215d9c"
示例#20
0
文件: schemes.py 项目: xoan/nfoview
class Default(ColorScheme):
    """Color scheme with system default colors."""

    # http://git.gnome.org/browse/gtk+/tree/gtk/theme/Adwaita/_colors-public.scss
    # http://git.gnome.org/browse/gtk+/tree/gtk/theme/Adwaita/gtk-contained.css

    name = "default"
    label = _("System theme")
    foreground = nfoview.util.lookup_color("theme_text_color", "#000000")
    background = nfoview.util.lookup_color("theme_base_color", "#ffffff")
    link = "#2a76c6"
    visited_link = "#215d9c"
示例#21
0
 def _init_titlebar(self):
     header = Gtk.HeaderBar()
     header.set_title(_("NFO Viewer"))
     header.set_show_close_button(True)
     menu_button = Gtk.MenuButton()
     menu_button.set_direction(Gtk.ArrowType.NONE)
     # Popover doesn't show keyboard shortcuts.
     menu_button.set_use_popover(False)
     path = os.path.join(nfoview.DATA_DIR, "menu.ui")
     builder = Gtk.Builder.new_from_file(path)
     menu = builder.get_object("menu")
     menu_button.set_menu_model(menu)
     header.pack_start(menu_button)
     header.show_all()
     self.set_titlebar(header)
示例#22
0
 def _init_titlebar(self):
     header = Gtk.HeaderBar()
     header.set_title(_("NFO Viewer"))
     header.set_show_close_button(True)
     menu_button = Gtk.MenuButton()
     menu_button.set_direction(Gtk.ArrowType.NONE)
     # Popover doesn't show keyboard shortcuts.
     menu_button.set_use_popover(False)
     path = os.path.join(nfoview.DATA_DIR, "menu.ui")
     builder = Gtk.Builder.new_from_file(path)
     menu = builder.get_object("menu")
     menu_button.set_menu_model(menu)
     header.pack_start(menu_button)
     header.show_all()
     self.set_titlebar(header)
示例#23
0
文件: open.py 项目: otsaloma/nfoview
 def __init__(self, parent):
     GObject.GObject.__init__(self)
     self.set_title(_("Open"))
     self.set_transient_for(parent)
     self.set_action(Gtk.FileChooserAction.OPEN)
     if Base is Gtk.FileChooserNative:
         self.set_cancel_label(_("_Cancel"))
         self.set_accept_label(_("_Open"))
     if Base is Gtk.FileChooserDialog:
         self.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
         self.add_button(_("_Open"), Gtk.ResponseType.OK)
         self.set_default_response(Gtk.ResponseType.OK)
     self.set_select_multiple(True)
     file_filter = Gtk.FileFilter()
     file_filter.set_name(_("All files"))
     file_filter.add_pattern("*")
     self.add_filter(file_filter)
     file_filter = Gtk.FileFilter()
     file_filter.set_name(_("NFO files (*.nfo)"))
     file_filter.add_pattern("*.[Nn][Ff][Oo]")
     self.add_filter(file_filter)
     self.set_filter(file_filter)
示例#24
0
文件: open.py 项目: otsaloma/nfoview
 def __init__(self, parent):
     GObject.GObject.__init__(self)
     self.set_title(_("Open"))
     self.set_transient_for(parent)
     self.set_action(Gtk.FileChooserAction.OPEN)
     if Base is Gtk.FileChooserNative:
         self.set_cancel_label(_("_Cancel"))
         self.set_accept_label(_("_Open"))
     if Base is Gtk.FileChooserDialog:
         self.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
         self.add_button(_("_Open"), Gtk.ResponseType.OK)
         self.set_default_response(Gtk.ResponseType.OK)
     self.set_select_multiple(True)
     file_filter = Gtk.FileFilter()
     file_filter.set_name(_("All files"))
     file_filter.add_pattern("*")
     self.add_filter(file_filter)
     file_filter = Gtk.FileFilter()
     file_filter.set_name(_("NFO files (*.nfo)"))
     file_filter.add_pattern("*.[Nn][Ff][Oo]")
     self.add_filter(file_filter)
     self.set_filter(file_filter)
示例#25
0
 def __init__(self, parent):
     """Initialize an :class:`AboutDialog` instance."""
     GObject.GObject.__init__(self)
     self.set_title(_("About NFO Viewer"))
     self.set_transient_for(parent)
     self.set_authors(("Osmo Salomaa <*****@*****.**>", ))
     self.set_comments(_("Viewer for NFO files"))
     self.set_copyright("Copyright © 2005–2017 Osmo Salomaa")
     self.set_license_type(Gtk.License.GPL_3_0)
     self.set_logo_icon_name("nfoview")
     # TRANSLATORS: The application name "NFO Viewer" has been intentionally
     # marked as translatable. If you manage to translate the name in a
     # fluent manner, without changing the meaning, you may use that
     # translation at your discretion.
     self.set_program_name(_("NFO Viewer"))
     # TRANSLATORS: This is a special message that shouldn't be translated
     # literally. It is used in the about dialog to give credits to the
     # translators. Thus, you should translate it to your name and email
     # address. You can also include other translators who have contributed
     # to this translation; in that case, please write them on separate
     # lines seperated by newlines (\n).
     self.set_translator_credits(_("translator-credits"))
     self.set_version(nfoview.__version__)
     self.set_website("https://otsaloma.io/nfoview/")
     self.set_website_label(_("NFO Viewer Website"))
     self.set_wrap_license(True)
     with nfoview.util.silent(Exception, tb=True):
         # Add donate button to the bottom of the dialog.
         # This can fail if the dialog structure changes.
         box = self.get_content_area()
         button = Gtk.LinkButton(label=_("Donate"))
         button.set_uri("https://www.paypal.me/otsaloma")
         button.show()
         box.pack_start(button, expand=False, fill=False, padding=0)
         header = self.get_header_bar()
         if header is not None:
             switcher = header.get_children()[0]
             switcher.get_children()[0].grab_focus()
示例#26
0
def _translate_labels():
    for scheme in list(map(globals().get, __all__)):
        if not hasattr(scheme, "untranslated_label"):
            scheme.untranslated_label = scheme.label
        scheme.label = _(scheme.untranslated_label)
示例#27
0
文件: schemes.py 项目: xoan/nfoview
def _translate_labels():
    """Translate all color scheme labels."""
    for scheme in list(map(globals().get, __all__)):
        if not hasattr(scheme, "untranslated_label"):
            scheme.untranslated_label = scheme.label
        scheme.label = _(scheme.untranslated_label)