From 0e1b857c435fdaf202c498de6188d5e115da2ff4 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 6 Nov 2019 15:14:52 +0300 Subject: [PATCH] Task 5.2.6 "Part -> Parameters" dialog box: add a keyboard shortcut for "Add" --- .../ParametersPlugin_WidgetParamsMgr.cpp | 9 +++++++++ src/PartSet/PartSet_Module.cpp | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp index 907832966..9938df1e6 100644 --- a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp +++ b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -50,6 +51,7 @@ #include #include #include +#include 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); diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 0ad3ce8f2..fa801f6aa 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -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"); } //****************************************************** -- 2.39.2