Add option to save game covers losslessly
This commit is contained in:
@@ -6,7 +6,7 @@ template PreferencesWindow : Adw.PreferencesWindow {
|
|||||||
default-height: 500;
|
default-height: 500;
|
||||||
|
|
||||||
Adw.PreferencesPage page {
|
Adw.PreferencesPage page {
|
||||||
Adw.PreferencesGroup {
|
Adw.PreferencesGroup general_group {
|
||||||
title: _("General");
|
title: _("General");
|
||||||
|
|
||||||
Adw.ActionRow {
|
Adw.ActionRow {
|
||||||
@@ -16,6 +16,14 @@ template PreferencesWindow : Adw.PreferencesWindow {
|
|||||||
valign: center;
|
valign: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Adw.ActionRow {
|
||||||
|
title: _("High Quality Images");
|
||||||
|
subtitle: _("Save game covers losslessly at the cost of storage");
|
||||||
|
|
||||||
|
Switch high_quality_images_switch {
|
||||||
|
valign: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Adw.PreferencesGroup steam_group {
|
Adw.PreferencesGroup steam_group {
|
||||||
@@ -72,7 +80,7 @@ template PreferencesWindow : Adw.PreferencesWindow {
|
|||||||
Adw.ActionRow {
|
Adw.ActionRow {
|
||||||
title: _("Import Epic Games");
|
title: _("Import Epic Games");
|
||||||
|
|
||||||
Switch import_epic_games_switch {
|
Switch heroic_epic_switch {
|
||||||
valign: center;
|
valign: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,7 +88,7 @@ template PreferencesWindow : Adw.PreferencesWindow {
|
|||||||
Adw.ActionRow {
|
Adw.ActionRow {
|
||||||
title: _("Import GOG Games");
|
title: _("Import GOG Games");
|
||||||
|
|
||||||
Switch import_gog_games_switch {
|
Switch heroic_gog_switch {
|
||||||
valign: center;
|
valign: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,7 +96,7 @@ template PreferencesWindow : Adw.PreferencesWindow {
|
|||||||
Adw.ActionRow {
|
Adw.ActionRow {
|
||||||
title: _("Import Sideloaded Games");
|
title: _("Import Sideloaded Games");
|
||||||
|
|
||||||
Switch import_sideload_games_switch {
|
Switch heroic_sideloaded_switch {
|
||||||
valign: center;
|
valign: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
</key>
|
</key>
|
||||||
<key name="bottles-location" type="s">
|
<key name="bottles-location" type="s">
|
||||||
<default>"~/.var/app/com.usebottles.bottles/data/bottles/"</default>
|
<default>"~/.var/app/com.usebottles.bottles/data/bottles/"</default>
|
||||||
|
</key>
|
||||||
|
<key name="high-quality-images" type="b">
|
||||||
|
<default>false</default>
|
||||||
</key>
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
<schema id="hu.kramo.Cartridge.State" path="/hu/kramo/Cartridges/State/">
|
<schema id="hu.kramo.Cartridge.State" path="/hu/kramo/Cartridges/State/">
|
||||||
|
|||||||
@@ -27,20 +27,24 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
|||||||
__gtype_name__ = "PreferencesWindow"
|
__gtype_name__ = "PreferencesWindow"
|
||||||
|
|
||||||
page = Gtk.Template.Child()
|
page = Gtk.Template.Child()
|
||||||
bottles_group = Gtk.Template.Child()
|
|
||||||
|
|
||||||
exit_after_launch_switch = Gtk.Template.Child()
|
exit_after_launch_switch = Gtk.Template.Child()
|
||||||
import_epic_games_switch = Gtk.Template.Child()
|
|
||||||
import_gog_games_switch = Gtk.Template.Child()
|
|
||||||
import_sideload_games_switch = Gtk.Template.Child()
|
|
||||||
|
|
||||||
steam_file_chooser_button = Gtk.Template.Child()
|
steam_file_chooser_button = Gtk.Template.Child()
|
||||||
steam_extra_file_chooser_button = Gtk.Template.Child()
|
steam_extra_file_chooser_button = Gtk.Template.Child()
|
||||||
steam_clear_button = Gtk.Template.Child()
|
|
||||||
steam_clear_button_revealer = Gtk.Template.Child()
|
steam_clear_button_revealer = Gtk.Template.Child()
|
||||||
|
steam_clear_button = Gtk.Template.Child()
|
||||||
|
|
||||||
heroic_file_chooser_button = Gtk.Template.Child()
|
heroic_file_chooser_button = Gtk.Template.Child()
|
||||||
|
heroic_epic_switch = Gtk.Template.Child()
|
||||||
|
heroic_gog_switch = Gtk.Template.Child()
|
||||||
|
heroic_sideloaded_switch = Gtk.Template.Child()
|
||||||
|
|
||||||
|
bottles_group = Gtk.Template.Child()
|
||||||
bottles_file_chooser_button = Gtk.Template.Child()
|
bottles_file_chooser_button = Gtk.Template.Child()
|
||||||
|
|
||||||
|
high_quality_images_switch = Gtk.Template.Child()
|
||||||
|
|
||||||
def __init__(self, parent_widget, **kwargs):
|
def __init__(self, parent_widget, **kwargs):
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
@@ -54,19 +58,25 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
|||||||
)
|
)
|
||||||
schema.bind(
|
schema.bind(
|
||||||
"heroic-import-epic",
|
"heroic-import-epic",
|
||||||
self.import_epic_games_switch,
|
self.heroic_epic_switch,
|
||||||
"active",
|
"active",
|
||||||
Gio.SettingsBindFlags.DEFAULT,
|
Gio.SettingsBindFlags.DEFAULT,
|
||||||
)
|
)
|
||||||
schema.bind(
|
schema.bind(
|
||||||
"heroic-import-gog",
|
"heroic-import-gog",
|
||||||
self.import_gog_games_switch,
|
self.heroic_gog_switch,
|
||||||
"active",
|
"active",
|
||||||
Gio.SettingsBindFlags.DEFAULT,
|
Gio.SettingsBindFlags.DEFAULT,
|
||||||
)
|
)
|
||||||
schema.bind(
|
schema.bind(
|
||||||
"heroic-import-sideload",
|
"heroic-import-sideload",
|
||||||
self.import_sideload_games_switch,
|
self.heroic_sideloaded_switch,
|
||||||
|
"active",
|
||||||
|
Gio.SettingsBindFlags.DEFAULT,
|
||||||
|
)
|
||||||
|
schema.bind(
|
||||||
|
"high-quality-images",
|
||||||
|
self.high_quality_images_switch,
|
||||||
"active",
|
"active",
|
||||||
Gio.SettingsBindFlags.DEFAULT,
|
Gio.SettingsBindFlags.DEFAULT,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -48,6 +48,6 @@ def save_cover(game, parent_widget, file_path, pixbuf=None, game_id=None):
|
|||||||
open_file.replace(None, False, Gio.FileCreateFlags.NONE),
|
open_file.replace(None, False, Gio.FileCreateFlags.NONE),
|
||||||
"tiff",
|
"tiff",
|
||||||
["compression"],
|
["compression"],
|
||||||
["7"],
|
["8"] if parent_widget.schema.get_boolean("high-quality-images") else ["7"],
|
||||||
callback=cover_callback,
|
callback=cover_callback,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user