Changeset 768387e0 in sasview for src/sas/qtgui/MainWindow


Ignore:
Timestamp:
Sep 14, 2018 5:45:39 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
86d3207
Parents:
855e7ad
Message:

Added Data Explorer visibility toggle for more flexibility. SASVIEW-998

Location:
src/sas/qtgui/MainWindow
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/GuiManager.py

    r5b144c6 r768387e0  
    118118        self.dockedFilesWidget.setWidget(self.filesWidget) 
    119119 
    120         # Disable maximize/minimize and close buttons 
    121         self.dockedFilesWidget.setFeatures(QDockWidget.NoDockWidgetFeatures) 
    122  
    123         #self._workspace.workspace.addDockWidget(Qt.LeftDockWidgetArea, self.dockedFilesWidget) 
     120        # Modify menu items on widget visibility change 
     121        self.dockedFilesWidget.visibilityChanged.connect(self.updateContextMenus) 
     122 
    124123        self._workspace.addDockWidget(Qt.LeftDockWidgetArea, self.dockedFilesWidget) 
    125124        self._workspace.resizeDocks([self.dockedFilesWidget], [305], Qt.Horizontal) 
     
    164163            logger.error("%s: could not load SasView models") 
    165164            logger.error(traceback.format_exc()) 
     165 
     166    def updateContextMenus(self, visible=False): 
     167        """ 
     168        Modify the View/Data Explorer menu item text on widget visibility 
     169        """ 
     170        if visible: 
     171            self._workspace.actionHide_DataExplorer.setText("Hide Data Explorer") 
     172        else: 
     173            self._workspace.actionHide_DataExplorer.setText("Show Data Explorer") 
    166174 
    167175    def statusBarSetup(self): 
     
    427435        self._workspace.actionStartup_Settings.triggered.connect(self.actionStartup_Settings) 
    428436        self._workspace.actionCategory_Manager.triggered.connect(self.actionCategory_Manager) 
     437        self._workspace.actionHide_DataExplorer.triggered.connect(self.actionHide_DataExplorer) 
    429438        # Tools 
    430439        self._workspace.actionData_Operation.triggered.connect(self.actionData_Operation) 
     
    617626        pass 
    618627 
     628    def actionHide_DataExplorer(self): 
     629        """ 
     630        Toggle Data Explorer vsibility 
     631        """ 
     632        if self.dockedFilesWidget.isVisible(): 
     633            #self._workspace.actionHide_DataExplorer.setText("Show Data Explorer") 
     634            self.dockedFilesWidget.setVisible(False) 
     635        else: 
     636            #self._workspace.actionHide_DataExplorer.setText("Hide Data Explorer") 
     637            self.dockedFilesWidget.setVisible(True) 
     638        pass 
     639 
    619640    def actionStartup_Settings(self): 
    620641        """ 
  • src/sas/qtgui/MainWindow/UI/MainWindowUI.ui

    r33b3e4d r768387e0  
    7474    <addaction name="separator"/> 
    7575    <addaction name="actionHide_Toolbar"/> 
     76    <addaction name="actionHide_DataExplorer"/> 
    7677    <addaction name="separator"/> 
    7778    <addaction name="actionStartup_Settings"/> 
     
    552553   </property> 
    553554  </action> 
     555  <action name="actionHide_DataExplorer"> 
     556   <property name="text"> 
     557    <string>Hide Data Explorer</string> 
     558   </property> 
     559  </action> 
    554560 </widget> 
    555561 <resources/> 
  • src/sas/qtgui/MainWindow/UnitTesting/GuiManagerTest.py

    r144fe21 r768387e0  
    5353        self.assertIsInstance(self.manager.dockedFilesWidget, QDockWidget) 
    5454        self.assertIsInstance(self.manager.dockedFilesWidget.widget(), DataExplorerWindow) 
    55         self.assertEqual(self.manager.dockedFilesWidget.features(), QDockWidget.NoDockWidgetFeatures) 
    5655        self.assertEqual(self.manager._workspace.dockWidgetArea(self.manager.dockedFilesWidget), Qt.LeftDockWidgetArea) 
    5756 
Note: See TracChangeset for help on using the changeset viewer.