- Timestamp:
- May 15, 2017 5:40:12 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:
- 00b3b40
- Parents:
- 6011788
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r6011788 r2241130 80 80 # Does the control support UNDO/REDO 81 81 # temporarily off 82 self.support_undo = False 82 self.undo_supported = False 83 self.page_stack = [] 83 84 84 85 # Data for chosen model … … 369 370 370 371 # Update state stack 371 if self. support_undo:372 if self.undo_supported: 372 373 state = self.currentState() 373 374 self.pushFitPage(state) … … 877 878 if model_column == 1: 878 879 self.recalculatePlotData() 880 881 # Update state stack 882 if self.undo_supported: 883 state = self.currentState() 884 self.pushFitPage(state) 879 885 880 886 def checkboxSelected(self, item): -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
r6011788 r2241130 606 606 Push current state of fitpage onto stack 607 607 """ 608 pass 608 # Set data 609 test_data = Data1D(x=[1,2], y=[1,2]) 610 611 # Force same data into logic 612 self.widget.logic.data = test_data 613 self.widget.data_is_loaded = True 614 category_index = self.widget.cbCategory.findText("Sphere") 615 616 # Asses the initial state of stack 617 self.assertEqual(self.widget.page_stack, []) 618 619 # Set the undo flag 620 self.widget.undo_supported = True 621 self.widget.cbCategory.setCurrentIndex(category_index) 622 self.widget.parameters_to_fit = ['scale'] 623 624 # Check that the stack is updated 625 self.assertEqual(len(self.widget.page_stack), 1) 626 627 # Change another parameter 628 self.widget._model_model.item(2, 1).setText("3.0") 629 # Check that the stack is updated 630 self.assertEqual(len(self.widget.page_stack), 2) 609 631 610 632 def testPopFitPage(self): … … 612 634 Pop current state of fitpage from stack 613 635 """ 636 # TODO: to be added when implementing UNDO/REDO 614 637 pass 615 638
Note: See TracChangeset
for help on using the changeset viewer.