Changeset 9e54199 in sasview
- Timestamp:
- Oct 26, 2017 8:47:30 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 749b715
- Parents:
- 02c11b04
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/GuiManager.py
r9863343 r9e54199 180 180 Respond to change of the perspective signal 181 181 """ 182 183 # Save users from themselves... 184 if isinstance(self._current_perspective, Perspectives.PERSPECTIVES[str(perspective_name)]): 185 self.setupPerspectiveMenubarOptions(self._current_perspective) 186 return 187 182 188 # Close the previous perspective 189 self.clearPerspectiveMenubarOptions(self._current_perspective) 183 190 if self._current_perspective: 184 191 self._current_perspective.setClosable() … … 187 194 self._current_perspective = Perspectives.PERSPECTIVES[str(perspective_name)](parent=self) 188 195 196 self.setupPerspectiveMenubarOptions(self._current_perspective) 189 197 self._workspace.workspace.addWindow(self._current_perspective) 190 198 # Resize to the workspace height … … 650 658 def actionFitting(self): 651 659 """ 652 """653 print("actionFitting TRIGGERED")654 pass660 Change to the Fitting perspective 661 """ 662 self.perspectiveChanged("Fitting") 655 663 656 664 def actionInversion(self): 657 665 """ 658 """ 666 Change to the Inversion perspective 667 """ 668 # For now we'll just update the analysis menu status but when the inversion is implemented delete from here 669 self.checkAnalysisOption(self._workspace.actionInversion) 659 670 print("actionInversion TRIGGERED") 660 pass 671 # to here and uncomment the following line 672 # self.perspectiveChanged("Inversion") 661 673 662 674 def actionInvariant(self): 663 675 """ 664 """665 print("actionInvariant TRIGGERED")666 pass676 Change to the Invariant perspective 677 """ 678 self.perspectiveChanged("Invariant") 667 679 668 680 #============ WINDOW ================= … … 763 775 if hasattr(self, "filesWidget"): 764 776 self.filesWidget.displayData(plot) 777 778 def uncheckAllMenuItems(self, menuObject): 779 """ 780 Uncheck all options in a given menu 781 """ 782 menuObjects = menuObject.actions() 783 784 for menuItem in menuObjects: 785 menuItem.setChecked(False) 786 787 def checkAnalysisOption(self, analysisMenuOption): 788 """ 789 Unchecks all the items in the analysis menu and checks the item passed 790 """ 791 self.uncheckAllMenuItems(self._workspace.menuAnalysis) 792 analysisMenuOption.setChecked(True) 793 794 def clearPerspectiveMenubarOptions(self, perspective): 795 """ 796 When closing a perspective, clears the menu bar 797 """ 798 for menuItem in self._workspace.menuAnalysis.actions(): 799 menuItem.setChecked(False) 800 801 if isinstance(self._current_perspective, Perspectives.PERSPECTIVES["Fitting"]): 802 self._workspace.menubar.removeAction(self._workspace.menuFitting.menuAction()) 803 804 def setupPerspectiveMenubarOptions(self, perspective): 805 """ 806 When setting a perspective, sets up the menu bar 807 """ 808 if isinstance(perspective, Perspectives.PERSPECTIVES["Fitting"]): 809 self.checkAnalysisOption(self._workspace.actionFitting) 810 # Put the fitting menu back in 811 # This is a bit involved but it is needed to preserve the menu ordering 812 self._workspace.menubar.removeAction(self._workspace.menuWindow.menuAction()) 813 self._workspace.menubar.removeAction(self._workspace.menuHelp.menuAction()) 814 self._workspace.menubar.addAction(self._workspace.menuFitting.menuAction()) 815 self._workspace.menubar.addAction(self._workspace.menuWindow.menuAction()) 816 self._workspace.menubar.addAction(self._workspace.menuHelp.menuAction()) 817 elif isinstance(perspective, Perspectives.PERSPECTIVES["Invariant"]): 818 self.checkAnalysisOption(self._workspace.actionInvariant) 819 # elif isinstance(perspective, Perspectives.PERSPECTIVES["Inversion"]): 820 # self.checkAnalysisOption(self._workspace.actionInversion)
Note: See TracChangeset
for help on using the changeset viewer.