Salome HOME
Added history branch into data tree (issue #22)
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 8 May 2014 13:59:19 +0000 (17:59 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 8 May 2014 13:59:19 +0000 (17:59 +0400)
Removed generated TS files

13 files changed:
.gitignore
src/PartSet/CMakeLists.txt
src/PartSet/PartSet_msg_en.ts [deleted file]
src/PyConsole/CMakeLists.txt
src/PyConsole/PyConsole_Console.cpp
src/PyConsole/resources/PyConsole_msg_en.ts [deleted file]
src/PyConsole/resources/PyConsole_msg_fr.ts [deleted file]
src/PyConsole/resources/PyConsole_msg_ja.ts [deleted file]
src/XGUI/XGUI_DocumentDataModel.cpp
src/XGUI/XGUI_DocumentDataModel.h
src/XGUI/XGUI_msg_fr.ts [deleted file]
src/XGUI/XGUI_pictures.qrc
src/XGUI/pictures/ViewPort.png [deleted file]

index 25d046ae1b03e0bfce5a2f82638e665e79a0218e..f55ecf287870a46e890ed9032633c95acc3311ab 100644 (file)
@@ -18,6 +18,7 @@ lib/
 *.pro.user
 moc_*.*
 *.qm
+*.ts
 #Resources
 resources
 !src/*/resources
index 2f4c40ba7c8601e70570c429ae7f63d996a3745c..7461196d2aabfa03c6ce7dec0bc9dce119c631a9 100644 (file)
@@ -28,9 +28,9 @@ SET(PROJECT_RESOURCES
     PartSet_icons.qrc
 )
 
-SET(TEXT_RESOURCES
-       PartSet_msg_en.ts
-)
+#SET(TEXT_RESOURCES
+#      PartSet_msg_fr.ts
+#)
 
 SET(PROJECT_LIBRARIES
     ModuleBase
@@ -45,10 +45,17 @@ SET(PROJECT_AUTOMOC
 )
 
 QT4_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
-QT4_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
+#QT4_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
+#QT4_CREATE_TRANSLATION(QM_RESOURCES 
+#                                         ${PROJECT_SOURCES}
+#                                         ${TEXT_RESOURCES}
+#                                         OPTIONS -extensions cpp -no-recursive
+#                                         )
 
-SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES})
-SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES})
+#SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES})
+SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES})
+#SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES})
+SOURCE_GROUP ("Resource Files" FILES ${PROJECT_RESOURCES})
 
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/XGUI 
                     ${CMAKE_SOURCE_DIR}/src/Config
@@ -68,8 +75,8 @@ ADD_LIBRARY(PartSet SHARED
        ${PROJECT_SOURCES} 
        ${PROJECT_HEADERS} 
        ${PROJECT_COMPILED_RESOURCES} 
-       ${TEXT_RESOURCES} 
-       ${QM_RESOURCES}
+#      ${TEXT_RESOURCES} 
+#      ${QM_RESOURCES}
 )
 
 # The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
@@ -78,3 +85,4 @@ TARGET_LINK_LIBRARIES(PartSet ${PROJECT_LIBRARIES} XGUI ModelAPI GeomAlgoAPI)
 ADD_DEPENDENCIES(PartSet ModuleBase)
 
 INSTALL(TARGETS PartSet DESTINATION bin)
+#INSTALL(FILES ${QM_RESOURCES} DESTINATION bin)
\ No newline at end of file
diff --git a/src/PartSet/PartSet_msg_en.ts b/src/PartSet/PartSet_msg_en.ts
deleted file mode 100644 (file)
index 4270bb8..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="en_US">
-<context>
-    <name>@default</name>
-</context>
-<context>
-    <name>XGUI_Workshop</name>
-    <message>
-        <source>HOME_MENU_TITLE</source>
-        <translation>Home</translation>
-    </message>
-    <message>
-        <source>NEW_MENU</source>
-        <translation>New</translation>
-    </message>
-</context>
-</TS>
index 4ba2ef12446d2f19ed99e6ca212e5fab04049d95..aa79a1dc457df7693cd6e73f14719b64ac71a2bd 100644 (file)
@@ -19,10 +19,9 @@ SET(PROJECT_AUTOMOC
 
 # resource files / to be processed by lrelease
 SET(TEXT_RESOURCES
-  resources/PyConsole_msg_en.ts
-  resources/PyConsole_msg_fr.ts
-  resources/PyConsole_msg_ja.ts
+  PyConsole_msg_fr.ts
 )
+
 # sources / static
 SET(PROJECT_SOURCES
   PyConsole_Console.cpp
@@ -40,7 +39,12 @@ SET(PROJECT_LIBRARIES
        ${PYTHON_LIBRARIES}
 )
 
-QT4_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
+#QT4_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
+QT4_CREATE_TRANSLATION(QM_RESOURCES 
+                                          ${PROJECT_SOURCES}
+                                          ${TEXT_RESOURCES}
+                                          OPTIONS -extensions cpp -no-recursive
+                                          )
 
 SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${QM_RESOURCES})
 
@@ -61,5 +65,6 @@ ADD_LIBRARY(PyConsole SHARED
 TARGET_LINK_LIBRARIES(PyConsole ${PROJECT_LIBRARIES})
 
 INSTALL(TARGETS PyConsole DESTINATION bin)
+INSTALL(FILES ${QM_RESOURCES} DESTINATION bin)
 
 
index 54391474f585d3f3c57841cee5d05860284eceb3..79ae485e9f94c2d2a5c23b4ce36f706fc15ce069 100644 (file)
@@ -270,23 +270,23 @@ int PyConsole_Console::menuActions() const
 */
 void PyConsole_Console::createActions()
 {
-  QAction* a = new QAction( tr( "EDIT_COPY_CMD" ), this );
-  a->setStatusTip( tr( "EDIT_COPY_CMD" ) );
+  QAction* a = new QAction( tr( "&Copy" ), this );
+  a->setStatusTip( tr( "Copy" ) );
   connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( copy() ) );
   myActions.insert( CopyId, a );
 
-  a = new QAction( tr( "EDIT_PASTE_CMD" ), this );
-  a->setStatusTip( tr( "EDIT_PASTE_CMD" ) );
+  a = new QAction( tr( "&Paste" ), this );
+  a->setStatusTip( tr( "Paste" ) );
   connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( paste() ) );
   myActions.insert( PasteId, a );
 
-  a = new QAction( tr( "EDIT_CLEAR_CMD" ), this );
-  a->setStatusTip( tr( "EDIT_CLEAR_CMD" ) );
+  a = new QAction( tr( "Clea&r" ), this );
+  a->setStatusTip( tr( "Clear" ) );
   connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( clear() ) );
   myActions.insert( ClearId, a );
 
