SteamGridDB cleanups
This commit is contained in:
@@ -210,7 +210,6 @@ template PreferencesWindow : Adw.PreferencesWindow {
|
|||||||
|
|
||||||
Adw.PreferencesGroup sgdb_key_group {
|
Adw.PreferencesGroup sgdb_key_group {
|
||||||
title: _("Authentication");
|
title: _("Authentication");
|
||||||
description: _("An API Key is required to use SteamGridDB. You can generate one <a href=\"https://www.steamgriddb.com/profile/preferences/api\">here</a>.");
|
|
||||||
|
|
||||||
Adw.EntryRow sgdb_key_entry_row {
|
Adw.EntryRow sgdb_key_entry_row {
|
||||||
title: _("API Key");
|
title: _("API Key");
|
||||||
@@ -221,7 +220,7 @@ template PreferencesWindow : Adw.PreferencesWindow {
|
|||||||
title: _("Behavior");
|
title: _("Behavior");
|
||||||
|
|
||||||
Adw.ActionRow {
|
Adw.ActionRow {
|
||||||
title: _("Download Images Automatically");
|
title: _("Use SteamGridDB");
|
||||||
subtitle: _("Download images when adding or importing games");
|
subtitle: _("Download images when adding or importing games");
|
||||||
|
|
||||||
Switch sgdb_download_switch {
|
Switch sgdb_download_switch {
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
<key name="sgdb-key" type="s">
|
<key name="sgdb-key" type="s">
|
||||||
<default>""</default>
|
<default>""</default>
|
||||||
</key>
|
</key>
|
||||||
<key name="sgdb-import" type="b">
|
<key name="sgdb" type="b">
|
||||||
<default>false</default>
|
<default>false</default>
|
||||||
</key>
|
</key>
|
||||||
<key name="sgdb-prefer" type="b">
|
<key name="sgdb-prefer" type="b">
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
|||||||
itch_expander_row = Gtk.Template.Child()
|
itch_expander_row = Gtk.Template.Child()
|
||||||
itch_file_chooser_button = Gtk.Template.Child()
|
itch_file_chooser_button = Gtk.Template.Child()
|
||||||
|
|
||||||
|
sgdb_key_group = Gtk.Template.Child()
|
||||||
sgdb_key_entry_row = Gtk.Template.Child()
|
sgdb_key_entry_row = Gtk.Template.Child()
|
||||||
sgdb_download_switch = Gtk.Template.Child()
|
sgdb_download_switch = Gtk.Template.Child()
|
||||||
sgdb_prefer_switch = Gtk.Template.Child()
|
sgdb_prefer_switch = Gtk.Template.Child()
|
||||||
@@ -303,7 +304,7 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
|||||||
|
|
||||||
# SteamGridDB
|
# SteamGridDB
|
||||||
self.schema.bind(
|
self.schema.bind(
|
||||||
"sgdb-import",
|
"sgdb",
|
||||||
self.sgdb_download_switch,
|
self.sgdb_download_switch,
|
||||||
"active",
|
"active",
|
||||||
Gio.SettingsBindFlags.DEFAULT,
|
Gio.SettingsBindFlags.DEFAULT,
|
||||||
@@ -322,6 +323,14 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
|||||||
self.sgdb_key_entry_row.set_text(self.schema.get_string("sgdb-key"))
|
self.sgdb_key_entry_row.set_text(self.schema.get_string("sgdb-key"))
|
||||||
self.sgdb_key_entry_row.connect("changed", sgdb_key_changed)
|
self.sgdb_key_entry_row.connect("changed", sgdb_key_changed)
|
||||||
|
|
||||||
|
self.sgdb_key_group.set_description(
|
||||||
|
_(
|
||||||
|
"An API Key is required to use SteamGridDB. You can generate one {}here{}."
|
||||||
|
).format(
|
||||||
|
'<a href="https://www.steamgriddb.com/profile/preferences/api">', "</a>"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
def choose_folder(self, _widget, function):
|
def choose_folder(self, _widget, function):
|
||||||
self.file_chooser.select_folder(self.parent_widget, None, function, None)
|
self.file_chooser.select_folder(self.parent_widget, None, function, None)
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ class SGDBSave:
|
|||||||
Gio.Task.new(None, None, self.task_done).run_in_thread(create_func(game))
|
Gio.Task.new(None, None, self.task_done).run_in_thread(create_func(game))
|
||||||
|
|
||||||
def update_cover(self, task, game):
|
def update_cover(self, task, game):
|
||||||
if self.parent_widget.schema.get_boolean("sgdb-prefer") or (
|
if self.parent_widget.schema.get_boolean("sgdb") and (
|
||||||
self.parent_widget.schema.get_boolean("sgdb-import")
|
self.parent_widget.schema.get_boolean("sgdb-prefer")
|
||||||
and not (
|
or not (
|
||||||
self.parent_widget.data_dir
|
self.parent_widget.data_dir
|
||||||
/ "cartridges"
|
/ "cartridges"
|
||||||
/ "covers"
|
/ "covers"
|
||||||
|
|||||||
Reference in New Issue
Block a user