- Timestamp:
- Sep 25, 2018 9:50:18 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- cb39d66
- Parents:
- 624c8747
- Location:
- src/sas/qtgui/Plotting
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Plotting/Plotter.py
r1f34e00 r34f13a83 75 75 if isinstance(data, Data1D): 76 76 self.data = data 77 if not self._data or data is None: 77 78 if not self._data: 78 79 return 79 80 -
src/sas/qtgui/Plotting/Plotter2D.py
r1f34e00 r34f13a83 95 95 self.data = data 96 96 97 if not self._data or data is None:97 if not self._data: 98 98 return 99 99 -
src/sas/qtgui/Plotting/PlotterBase.py
r863ebca r34f13a83 114 114 if not quickplot: 115 115 # Add the toolbar 116 self.toolbar.show() 116 # self.toolbar.show() 117 self.toolbar.hide() # hide for the time being 117 118 # Notify PlotHelper about the new plot 118 119 self.upatePlotHelper() … … 220 221 self.actionPrintImage = self.contextMenu.addAction("Print Image") 221 222 self.actionCopyToClipboard = self.contextMenu.addAction("Copy to Clipboard") 222 self.contextMenu.addSeparator()223 self.actionToggleMenu = self.contextMenu.addAction("Toggle Navigation Menu")223 #self.contextMenu.addSeparator() 224 #self.actionToggleMenu = self.contextMenu.addAction("Toggle Navigation Menu") 224 225 self.contextMenu.addSeparator() 225 226 … … 229 230 self.actionPrintImage.triggered.connect(self.onImagePrint) 230 231 self.actionCopyToClipboard.triggered.connect(self.onClipboardCopy) 231 self.actionToggleMenu.triggered.connect(self.onToggleMenu)232 #self.actionToggleMenu.triggered.connect(self.onToggleMenu) 232 233 233 234 def createContextMenu(self): … … 381 382 Toggle navigation menu visibility in the chart 382 383 """ 383 if self.toolbar.isVisible(): 384 self.toolbar.hide() 385 else: 386 self.toolbar.show() 384 self.toolbar.hide() 385 # Current toolbar menu is too buggy. 386 # Comment out until we support 3.x, then recheck. 387 #if self.toolbar.isVisible(): 388 # self.toolbar.hide() 389 #else: 390 # self.toolbar.show() 387 391 388 392 def offset_graph(self): -
src/sas/qtgui/Plotting/UnitTesting/Plotter2DTest.py
r863ebca r34f13a83 146 146 self.plotter.createContextMenuQuick() 147 147 actions = self.plotter.contextMenu.actions() 148 self.assertEqual(len(actions), 9)148 self.assertEqual(len(actions), 7) 149 149 150 150 # Trigger Print Image and make sure the method is called … … 158 158 159 159 # Trigger Toggle Grid and make sure the method is called 160 self.assertEqual(actions[ 6].text(), "Toggle Grid On/Off")160 self.assertEqual(actions[4].text(), "Toggle Grid On/Off") 161 161 self.plotter.ax.grid = MagicMock() 162 actions[4].trigger() 163 self.assertTrue(self.plotter.ax.grid.called) 164 165 # Trigger Change Scale and make sure the method is called 166 self.assertEqual(actions[6].text(), "Toggle Linear/Log Scale") 167 FigureCanvas.draw_idle = MagicMock() 162 168 actions[6].trigger() 163 self.assertTrue(self.plotter.ax.grid.called)164 165 # Trigger Change Scale and make sure the method is called166 self.assertEqual(actions[8].text(), "Toggle Linear/Log Scale")167 FigureCanvas.draw_idle = MagicMock()168 actions[8].trigger()169 169 self.assertTrue(FigureCanvas.draw_idle.called) 170 170 -
src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py
r863ebca r34f13a83 124 124 125 125 actions = self.plotter.contextMenu.actions() 126 self.assertEqual(len(actions), 6)126 self.assertEqual(len(actions), 4) 127 127 128 128 # Trigger Print Image and make sure the method is called … … 147 147 self.assertTrue(self.clipboard_called) 148 148 149 # Trigger toggle navigation bar and make sure the method is called150 self.assertEqual(actions[4].text(), "Toggle Navigation Menu")151 isShown = self.plotter.toolbar.isVisible()152 self.assertTrue(isShow)153 actions[4].trigger()154 isShown = self.plotter.toolbar.isVisible()155 self.assertFalse(isShow)156 actions[4].trigger()157 isShown = self.plotter.toolbar.isVisible()158 self.assertTrue(isShow)149 ## Trigger toggle navigation bar and make sure the method is called 150 #self.assertEqual(actions[4].text(), "Toggle Navigation Menu") 151 #isShown = self.plotter.toolbar.isVisible() 152 #self.assertTrue(isShow) 153 #actions[4].trigger() 154 #isShown = self.plotter.toolbar.isVisible() 155 #self.assertFalse(isShow) 156 #actions[4].trigger() 157 #isShown = self.plotter.toolbar.isVisible() 158 #self.assertTrue(isShow) 159 159 160 160 -
src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py
r863ebca r34f13a83 103 103 self.plotter.createContextMenuQuick() 104 104 actions = self.plotter.contextMenu.actions() 105 self.assertEqual(len(actions), 9)105 self.assertEqual(len(actions), 7) 106 106 107 107 # Trigger Print Image and make sure the method is called … … 115 115 116 116 # Trigger Toggle Grid and make sure the method is called 117 self.assertEqual(actions[ 6].text(), "Toggle Grid On/Off")117 self.assertEqual(actions[4].text(), "Toggle Grid On/Off") 118 118 self.plotter.ax.grid = MagicMock() 119 actions[4].trigger() 120 self.assertTrue(self.plotter.ax.grid.called) 121 122 # Trigger Change Scale and make sure the method is called 123 self.assertEqual(actions[6].text(), "Change Scale") 124 self.plotter.properties.exec_ = MagicMock(return_value=QtWidgets.QDialog.Rejected) 119 125 actions[6].trigger() 120 self.assertTrue(self.plotter.ax.grid.called)121 122 # Trigger Change Scale and make sure the method is called123 self.assertEqual(actions[8].text(), "Change Scale")124 self.plotter.properties.exec_ = MagicMock(return_value=QtWidgets.QDialog.Rejected)125 actions[8].trigger()126 126 self.assertTrue(self.plotter.properties.exec_.called) 127 127
Note: See TracChangeset
for help on using the changeset viewer.