- Timestamp:
- Nov 29, 2016 8:08:29 AM (8 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:
- 8548d739
- Parents:
- e84ccf5
- git-author:
- Piotr Rozyczko <rozyczko@…> (11/29/16 02:56:47)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (11/29/16 08:08:29)
- Location:
- src/sas/qtgui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/DataExplorer.py
r31c5b58 radf81b8 293 293 self.communicator.updateModelFromPerspectiveSignal.connect(self.updateModelFromPerspective) 294 294 295 def isItemReady(index): 296 item = self.model.item(index) 297 return item.isCheckable() and item.checkState() == QtCore.Qt.Checked 298 295 299 # Figure out which rows are checked 296 selected_items = [] 297 for index in range(self.model.rowCount()): 298 item = self.model.item(index) 299 if item.isCheckable() and item.checkState() == QtCore.Qt.Checked: 300 selected_items.append(item) 300 selected_items = [self.model.item(index) 301 for index in xrange(self.model.rowCount()) 302 if isItemReady(index)] 301 303 302 304 if len(selected_items) < 1: … … 312 314 retval = msgbox.exec_() 313 315 return 314 315 # TODO316 # New plot or appended?317 316 318 317 # Notify the GuiManager about the send request … … 378 377 self.cbgraph.clear() 379 378 graph_titles = [] 380 for graph in graph_list:381 graph_titles.append("Graph"+str(graph)) 379 graph_titles= ["Graph"+str(graph) for graph in graph_list] 380 382 381 self.cbgraph.insertItems(0, graph_titles) 383 382 ind = self.cbgraph.findText(orig_text) … … 395 394 # All same-type charts in one plot 396 395 new_plot = Plotter(self) 396 397 def addDataPlot(plot, plot_set): 398 plot.data = plot_set 399 plot.plot() 400 401 def addDataPlot2D(plot_set): 402 plot2D = Plotter2D(self) 403 addDataPlot(plot2D, plot_set) 404 self.plotAdd(plot2D) 405 397 406 for plot_set in plots: 398 407 if isinstance(plot_set, Data1D): 399 new_plot.data = plot_set 400 new_plot.plot() 408 addDataPlot(new_plot, plot_set) 401 409 elif isinstance(plot_set, Data2D): 402 # Separate 2D plot 403 plot2D = Plotter2D(self) 404 plot2D.data = plot_set 405 plot2D.plot() 406 self.plotAdd(plot2D) 410 addDataPlot2D(plot_set) 407 411 else: 408 412 msg = "Incorrect data type passed to Plotting" 409 413 raise AttributeError, msg 414 410 415 411 416 if plots and \ -
src/sas/qtgui/UnitTesting/WelcomePanelTest.py
r31c5b58 radf81b8 2 2 import unittest 3 3 4 from PyQt4.QtGui import * 5 from PyQt4.QtTest import QTest 6 from PyQt4.QtCore import * 4 from PyQt4 import QtGui 7 5 8 6 # set up import paths … … 12 10 from WelcomePanel import WelcomePanel 13 11 14 app = Q Application(sys.argv)12 app = QtGui.QApplication(sys.argv) 15 13 16 14 class WelcomePanelTest(unittest.TestCase): … … 28 26 def testDefaults(self): 29 27 '''Test the GUI in its default state''' 30 self.assertIsInstance(self.widget, Q Dialog)28 self.assertIsInstance(self.widget, QtGui.QDialog) 31 29 self.assertEqual(self.widget.windowTitle(), "Welcome") 32 30 33 31 def testVersion(self): 34 """ 35 """ 32 '''Test the version string''' 36 33 version = self.widget.lblVersion 37 self.assertIsInstance(version, Q Label)38 ver_text = "\nSasView 4.0.0-alpha\nBuild: 1\n(c) 2009 - 2013, UTK, UMD, NIST, ORNL, ISIS, ESS and IL" 39 #self.assertEqual(str(version.text()), ver_text)40 self.assertIn(" SasView", str(version.text()))41 self.assertIn(" Build:", str(version.text()))34 self.assertIsInstance(version, QtGui.QLabel) 35 36 self.assertIn("SasView", version.text()) 37 self.assertIn("Build:", version.text()) 38 self.assertIn("UTK, UMD, NIST, ORNL, ISIS, ESS, ILL and ANSTO", version.text()) 42 39 43 40 if __name__ == "__main__":
Note: See TracChangeset
for help on using the changeset viewer.