Skip to content

Commit

Permalink
Re #4303 fix issue with disabled buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Jan 25, 2012
1 parent c39b902 commit cf5585d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 5 additions & 1 deletion Code/Mantid/scripts/Interface/reduction_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ def reduce_clicked(self):
self.tools_menu.setEnabled(False)
if IS_IN_MANTIDPLOT:
_qti.app.mantidUI.setIsRunning(True)
self._interface.reduce()
if self._interface is not None:
self._interface.reduce()
if IS_IN_MANTIDPLOT:
_qti.app.mantidUI.setIsRunning(False)
self.reduce_button.setEnabled(True)
Expand Down Expand Up @@ -503,6 +504,9 @@ def _export(self):
Exports the current content of the UI to a python script that can
be run within MantidPlot
"""
if self._interface is None:
return

fname = '.'
if self._filename is not None:
(root, ext) = os.path.splitext(self._filename)
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/scripts/Interface/ui/reduction_main.ui
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ p, li { white-space: pre-wrap; }
<item>
<widget class="QPushButton" name="reduce_button">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="toolTip">
<string>Click to execute reduction.</string>
Expand All @@ -122,7 +122,7 @@ p, li { white-space: pre-wrap; }
<item>
<widget class="QPushButton" name="save_button">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="toolTip">
<string>Click to save your reduction parameters.</string>
Expand All @@ -135,7 +135,7 @@ p, li { white-space: pre-wrap; }
<item>
<widget class="QPushButton" name="export_button">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="toolTip">
<string>Click to export the reduction parameters to a python script that can be run in MantidPlot.</string>
Expand Down
8 changes: 4 additions & 4 deletions Code/Mantid/scripts/Interface/ui/ui_reduction_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Form implementation generated from reading ui file 'ui/reduction_main.ui'
#
# Created: Wed Jan 25 09:40:15 2012
# Created: Wed Jan 25 14:22:13 2012
# by: PyQt4 UI code generator 4.7.4
#
# WARNING! All changes made in this file will be lost!
Expand Down Expand Up @@ -54,15 +54,15 @@ def setupUi(self, SANSReduction):
spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem1)
self.reduce_button = QtGui.QPushButton(self.centralwidget)
self.reduce_button.setEnabled(False)
self.reduce_button.setEnabled(True)
self.reduce_button.setObjectName("reduce_button")
self.horizontalLayout.addWidget(self.reduce_button)
self.save_button = QtGui.QPushButton(self.centralwidget)
self.save_button.setEnabled(False)
self.save_button.setEnabled(True)
self.save_button.setObjectName("save_button")
self.horizontalLayout.addWidget(self.save_button)
self.export_button = QtGui.QPushButton(self.centralwidget)
self.export_button.setEnabled(False)
self.export_button.setEnabled(True)
self.export_button.setObjectName("export_button")
self.horizontalLayout.addWidget(self.export_button)
self.verticalLayout.addLayout(self.horizontalLayout)
Expand Down

0 comments on commit cf5585d

Please sign in to comment.