chore: placeholder logic

This commit is contained in:
aclist committed 2026-05-04 02:04:34 +09:00
1 parent 2dbdc3f928
commit a5c562f022
4 files changed
+26 -63

No files matched your search

+10
View File
@@ -461,3 +461,13 @@ def compare_versions(local: DayZVersion, remote: DayZVersion) -> VersionMatch:
if local_str > remote_str: if local_str > remote_str:
return VersionMatch.LOCAL_NEWER return VersionMatch.LOCAL_NEWER
def get_pretty_version(steam_path: Path, appid: int) -> str | None:
try:
pe_file_path = get_pefile_path(steam_path, appid)
vers = get_dayz_version(pe_file_path)
dayz_version = dayz_version_to_str(vers)
return dayz_version
except Exception:
return None
-3
View File
@@ -64,9 +64,6 @@ class ConnectionManager:
StoredFunc(self._server_timeout), destroy_first=True StoredFunc(self._server_timeout), destroy_first=True
) )
self.controller.open_connection_assistant(res, mods) self.controller.open_connection_assistant(res, mods)
# TODO: add to history if successful
# print(res)
# print(rules)
@call_on_thread(dialog.querying) @call_on_thread(dialog.querying)
def query_details(self, record: Servers.Record) -> None: def query_details(self, record: Servers.Record) -> None:
+6 -46
View File
@@ -130,17 +130,9 @@ class Options(Gtk.Box):
self.dayz_version_label = Gtk.Label(label=strings.null) self.dayz_version_label = Gtk.Label(label=strings.null)
self.dayz_exp_version_label = Gtk.Label(label=strings.null) self.dayz_exp_version_label = Gtk.Label(label=strings.null)
# self.branch_combo = Gtk.ComboBoxText()
# self.branch_combo.append_text(strings.options.stable)
# self.branch_combo.append_text(strings.options.testing)
# self.branch_combo.set_active(0)
# self.branch_combo.connect("changed", self._on_branch_changed)
# self.branch_eb = InfoEventBox("", controller)
version_rows = [ version_rows = [
[LeftLabel(APPNAME_DAYZ), self.dayz_version_label], [LeftLabel(APPNAME_DAYZ), self.dayz_version_label],
[LeftLabel(APPNAME_DAYZ_EXP), self.dayz_exp_version_label], [LeftLabel(APPNAME_DAYZ_EXP), self.dayz_exp_version_label],
# [LeftLabel(strings.options.branch), self.branch_combo, self.branch_eb],
] ]
api_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) api_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
@@ -315,15 +307,6 @@ class Options(Gtk.Box):
value = FLATPAK_SANDBOX value = FLATPAK_SANDBOX
self.controller.update_config(Preferences.CLIENT, value) self.controller.update_config(Preferences.CLIENT, value)
def _on_branch_changed(self, combo: Gtk.ComboBoxText) -> None:
branch = combo.get_active_text()
print("UNIMPLEMENTED: ", branch)
## TODO: needs to trigger download process
# self.controller.toggle_branch(branch)
# branch = combo.get_active_text().lower()
# self.controller.update_config("branch", branch)
# scripts/update
def _on_radio_toggled(self, button: Gtk.RadioButton, context: Preferences) -> None: def _on_radio_toggled(self, button: Gtk.RadioButton, context: Preferences) -> None:
try: try:
self.controller.toggle_config(context) self.controller.toggle_config(context)
@@ -415,6 +398,7 @@ class Options(Gtk.Box):
raise Exception raise Exception
config = query.get_config(prefs.paths.config) config = query.get_config(prefs.paths.config)
# TODO: use newer config enums # TODO: use newer config enums
name = config["name"] name = config["name"]
default_steam_path = config["default_steam_path"] default_steam_path = config["default_steam_path"]
@@ -457,19 +441,12 @@ class Options(Gtk.Box):
if field[0] == "": if field[0] == "":
field[1].get_children()[1].set_sensitive(False) field[1].get_children()[1].set_sensitive(False)
# TODO: abstract this logic dayz_version = PeFile.get_pretty_version(steam_path, APPID_DAYZ)
try: if dayz_version is None:
pe_file_path = PeFile.get_pefile_path(steam_path, APPID_DAYZ)
vers = PeFile.get_dayz_version(pe_file_path)
dayz_version = PeFile.dayz_version_to_str(vers)
except Exception:
dayz_version = strings.null dayz_version = strings.null
try: dayz_exp_version = PeFile.get_pretty_version(steam_path, APPID_DAYZ_EXP)
exp_file_path = PeFile.get_pefile_path(steam_path, APPID_DAYZ_EXP) if dayz_exp_version is None:
vers = PeFile.get_dayz_version(exp_file_path)
dayz_exp_version = PeFile.dayz_version_to_str(vers)
except Exception:
dayz_exp_version = strings.null dayz_exp_version = strings.null
self.dayz_version_label.set_text(dayz_version) self.dayz_version_label.set_text(dayz_version)
@@ -478,24 +455,7 @@ class Options(Gtk.Box):
# TODO: not happy with this # TODO: not happy with this
active_combo = query.get_client_index(config["client"]) active_combo = query.get_client_index(config["client"])
self.client_combo.set_active(active_combo) self.client_combo.set_active(active_combo)
active_combo = 0 # active_combo = 0
# active_combo = 1 if config["branch"] == BETA_REPO else 0
# self.controller.suppress_signal(
# self, self.branch_combo, "_on_branch_changed", True
# )
# self.branch_combo.set_active(active_combo)
# self.branch_combo.set_sensitive(prefs.allow_updates)
# self.controller.suppress_signal(
# self, self.branch_combo, "_on_branch_changed", False
# )
# if prefs.allow_updates is True:
# msg = strings.options.self_update
# else:
# msg = strings.options.no_self_update
# self.branch_eb.set_text(msg)
def _suppress_toggles(self, state: bool) -> None: def _suppress_toggles(self, state: bool) -> None:
for toggle in [ for toggle in [
+10 -14
View File
@@ -46,8 +46,8 @@ class PreConnectionAssistant(Gtk.Box):
self.button_box.add(self.back) self.button_box.add(self.back)
self.button_box.add(self.ok) self.button_box.add(self.ok)
self.ok.connect("clicked", self._on_ok_clicked)
self.back.connect("clicked", self._on_back_clicked) self.back.connect("clicked", self._on_back_clicked)
self.ok.connect("clicked", self._on_ok_clicked)
self.warnings = [] self.warnings = []
# TODO: populate with strings and icons # TODO: populate with strings and icons
@@ -67,18 +67,14 @@ class PreConnectionAssistant(Gtk.Box):
self.controller.open_page(page) self.controller.open_page(page)
def populate(self, res: dict[Any], mods: list["DayzMod"]) -> None: def populate(self, res: dict[Any], mods: list["DayzMod"]) -> None:
# TODO: compare remote and local build versions # steam_path = self.controller.get_config_man().lookup(Preferences.DEFAULT)
# try: # dayz_version = PeFile.get_pretty_version(steam_path, APPID_DAYZ)
# pe_file_path = PeFile.get_pefile_path(steam_path, APPID_DAYZ) # dayz_exp_version = PeFile.get_pretty_version(steam_path, APPID_DAYZ_EXP)
# vers = PeFile.get_dayz_version(pe_file_path) pass
# dayz_version = PeFile.dayz_version_to_str(vers)
# except Exception:
# dayz_version = strings.null
# try: def download_mods(self) -> None:
# exp_file_path = PeFile.get_pefile_path(steam_path, APPID_DAYZ_EXP) pass
# vers = PeFile.get_dayz_version(exp_file_path)
# dayz_exp_version = PeFile.dayz_version_to_str(vers) def connect(self) -> None:
# except Exception: # TODO: add to history file and list store
# dayz_exp_version = strings.null
pass pass