Changes in / [3c4f02e:e2451f2] in sasview
- Location:
- src/sas/qtgui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/GuiManager.py
r5b144c6 r768387e0 118 118 self.dockedFilesWidget.setWidget(self.filesWidget) 119 119 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 124 123 self._workspace.addDockWidget(Qt.LeftDockWidgetArea, self.dockedFilesWidget) 125 124 self._workspace.resizeDocks([self.dockedFilesWidget], [305], Qt.Horizontal) … … 164 163 logger.error("%s: could not load SasView models") 165 164 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") 166 174 167 175 def statusBarSetup(self): … … 427 435 self._workspace.actionStartup_Settings.triggered.connect(self.actionStartup_Settings) 428 436 self._workspace.actionCategory_Manager.triggered.connect(self.actionCategory_Manager) 437 self._workspace.actionHide_DataExplorer.triggered.connect(self.actionHide_DataExplorer) 429 438 # Tools 430 439 self._workspace.actionData_Operation.triggered.connect(self.actionData_Operation) … … 617 626 pass 618 627 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 619 640 def actionStartup_Settings(self): 620 641 """ -
src/sas/qtgui/MainWindow/UI/MainWindowUI.ui
r33b3e4d r768387e0 74 74 <addaction name="separator"/> 75 75 <addaction name="actionHide_Toolbar"/> 76 <addaction name="actionHide_DataExplorer"/> 76 77 <addaction name="separator"/> 77 78 <addaction name="actionStartup_Settings"/> … … 552 553 </property> 553 554 </action> 555 <action name="actionHide_DataExplorer"> 556 <property name="text"> 557 <string>Hide Data Explorer</string> 558 </property> 559 </action> 554 560 </widget> 555 561 <resources/> -
src/sas/qtgui/MainWindow/UnitTesting/GuiManagerTest.py
r144fe21 r768387e0 53 53 self.assertIsInstance(self.manager.dockedFilesWidget, QDockWidget) 54 54 self.assertIsInstance(self.manager.dockedFilesWidget.widget(), DataExplorerWindow) 55 self.assertEqual(self.manager.dockedFilesWidget.features(), QDockWidget.NoDockWidgetFeatures)56 55 self.assertEqual(self.manager._workspace.dockWidgetArea(self.manager.dockedFilesWidget), Qt.LeftDockWidgetArea) 57 56 -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r557fc498 r86d3207 28 28 from sas.qtgui.Plotting.PlotterData import Data1D 29 29 from sas.qtgui.Plotting.PlotterData import Data2D 30 from sas.qtgui.Plotting.Plotter import PlotterWidget 30 31 31 32 from sas.qtgui.Perspectives.Fitting.UI.FittingWidgetUI import Ui_FittingWidgetUI … … 2825 2826 item4 = QtGui.QStandardItem() 2826 2827 2827 self._model_model.appendRow([item1, item2, item3, item4]) 2828 # cell 4: SLD button 2829 item5 = QtGui.QStandardItem() 2830 button = QtWidgets.QPushButton() 2831 button.setText("Show SLD Profile") 2832 2833 self._model_model.appendRow([item1, item2, item3, item4, item5]) 2828 2834 2829 2835 # Beautify the row: span columns 2-4 2830 2836 shell_row = self._model_model.rowCount() 2831 2837 shell_index = self._model_model.index(shell_row-1, 1) 2838 button_index = self._model_model.index(shell_row-1, 4) 2832 2839 2833 2840 self.lstParams.setIndexWidget(shell_index, func) 2841 self.lstParams.setIndexWidget(button_index, button) 2834 2842 self._n_shells_row = shell_row - 1 2835 2843 … … 2858 2866 func.currentTextChanged.connect(self.modifyShellsInList) 2859 2867 2868 # Respond to button press 2869 button.clicked.connect(self.onShowSLDProfile) 2870 2860 2871 # Available range of shells displayed in the combobox 2861 2872 func.addItems([str(i) for i in range(shell_min, shell_max+1)]) … … 2877 2888 index = 0 2878 2889 logger.error("Multiplicity incorrect! Setting to 0") 2879 2890 self.kernel_module.multiplicity = index 2880 2891 if remove_rows > 1: 2881 2892 self._model_model.removeRows(first_row, remove_rows) … … 2903 2914 self.setPolyModel() 2904 2915 self.setMagneticModel() 2916 2917 def onShowSLDProfile(self): 2918 """ 2919 Show a quick plot of SLD profile 2920 """ 2921 # get profile data 2922 x, y = self.kernel_module.getProfile() 2923 y *= 1.0e6 2924 profile_data = Data1D(x=x, y=y) 2925 profile_data.name = "SLD" 2926 profile_data.scale = 'linear' 2927 profile_data.symbol = 'Line' 2928 profile_data.hide_error = True 2929 profile_data._xaxis = "R(\AA)" 2930 profile_data._yaxis = "SLD(10^{-6}\AA^{-2})" 2931 2932 plotter = PlotterWidget(self, quickplot=True) 2933 plotter.data = profile_data 2934 plotter.showLegend = True 2935 plotter.plot(hide_error=True, marker='-') 2936 2937 self.plot_widget = QtWidgets.QWidget() 2938 self.plot_widget.setWindowTitle("Scattering Length Density Profile") 2939 layout = QtWidgets.QVBoxLayout() 2940 layout.addWidget(plotter) 2941 self.plot_widget.setLayout(layout) 2942 self.plot_widget.show() 2905 2943 2906 2944 def setInteractiveElements(self, enabled=True):
Note: See TracChangeset
for help on using the changeset viewer.