fix: user-facing Steam client name not available until Options populated

The old method was checking the active ComboBox string after the Options
page was initialized, but before it was actually populated with the real
setting. This caused it to always return the string 'Steam' instead of
the actual client name.
This commit is contained in:
aclist committed 2026-10-09 04:03:17 +09:00
1 parent 7fc1264b65
commit 8c44a6e255
4 files changed
+14 -8

No files matched your search

+2 -2
View File
@@ -541,8 +541,8 @@ class Controller(GObject.GObject):
def update_status(self) -> None:
self.mediator.preconnect.mark_finished()
def get_steam_client_name(self) -> str:
return self.mediator.options.get_client_name()
def get_steam_client_name(self, cmd: str) -> str:
return self.mediator.options.get_client_name(cmd)
def present_window(self) -> None:
self.mediator.window.present_with_time(Gdk.CURRENT_TIME)
+1 -1
View File
@@ -184,8 +184,8 @@ class ConnectionManager:
else:
allows_downloads = (True, "")
client_name = self.controller.get_steam_client_name()
client = self.controller.query_config(Preferences.CLIENT)
client_name = self.controller.get_steam_client_name(client)
running = is_steam_running(client)
steam_proc = SteamProcess(client_name, running)
self.client = client
+9 -2
View File
@@ -15,7 +15,7 @@ class ClientCombo(Gtk.ComboBox):
super().__init__()
self.client_store = Gtk.ListStore(str, str)
clients = (
self.clients = (
(
options.steam_combo,
STEAM_CMD,
@@ -29,7 +29,7 @@ class ClientCombo(Gtk.ComboBox):
FLATPAK_SANDBOX,
),
)
for client in clients:
for client in self.clients:
self.client_store.append(client)
self.set_model(self.client_store)
renderer_text = Gtk.CellRendererText()
@@ -37,6 +37,13 @@ class ClientCombo(Gtk.ComboBox):
self.add_attribute(renderer_text, "text", 0)
self.set_active(0)
def get_client_human_readable(self, cmd: str) -> str:
for client in self.clients:
human, command = client
if command == cmd:
return human
raise TypeError("Not a valid Steam client selection")
class ErrorPopover(Gtk.Popover):
def __init__(self, relative_to: Gtk.Widget, position: Gtk.PositionType) -> None:
super().__init__(relative_to=relative_to, position=position)
+2 -3
View File
@@ -371,10 +371,9 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
self.connect("key-press-event", self._on_keypress)
def get_client_name(self) -> str:
def get_client_name(self, cmd: str) -> str:
model = self.client_combo.get_model()
ind = self.client_combo.get_active()
return str(model[ind][0])
return self.client_combo.get_client_human_readable(cmd)
def block_text_entry(self) -> None:
self.steam_box.block_text_entry()