-// Copyright (C) 2006-2014 CEA/DEN, EDF R&D
+// Copyright (C) 2006-2016 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
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()));
tr("shrink/expand"), tr("shrink or expand the selected node"),
0, _parent, false, this, SLOT(onShrinkExpand()));
+ _shrinkExpandChildren = _wrapper->createAction(getMenuId(), tr("shrink or expand direct children of the selected node"), QIcon("icons:shrinkExpand.png"),
+ tr("shrink/expand children"), tr("shrink or expand direct children of the selected node"),
+ 0, _parent, false, this, SLOT(onShrinkExpandChildren()));
+
+ _shrinkExpandElementaryRecursively = _wrapper->createAction(getMenuId(), tr("shrink or expand elementary nodes of the selected node recursively"), QIcon("icons:shrinkExpand.png"),
+ tr("shrink/expand elementary"), tr("shrink or expand elementary nodes of the selected node recursively"),
+ 0, _parent, false, this, SLOT(onShrinkExpandElementaryRecursively()));
+
_toggleStraightLinksAct = _wrapper->createAction(getMenuId(), tr("draw straight or orthogonal links"), QIcon("icons:straightLink.png"),
tr("straight/orthogonal"), tr("draw straight or orthogonal links"),
0, _parent, true, this, SLOT(onToggleStraightLinks(bool)));
void GenericGui::createTools()
{
- int aToolId = _wrapper->createTool ( tr( "YACS Toolbar" ) );
+ int aToolId = _wrapper->createTool ( tr( "YACS Toolbar" ), QString( "YACSToolbar" ) );
_wrapper->createTool( _newSchemaAct, aToolId );
_wrapper->createTool( _importSchemaAct, aToolId );
_wrapper->createTool( _wrapper->separator(), aToolId );
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");
_guiEditor->shrinkExpand();
}
+void GenericGui::onShrinkExpandChildren() {
+ DEBTRACE("GenericGui::onShrinkExpandChildren");
+ _guiEditor->shrinkExpand(Qt::ControlModifier|Qt::ShiftModifier);
+}
+
+void GenericGui::onShrinkExpandElementaryRecursively() {
+ DEBTRACE("GenericGui::onShrinkExpandElementaryRecursively");
+ _guiEditor->shrinkExpand(Qt::ControlModifier);
+}
+
void GenericGui::onToggleStraightLinks(bool checked)
{
Scene::_straightLinks = checked;
{
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");
}