Skip to content

Commit

Permalink
Added a "Plot All" button to the spectra dialog. Refs #4034.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterParker committed Nov 4, 2011
1 parent 413ca4c commit 213a0bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Code/Mantid/MantidPlot/src/Mantid/MantidWSIndexDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ void MantidWSIndexDialog::plot()
// TODO - Add functionality to warn the user?
}

void MantidWSIndexDialog::plotAll()
{
m_wsIndexChoice = m_wsIndexIntervals;
accept();
}

void MantidWSIndexDialog::editedWsField()
{
if(m_spectra) m_spectraField->clear();
Expand Down Expand Up @@ -190,14 +196,17 @@ void MantidWSIndexDialog::initButtons()

m_okButton = new QPushButton("Ok");
m_cancelButton = new QPushButton("Cancel");
m_plotAllButton = new QPushButton("Plot All");

m_buttonBox->addWidget(m_okButton);
m_buttonBox->addWidget(m_cancelButton);
m_buttonBox->addWidget(m_plotAllButton);

m_outer->addItem(m_buttonBox);

connect(m_okButton, SIGNAL(clicked()), this, SLOT(plot()));
connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(close()));
connect(m_plotAllButton, SIGNAL(clicked()), this, SLOT(plotAll()));
}

void MantidWSIndexDialog::checkForSpectraAxes()
Expand Down
4 changes: 3 additions & 1 deletion Code/Mantid/MantidPlot/src/Mantid/MantidWSIndexDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ class MantidWSIndexDialog : public QDialog
private slots:
/// Called when the OK button is pressed.
void plot();
/// Called when the "Plot All" button is pressed.
void plotAll();
/// Called when the wsField has been edited.
void editedWsField();
/// Called when the spectraField has been edited.
Expand Down Expand Up @@ -236,7 +238,7 @@ private slots:
QLineEdit *m_wsField, *m_spectraField;
QVBoxLayout *m_outer, *m_wsBox, *m_spectraBox;
QHBoxLayout *m_buttonBox;
QPushButton *m_okButton, *m_cancelButton;
QPushButton *m_okButton, *m_cancelButton, *m_plotAllButton;

/// A list of names of workspaces which are to be plotted.
QList<QString> m_wsNames;
Expand Down

0 comments on commit 213a0bb

Please sign in to comment.