From: vsv Date: Wed, 6 Nov 2019 12:14:52 +0000 (+0300) Subject: Task 5.2.6 "Part -> Parameters" dialog box: add a keyboard shortcut for "Add" X-Git-Tag: V9_5_0a1~166^2~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0e1b857c435fdaf202c498de6188d5e115da2ff4;p=modules%2Fshaper.git Task 5.2.6 "Part -> Parameters" dialog box: add a keyboard shortcut for "Add" --- 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"); } //******************************************************