Skip to content
Snippets Groups Projects
Commit 7f93be36 authored by Dominik Möslinger's avatar Dominik Möslinger
Browse files

TST/Progress Viewer: Remember the last used folder for File opening/saving

parent 1601a799
No related branches found
No related tags found
No related merge requests found
......@@ -11,4 +11,7 @@ minimum-width-step-mode = 500
minimum-width-run-mode = 700
basic-height = 1000
basic-width-step-mode = 900
basic-width-run-mode = 1100
\ No newline at end of file
basic-width-run-mode = 1100
[progress-viewer-history]
last-folder = ${paths:tst}/test_specs
\ No newline at end of file
......@@ -255,11 +255,12 @@ class TestProgressView(Gtk.ApplicationWindow):
parent=self,
action=Gtk.FileChooserAction.OPEN)
dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.OK)
dialog.set_current_folder(confignator.get_option(section='progress-viewer-history', option='last-folder'))
self.add_filters(dialog)
response = dialog.run()
if response == Gtk.ResponseType.OK:
file_selected = dialog.get_filename()
confignator.save_option('progress-viewer-history', 'last-folder', os.path.dirname(file_selected))
self.open_test_files(None, self.get_log_file_paths_from_json_file_name(file_selected))
elif response == Gtk.ResponseType.CANCEL:
pass
......@@ -1398,6 +1399,7 @@ class File_Path_Dialog(Gtk.FileChooserDialog):
#main_box.pack_end(label, False, True, 10)
area.pack_start(label, False, True, 0)
self.show_all()
def run():
bus_name = confignator.get_option('dbus_names', 'progress-view')
dbus.validate_bus_name(bus_name)
......
......@@ -544,11 +544,13 @@ class TstAppWindow(Gtk.ApplicationWindow):
self,
Gtk.FileChooserAction.SAVE,
(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_SAVE, Gtk.ResponseType.OK))
dialog.set_current_folder(confignator.get_option(section='tst-history', option='last-folder'))
dialog.set_current_name(current_name+'.json')
self.add_filters(dialog)
response = dialog.run()
if response == Gtk.ResponseType.OK:
file_selected = dialog.get_filename()
confignator.save_option('tst-history', 'last-folder', os.path.dirname(file_selected))
if '-v_' in file_selected:
test_name = file_selected.split('-v_')[0]
filename = file_selected
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment