Skip to content

Commit

Permalink
Re #4431. Fixing the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed Jan 10, 2012
1 parent b026dc5 commit cf21dae
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3098,11 +3098,11 @@ Note* ApplicationWindow::newNote(const QString& caption)

addMdiSubWindow(m);

connect(m, SIGNAL(modifiedWindow(MdiSubWindow*)), this, SLOT(modifiedProject(MdiSubWindow*)));
connect(m, SIGNAL(resizedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*)));
connect(m, SIGNAL(closedWindow(MdiSubWindow*)), this, SLOT(closeWindow(MdiSubWindow*)));
connect(m, SIGNAL(hiddenWindow(MdiSubWindow*)), this, SLOT(hideWindow(MdiSubWindow*)));
connect(m, SIGNAL(statusChanged(MdiSubWindow*)), this, SLOT(updateWindowStatus(MdiSubWindow*)));
//connect(m, SIGNAL(modifiedWindow(MdiSubWindow*)), this, SLOT(modifiedProject(MdiSubWindow*)));
//connect(m, SIGNAL(resizedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*)));
//connect(m, SIGNAL(closedWindow(MdiSubWindow*)), this, SLOT(closeWindow(MdiSubWindow*)));
//connect(m, SIGNAL(hiddenWindow(MdiSubWindow*)), this, SLOT(hideWindow(MdiSubWindow*)));
//connect(m, SIGNAL(statusChanged(MdiSubWindow*)), this, SLOT(updateWindowStatus(MdiSubWindow*)));

m->showNormal();
return m;
Expand Down Expand Up @@ -4501,7 +4501,8 @@ ApplicationWindow* ApplicationWindow::openProject(const QString& fn, bool factor
app->setListViewDate(caption, graph[3]);
plot->setBirthDate(graph[3]);

restoreWindowGeometry(app, plot, t.readLine());
//restoreWindowGeometry(app, plot, t.readLine());
t.readLine();
plot->blockSignals(true);

if (d_file_version > 71)
Expand Down Expand Up @@ -4776,7 +4777,7 @@ MdiSubWindow* ApplicationWindow::openTemplate(const QString& fn)
if (w){
dynamic_cast<MultiLayer*>(w)->setCols(cols);
dynamic_cast<MultiLayer*>(w)->setRows(rows);
restoreWindowGeometry(this, w, geometry);
//restoreWindowGeometry(this, w, geometry);
if (d_file_version > 83){
QStringList lst=t.readLine().split("\t", QString::SkipEmptyParts);
dynamic_cast<MultiLayer*>(w)->setMargins(lst[1].toInt(),lst[2].toInt(),lst[3].toInt(),lst[4].toInt());
Expand Down Expand Up @@ -4809,7 +4810,7 @@ MdiSubWindow* ApplicationWindow::openTemplate(const QString& fn)
while (!t.atEnd())
lst << t.readLine();
w->restore(lst);
restoreWindowGeometry(this, w, geometry);
//restoreWindowGeometry(this, w, geometry);
}
}
}
Expand Down Expand Up @@ -10695,7 +10696,7 @@ Note* ApplicationWindow::openNote(ApplicationWindow* app, const QStringList &fli
app->setListViewDate(caption, lst[1]);
w->setBirthDate(lst[1]);
}
restoreWindowGeometry(app, w, flist[1]);
//restoreWindowGeometry(app, w, flist[1]);

lst=flist[2].split("\t");
w->setWindowLabel(lst[1]);
Expand Down Expand Up @@ -10799,7 +10800,7 @@ void ApplicationWindow::openMantidMatrix(const QStringList &list)
QStringList fields = (*line).split("\t");
if (fields[0] == "geometry" || fields[0] == "tgeometry")
{
restoreWindowGeometry(this, m, *line);
//restoreWindowGeometry(this, m, *line);
}
}
}
Expand All @@ -10811,14 +10812,14 @@ void ApplicationWindow::openInstrumentWindow(const QStringList &list)
InstrumentWindow *insWin = mantidUI->getInstrumentView(wsName);
if(!insWin)
return;
insWin->show();
//insWin->show();
QStringList::const_iterator line = list.begin();
for (line++; line!=list.end(); ++line)
{
QStringList fields = (*line).split("\t");
if (fields[0] == "geometry" || fields[0] == "tgeometry")
{
restoreWindowGeometry(this, insWin, *line);
//restoreWindowGeometry(this, insWin, *line);
}
}
}
Expand Down Expand Up @@ -11791,7 +11792,7 @@ Graph3D* ApplicationWindow::openSurfacePlot(ApplicationWindow* app, const QStrin
app->setListViewDate(caption, date);
plot->setBirthDate(date);
plot->setIgnoreFonts(true);
restoreWindowGeometry(app, plot, lst[1]);
//restoreWindowGeometry(app, plot, lst[1]);

fList=lst[4].split("\t", QString::SkipEmptyParts);
plot->setGrid(fList[1].toInt());
Expand Down Expand Up @@ -14679,7 +14680,7 @@ Folder* ApplicationWindow::appendProject(const QString& fn, Folder* parentFolder
plot->setBirthDate(graph[3]);
plot->blockSignals(true);

restoreWindowGeometry(this, plot, t.readLine());
//restoreWindowGeometry(this, plot, t.readLine());

if (d_file_version > 71){
QStringList lst=t.readLine().split("\t");
Expand Down Expand Up @@ -15998,8 +15999,13 @@ void ApplicationWindow::cascade()
int y = 0;
QList<QMdiSubWindow*> windows = d_workspace->subWindowList(QMdiArea::StackingOrder);
foreach (QMdiSubWindow *w, windows){
MdiSubWindow* innerWidget = dynamic_cast<MdiSubWindow*>(w->widget());
if (!innerWidget)
{
throw std::runtime_error("A non-MdiSubWindow detected in the MDI area");
}
w->setActiveWindow();
dynamic_cast<MdiSubWindow*>(w)->setNormal();
innerWidget->setNormal();
w->setGeometry(x, y, w->geometry().width(), w->geometry().height());
w->raise();
x += xoffset;
Expand Down

0 comments on commit cf21dae

Please sign in to comment.