Salome HOME
Initial part document shapes management implementation.
[modules/shaper.git] / src / XGUI / XGUI_Workshop.cpp
index ec7ddf45abc9553a84184f3ccbdea0bdddf103fc..bbcef0e89cf857a8122008490661e4f6fae4eca7 100644 (file)
@@ -268,7 +268,7 @@ void XGUI_Workshop::initMenu()
 
   AppElements_Command* aCommand;
 
-  aCommand = aGroup->addFeature("SAVE_CMD", tr("Save..."), tr("Save the document"),
+  aCommand = aGroup->addFeature("SAVE_CMD", tr("Save"), tr("Save the document"),
                                 QIcon(":pictures/save.png"), QKeySequence::Save);
   aCommand->connectTo(this, SLOT(onSave()));
   //aCommand->disable();
@@ -881,7 +881,7 @@ void XGUI_Workshop::onOpen()
   }
 
   //show file dialog, check if readable and open
-  myCurrentDir = QFileDialog::getExistingDirectory(mainWindow());
+  myCurrentDir = QFileDialog::getExistingDirectory(mainWindow(), tr("Select folder"));
   if (myCurrentDir.isEmpty())
     return;
   QFileInfo aFileInfo(myCurrentDir);
@@ -923,7 +923,7 @@ bool XGUI_Workshop::onSaveAs()
   if(!isActiveOperationAborted())
     return false;
   QFileDialog dialog(mainWindow());
-  dialog.setWindowTitle(tr("Select directory to save files..."));
+  dialog.setWindowTitle(tr("Select folder to save files..."));
   dialog.setFileMode(QFileDialog::Directory);
   dialog.setFilter(tr("Folders (*)"));
   dialog.setOptions(QFileDialog::HideNameFilterDetails | QFileDialog::ShowDirsOnly);
@@ -932,6 +932,7 @@ bool XGUI_Workshop::onSaveAs()
   if (!dialog.exec()) {
     return false;
   }
+
   QString aTempDir = dialog.selectedFiles().first();
   QDir aDir(aTempDir);
   if (aDir.exists() && !aDir.entryInfoList(QDir::NoDotAndDotDot | QDir::AllEntries).isEmpty()) {
@@ -1118,20 +1119,16 @@ void XGUI_Workshop::updateCommandStatus()
   }
   SessionPtr aMgr = ModelAPI_Session::get();
   if (aMgr->hasModuleDocument()) {
-    QAction *aUndoCmd, *aRedoCmd;
     foreach(QAction* aCmd, aCommands) {
       QString aId = aCmd->data().toString();
       if (aId == "UNDO_CMD")
-        aUndoCmd = aCmd;
+        aCmd->setEnabled(myModule->canUndo());
       else if (aId == "REDO_CMD")
-        aRedoCmd = aCmd;
+        aCmd->setEnabled(myModule->canRedo());
       else
         // Enable all commands
         aCmd->setEnabled(true);
     }
-
-    aUndoCmd->setEnabled(myModule->canUndo());
-    aRedoCmd->setEnabled(myModule->canRedo());
     updateHistory();
   } else {
     foreach(QAction* aCmd, aCommands) {
@@ -1637,6 +1634,7 @@ for (int i = 0; i < aDoc->size(aGroupName); i++) { \
 void XGUI_Workshop::showObjects(const QObjectPtrList& theList, bool isVisible)
 {
   foreach (ObjectPtr aObj, theList) {
+    /*
     ResultPartPtr aPartRes = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aObj);
     if (aPartRes) {
       DocumentPtr aDoc = aPartRes->partDoc();
@@ -1644,8 +1642,9 @@ void XGUI_Workshop::showObjects(const QObjectPtrList& theList, bool isVisible)
       SET_DISPLAY_GROUP(ModelAPI_ResultConstruction::group(), isVisible)
       SET_DISPLAY_GROUP(ModelAPI_ResultGroup::group(), isVisible)
     } else {
+    */
       aObj->setDisplayed(isVisible);
-    }
+    //}
   }
   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
 }
@@ -1660,6 +1659,7 @@ void XGUI_Workshop::showOnlyObjects(const QObjectPtrList& theList)
 
   // Show only objects from the list
   foreach (ObjectPtr aObj, theList) {
+    /*
     ResultPartPtr aPartRes = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aObj);
     if (aPartRes) {
       DocumentPtr aDoc = aPartRes->partDoc();
@@ -1667,8 +1667,9 @@ void XGUI_Workshop::showOnlyObjects(const QObjectPtrList& theList)
       SET_DISPLAY_GROUP(ModelAPI_ResultConstruction::group(), true)
       SET_DISPLAY_GROUP(ModelAPI_ResultGroup::group(), true)
     } else {
+    */
       aObj->setDisplayed(true);
-    }
+    //}
   }
   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));