Browse Source

Add `File->Set base directory` to set and reset the application root

Michael Hanke 1 year ago
parent
commit
d3fb7214ad
2 changed files with 9 additions and 1 deletions
  1. 3 1
      datalad_gooey/app.py
  2. 6 0
      datalad_gooey/resources/ui/main_window.ui

+ 3 - 1
datalad_gooey/app.py

@@ -63,10 +63,10 @@ class GooeyApp(QObject):
         'commandLog': QPlainTextEdit,
         'errorLog': QPlainTextEdit,
         'menuDataset': QMenu,
-        'menuHelp': QMenu,
         'menuView': QMenu,
         'menuSuite': QMenu,
         'menuUtilities': QMenu,
+        'menuHelp': QMenu,
         'statusbar': QStatusBar,
         'actionCheck_for_new_version': QAction,
         'actionReport_a_problem': QAction,
@@ -145,6 +145,8 @@ class GooeyApp(QObject):
         # necessary
         self.get_widget('menuDataset').aboutToShow.connect(
             self._populate_dataset_menu)
+        self.main_window.actionSetBaseDirectory.triggered.connect(
+            self._set_root_path)
         self.main_window.actionCheck_for_new_version.triggered.connect(
             self._check_new_version)
         self.main_window.actionReport_a_problem.triggered.connect(

+ 6 - 0
datalad_gooey/resources/ui/main_window.ui

@@ -253,6 +253,7 @@
     <property name="title">
      <string>&amp;File</string>
     </property>
+    <addaction name="actionSetBaseDirectory"/>
     <addaction name="action_Quit"/>
    </widget>
    <widget class="QMenu" name="menuView">
@@ -339,6 +340,11 @@
     <string>&amp;Diagnostic infos</string>
    </property>
   </action>
+  <action name="actionSetBaseDirectory">
+   <property name="text">
+    <string>Set &amp;base directory</string>
+   </property>
+  </action>
  </widget>
  <resources/>
  <connections>