Skip to content

Commit

Permalink
Merge pull request #13995 from mantidproject/feature/13470_sliceviewe…
Browse files Browse the repository at this point in the history
…r_menus

Remove the invisible sliceviewer rebin lock button that is not used
  • Loading branch information
OwenArnold committed Oct 19, 2015
2 parents 34b2401 + 5e11bb9 commit 30a6dac
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 75 deletions.
6 changes: 2 additions & 4 deletions MantidQt/Python/mantidqt.sip
Original file line number Diff line number Diff line change
Expand Up @@ -1171,9 +1171,9 @@ void SliceViewer::setRebinNumBins(int xBins, int yBins)

%End

void setRebinMode(bool mode, bool locked) throw (std::runtime_error);
void setRebinMode(bool mode) throw (std::runtime_error);
%Docstring
void SliceViewer::setRebinMode(bool mode, bool locked)
void SliceViewer::setRebinMode(bool mode)
------------------------------------------------------
Sets the SliceViewer in dynamic rebin mode.
In this mode, the current view area (see setXYLimits()) is used as the
Expand All @@ -1183,8 +1183,6 @@ void SliceViewer::setRebinMode(bool mode, bool locked)

Args:
mode :: true for rebinning mode
locked :: if true, then the rebinned area is only refreshed manually
or when changing rebinning parameters.

%End

Expand Down
5 changes: 2 additions & 3 deletions MantidQt/SliceViewer/inc/MantidQtSliceViewer/SliceViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class EXPORT_OPT_MANTIDQT_SLICEVIEWER SliceViewer : public QWidget, public Zooma
/// Dynamic Rebinning-related Python bindings
void setRebinThickness(int dim, double thickness);
void setRebinNumBins(int xBins, int yBins);
void setRebinMode(bool mode, bool locked);
void setRebinMode(bool mode);
void refreshRebin();

/// Methods relating to peaks overlays.
Expand Down Expand Up @@ -188,7 +188,6 @@ public slots:
void LineMode_toggled(bool);
void SnapToGrid_toggled(bool);
void RebinMode_toggled(bool);
void RebinLock_toggled(bool);
void autoRebin_toggled(bool);

// Dynamic rebinning
Expand Down Expand Up @@ -333,7 +332,7 @@ public slots:

/// Synced menu/buttons
MantidQt::API::SyncedCheckboxes *m_syncLineMode, *m_syncSnapToGrid,
*m_syncRebinMode, *m_syncRebinLock, *m_syncAutoRebin;
*m_syncRebinMode, *m_syncAutoRebin;

/// Cached double for infinity
double m_inf;
Expand Down
41 changes: 0 additions & 41 deletions MantidQt/SliceViewer/inc/MantidQtSliceViewer/SliceViewer.ui
Original file line number Diff line number Diff line change
Expand Up @@ -489,47 +489,6 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnRebinLock">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>45</width>
<height>45</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>45</width>
<height>45</height>
</size>
</property>
<property name="toolTip">
<string>Lock the rebinned workspace in place (use the refresh button to refresh)</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/SliceViewer/icons/stock-lock.png</normaloff>:/SliceViewer/icons/stock-lock.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
Expand Down
27 changes: 1 addition & 26 deletions MantidQt/SliceViewer/src/SliceViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ SliceViewer::SliceViewer(QWidget *parent)

// hide unused buttons
ui.btnZoom->hide(); // hidden for a long time
ui.btnRebinLock->hide(); // now replaced by auto rebin mode
// ui.btnClearLine->hide(); // turning off line mode now removes line

// ----------- Toolbar button signals ----------------
QObject::connect(ui.btnResetZoom, SIGNAL(clicked()), this, SLOT(resetZoom()));
Expand Down Expand Up @@ -379,13 +377,6 @@ void SliceViewer::initMenus() {
SLOT(RebinMode_toggled(bool)));
m_menuView->addAction(action);

action = new QAction(QPixmap(), "&Lock Rebinned WS", this);
m_syncRebinLock = new SyncedCheckboxes(action, ui.btnRebinLock, true);
connect(m_syncRebinLock, SIGNAL(toggled(bool)), this,
SLOT(RebinLock_toggled(bool)));
action->setVisible(false); // hide this action
m_menuView->addAction(action);

action = new QAction(QPixmap(), "Rebin Current View", this);
action->setShortcut(Qt::Key_R + Qt::ControlModifier);
action->setEnabled(false);
Expand Down Expand Up @@ -691,7 +682,6 @@ void SliceViewer::setWorkspace(Mantid::API::IMDWorkspace_sptr ws) {

// Can't use dynamic rebin mode with a MatrixWorkspace
m_syncRebinMode->setEnabled(!matrix);
m_syncRebinLock->setEnabled(!matrix);

// Go to no normalization by default for MatrixWorkspaces
if (matrix)
Expand Down Expand Up @@ -1008,13 +998,10 @@ void SliceViewer::setRebinNumBins(int xBins, int yBins) {
* See setRebinThickness() to adjust the thickness in other dimensions.
*
* @param mode :: true for rebinning mode
* @param locked :: if true, then the rebinned area is only refreshed manually
* or when changing rebinning parameters.
*/
void SliceViewer::setRebinMode(bool mode, bool locked) {
void SliceViewer::setRebinMode(bool mode) {
// The events associated with these controls will trigger a re-draw
m_syncRebinMode->toggle(mode);
m_syncRebinLock->toggle(locked);
}

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -1098,7 +1085,6 @@ void SliceViewer::RebinMode_toggled(bool checked) {
for (size_t d = 0; d < m_dimWidgets.size(); d++)
m_dimWidgets[d]->showRebinControls(checked);
ui.btnRebinRefresh->setEnabled(checked);
ui.btnRebinLock->setEnabled(checked);
m_syncAutoRebin->setEnabled(checked);
m_actionRefreshRebin->setEnabled(checked);
m_rebinMode = checked;
Expand All @@ -1118,17 +1104,6 @@ void SliceViewer::RebinMode_toggled(bool checked) {
}
}

//------------------------------------------------------------------------------
/** Slot called when locking/unlocking the dynamically rebinned
* overlaid workspace
* @param checked :: DO lock the workspace in place
*/
void SliceViewer::RebinLock_toggled(bool checked) {
m_rebinLocked = checked;
// Rebin immediately
if (!m_rebinLocked && m_rebinMode)
this->rebinParamsChanged();
}

//------------------------------------------------------------------------------
/// Slot for zooming into
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def test_DynamicRebinning(self):
sv.setRebinThickness(2, 1.0)
sv.setRebinNumBins(50, 200)
sv.refreshRebin()
sv.setRebinMode(True, True)
sv.setRebinMode(True)
time.sleep(1)
self.assertTrue(mtd.doesExist('uniform_rebinned'), 'Dynamically rebinned workspace was created.')
ws = mtd['uniform_rebinned']
Expand Down

0 comments on commit 30a6dac

Please sign in to comment.