Fixed some bugs regarding setting paths and incorrect selections
This commit is contained in:
@@ -19,7 +19,6 @@ class Controller(Gtk.Box, CommonWidgetGeneratorMixin):
|
||||
def __init__(self, args, unknownargs):
|
||||
super(Controller, self).__init__()
|
||||
|
||||
# # Add header
|
||||
self.change_view = None
|
||||
self.copy_window = None
|
||||
self.store = None
|
||||
@@ -37,9 +36,12 @@ class Controller(Gtk.Box, CommonWidgetGeneratorMixin):
|
||||
for arg in unknownargs:
|
||||
if os.path.isdir(arg):
|
||||
event_system.emit("set-active-path", (arg,))
|
||||
self._set_file_chooser_path(arg)
|
||||
|
||||
if args.path and os.path.isdir(args.path):
|
||||
event_system.emit("set-active-path", (args.path,))
|
||||
self._set_file_chooser_path(args.path)
|
||||
|
||||
|
||||
|
||||
def _setup_styling(self):
|
||||
@@ -55,6 +57,7 @@ class Controller(Gtk.Box, CommonWidgetGeneratorMixin):
|
||||
|
||||
def _subscribe_to_events(self):
|
||||
event_system.subscribe("handle-gui-event", self._handle_gui_event)
|
||||
event_system.subscribe("set-file-chooser-path", self._set_file_chooser_path)
|
||||
|
||||
def _load_widgets(self):
|
||||
self.change_view = ChangeView()
|
||||
@@ -106,6 +109,9 @@ class Controller(Gtk.Box, CommonWidgetGeneratorMixin):
|
||||
self.add(run_button)
|
||||
|
||||
|
||||
def _set_file_chooser_path(self, path):
|
||||
self.get_children()[0].set_filename(path)
|
||||
|
||||
def update_dir_path(self, widget):
|
||||
path = widget.get_filename()
|
||||
event_system.emit("set-active-path", (path,))
|
||||
|
||||
Reference in New Issue
Block a user