-  a = new QAction( tr( "EDIT_SELECTALL_CMD" ), this );
-  a->setStatusTip( tr( "EDIT_SELECTALL_CMD" ) );
+  a = new QAction( tr( "Select &All" ), this );
+  a->setStatusTip( tr( "Select all" ) );
   connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( selectAll() ) );
   myActions.insert( SelectAllId, a );
   
diff --git a/src/PyConsole/resources/PyConsole_msg_en.ts b/src/PyConsole/resources/PyConsole_msg_en.ts
deleted file mode 100644 (file)
index 85393a2..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="en_US">
-<context>
-    <name>PyConsole_Console</name>
-    <message>
-        <location filename="../PyConsole_Console.cxx" line="216"/>
-        <source>EDIT_COPY_CMD</source>
-        <translation>&amp;Copy</translation>
-    </message>
-    <message>
-        <location filename="../PyConsole_Console.cxx" line="221"/>
-        <source>EDIT_PASTE_CMD</source>
-        <translation>&amp;Paste</translation>
-    </message>
-    <message>
-        <location filename="../PyConsole_Console.cxx" line="226"/>
-        <source>EDIT_CLEAR_CMD</source>
-        <translation>Clea&amp;r</translation>
-    </message>
-    <message>
-        <location filename="../PyConsole_Console.cxx" line="231"/>
-        <source>EDIT_SELECTALL_CMD</source>
-        <translation>Select &amp;All</translation>
-    </message>
-    <message>
-        <source>EDIT_DUMPCOMMANDS_CMD</source>
-        <translation>D&amp;ump commands</translation>
-    </message>
-</context>
-<context>
-    <name>PyConsole_Editor</name>
-    <message>
-        <source>TOT_DUMP_PYCOMMANDS</source>
-        <translation>Dump commands</translation>
-    </message>
-    <message>
-        <source>PYTHON_FILES_FILTER</source>
-        <translation>PYTHON Files (*.py)</translation>
-    </message>
-</context>
-</TS>
diff --git a/src/PyConsole/resources/PyConsole_msg_fr.ts b/src/PyConsole/resources/PyConsole_msg_fr.ts
deleted file mode 100644 (file)
index 9109115..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="fr_FR">
-<context>
-    <name>PyConsole_Console</name>
-    <message>
-        <location filename="../PyConsole_Console.cxx" line="216"/>
-        <source>EDIT_COPY_CMD</source>
-        <translation>&amp;Copier</translation>
-    </message>
-    <message>
-        <location filename="../PyConsole_Console.cxx" line="221"/>
-        <source>EDIT_PASTE_CMD</source>
-        <translation>C&amp;oller</translation>
-    </message>
-    <message>
-        <location filename="../PyConsole_Console.cxx" line="226"/>
-        <source>EDIT_CLEAR_CMD</source>
-        <translation>&amp;Effacer</translation>
-    </message>
-    <message>
-        <location filename="../PyConsole_Console.cxx" line="231"/>
-        <source>EDIT_SELECTALL_CMD</source>
-        <translation>&amp;Tout sélectionner</translation>
-    </message>
-    <message>
-        <source>EDIT_DUMPCOMMANDS_CMD</source>
-        <translation>&amp;Générer le script des commandes</translation>
-    </message>
-</context>
-<context>
-    <name>PyConsole_Editor</name>
-    <message>
-        <source>TOT_DUMP_PYCOMMANDS</source>
-        <translation>&amp;Générer le script des commandes</translation>
-    </message>
-    <message>
-        <source>PYTHON_FILES_FILTER</source>
-        <translation>Fichiers PYTHON (*.py)</translation>
-    </message>
-</context>
-</TS>
diff --git a/src/PyConsole/resources/PyConsole_msg_ja.ts b/src/PyConsole/resources/PyConsole_msg_ja.ts
deleted file mode 100644 (file)
index c8d0fb1..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS>
-  <context>
-    <name>PyConsole_Console</name>
-    <message>
-      <location filename="../PyConsole_Console.cxx" line="216"/>
-      <source>EDIT_COPY_CMD</source>
-      <translation>コピー(&amp;C)</translation>
-    </message>
-    <message>
-      <location filename="../PyConsole_Console.cxx" line="221"/>
-      <source>EDIT_PASTE_CMD</source>
-      <translation>貼り付け(&amp;P)</translation>
-    </message>
-    <message>
-      <location filename="../PyConsole_Console.cxx" line="226"/>
-      <source>EDIT_CLEAR_CMD</source>
-      <translation>削除(&amp;r)</translation>
-    </message>
-    <message>
-      <location filename="../PyConsole_Console.cxx" line="231"/>
-      <source>EDIT_SELECTALL_CMD</source>
-      <translation>すべて選択します。(&amp;A)</translation>
-    </message>
-    <message>
-      <source>EDIT_DUMPCOMMANDS_CMD</source>
-      <translation>スクリプト コマンドを生成します。(&amp;u)</translation>
-    </message>
-  </context>
-  <context>
-    <name>PyConsole_Editor</name>
-    <message>
-      <source>TOT_DUMP_PYCOMMANDS</source>
-      <translation>スクリプト コマンドを生成します。</translation>
-    </message>
-    <message>
-      <source>PYTHON_FILES_FILTER</source>
-      <translation>ファイル (*.py) PYTHON</translation>
-    </message>
-  </context>
-</TS>
index ebae53b82849b7f98631299e36dc6841fe45dff3..e1d4aee48882c96744264646633499a0e1896267 100644 (file)
@@ -52,12 +52,12 @@ void XGUI_DocumentDataModel::processEvent(const Events_Message* theMessage)
         XGUI_PartDataModel* aModel = new XGUI_PartDataModel(myDocument, this);
         aModel->setPartId(myPartModels.count());
         myPartModels.append(aModel);
