From 501b11a03d4398a87e871d2d8da525f10eff90a8 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 30 Apr 2020 14:53:37 +0200 Subject: [PATCH] Gui: [skip ci] fixes #0004330: The Std_WhatsThis command does not work for 2 submenus of the View menu. --- src/Gui/Command.cpp | 1 + src/Gui/CommandLink.cpp | 10 +++++++--- src/Gui/CommandView.cpp | 13 ++++++++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/Gui/Command.cpp b/src/Gui/Command.cpp index cd5fb7f4cd..cbe4f5d98f 100644 --- a/src/Gui/Command.cpp +++ b/src/Gui/Command.cpp @@ -987,6 +987,7 @@ Action * GroupCommand::createAction(void) { pcAction->setDropDownMenu(true); pcAction->setExclusive(false); pcAction->setCheckable(true); + pcAction->setWhatsThis(QString::fromLatin1(sWhatsThis)); for(auto &v : cmds) { if(!v.first) diff --git a/src/Gui/CommandLink.cpp b/src/Gui/CommandLink.cpp index 3a6e6f3c2a..1e699caa55 100644 --- a/src/Gui/CommandLink.cpp +++ b/src/Gui/CommandLink.cpp @@ -96,9 +96,13 @@ Action * StdCmdLinkMakeGroup::createAction(void) applyCommandData(this->className(), pcAction); // add the action items - pcAction->addAction(QObject::tr("Simple group")); - pcAction->addAction(QObject::tr("Group with links")); - pcAction->addAction(QObject::tr("Group with transform links")); + QAction* action = nullptr; + action = pcAction->addAction(QObject::tr("Simple group")); + action->setWhatsThis(QString::fromLatin1(sWhatsThis)); + action = pcAction->addAction(QObject::tr("Group with links")); + action->setWhatsThis(QString::fromLatin1(sWhatsThis)); + action = pcAction->addAction(QObject::tr("Group with transform links")); + action->setWhatsThis(QString::fromLatin1(sWhatsThis)); return pcAction; } diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 24b18a6602..0426c17b61 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -255,11 +255,15 @@ Action * StdCmdFreezeViews::createAction(void) // add the action items saveView = pcAction->addAction(QObject::tr("Save views...")); - pcAction->addAction(QObject::tr("Load views...")); + saveView->setWhatsThis(QString::fromLatin1(sWhatsThis)); + QAction* loadView = pcAction->addAction(QObject::tr("Load views...")); + loadView->setWhatsThis(QString::fromLatin1(sWhatsThis)); pcAction->addAction(QString::fromLatin1(""))->setSeparator(true); freezeView = pcAction->addAction(QObject::tr("Freeze view")); freezeView->setShortcut(QString::fromLatin1(sAccel)); + freezeView->setWhatsThis(QString::fromLatin1(sWhatsThis)); clearView = pcAction->addAction(QObject::tr("Clear views")); + clearView->setWhatsThis(QString::fromLatin1(sWhatsThis)); separator = pcAction->addAction(QString::fromLatin1("")); separator->setSeparator(true); offset = pcAction->actions().count(); @@ -596,36 +600,43 @@ Gui::Action * StdCmdDrawStyle::createAction(void) a0->setChecked(true); a0->setObjectName(QString::fromLatin1("Std_DrawStyleAsIs")); a0->setShortcut(QKeySequence(QString::fromUtf8("V,1"))); + a0->setWhatsThis(QString::fromLatin1(sWhatsThis)); QAction* a1 = pcAction->addAction(QString()); a1->setCheckable(true); a1->setIcon(BitmapFactory().iconFromTheme("DrawStylePoints")); a1->setObjectName(QString::fromLatin1("Std_DrawStylePoints")); a1->setShortcut(QKeySequence(QString::fromUtf8("V,2"))); + a1->setWhatsThis(QString::fromLatin1(sWhatsThis)); QAction* a2 = pcAction->addAction(QString()); a2->setCheckable(true); a2->setIcon(BitmapFactory().iconFromTheme("DrawStyleWireFrame")); a2->setObjectName(QString::fromLatin1("Std_DrawStyleWireframe")); a2->setShortcut(QKeySequence(QString::fromUtf8("V,3"))); + a2->setWhatsThis(QString::fromLatin1(sWhatsThis)); QAction* a3 = pcAction->addAction(QString()); a3->setCheckable(true); a3->setIcon(BitmapFactory().iconFromTheme("DrawStyleHiddenLine")); a3->setObjectName(QString::fromLatin1("Std_DrawStyleHiddenLine")); a3->setShortcut(QKeySequence(QString::fromUtf8("V,4"))); + a3->setWhatsThis(QString::fromLatin1(sWhatsThis)); QAction* a4 = pcAction->addAction(QString()); a4->setCheckable(true); a4->setIcon(BitmapFactory().iconFromTheme("DrawStyleNoShading")); a4->setObjectName(QString::fromLatin1("Std_DrawStyleNoShading")); a4->setShortcut(QKeySequence(QString::fromUtf8("V,5"))); + a4->setWhatsThis(QString::fromLatin1(sWhatsThis)); QAction* a5 = pcAction->addAction(QString()); a5->setCheckable(true); a5->setIcon(BitmapFactory().iconFromTheme("DrawStyleShaded")); a5->setObjectName(QString::fromLatin1("Std_DrawStyleShaded")); a5->setShortcut(QKeySequence(QString::fromUtf8("V,6"))); + a5->setWhatsThis(QString::fromLatin1(sWhatsThis)); QAction* a6 = pcAction->addAction(QString()); a6->setCheckable(true); a6->setIcon(BitmapFactory().iconFromTheme("DrawStyleFlatLines")); a6->setObjectName(QString::fromLatin1("Std_DrawStyleFlatLines")); a6->setShortcut(QKeySequence(QString::fromUtf8("V,7"))); + a6->setWhatsThis(QString::fromLatin1(sWhatsThis)); pcAction->setIcon(a0->icon());