Salome HOME
projects
/
modules
/
yacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove QT4 compatibility.
[modules/yacs.git]
/
src
/
genericgui
/
GenericGui.cxx
diff --git
a/src/genericgui/GenericGui.cxx
b/src/genericgui/GenericGui.cxx
index 67d02f5811ad1f851ea797b925ed1e22bb139ae0..cbcc9c110b9bd46ade940eaec8946fa142d2fa0f 100644
(file)
--- a/
src/genericgui/GenericGui.cxx
+++ b/
src/genericgui/GenericGui.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2006-201
5
CEA/DEN, EDF R&D
+// Copyright (C) 2006-201
9
CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@
-172,10
+172,9
@@
GenericGui::GenericGui(YACS::HMI::SuitWrapper* wrapper, QMainWindow *parent)
_dwCatalogs->setWidget(_catalogsWidget);
_parent->tabifyDockWidget(_dwStacked, _dwCatalogs);
_dwCatalogs->setWidget(_catalogsWidget);
_parent->tabifyDockWidget(_dwStacked, _dwCatalogs);
- _parent->tabifyDockWidget(_dwTree, _wrapper->objectBrowser());
-#if QT_VERSION >= 0x040500
+ if (_wrapper->objectBrowser())
+ _parent->tabifyDockWidget(_dwTree, _wrapper->objectBrowser());
_parent->setTabPosition(Qt::AllDockWidgetAreas, Resource::tabPanelsUp? QTabWidget::North: QTabWidget::South);
_parent->setTabPosition(Qt::AllDockWidgetAreas, Resource::tabPanelsUp? QTabWidget::North: QTabWidget::South);
-#endif
//Import user catalog
std::string usercata=Resource::userCatalog.toStdString();
_catalogsWidget->addCatalogFromFile(usercata);
//Import user catalog
std::string usercata=Resource::userCatalog.toStdString();
_catalogsWidget->addCatalogFromFile(usercata);
@@
-968,19
+967,15
@@
bool GenericGui::closeContext(QWidget *view, bool onExit)
break;
}
}
break;
}
}
- int studyId = _wrapper->activeStudyId();
- if (context->getStudyId() == studyId)
+ _wrapper->deleteSchema(view);
+ DEBTRACE("delete context");
+ if (GuiExecutor* exec = context->getGuiExecutor())
{
{
- _wrapper->deleteSchema(view);
- DEBTRACE("delete context");
- if (GuiExecutor* exec = context->getGuiExecutor())
- {
- exec->closeContext();
- }
- delete context;
- _mapViewContext.erase(view);
- switchContext(newView, onExit);
+ exec->closeContext();
}
}
+ delete context;
+ _mapViewContext.erase(view);
+ switchContext(newView, onExit);
return true;
}
return true;
}
@@
-1092,11
+1087,7
@@
void GenericGui::createContext(YACS::ENGINE::Proc* proc,
GraphicsView* gView = new GraphicsView(viewWindow);
gView->setScene(scene);
gView->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
GraphicsView* gView = new GraphicsView(viewWindow);
gView->setScene(scene);
gView->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
- int studyId = _wrapper->AssociateViewToWindow(gView, viewWindow);
- context->setStudyId(studyId);
- std::ostringstream value;
- value << studyId;
- proc->setProperty("DefaultStudyID",value.str());
+ _wrapper->AssociateViewToWindow(gView, viewWindow);
context->setScene(scene);
context->setView(gView);
context->setWindow(viewWindow);
context->setScene(scene);
context->setView(gView);
context->setWindow(viewWindow);
@@
-1437,11
+1428,11
@@
void GenericGui::onImportSupervSchema()
QString aCall = "salomeloader."+ fileExt+ " "+ fn + " " + tmpFileName + " > " + tmpOutput;
DEBTRACE(aCall.toStdString());
QString aCall = "salomeloader."+ fileExt+ " "+ fn + " " + tmpFileName + " > " + tmpOutput;
DEBTRACE(aCall.toStdString());
- int ret = system(aCall.to
Ascii
());
+ int ret = system(aCall.to
Latin1
());
if(ret != 0)
{
// --- read file with logs
if(ret != 0)
{
// --- read file with logs
- fstream f(tmpOutput.to
Ascii
());
+ fstream f(tmpOutput.to
Latin1
());
stringstream hfile;
hfile << f.rdbuf();
f.close();
stringstream hfile;
hfile << f.rdbuf();
f.close();
@@
-1516,8
+1507,8
@@
QString GenericGui::getSaveFileName(const QString& fileName)
filters << "XML files (*.xml)"
<< "Any files (*)";
dialog.setFileMode(QFileDialog::AnyFile);
filters << "XML files (*.xml)"
<< "Any files (*)";
dialog.setFileMode(QFileDialog::AnyFile);
- dialog.setFilters(filters);
- dialog.selectFilter("(*.xml)");
+ dialog.set
Name
Filters(filters);
+ dialog.select
Name
Filter("(*.xml)");
dialog.setDefaultSuffix("xml");
dialog.setConfirmOverwrite(true);
//dialog.setConfirmOverwrite(false); // bug Qt4.3.3
dialog.setDefaultSuffix("xml");
dialog.setConfirmOverwrite(true);
//dialog.setConfirmOverwrite(false); // bug Qt4.3.3
@@
-2588,7
+2579,6
@@
void GenericGui::onShowRedo()
void GenericGui::onCleanOnExit()
{
DEBTRACE("GenericGui::onCleanOnExit");
void GenericGui::onCleanOnExit()
{
DEBTRACE("GenericGui::onCleanOnExit");
- int studyId = _wrapper->activeStudyId();
map<QWidget*, YACS::HMI::QtGuiContext*> mapViewContextCopy = _mapViewContext;
map<QWidget*, YACS::HMI::QtGuiContext*>::iterator it = mapViewContextCopy.begin();
for (; it != mapViewContextCopy.end(); ++it)
map<QWidget*, YACS::HMI::QtGuiContext*> mapViewContextCopy = _mapViewContext;
map<QWidget*, YACS::HMI::QtGuiContext*>::iterator it = mapViewContextCopy.begin();
for (; it != mapViewContextCopy.end(); ++it)