Browse Source

Make Datalad menu show on Mac

Closes #231
Michael Hanke 1 year ago
parent
commit
6f85c57fd5
2 changed files with 12 additions and 0 deletions
  1. 6 0
      datalad_gooey/app.py
  2. 6 0
      datalad_gooey/resources/ui/main_window.ui

+ 6 - 0
datalad_gooey/app.py

@@ -277,6 +277,12 @@ class GooeyApp(QObject):
 
     def _populate_datalad_menu(self):
         """Private slot to populate connected QMenus with dataset actions"""
+        sender = self.sender()
+        if sender.objectName() == 'menuDatalad':
+            # stupid workaround, because on a mac an empty menu is hidden, hence cannot
+            # be clicked on. So in the .ui file, we put rubbish in to make it show, which
+            # needs to be cleared now
+            sender.clear()
         from .active_suite import dataset_api
         add_cmd_actions_to_menu(
             self, self._cmdui.configure, dataset_api, self.sender())

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

@@ -248,6 +248,7 @@
     <property name="title">
      <string>&amp;DataLad</string>
     </property>
+    <addaction name="actionWaitingToBePopulated"/>
    </widget>
    <widget class="QMenu" name="menuFile">
     <property name="title">
@@ -345,6 +346,11 @@
     <string>Set &amp;base directory</string>
    </property>
   </action>
+  <action name="actionWaitingToBePopulated">
+   <property name="text">
+    <string>Waiting to be populated</string>
+   </property>
+  </action>
  </widget>
  <resources/>
  <connections>