From 39119b4e131155ae38f7b435fc9f3693ca924eed Mon Sep 17 00:00:00 2001 From: "Lovett, Trevor" Date: Fri, 6 Sep 2019 08:57:30 -0500 Subject: Fixed GUI not saving users' prior settings Change-Id: Id495e291ef6fe9f8ff024decfe27220a32e727ba Issue-ID: VVP-298 Signed-off-by: Lovett, Trevor --- ice_validator/config.py | 4 ++++ ice_validator/vvp.py | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ice_validator/config.py b/ice_validator/config.py index 5ac1cf5..fa8ec62 100644 --- a/ice_validator/config.py +++ b/ice_validator/config.py @@ -225,6 +225,10 @@ class Config: def default_report_format(self): return self._user_settings.get("report_format", "HTML") + @property + def default_create_preloads(self): + return self._user_settings.get("create_preloads", 0) + @property def report_formats(self): return ["CSV", "Excel", "HTML"] diff --git a/ice_validator/vvp.py b/ice_validator/vvp.py index cc2c66f..a998fd1 100644 --- a/ice_validator/vvp.py +++ b/ice_validator/vvp.py @@ -477,7 +477,7 @@ class ValidatorApp: settings_row += 1 self.create_preloads = BooleanVar(self._root, name="create_preloads") - self.create_preloads.set(0) + self.create_preloads.set(self.config.default_create_preloads) create_preloads_label = Label( settings_frame, text="Create Preload from Env Files:", @@ -507,8 +507,9 @@ class ValidatorApp: env_dir_label = Label(actions, text="Env Files:") env_dir_label.grid(row=5, column=1, pady=5, sticky=W) self.env_dir = StringVar(self._root, name="env_dir") + env_dir_state = NORMAL if self.create_preloads.get() else DISABLED self.env_dir_entry = Entry( - actions, width=40, textvariable=self.env_dir, state=DISABLED + actions, width=40, textvariable=self.env_dir, state=env_dir_state ) self.env_dir_entry.grid(row=5, column=2, pady=5, sticky=W) env_dir_browse = Button(actions, text="...", command=self.ask_env_dir_source) @@ -563,9 +564,9 @@ class ValidatorApp: self.input_format, self.report_format, self.halt_on_failure, + self.preload_format, + self.create_preloads, ) - if self.config.preload_formats: - self.config.watch(self.preload_format) self.schedule(self.execute_pollers) if self.config.terms_link_text and not self.config.are_terms_accepted: TermsAndConditionsDialog(parent_frame, self.config) -- cgit 1.2.3-korg