- Timestamp:
- Oct 20, 2016 9:11:19 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:
- 9968d6a
- Parents:
- ef36eb2
- Location:
- src/sas/qtgui
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/DensityPanel.py
r6083d6e r1d85b5e 1 1 # global 2 2 import logging 3 import functools 4 3 5 from periodictable import formula as Formula 4 6 … … 59 61 60 62 def __init__(self, parent=None): 61 super(DensityPanel, self).__init__( parent)63 super(DensityPanel, self).__init__() 62 64 63 65 self.mode = None 64 66 self.manager = parent 65 67 self.setupUi() 66 68 self.setupModel() … … 79 81 80 82 # signals 81 QtCore.QObject.connect( 82 self.ui.editMolarVolume, 83 QtCore.SIGNAL("textEdited(QString)"), 84 lambda text: self.setMode(MODES.VOLUME_TO_DENSITY)) 85 QtCore.QObject.connect( 86 self.ui.editMassDensity, 87 QtCore.SIGNAL("textEdited(QString)"), 88 lambda text: self.setMode(MODES.DENSITY_TO_VOLUME)) 89 QtCore.QObject.connect( 90 self.ui.buttonBox.button(QtGui.QDialogButtonBox.Reset), 91 QtCore.SIGNAL("clicked(bool)"), 92 lambda checked: self.modelReset()) 83 self.ui.editMolarVolume.textEdited.connect(functools.partial(self.setMode, MODES.VOLUME_TO_DENSITY)) 84 self.ui.editMassDensity.textEdited.connect(functools.partial(self.setMode, MODES.DENSITY_TO_VOLUME)) 85 86 self.ui.buttonBox.button(QtGui.QDialogButtonBox.Reset).clicked.connect(self.modelReset) 87 self.ui.buttonBox.button(QtGui.QDialogButtonBox.Help).clicked.connect(self.displayHelp) 93 88 94 89 def setupModel(self): … … 99 94 self.model.setItem(MODEL.MASS_DENSITY , QtGui.QStandardItem()) 100 95 101 QtCore.QObject.connect( 102 self.model, 103 QtCore.SIGNAL("dataChanged(QModelIndex,QModelIndex)"), 104 self.dataChanged) 96 self.model.dataChanged.connect(self.dataChanged) 105 97 106 98 self.modelReset() … … 170 162 pass 171 163 #self.model.endResetModel() 164 165 def displayHelp(self): 166 try: 167 location = self.manager.HELP_DIRECTORY_LOCATION + \ 168 "/user/sasgui/perspectives/calculator/density_calculator_help.html" 169 self.manager._helpView.load(QtCore.QUrl(location)) 170 self.manager._helpView.show() 171 except AttributeError: 172 # No manager defined - testing and standalone runs 173 pass -
src/sas/qtgui/GuiManager.py
- Property mode changed from 100755 to 100644
r7451b88 r1d85b5e 24 24 from IPythonWidget import IPythonWidget 25 25 from WelcomePanel import WelcomePanel 26 from SldPanel import SldPanel 27 from DensityPanel import DensityPanel 26 28 27 29 # Perspectives … … 131 133 self.ackWidget = Acknowledgements() 132 134 self.aboutWidget = AboutBox() 135 136 # Add calculators - floating for usability 137 self.SLDCalculator = SldPanel(self) 138 self.DVCalculator = DensityPanel(self) 133 139 134 140 def statusBarSetup(self): … … 513 519 """ 514 520 """ 515 print("actionSLD_Calculator TRIGGERED") 516 pass 521 self.SLDCalculator.show() 517 522 518 523 def actionDensity_Volume_Calculator(self): 519 524 """ 520 525 """ 521 print("actionDensity_Volume_Calculator TRIGGERED") 522 pass 526 self.DVCalculator.show() 523 527 524 528 def actionSlit_Size_Calculator(self): -
src/sas/qtgui/SldPanel.py
ref36eb2 r1d85b5e 118 118 119 119 def __init__(self, parent=None): 120 super(SldPanel, self).__init__(parent) 120 super(SldPanel, self).__init__() 121 122 self.manager = parent 121 123 122 124 self.setupUi() … … 149 151 150 152 # signals 151 QtCore.QObject.connect( 152 self.ui.buttonBox.button(QtGui.QDialogButtonBox.Reset), 153 QtCore.SIGNAL("clicked(bool)"), 154 lambda checked: self.modelReset()) 153 self.ui.buttonBox.button(QtGui.QDialogButtonBox.Reset).clicked.connect(self.modelReset) 154 self.ui.buttonBox.button(QtGui.QDialogButtonBox.Help).clicked.connect(self.displayHelp) 155 155 156 156 def setupModel(self): … … 232 232 pass 233 233 #self.model.endResetModel() 234 235 def displayHelp(self): 236 try: 237 location = self.manager.HELP_DIRECTORY_LOCATION + \ 238 "/user/sasgui/perspectives/calculator/sld_calculator_help.html" 239 self.manager._helpView.load(QtCore.QUrl(location)) 240 self.manager._helpView.show() 241 except AttributeError: 242 # No manager defined - testing and standalone runs 243 pass 244 -
src/sas/qtgui/UI/DensityPanel.ui
r6083d6e r1d85b5e 7 7 <x>0</x> 8 8 <y>0</y> 9 <width> 633</width>10 <height> 293</height>9 <width>290</width> 10 <height>178</height> 11 11 </rect> 12 </property> 13 <property name="sizePolicy"> 14 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 15 <horstretch>0</horstretch> 16 <verstretch>0</verstretch> 17 </sizepolicy> 12 18 </property> 13 19 <property name="windowTitle"> 14 20 <string>Density/Volume Calculator</string> 21 </property> 22 <property name="windowIcon"> 23 <iconset resource="main_resources.qrc"> 24 <normaloff>:/res/ball.ico</normaloff>:/res/ball.ico</iconset> 15 25 </property> 16 26 <layout class="QGridLayout" name="gridLayout_2"> … … 134 144 <item row="2" column="0"> 135 145 <widget class="QDialogButtonBox" name="buttonBox"> 146 <property name="sizePolicy"> 147 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> 148 <horstretch>0</horstretch> 149 <verstretch>0</verstretch> 150 </sizepolicy> 151 </property> 136 152 <property name="orientation"> 137 153 <enum>Qt::Horizontal</enum> 138 154 </property> 139 155 <property name="standardButtons"> 140 <set>QDialogButtonBox::Close|QDialogButtonBox:: Reset</set>156 <set>QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Reset</set> 141 157 </property> 142 158 <property name="centerButtons"> … … 154 170 <tabstop>buttonBox</tabstop> 155 171 </tabstops> 156 <resources/> 172 <resources> 173 <include location="main_resources.qrc"/> 174 </resources> 157 175 <connections> 158 176 <connection> -
src/sas/qtgui/UI/SldPanel.ui
ref36eb2 r1d85b5e 7 7 <x>0</x> 8 8 <y>0</y> 9 <width> 632</width>10 <height> 651</height>9 <width>447</width> 10 <height>403</height> 11 11 </rect> 12 </property> 13 <property name="sizePolicy"> 14 <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> 15 <horstretch>0</horstretch> 16 <verstretch>0</verstretch> 17 </sizepolicy> 12 18 </property> 13 19 <property name="windowTitle"> 14 20 <string>SLD Calculator</string> 21 </property> 22 <property name="windowIcon"> 23 <iconset resource="main_resources.qrc"> 24 <normaloff>:/res/ball.ico</normaloff>:/res/ball.ico</iconset> 15 25 </property> 16 26 <layout class="QGridLayout" name="gridLayout_2"> … … 307 317 </property> 308 318 <property name="standardButtons"> 309 <set>QDialogButtonBox::Close|QDialogButtonBox:: Reset</set>319 <set>QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Reset</set> 310 320 </property> 311 321 <property name="centerButtons"> … … 331 341 <tabstop>buttonBox</tabstop> 332 342 </tabstops> 333 <resources/> 343 <resources> 344 <include location="main_resources.qrc"/> 345 </resources> 334 346 <connections> 335 347 <connection> -
src/sas/qtgui/UI/convert_all.sh
rfac2619 r1d85b5e 1 1 # UI -> PY 2 2 for filename in *.ui; do 3 pyuic4 $filename > "`basename "$filename" .ui`.py"3 pyuic4.bat $filename > "`basename "$filename" .ui`.py" 4 4 done 5 5
Note: See TracChangeset
for help on using the changeset viewer.