Skip to content

Commit

Permalink
Pass the whole selection to the method.
Browse files Browse the repository at this point in the history
And check for multiple X columns selected as well.

Refs #7579
  • Loading branch information
arturbekasov committed Sep 24, 2013
1 parent 95bcc55 commit ae1be2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16448,6 +16448,9 @@ bool ApplicationWindow::validFor2DPlot(Table *table)
if (!table->selectedYColumns().count()){
QMessageBox::warning(this, tr("MantidPlot - Error"), tr("Please select a Y column to plot!"));//Mantid
return false;
} else if (table->selectedXColumns().count() > 1){
QMessageBox::warning(this, tr("MantidPlot - Error"), tr("Can't plot using multiple X columns!"));//Mantid
return false;
} else if (table->numCols()<2) {
QMessageBox::critical(this, tr("MantidPlot - Error"),tr("You need at least two columns for this operation!"));//Mantid
return false;
Expand All @@ -16470,7 +16473,7 @@ MultiLayer* ApplicationWindow::generate2DGraph(Graph::CurveType type)
return 0;

Q3TableSelection sel = table->getSelection();
return multilayerPlot(table, table->drawableColumnSelection(), type, sel.topRow(), sel.bottomRow());
return multilayerPlot(table, table->selectedColumns(), type, sel.topRow(), sel.bottomRow());
} else if (w->isA("Matrix")){
Matrix *m = static_cast<Matrix *>(w);
return plotHistogram(m);
Expand Down

0 comments on commit ae1be2a

Please sign in to comment.