-        insertRows(partFolderNode(), aStart, aStart);
+        insertRow(aStart, partFolderNode());
       } else { // Update top groups (other except parts
         QModelIndex aIndex = myModel->findParent(aFeature);
         int aStart = myModel->rowCount(aIndex) - 1;
         aIndex = createIndex(aIndex.row(), aIndex.column(), (void*)getModelIndex(aIndex));
-        insertRows(aIndex, aStart, aStart);
+        insertRow(aStart, aIndex);
       }
     } else { // if sub-objects of first level nodes
       XGUI_PartModel* aPartModel = 0;
@@ -72,7 +72,7 @@ void XGUI_DocumentDataModel::processEvent(const Events_Message* theMessage)
         QModelIndex aIndex = aPartModel->findParent(aFeature);
         int aStart = aPartModel->rowCount(aIndex) - 1;
         aIndex = createIndex(aIndex.row(), aIndex.column(), (void*)getModelIndex(aIndex));
-        insertRows(aIndex, aStart, aStart);
+        insertRow(aStart, aIndex);
       }
     }
 
@@ -84,15 +84,13 @@ void XGUI_DocumentDataModel::processEvent(const Events_Message* theMessage)
     if (aDoc == myDocument) {  // If root objects
       if (aUpdMsg->group().compare(PARTS_GROUP) == 0) { // Updsate only Parts group
         int aStart = myPartModels.size();
-        beginRemoveRows(partFolderNode(), aStart, aStart);
         removeSubModel(myPartModels.size() - 1);
-        endRemoveRows();
+        removeRow(aStart - 1, partFolderNode());
       } else { // Update top groups (other except parts
         QModelIndex aIndex = myModel->findGroup(aUpdMsg->group());
         int aStart = myModel->rowCount(aIndex);
         aIndex = createIndex(aIndex.row(), aIndex.column(), (void*)getModelIndex(aIndex));
-        beginRemoveRows(aIndex, aStart, aStart);
-        endRemoveRows();
+        removeRow(aStart - 1, aIndex);
       }
     } else {
       XGUI_PartModel* aPartModel = 0;
@@ -107,8 +105,7 @@ void XGUI_DocumentDataModel::processEvent(const Events_Message* theMessage)
         QModelIndex aIndex = aPartModel->findGroup(aUpdMsg->group());
         int aStart = aPartModel->rowCount(aIndex);
         aIndex = createIndex(aIndex.row(), aIndex.column(), (void*)getModelIndex(aIndex));
-        beginRemoveRows(aIndex, aStart, aStart);
-        endRemoveRows();
+        removeRow(aStart - 1, aIndex);
       }
     }
 
