Skip to content

Commit

Permalink
Re #4282. Change some dialog parents to a floating window
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed Jan 18, 2012
1 parent 2f58d5a commit fc55e64
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 17 deletions.
8 changes: 3 additions & 5 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6196,9 +6196,8 @@ AssociationsDialog* ApplicationWindow::showPlotAssociations(int curve)
if (!g)
return 0;

AssociationsDialog* ad = new AssociationsDialog(this);
AssociationsDialog* ad = new AssociationsDialog(g);
ad->setAttribute(Qt::WA_DeleteOnClose);
ad->setGraph(g);
ad->initTablesList(tableList(), curve);
ad->show();
return ad;
Expand Down Expand Up @@ -6397,9 +6396,8 @@ void ApplicationWindow::showColumnValuesDialog()
return;

if (w->selectedColumns().count()>0 || w->table()->currentSelection() >= 0){
SetColValuesDialog* vd = new SetColValuesDialog(scriptingEnv(), this);
SetColValuesDialog* vd = new SetColValuesDialog(scriptingEnv(), w);
vd->setAttribute(Qt::WA_DeleteOnClose);
vd->setTable(w);
vd->exec();
} else
QMessageBox::warning(this, tr("MantidPlot - Column selection error"), tr("Please select a column first!"));//Mantid
Expand Down Expand Up @@ -6877,7 +6875,7 @@ void ApplicationWindow::showColumnOptionsDialog()
return;

if(t->selectedColumns().count()>0) {
TableDialog* td = new TableDialog(t, this);
TableDialog* td = new TableDialog(t);
td->setAttribute(Qt::WA_DeleteOnClose);
td->exec();
} else
Expand Down
6 changes: 4 additions & 2 deletions Code/Mantid/MantidPlot/src/AssociationsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
#include <QApplication>
#include <QMessageBox>

AssociationsDialog::AssociationsDialog( QWidget* parent, Qt::WFlags fl )
: QDialog( parent, fl )
AssociationsDialog::AssociationsDialog( Graph* g, Qt::WFlags fl )
: QDialog( g, fl )
{
setName( "AssociationsDialog" );
setWindowTitle( tr( "MantidPlot - Plot Associations" ) );
Expand Down Expand Up @@ -96,6 +96,8 @@ AssociationsDialog::AssociationsDialog( QWidget* parent, Qt::WFlags fl )
connect(btnOK, SIGNAL(clicked()),this, SLOT(accept()));
connect(btnCancel, SIGNAL(clicked()),this, SLOT(close()));
connect(btnApply, SIGNAL(clicked()),this, SLOT(updateCurves()));

setGraph(g);
}

void AssociationsDialog::accept()
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/MantidPlot/src/AssociationsDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ class AssociationsDialog : public QDialog
Q_OBJECT

public:
AssociationsDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
AssociationsDialog( Graph* g, Qt::WFlags fl = 0 );

void initTablesList(QList<MdiSubWindow *> lst, int curve);
void setGraph(Graph *g);

private slots:
void updateTable(int index);
void updateCurves();
void accept();

private:
void changePlotAssociation(int curve, const QString& text);
void setGraph(Graph *g);
void changePlotAssociation(int curve, const QString& text);
void updateColumnTypes();
void uncheckCol(int col);
void updatePlotAssociation(int row, int col);
Expand Down
6 changes: 4 additions & 2 deletions Code/Mantid/MantidPlot/src/SetColValuesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
#include <QCheckBox>
#endif

SetColValuesDialog::SetColValuesDialog( ScriptingEnv *env, QWidget* parent, Qt::WFlags fl )
: QDialog( parent, fl ), Scripted(env)
SetColValuesDialog::SetColValuesDialog( ScriptingEnv *env, Table* t, Qt::WFlags fl )
: QDialog( t, fl ), Scripted(env)
{
setName( "SetColValuesDialog" );
setWindowTitle( tr( "MantidPlot - Set column values" ) );
Expand Down Expand Up @@ -160,6 +160,8 @@ SetColValuesDialog::SetColValuesDialog( ScriptingEnv *env, QWidget* parent, Qt::
connect(functions, SIGNAL(activated(int)),this, SLOT(insertExplain(int)));
connect(buttonPrev, SIGNAL(clicked()), this, SLOT(prevColumn()));
connect(buttonNext, SIGNAL(clicked()), this, SLOT(nextColumn()));

setTable(t);
}

void SetColValuesDialog::prevColumn()
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/MantidPlot/src/SetColValuesDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ class SetColValuesDialog : public QDialog, public Scripted
Q_OBJECT

public:
SetColValuesDialog( ScriptingEnv *env, QWidget* parent = 0, Qt::WFlags fl = 0 );
void setTable(Table* w);
SetColValuesDialog( ScriptingEnv *env, Table* t, Qt::WFlags fl = 0 );

private slots:
bool apply();
Expand All @@ -71,6 +70,7 @@ private slots:
private:
Table* table;

void setTable(Table* w);
QSize sizeHint() const ;
void customEvent( QEvent *e );

Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/MantidPlot/src/TableDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
#include <QRegExp>
#include <QDate>

TableDialog::TableDialog(Table *t, QWidget* parent, Qt::WFlags fl )
: QDialog( parent, fl),
TableDialog::TableDialog(Table *t, Qt::WFlags fl )
: QDialog( t, fl),
d_table(t)
{
setName( "TableDialog" );
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/MantidPlot/src/TableDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class TableDialog : public QDialog
Q_OBJECT

public:
TableDialog(Table *t, QWidget* parent, Qt::WFlags fl = 0 );
TableDialog(Table *t, Qt::WFlags fl = 0 );

private slots:
void prevColumn();
Expand Down

0 comments on commit fc55e64

Please sign in to comment.