Changeset d6b8a1d in sasview for src/sas/qtgui/Utilities
- Timestamp:
- Nov 9, 2017 8:43:56 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:
- 53c771e
- Parents:
- fbfc488
- git-author:
- Piotr Rozyczko <rozyczko@…> (11/07/17 08:29:59)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (11/09/17 08:43:56)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Utilities/GuiUtils.py
rfbfc488 rd6b8a1d 584 584 } 585 585 # Query user for filename. 586 filename = QtWidgets.QFileDialog.getSaveFileName(**kwargs) 586 filename_tuple = QtWidgets.QFileDialog.getSaveFileName(**kwargs) 587 filename = filename_tuple[0] 587 588 588 589 # User cancelled. 589 590 if not filename: 590 591 return 591 592 filename = str(filename)593 592 594 593 #Instantiate a loader … … 616 615 } 617 616 # Query user for filename. 618 filename = QtWidgets.QFileDialog.getSaveFileName(**kwargs) 617 filename_tuple = QtWidgets.QFileDialog.getSaveFileName(**kwargs) 618 filename = filename_tuple[0] 619 619 620 620 # User cancelled. 621 621 if not filename: 622 622 return 623 filename = str(filename) 623 624 624 #Instantiate a loader 625 625 loader = Loader() … … 825 825 else: 826 826 raise ValueError 827 828 class DoubleValidator(QtGui.QDoubleValidator): 829 """ 830 Allow only dots as decimal separator 831 """ 832 def validate(self, input, pos): 833 """ 834 Return invalid for commas 835 """ 836 if (',' in input): 837 return (QtGui.QValidator.Invalid, input, pos) 838 return super(DoubleValidator, self).validate(input, pos) 839 840 def fixup(self, input): 841 """ 842 Correct (remove) potential preexisting content 843 """ 844 QtGui.QDoubleValidator.fixup(input) 845 input = input.replace(",", "") 846
Note: See TracChangeset
for help on using the changeset viewer.