Make the SGDB row insensitive if no API key
This commit is contained in:
@@ -234,7 +234,7 @@ template $PreferencesWindow : Adw.PreferencesWindow {
|
|||||||
Adw.PreferencesGroup sgdb_behavior_group {
|
Adw.PreferencesGroup sgdb_behavior_group {
|
||||||
title: _("Behavior");
|
title: _("Behavior");
|
||||||
|
|
||||||
Adw.ActionRow {
|
Adw.ActionRow sgdb_switch_row {
|
||||||
title: _("Use SteamGridDB");
|
title: _("Use SteamGridDB");
|
||||||
subtitle: _("Download images when adding or importing games");
|
subtitle: _("Download images when adding or importing games");
|
||||||
activatable-widget: sgdb_switch;
|
activatable-widget: sgdb_switch;
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
|||||||
sgdb_key_group = Gtk.Template.Child()
|
sgdb_key_group = Gtk.Template.Child()
|
||||||
sgdb_key_entry_row = Gtk.Template.Child()
|
sgdb_key_entry_row = Gtk.Template.Child()
|
||||||
sgdb_switch = Gtk.Template.Child()
|
sgdb_switch = Gtk.Template.Child()
|
||||||
|
sgdb_switch_row = Gtk.Template.Child()
|
||||||
sgdb_prefer_switch = Gtk.Template.Child()
|
sgdb_prefer_switch = Gtk.Template.Child()
|
||||||
sgdb_animated_switch = Gtk.Template.Child()
|
sgdb_animated_switch = Gtk.Template.Child()
|
||||||
|
|
||||||
@@ -188,6 +189,15 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def set_sgdb_sensitive(widget):
|
||||||
|
if not widget.get_text():
|
||||||
|
self.sgdb_switch.set_active(False)
|
||||||
|
|
||||||
|
self.sgdb_switch_row.set_sensitive(widget.get_text())
|
||||||
|
|
||||||
|
self.sgdb_key_entry_row.connect("changed", set_sgdb_sensitive)
|
||||||
|
set_sgdb_sensitive(self.sgdb_key_entry_row)
|
||||||
|
|
||||||
# Switches
|
# Switches
|
||||||
self.bind_switches(
|
self.bind_switches(
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user