Skip to content

Commit

Permalink
envvars-dialog: Rename classes to more descriptive names
Browse files Browse the repository at this point in the history
  • Loading branch information
jntesteves committed Jan 9, 2025
1 parent 56f959d commit 00cd729
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bottles/frontend/ui/dialog-env-vars.blp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Gtk 4.0;
using Adw 1;

template $EnvVarsDialog: Adw.Dialog {
template $EnvironmentVariablesDialog: Adw.Dialog {
content-width: 600;
content-height: 800;
title: _("Environment Variables");
Expand Down
2 changes: 1 addition & 1 deletion bottles/frontend/ui/env-var-entry.blp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Gtk 4.0;
using Adw 1;

template $EnvVarEntry: Adw.EntryRow {
template $EnvironmentVariableEntryRow: Adw.EntryRow {
show-apply-button: true;

Button btn_remove {
Expand Down
4 changes: 2 additions & 2 deletions bottles/frontend/views/bottle_preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from bottles.frontend.windows.display import DisplayDialog
from bottles.frontend.windows.dlloverrides import DLLOverridesDialog
from bottles.frontend.windows.drives import DrivesDialog
from bottles.frontend.windows.envvars import EnvVarsDialog
from bottles.frontend.windows.envvars import EnvironmentVariablesDialog
from bottles.frontend.windows.exclusionpatterns import ExclusionPatternsDialog
from bottles.frontend.windows.fsr import FsrDialog
from bottles.frontend.windows.gamescope import GamescopeDialog
Expand Down Expand Up @@ -200,7 +200,7 @@ def __init__(self, details, config, **kwargs):
"activated", self.__show_feature_dialog, DLLOverridesDialog
)
self.row_env_variables.connect(
"activated", self.__show_feature_dialog, EnvVarsDialog
"activated", self.__show_feature_dialog, EnvironmentVariablesDialog
)
self.row_drives.connect("activated", self.__show_feature_dialog, DrivesDialog)
self.btn_manage_gamescope.connect(
Expand Down
14 changes: 7 additions & 7 deletions bottles/frontend/windows/envvars.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@


@Gtk.Template(resource_path="/com/usebottles/bottles/env-var-entry.ui")
class EnvVarEntry(Adw.EntryRow):
__gtype_name__ = "EnvVarEntry"
class EnvironmentVariableEntryRow(Adw.EntryRow):
__gtype_name__ = "EnvironmentVariableEntryRow"

# region Widgets
btn_remove = Gtk.Template.Child()
Expand Down Expand Up @@ -61,7 +61,7 @@ def __init__(self, parent, env, **kwargs):
raise RuntimeError("Could not find widget Gtk.Text")
except Exception as e:
logging.error(
f"{type(e)}: {e}\nEnvVarEntry could not find text widget. Did AdwEntryRow change it's widget tree?"
f"{type(e)}: {e}\nEnvironmentVariableEntryRow could not find text widget. Did AdwEntryRow change it's widget tree?"
)

def __save(self, *_args):
Expand Down Expand Up @@ -111,8 +111,8 @@ def __validate(self, *_args):


@Gtk.Template(resource_path="/com/usebottles/bottles/dialog-env-vars.ui")
class EnvVarsDialog(Adw.Dialog):
__gtype_name__ = "EnvVarsDialog"
class EnvironmentVariablesDialog(Adw.Dialog):
__gtype_name__ = "EnvironmentVariablesDialog"

# region Widgets
entry_new_var = Gtk.Template.Child()
Expand Down Expand Up @@ -159,7 +159,7 @@ def __save_var(self, *_args):
value=new_value,
scope="Environment_Variables",
)
_entry = EnvVarEntry(parent=self, env=(new_name, new_value))
_entry = EnvironmentVariableEntryRow(parent=self, env=(new_name, new_value))
self.group_vars.set_description()
self.group_vars.add(_entry)
self.entry_new_var.set_text("")
Expand All @@ -175,5 +175,5 @@ def __populate_vars_list(self):
return

for env in envs:
_entry = EnvVarEntry(parent=self, env=env)
_entry = EnvironmentVariableEntryRow(parent=self, env=env)
self.group_vars.add(_entry)

0 comments on commit 00cd729

Please sign in to comment.