@@ -145,7 +142,8 @@ QVariant XGUI_DocumentDataModel::data(const QModelIndex& theIndex, int theRole)
 {
   if (!theIndex.isValid())
     return QVariant();
-  if (theIndex.internalId() == 0){
+  switch (theIndex.internalId()) {
+  case PartsFolder:
     switch (theRole) {
     case Qt::DisplayRole:
       return tr("Parts") + QString(" (%1)").arg(rowCount(theIndex));
@@ -156,9 +154,37 @@ QVariant XGUI_DocumentDataModel::data(const QModelIndex& theIndex, int theRole)
     default:
       return QVariant();
     }
+    break;
+  case HistoryNode:
+    {
+      int aOffset = historyOffset();
+      FeaturePtr aFeature = myDocument->feature(FEATURES_GROUP, theIndex.row() - aOffset);
+      switch (theRole) {
+      case Qt::DisplayRole:
+        if (aFeature)
+          return aFeature->data()->getName().c_str();
+        else 
+          return QVariant();
+      case Qt::DecorationRole:
+        {
+          std::string aType = aFeature->getKind();
+          if (aType.compare("Point") == 0)
+            return QIcon(":pictures/point_ico.png");
+          if (aType.compare("Part") == 0)
+            return QIcon(":pictures/part_ico.png");
+          if (aType.compare("Sketch") == 0)
+            return QIcon(":icons/sketch.png");
+        }
+      case Qt::ToolTipRole:
+        return tr("Feature object");
+      default:
+        return QVariant();
+      }
+    }
+    break;
   }
   QModelIndex aParent = theIndex.parent();
-  if (aParent.isValid() && (aParent.internalId() == 0)) {
+  if (aParent.isValid() && (aParent.internalId() == PartsFolder)) {
     return myPartModels.at(theIndex.row())->data(QModelIndex(), theRole);
   }
   return toSourceModelIndex(theIndex).data(theRole);
@@ -173,12 +199,18 @@ QVariant XGUI_DocumentDataModel::headerData(int theSection, Qt::Orientation theO
 int XGUI_DocumentDataModel::rowCount(const QModelIndex& theParent) const
 {
   if (!theParent.isValid()) {
-    int aVal = myModel->rowCount(theParent) + myPartModels.size();
-    return myModel->rowCount(theParent) + 1;//myPartModels.size();
+    // Size of external models
+    int aVal = historyOffset();
+    // Plus history size
+    aVal += myDocument->size(FEATURES_GROUP);
+    return aVal;
   }
-  if (theParent.internalId() == 0) {
+  if (theParent.internalId() == PartsFolder) {
     return myPartModels.size();
   }
+  if (theParent.internalId() == HistoryNode) {
+    return 0;
+  }
   QModelIndex aParent = toSourceModelIndex(theParent);
   if (!isSubModel(aParent.model())) 
     return 0;
@@ -200,11 +232,13 @@ QModelIndex XGUI_DocumentDataModel::index(int theRow, int theColumn, const QMode
       aIndex = myModel->index(theRow, theColumn, theParent);
       aIndex = createIndex(theRow, theColumn, (void*)getModelIndex(aIndex));
     } else {
-      // Create Parts node
-      aIndex = partFolderNode();
+      if (theRow == aOffs)  // Create Parts node
+        aIndex = partFolderNode();
+      else // create history node
+        aIndex = createIndex(theRow, theColumn, HistoryNode);
     }
   } else {
-    if (theParent.internalId() == 0) {
+    if (theParent.internalId() == PartsFolder) {
       aIndex = myPartModels.at(theRow)->index(0, theColumn, QModelIndex());
     } else {
       QModelIndex* aParent = (QModelIndex*)theParent.internalPointer();
@@ -218,7 +252,7 @@ QModelIndex XGUI_DocumentDataModel::index(int theRow, int theColumn, const QMode
 
 QModelIndex XGUI_DocumentDataModel::parent(const QModelIndex& theIndex) const
 {
-  if (theIndex.internalId() == 0)
+  if ((theIndex.internalId() == PartsFolder) || (theIndex.internalId() == HistoryNode))
     return QModelIndex();
 
   QModelIndex aIndex = toSourceModelIndex(theIndex);
@@ -286,7 +320,7 @@ void XGUI_DocumentDataModel::clearModelIndexes()
 
 FeaturePtr XGUI_DocumentDataModel::feature(const QModelIndex& theIndex) const
 {
-  if (theIndex.internalId() == 0)
+  if (theIndex.internalId() == PartsFolder)
     return FeaturePtr();
 
   QModelIndex aIndex = toSourceModelIndex(theIndex);
@@ -297,14 +331,28 @@ FeaturePtr XGUI_DocumentDataModel::feature(const QModelIndex& theIndex) const
   return aModel->feature(aIndex);
 }
 
-void XGUI_DocumentDataModel::insertRows(const QModelIndex& theParent, int theStart, int theEnd)
+bool XGUI_DocumentDataModel::insertRows(int theRow, int theCount, const QModelIndex& theParent)
 {
-  beginInsertRows(theParent, theStart, theEnd);
+  beginInsertRows(theParent, theRow, theRow + theCount - 1);
+  //endInsertRows();
+
+  // Update history
+  QModelIndex aRoot;
+  int aRow = rowCount(aRoot);
+  beginInsertRows(aRoot, aRow, aRow);
   endInsertRows();
-  if (theStart == 0) // Update parent if this is a first child in order to update node decoration
-    emit dataChanged(theParent, theParent);
+
+  return true;
 }
 
+bool XGUI_DocumentDataModel::removeRows(int theRow, int theCount, const QModelIndex& theParent)
+{
+  beginRemoveRows(theParent, theRow, theRow + theCount - 1);
+  endRemoveRows();
+  return true;
+}
+
+
 void XGUI_DocumentDataModel::removeSubModel(int theModelId)
 {
   XGUI_PartModel* aModel = myPartModels.at(theModelId);
@@ -339,5 +387,11 @@ bool XGUI_DocumentDataModel::isPartSubModel(const QAbstractItemModel* theModel)
 QModelIndex XGUI_DocumentDataModel::partFolderNode() const
 {
   int aPos = myModel->rowCount(QModelIndex());
-  return createIndex(aPos, columnCount() - 1, 0);
+  return createIndex(aPos, columnCount() - 1, PartsFolder);
 }
+
+int XGUI_DocumentDataModel::historyOffset() const
+{
+  // Nb of rows of top model + Parts folder
+  return myModel->rowCount(QModelIndex()) + 1;
+}
\ No newline at end of file
index e389cd80097a1147a6ec2ca5f5fd18e2fad8395d..3c90dcf1f5e6f7c54d964f7c506fb54fb10d5b4e 100644 (file)
@@ -46,12 +46,19 @@ public:
 
   virtual bool hasChildren(const QModelIndex& theParent = QModelIndex()) const;
 
+  bool insertRows(int theRow, int theCount, const QModelIndex& theParent = QModelIndex());
+
+  bool removeRows(int theRow, int theCount, const QModelIndex& theParent = QModelIndex());
+
   //! Returns Feature object by the given Model index.
   //! Returns 0 if the given index is not index of a feature
   FeaturePtr feature(const QModelIndex& theIndex) const;
 
 private:
 
+  enum {PartsFolder, HistoryNode};
+
+
   //! Converts QModelIndex of this model to QModelIndex of a one of sub-models.
   QModelIndex toSourceModelIndex(const QModelIndex& theProxy) const;
 
@@ -64,9 +71,6 @@ private:
   //! Deletes all saved pointers on QModelIndex objects.
   void clearModelIndexes();
 
-  //! Causes inserting of new nodes for given parent and indexes
-  void insertRows(const QModelIndex& theParent, int theStart, int theEnd);
-
   //! Removes sub-model on removing a part object. Also it removes QModelIndex-es which refer to this model
   void removeSubModel(int theModelId);
 
@@ -76,8 +80,11 @@ private:
   //! Returns true if the given model is a one of sub-models of Part type
   bool isPartSubModel(const QAbstractItemModel* theModel) const;
 
+  //! Returns Parts Folder node
   QModelIndex partFolderNode() const;
 
+  int historyOffset() const;
+
 
   //! Document
   boost::shared_ptr<ModelAPI_Document> myDocument;
diff --git a/src/XGUI/XGUI_msg_fr.ts b/src/XGUI/XGUI_msg_fr.ts
deleted file mode 100644 (file)
index 5562247..0000000
+++ /dev/null
@@ -1,348 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="fr_FR">
-<context>
-    <name>XGUI_DocumentDataModel</name>
-    <message>
-        <location filename="XGUI_DocumentDataModel.cpp" line="152"/>
-        <source>Parts</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_DocumentDataModel.cpp" line="156"/>
-        <source>Parts folder</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>XGUI_ErrorDialog</name>
-    <message>
-        <location filename="XGUI_ErrorDialog.cpp" line="19"/>
-        <source>Application errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>XGUI_MainMenu</name>
-    <message>
-        <location filename="XGUI_MainMenu.cpp" line="16"/>
-        <source>General</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>XGUI_MainWindow</name>
-    <message>
-        <location filename="XGUI_MainWindow.cpp" line="33"/>
-        <source>New Geom</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>XGUI_OperationMgr</name>
-    <message>
-        <location filename="XGUI_OperationMgr.cpp" line="63"/>
-        <source>Operation launch</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_OperationMgr.cpp" line="64"/>
-        <source>Previous operation is not finished and will be aborted</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>XGUI_PartDataModel</name>
-    <message>
-        <location filename="XGUI_PartDataModel.cpp" line="191"/>
-        <source>Parameters</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_PartDataModel.cpp" line="193"/>
-        <source>Constructions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_PartDataModel.cpp" line="195"/>
-        <source>Bodies</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>XGUI_PropertyPanel</name>
-    <message>
-        <location filename="XGUI_PropertyPanel.cpp" line="24"/>
-        <source>Property Panel</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>XGUI_TopDataModel</name>
-    <message>
-        <location filename="XGUI_PartDataModel.cpp" line="29"/>
-        <source>Parameters</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_PartDataModel.cpp" line="37"/>
-        <source>Constructions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>XGUI_ViewWindow</name>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="213"/>
-        <source>Dump view</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="217"/>
-        <source>Fit all</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="221"/>
-        <source>Fit area</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="225"/>
-        <source>Zoom</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="229"/>
-        <source>Panning</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="233"/>
-        <source>Global panning</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="237"/>
-        <source>Rotate</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="241"/>
-        <source>Reset</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="245"/>
-        <source>Front</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="249"/>
-        <source>Back</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="253"/>
-        <source>Top</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="257"/>
-        <source>Bottom</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="261"/>
-        <source>Left</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="265"/>
-        <source>Right</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="269"/>
-        <source>Clone</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_ViewWindow.cpp" line="1030"/>
-        <source>Images Files (*.bmp *.png *.jpg *.jpeg *.eps *.ps)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>XGUI_Viewer</name>
-    <message>
-        <location filename="XGUI_Viewer.cpp" line="70"/>
-        <source>Horizontal gradient</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Viewer.cpp" line="70"/>
-        <source>Vertical gradient</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Viewer.cpp" line="71"/>
-        <source>First diagonal gradient</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Viewer.cpp" line="71"/>
-        <source>Second diagonal gradient</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Viewer.cpp" line="72"/>
-        <source>First corner gradient</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Viewer.cpp" line="72"/>
-        <source>Second corner gradient</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Viewer.cpp" line="73"/>
-        <source>Third corner gradient</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Viewer.cpp" line="73"/>
-        <source>Fourth corner gradient</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Viewer.cpp" line="80"/>
-        <source>Image files (*.bmp *.gif *.pix *.xwd *.rgb *.rs)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>XGUI_Workshop</name>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="116"/>
-        <location filename="XGUI_Workshop.cpp" line="140"/>
-        <source>Undo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="116"/>
-        <location filename="XGUI_Workshop.cpp" line="140"/>
-        <source>Undo last command</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="121"/>
-        <location filename="XGUI_Workshop.cpp" line="144"/>
-        <source>Redo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="121"/>
-        <location filename="XGUI_Workshop.cpp" line="144"/>
-        <source>Redo last command</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="135"/>
-        <source>Save...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="135"/>
-        <source>Save the document</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="148"/>
-        <source>Rebuild</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="148"/>
-        <source>Rebuild data objects</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="151"/>
-        <source>Save as...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="151"/>
-        <source>Save the document into a file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="156"/>
-        <source>Open...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="156"/>
-        <source>Open a new document</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="164"/>
-        <source>Exit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="164"/>
-        <source>Exit application</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="356"/>
-        <location filename="XGUI_Workshop.cpp" line="396"/>
-        <source>Save current file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="357"/>
-        <source>The document is modified, save before exit?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="397"/>
-        <source>The document is modified, save before opening another?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="414"/>
-        <location filename="XGUI_Workshop.cpp" line="446"/>
-        <source>Warning</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="414"/>
-        <source>Unable to open the file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="446"/>
-        <source>Unable to save the file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="478"/>
-        <source>Information about module &quot;%1&quot; doesn&apos;t exist.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="525"/>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="XGUI_Workshop.cpp" line="584"/>
-        <source>Object browser</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-</TS>
index 40ad6a34112de8abd2daef8c1fe9ea3e4b038407..399af82303f76a2d005bc7a4f1b20d9e9a4c9065 100644 (file)
@@ -9,8 +9,6 @@
      <file>pictures/rebuild.png</file>
      <!--For test purposes-->
 
-     <file>pictures/ViewPort.png</file>
-     
      <file>pictures/occ_view_back.png</file>
      <file>pictures/occ_view_bottom.png</file>
      <file>pictures/occ_view_camera_dump.png</file>
diff --git a/src/XGUI/pictures/ViewPort.png b/src/XGUI/pictures/ViewPort.png
deleted file mode 100644 (file)
index b827301..0000000
Binary files a/src/XGUI/pictures/ViewPort.png and /dev/null differ