]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SHAPERGUI/SHAPERGUI.cpp
Salome HOME
Update copyrights
[modules/shaper.git] / src / SHAPERGUI / SHAPERGUI.cpp
index 28f3de9a452fda65b9845be44ca597f04531e9c1..56f665801398467ea0463e9f877dc0028c832ec3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-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
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SHAPERGUI.h"
@@ -823,7 +822,10 @@ void SHAPERGUI::onEditToolbars()
 {
   SHAPERGUI_ToolbarsDlg aDlg(this);
   if (aDlg.exec() == QDialog::Accepted) {
-    updateToolbars(aDlg.result());
+    if (aDlg.isReset())
+      resetToolbars();
+    else
+      updateToolbars(aDlg.result());
   }
 }
 
@@ -846,6 +848,10 @@ int SHAPERGUI::getNextCommandId() const
 
 void SHAPERGUI::updateToolbars(const QMap<QString, QIntList>& theNewToolbars)
 {
+  // Store default toolbars
+  if (myDefaultToolbars.size() == 0)
+    myDefaultToolbars = myToolbars;
+
   QtxActionToolMgr* aMgr = toolMgr();
   QStringList aToolbars = theNewToolbars.keys();
   QIntList aCommands, aOldCmd;
@@ -1047,3 +1053,12 @@ QIntList SHAPERGUI::getFreeCommands() const
   }
   return aFreeCommands;
 }
+
+void SHAPERGUI::resetToolbars()
+{
+  if (!myDefaultToolbars.isEmpty())
+    updateToolbars(myDefaultToolbars);
+  myIsToolbarsModified = false;
+  SUIT_ResourceMgr* aResMgr = application()->resourceMgr();
+  aResMgr->remove(ToolbarsSection);
+}