]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Task 5.2.6 "Part -> Parameters" dialog box: add a keyboard shortcut for "Add"
authorvsv <vsv@opencascade.com>
Wed, 6 Nov 2019 12:14:52 +0000 (15:14 +0300)
committervsv <vsv@opencascade.com>
Wed, 6 Nov 2019 12:14:52 +0000 (15:14 +0300)
src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp
src/PartSet/PartSet_Module.cpp

index 9078329662e93044b3d61496b2e572539f63be1d..9938df1e66b911170eae3108086274f1a72ea186 100644 (file)
@@ -39,6 +39,7 @@
 #include <ModuleBase_Tools.h>
 
 #include <Events_Loop.h>
+#include <Config_PropManager.h>
 
 #include <QLayout>
 #include <QPushButton>
@@ -50,6 +51,7 @@
 #include <QEvent>
 #include <QKeyEvent>
 #include <QDialogButtonBox>
+#include <QShortcut>
 
 enum ColumnType {
   Col_Name,
@@ -238,6 +240,13 @@ ParametersPlugin_WidgetParamsMgr::ParametersPlugin_WidgetParamsMgr(QWidget* theP
   connect(myAddBtn, SIGNAL(clicked(bool)), SLOT(onAdd()));
   aBtnLayout->addWidget(myAddBtn);
 
+  QString aAddStr(Config_PropManager::string("Shortcuts", "add_parameter_shortcut").c_str());
+  if (aAddStr.isEmpty())
+    aAddStr = "Ctrl+A";
+
+  QShortcut* aAddShc = new QShortcut(QKeySequence(aAddStr), myAddBtn);
+  connect(aAddShc, SIGNAL(activated()), SLOT(onAdd()));
+
   myInsertBtn = new QPushButton(translate("Insert"), this);
   connect(myInsertBtn, SIGNAL(clicked(bool)), SLOT(onInsert()));
   aBtnLayout->addWidget(myInsertBtn);
index 0ad3ce8f22bf20accb23f184853d37930ddd21ac..fa801f6aa487cfb0a769b393d40571b47743c7b0 100644 (file)
@@ -228,6 +228,10 @@ PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
   Config_PropManager::registerProp("Visualization", "sketch_dimension_color",
     "Dimension color",
     Config_Prop::Color, SKETCH_DIMENSION_COLOR);
+
+  Config_PropManager::registerProp("Shortcuts", "add_parameter_shortcut",
+    "Add parameter in parameters manager dialog",
+    Config_Prop::Shortcut, "Ctrl+A");
 }
 
 //******************************************************