-// Copyright (C) 2006-2014 CEA/DEN, EDF R&D
+// Copyright (C) 2006-2019 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
_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);
-#endif
//Import user catalog
std::string usercata=Resource::userCatalog.toStdString();
_catalogsWidget->addCatalogFromFile(usercata);
tr("Create Container"), tr("Create a New Container"),
0, _parent, false, this, SLOT(onNewContainer()));
+ _newHPContainerAct = _wrapper->createAction(getMenuId(), tr("Create a New HP Container"), QIcon("icons:container.png"),
+ tr("Create HP Container"), tr("Create a New Homogeneous Pool Container."),
+ 0, _parent, false, this, SLOT(onNewHPContainer()));
+
_selectComponentInstanceAct = _wrapper->createAction(getMenuId(), tr("Select a Component Instance"), QIcon("icons:icon_select.png"),
tr("Select a Component Instance"), tr("Select a Component Instance"),
0, _parent, false, this, SLOT(onSelectComponentInstance()));
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;
}
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);
QString aCall = "salomeloader."+ fileExt+ " "+ fn + " " + tmpFileName + " > " + tmpOutput;
DEBTRACE(aCall.toStdString());
- int ret = system(aCall.toAscii());
+ int ret = system(aCall.toLatin1());
if(ret != 0)
{
// --- read file with logs
- fstream f(tmpOutput.toAscii());
+ fstream f(tmpOutput.toLatin1());
stringstream hfile;
hfile << f.rdbuf();
f.close();
filters << "XML files (*.xml)"
<< "Any files (*)";
dialog.setFileMode(QFileDialog::AnyFile);
- dialog.setFilters(filters);
- dialog.selectFilter("(*.xml)");
+ dialog.setNameFilters(filters);
+ dialog.selectNameFilter("(*.xml)");
dialog.setDefaultSuffix("xml");
dialog.setConfirmOverwrite(true);
//dialog.setConfirmOverwrite(false); // bug Qt4.3.3
_guiEditor->CreateContainer();
}
+void GenericGui::onNewHPContainer()
+{
+ DEBTRACE("GenericGui::onNewHPContainer");
+ _guiEditor->CreateHPContainer();
+}
+
void GenericGui::onNewSalomeComponent()
{
DEBTRACE("GenericGui::onNewSalomeComponent");
{
DEBTRACE("GenericGui::onUndo");
if (QtGuiContext::getQtCurrent()->_setOfModifiedSubjects.empty())
+ {
QtGuiContext::getQtCurrent()->getInvoc()->undo();
+ // Empty the clipboard in order to avoid the copy of a destroyed object.
+ QtGuiContext::getQtCurrent()->setSubjectToCopy(NULL);
+ }
else Message("undo not possible when there are local modifications not confirmed");
}
{
DEBTRACE("GenericGui::onRedo");
if (QtGuiContext::getQtCurrent()->_setOfModifiedSubjects.empty())
+ {
QtGuiContext::getQtCurrent()->getInvoc()->redo();
+ // Empty the clipboard in order to avoid the copy of a destroyed object.
+ QtGuiContext::getQtCurrent()->setSubjectToCopy(NULL);
+ }
else Message("redo not possible when there are local modifications not confirmed");
}
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)