Updated the update system to support multi channels (stable / pre-release).
This commit is contained in:
@@ -36,6 +36,10 @@ PROTON_SYNC_LABELS: dict[str, str] = {
|
||||
"Fsync": "fsync",
|
||||
"Esync": "esync",
|
||||
}
|
||||
UPDATE_CHANNEL_LABELS: dict[str, str] = {
|
||||
"Stable — Recommended for normal use": "stable",
|
||||
"Prerelease — Beta and release candidate builds": "prerelease",
|
||||
}
|
||||
|
||||
SETTINGS_STACKED_LAYOUT_WIDTH = 720
|
||||
SETTINGS_STACKED_FOOTER_WIDTH = 640
|
||||
@@ -207,6 +211,9 @@ def open_settings_dialog(
|
||||
low_bandwidth_value = tk.BooleanVar(
|
||||
value=current_settings.low_bandwidth_mode
|
||||
)
|
||||
update_channel_value = tk.StringVar(
|
||||
value=setting_label(current_settings.update_channel, UPDATE_CHANNEL_LABELS)
|
||||
)
|
||||
|
||||
def add_choice(
|
||||
parent: ttk.LabelFrame,
|
||||
@@ -325,6 +332,10 @@ def open_settings_dialog(
|
||||
game_source=game_source_value.get().strip() or None,
|
||||
download_speed_limit_mbps=download_speed_limit,
|
||||
low_bandwidth_mode=low_bandwidth_value.get(),
|
||||
update_channel=setting_value(
|
||||
update_channel_value.get(),
|
||||
UPDATE_CHANNEL_LABELS,
|
||||
),
|
||||
)
|
||||
except (OSError, ValueError) as save_error:
|
||||
show_themed_dialog(
|
||||
@@ -526,6 +537,42 @@ def open_settings_dialog(
|
||||
)
|
||||
update_custom_download_state()
|
||||
|
||||
updates_card = ttk.LabelFrame(
|
||||
content,
|
||||
text="LAUNCHER UPDATES",
|
||||
style="SettingsCard.TLabelframe",
|
||||
padding=14,
|
||||
)
|
||||
updates_card.grid(
|
||||
row=2,
|
||||
column=0,
|
||||
columnspan=2,
|
||||
sticky="ew",
|
||||
pady=(12, 0),
|
||||
)
|
||||
updates_card.columnconfigure(0, weight=1)
|
||||
updates_card.columnconfigure(1, weight=1)
|
||||
add_choice(
|
||||
updates_card,
|
||||
0,
|
||||
"settings_selector_update_channel",
|
||||
"Update channel",
|
||||
"Existing installations default to Stable",
|
||||
update_channel_value,
|
||||
tuple(UPDATE_CHANNEL_LABELS),
|
||||
)
|
||||
updates_hint = ttk.Label(
|
||||
updates_card,
|
||||
text=(
|
||||
"Stable receives production releases. Prerelease also receives beta and "
|
||||
"release candidate builds. Returning to Stable never downgrades the "
|
||||
"installed launcher automatically."
|
||||
),
|
||||
style="SettingsHint.TLabel",
|
||||
wraplength=720,
|
||||
)
|
||||
updates_hint.grid(row=2, column=0, columnspan=2, sticky="w")
|
||||
|
||||
diagnostics_card = ttk.LabelFrame(
|
||||
content,
|
||||
text="PRIVACY & DIAGNOSTICS",
|
||||
@@ -533,7 +580,7 @@ def open_settings_dialog(
|
||||
padding=14,
|
||||
)
|
||||
diagnostics_card.grid(
|
||||
row=2,
|
||||
row=3,
|
||||
column=0,
|
||||
columnspan=2,
|
||||
sticky="ew",
|
||||
@@ -568,7 +615,7 @@ def open_settings_dialog(
|
||||
style="SettingsCard.TLabelframe",
|
||||
padding=14,
|
||||
)
|
||||
overrides_card.grid(row=3, column=0, columnspan=2, sticky="ew", pady=(12, 0))
|
||||
overrides_card.grid(row=4, column=0, columnspan=2, sticky="ew", pady=(12, 0))
|
||||
overrides_card.columnconfigure(0, weight=1)
|
||||
ttk.Label(
|
||||
overrides_card,
|
||||
@@ -652,6 +699,9 @@ def open_settings_dialog(
|
||||
card_wraplength = max(140, card_width - round(42 * launcher_ui_scale))
|
||||
display_hint.configure(wraplength=card_wraplength)
|
||||
rendering_hint.configure(wraplength=card_wraplength)
|
||||
updates_hint.configure(
|
||||
wraplength=max(140, viewport_width - round(42 * launcher_ui_scale))
|
||||
)
|
||||
diagnostics_hint.configure(
|
||||
wraplength=max(140, viewport_width - round(42 * launcher_ui_scale))
|
||||
)
|
||||
@@ -685,8 +735,9 @@ def open_settings_dialog(
|
||||
pady=(12, 0),
|
||||
)
|
||||
downloads_card.grid_configure(row=2, pady=(12, 0))
|
||||
diagnostics_card.grid_configure(row=3, pady=(12, 0))
|
||||
overrides_card.grid_configure(row=4, pady=(12, 0))
|
||||
updates_card.grid_configure(row=3, pady=(12, 0))
|
||||
diagnostics_card.grid_configure(row=4, pady=(12, 0))
|
||||
overrides_card.grid_configure(row=5, pady=(12, 0))
|
||||
else:
|
||||
display_card.grid_configure(
|
||||
row=0,
|
||||
@@ -705,8 +756,9 @@ def open_settings_dialog(
|
||||
pady=0,
|
||||
)
|
||||
downloads_card.grid_configure(row=1, pady=(12, 0))
|
||||
diagnostics_card.grid_configure(row=2, pady=(12, 0))
|
||||
overrides_card.grid_configure(row=3, pady=(12, 0))
|
||||
updates_card.grid_configure(row=2, pady=(12, 0))
|
||||
diagnostics_card.grid_configure(row=3, pady=(12, 0))
|
||||
overrides_card.grid_configure(row=4, pady=(12, 0))
|
||||
|
||||
if footer_stacked:
|
||||
footer_note.grid_configure(row=0, column=0, columnspan=2)
|
||||
|
||||
Reference in New Issue
Block a user