Skip to content

Commit a471583

Browse files
committed
QOL: saves last selected project in file open ui
1 parent 5337f95 commit a471583

3 files changed

Lines changed: 23 additions & 2 deletions

File tree

core/expected_results.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
"EC_COMPAREDERIVEDTOAGGREGATE": "Successfully compared derived value {value1} to aggregate value {value2}",
148148
"EC_CHECKBUTTONNOTCLICKABLE": "Successfully checked button {value1} is not clickable",
149149
"EC_COMPAREBIDOFFERPRICES": "Successfully compared bid and offer prices for {value1} and {value2}",
150-
"EC_HANDLEPOPUPS": "Successfully handled popups with button {value1}",
150+
"EC_HANDLEPOPUPS": "Successfully handled popup",
151151
"EC_SETINVALIDVALUESINDROPDOWN": "Invalid value(s) are not accepted in {value1} dropdown.",
152152
"EC_SETVOLTEXTBOX": "Successfully set {value2} in {value1} vol textbox.",
153153
"EC_RESETBIDOFFERVERIFICATION": "Bid/offer values are successfully reset for cells {value1}.",

core/steps_performed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
"EC_COMPAREDERIVEDTOAGGREGATE": "Compare derived value {value1} to aggregate value {value2}",
150150
"EC_CHECKBUTTONNOTCLICKABLE": "Check button {value1} is not clickable",
151151
"EC_COMPAREBIDOFFERPRICES": "Compare bid and offer prices for {value1} and {value2}",
152-
"EC_HANDLEPOPUPS": "Handle popups with button {value1}",
152+
"EC_HANDLEPOPUPS": "Handle popup",
153153
"EC_SETINVALIDVALUESINDROPDOWN": "Attempt to set invalid value(s) in {value1} dropdown",
154154
"EC_SETVOLTEXTBOX": "Set {value2} in {value1} vol textbox",
155155
"EC_RESETBIDOFFERVERIFICATION": "Verify bid/offer reset for cells {value1} with expected bids {value2}",

ui/file_ui.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def _load_last_directory(self):
114114
self.data_directory = last_dir
115115
self.dir_label.setText(last_dir)
116116
self._populate_projects()
117+
self._load_last_project()
117118

118119
def _save_last_directory(self):
119120
if self.data_directory:
@@ -127,6 +128,21 @@ def _select_data_directory(self):
127128
self.dir_label.setText(directory)
128129
self._save_last_directory()
129130
self._populate_projects()
131+
self._load_last_project()
132+
133+
def _load_last_project(self):
134+
if self.mode != "open":
135+
return
136+
settings = QSettings("TestEditor", "Settings")
137+
last_project = settings.value("last_project", "")
138+
if not last_project:
139+
return
140+
141+
for i in range(self.projects_list.count()):
142+
item = self.projects_list.item(i)
143+
if item.text() == last_project:
144+
self.projects_list.setCurrentItem(item)
145+
break
130146

131147
# Dir Data Population
132148

@@ -264,6 +280,11 @@ def _open_files(self):
264280
QMessageBox.warning(self, "Error", "One or more files no longer exist")
265281
return
266282

283+
if self.projects_list.selectedItems():
284+
settings = QSettings("TestEditor", "Settings")
285+
last_project = self.projects_list.selectedItems()[0].text()
286+
settings.setValue("last_project", last_project)
287+
267288
self.accept()
268289

269290
def _save_files(self):

0 commit comments

Comments
 (0)