From 567925e4421b327eaee933a04d32c03bc8fc2c99 Mon Sep 17 00:00:00 2001 From: Paddle Date: Wed, 20 Sep 2023 12:11:10 +0200 Subject: [PATCH 1/8] Structure toolbar : put Link in the command group. --- src/Gui/CommandLink.cpp | 4 ++-- src/Gui/Workbench.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Gui/CommandLink.cpp b/src/Gui/CommandLink.cpp index edb69c974e..da5df19bf1 100644 --- a/src/Gui/CommandLink.cpp +++ b/src/Gui/CommandLink.cpp @@ -214,7 +214,7 @@ StdCmdLinkMake::StdCmdLinkMake() } bool StdCmdLinkMake::isActive() { - return !!App::GetApplication().getActiveDocument(); + return App::GetApplication().getActiveDocument(); } void StdCmdLinkMake::activated(int) { @@ -878,6 +878,7 @@ public: eType = AlterDoc; bCanLog = false; + addCommand(new StdCmdLinkMake()); addCommand(new StdCmdLinkMakeRelative()); addCommand(new StdCmdLinkReplace()); addCommand(new StdCmdLinkUnlink()); @@ -898,7 +899,6 @@ namespace Gui { void CreateLinkCommands() { CommandManager &rcCmdMgr = Application::Instance->commandManager(); - rcCmdMgr.addCommand(new StdCmdLinkMake()); rcCmdMgr.addCommand(new StdCmdLinkActions()); rcCmdMgr.addCommand(new StdCmdLinkMakeGroup()); rcCmdMgr.addCommand(new StdCmdLinkSelectActions()); diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index b1230a6101..c267fc81ff 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -800,7 +800,7 @@ ToolBarItem* StdWorkbench::setupToolBars() const // Structure auto structure = new ToolBarItem( root ); structure->setCommand("Structure"); - *structure << "Std_Part" << "Std_Group" << "Std_LinkMake" << "Std_LinkActions"; + *structure << "Std_Part" << "Std_Group" << "Std_LinkActions"; // Help auto help = new ToolBarItem( root ); From 696a48d3b4667b69867bd25d2f240db3b18775b9 Mon Sep 17 00:00:00 2001 From: Paddle Date: Wed, 20 Sep 2023 12:12:51 +0200 Subject: [PATCH 2/8] Give std_LinkMake a proper tooltip. --- src/Gui/CommandLink.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Gui/CommandLink.cpp b/src/Gui/CommandLink.cpp index da5df19bf1..ad249eb07d 100644 --- a/src/Gui/CommandLink.cpp +++ b/src/Gui/CommandLink.cpp @@ -206,7 +206,11 @@ StdCmdLinkMake::StdCmdLinkMake() { sGroup = "Link"; sMenuText = QT_TR_NOOP("Make link"); - sToolTipText = QT_TR_NOOP("Create a link to the selected object(s)"); + sToolTipText = QT_TR_NOOP("

An App::Link is a type of object that references or links" + " to another object, in the same document, or in another document. Unlike Clones, Link" + " references directly the original Shape, so it is more memory efficient which helps " + "with the creation of complex assemblies from smaller subassemblies, and from multiple" + " reusable components like screws, nuts, and similar fasteners.

"); sWhatsThis = "Std_LinkMake"; sStatusTip = sToolTipText; eType = AlterDoc; From d8151af3355f823a106fe00c9932c97ed4c41ef3 Mon Sep 17 00:00:00 2001 From: Paddle Date: Wed, 20 Sep 2023 12:15:40 +0200 Subject: [PATCH 3/8] Give std_SelBack and std_selforward proper names and tooltips. --- src/Gui/CommandView.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 2ad6a44e85..340133120c 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -3577,10 +3577,12 @@ StdCmdSelBack::StdCmdSelBack() :Command("Std_SelBack") { sGroup = "View"; - sMenuText = QT_TR_NOOP("&Back"); - sToolTipText = QT_TR_NOOP("Go back to previous selection"); + sMenuText = QT_TR_NOOP("Selection Back"); + sToolTipText = QT_TR_NOOP("

The Std SelBack command restores the previous" + " recorded Tree view selection. Note that selections are only recorded if" + " Tree RecordSelection mode is switched on.

"); sWhatsThis = "Std_SelBack"; - sStatusTip = QT_TR_NOOP("Go back to previous selection"); + sStatusTip = sToolTipText; sPixmap = "sel-back"; sAccel = "S, B"; eType = AlterSelection; @@ -3607,10 +3609,12 @@ StdCmdSelForward::StdCmdSelForward() :Command("Std_SelForward") { sGroup = "View"; - sMenuText = QT_TR_NOOP("&Forward"); - sToolTipText = QT_TR_NOOP("Repeat the backed selection"); + sMenuText = QT_TR_NOOP("Selection Forward"); + sToolTipText = QT_TR_NOOP("

The Std SelForward command restores the next " + "recorded Tree view selection. Note that selections are only recorded if " + "Tree RecordSelection mode is switched on.

"); sWhatsThis = "Std_SelForward"; - sStatusTip = QT_TR_NOOP("Repeat the backed selection"); + sStatusTip = sToolTipText; sPixmap = "sel-forward"; sAccel = "S, F"; eType = AlterSelection; From 77986707da57f3a6e74ab471e98273786e28e8c9 Mon Sep 17 00:00:00 2001 From: Paddle Date: Wed, 20 Sep 2023 12:18:34 +0200 Subject: [PATCH 4/8] Add Std_SelBack and Std_SelForward to the Std_TreeViewActions group where they belong. This also solve the fact that these commands were not in the menu which are supposed to be exaustive. --- src/Gui/CommandView.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 340133120c..948b12832c 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -3880,6 +3880,11 @@ public: addCommand(new StdTreeDrag(),!cmds.empty()); addCommand(new StdTreeSelection(),!cmds.empty()); + + addCommand(); + + addCommand(new StdCmdSelBack()); + addCommand(new StdCmdSelForward()); } const char* className() const override {return "StdCmdTreeViewActions";} }; From 566864c3160326b1ebdc3d08c2858a5de63ba9ef Mon Sep 17 00:00:00 2001 From: Paddle Date: Wed, 20 Sep 2023 12:23:25 +0200 Subject: [PATCH 5/8] Add "Std_LinkSelectActions" to the view menu. Remove "Std_LinkSelectActions" from the toolbar. Remove "Std_SelBack" & "Std_SelForward" from the toolbar Remove "Std_SelBoundingBox" from the toolbar Reorder the toolbar entries. --- src/Gui/Workbench.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index c267fc81ff..01a4ebeb15 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -690,6 +690,7 @@ MenuItem* StdWorkbench::setupMenuBar() const << "Std_ToggleNavigation" << "Std_SetAppearance" << "Std_RandomColor" << "Separator" << "Std_Workbench" << "Std_ToolBarMenu" << "Std_DockViewMenu" << "Separator" + << "Std_LinkSelectActions" << "Std_TreeViewActions" << "Std_ViewStatusBar"; @@ -791,11 +792,11 @@ ToolBarItem* StdWorkbench::setupToolBars() const // View auto view = new ToolBarItem( root ); view->setCommand("View"); - *view << "Std_ViewFitAll" << "Std_ViewFitSelection" << "Std_DrawStyle" << "Std_SelBoundingBox" - << "Separator" << "Std_SelectFilter" << "Std_SelBack" << "Std_SelForward" - << "Std_LinkSelectActions"<< "Separator" << "Std_TreeViewActions" << "Std_ViewIsometric" - << "Std_ViewFront"<< "Std_ViewTop" << "Std_ViewRight" << "Separator" << "Std_ViewRear" - << "Separator" << "Std_ViewBottom"<< "Std_ViewLeft" << "Separator" << "Std_MeasureDistance"; + *view << "Std_ViewFitAll" << "Std_ViewFitSelection" << "Std_ViewIsometric" + << "Std_ViewFront"<< "Std_ViewTop" << "Std_ViewRight" + << "Std_ViewRear" << "Std_ViewBottom"<< "Std_ViewLeft" + << "Separator" << "Std_DrawStyle" << "Std_SelectFilter" << "Std_TreeViewActions" + << "Separator" << "Std_MeasureDistance"; // Structure auto structure = new ToolBarItem( root ); From a06123f50ebe97909082ed60d80386d12933fa68 Mon Sep 17 00:00:00 2001 From: Paddle Date: Wed, 20 Sep 2023 13:39:50 +0200 Subject: [PATCH 6/8] Std_Part : give it a proper tooltip. --- src/Gui/CommandStructure.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Gui/CommandStructure.cpp b/src/Gui/CommandStructure.cpp index 70dcff97eb..9e1bbc9099 100644 --- a/src/Gui/CommandStructure.cpp +++ b/src/Gui/CommandStructure.cpp @@ -49,7 +49,11 @@ StdCmdPart::StdCmdPart() { sGroup = "Structure"; sMenuText = QT_TR_NOOP("Create part"); - sToolTipText = QT_TR_NOOP("Create a new part and make it active"); + sToolTipText = QT_TR_NOOP("

An App::Part is is a general purpose container that keeps together a " + "group of objects so that they can be moved together as a unit in the 3D view.\n" + "it is meant to arrange objects that have a Part TopoShape, like Part Primitives, PartDesign" + " Bodies, and other Part Features. In addition, Std Parts may be nested inside other" + " Std Parts to create a big assembly from smaller sub-assemblies.

"); sWhatsThis = "Std_Part"; sStatusTip = sToolTipText; sPixmap = "Geofeaturegroup"; From 887f119a8afe0ecf8a48770bf0dd2e74a62f26f5 Mon Sep 17 00:00:00 2001 From: Paddle Date: Wed, 20 Sep 2023 13:42:30 +0200 Subject: [PATCH 7/8] Group: Give a proper tooltip --- src/Gui/CommandStructure.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Gui/CommandStructure.cpp b/src/Gui/CommandStructure.cpp index 9e1bbc9099..674a455858 100644 --- a/src/Gui/CommandStructure.cpp +++ b/src/Gui/CommandStructure.cpp @@ -94,7 +94,10 @@ StdCmdGroup::StdCmdGroup() { sGroup = "Structure"; sMenuText = QT_TR_NOOP("Create group"); - sToolTipText = QT_TR_NOOP("Create a new group for ordering objects"); + sToolTipText = QT_TR_NOOP("

Group is a general purpose container that allows you to " + "group different types of objects in the Tree view, regardless of their data type. " + "It is used as a simple folder to categorize and organize the objects in your model, " + "in order to keep a logical structure. Std Groups may be nested inside other Std Groups.

"); sWhatsThis = "Std_Group"; sStatusTip = sToolTipText; sPixmap = "folder"; From c9d6e9f0b51b8c78eaca04a68a11e3ed2c22009f Mon Sep 17 00:00:00 2001 From: Paddle Date: Wed, 20 Sep 2023 15:33:35 +0200 Subject: [PATCH 8/8] Improve tooltips and remove the html from the translate. --- src/Gui/CommandLink.cpp | 11 ++++++----- src/Gui/CommandStructure.cpp | 23 ++++++++++++++--------- src/Gui/CommandView.cpp | 16 ++++++++++------ 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/Gui/CommandLink.cpp b/src/Gui/CommandLink.cpp index ad249eb07d..10b8c50a2e 100644 --- a/src/Gui/CommandLink.cpp +++ b/src/Gui/CommandLink.cpp @@ -206,11 +206,12 @@ StdCmdLinkMake::StdCmdLinkMake() { sGroup = "Link"; sMenuText = QT_TR_NOOP("Make link"); - sToolTipText = QT_TR_NOOP("

An App::Link is a type of object that references or links" - " to another object, in the same document, or in another document. Unlike Clones, Link" - " references directly the original Shape, so it is more memory efficient which helps " - "with the creation of complex assemblies from smaller subassemblies, and from multiple" - " reusable components like screws, nuts, and similar fasteners.

"); + static std::string toolTip = std::string("

") + + QT_TR_NOOP("A Link is an object that references or links to another object in the same " + "document, or in another document.Unlike Clones, Links reference the original Shape directly, " + " making them more memory efficient which helps with the creation of complex assemblies.") + + "

"; + sToolTipText = toolTip.c_str(); sWhatsThis = "Std_LinkMake"; sStatusTip = sToolTipText; eType = AlterDoc; diff --git a/src/Gui/CommandStructure.cpp b/src/Gui/CommandStructure.cpp index 674a455858..4c0c597f8b 100644 --- a/src/Gui/CommandStructure.cpp +++ b/src/Gui/CommandStructure.cpp @@ -49,11 +49,13 @@ StdCmdPart::StdCmdPart() { sGroup = "Structure"; sMenuText = QT_TR_NOOP("Create part"); - sToolTipText = QT_TR_NOOP("

An App::Part is is a general purpose container that keeps together a " - "group of objects so that they can be moved together as a unit in the 3D view.\n" - "it is meant to arrange objects that have a Part TopoShape, like Part Primitives, PartDesign" - " Bodies, and other Part Features. In addition, Std Parts may be nested inside other" - " Std Parts to create a big assembly from smaller sub-assemblies.

"); + static std::string toolTip = std::string("

") + + QT_TR_NOOP("A Part is is a general purpose container to keep together a " + "group of objects so that they act as a unit in the 3D view.\n" + "It is meant to arrange objects that have a Part TopoShape, like Part Primitives, PartDesign" + " Bodies, and other Parts.") + + "

"; + sToolTipText = toolTip.c_str(); sWhatsThis = "Std_Part"; sStatusTip = sToolTipText; sPixmap = "Geofeaturegroup"; @@ -94,10 +96,13 @@ StdCmdGroup::StdCmdGroup() { sGroup = "Structure"; sMenuText = QT_TR_NOOP("Create group"); - sToolTipText = QT_TR_NOOP("

Group is a general purpose container that allows you to " - "group different types of objects in the Tree view, regardless of their data type. " - "It is used as a simple folder to categorize and organize the objects in your model, " - "in order to keep a logical structure. Std Groups may be nested inside other Std Groups.

"); + static std::string toolTip = std::string("

") + + QT_TR_NOOP("A Group is a general purpose container to group objects in the " + "Tree view, regardless of their data type. It is a simple folder to organize " + "the objects in a model.") + + "

"; + + sToolTipText = toolTip.c_str(); sWhatsThis = "Std_Group"; sStatusTip = sToolTipText; sPixmap = "folder"; diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 948b12832c..49c9fe0301 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -3578,9 +3578,11 @@ StdCmdSelBack::StdCmdSelBack() { sGroup = "View"; sMenuText = QT_TR_NOOP("Selection Back"); - sToolTipText = QT_TR_NOOP("

The Std SelBack command restores the previous" - " recorded Tree view selection. Note that selections are only recorded if" - " Tree RecordSelection mode is switched on.

"); + static std::string toolTip = std::string("

") + + QT_TR_NOOP("Restore the previous Tree view selection. " + "Only works if Tree RecordSelection mode is switched on.") + + "

"; + sToolTipText = toolTip.c_str(); sWhatsThis = "Std_SelBack"; sStatusTip = sToolTipText; sPixmap = "sel-back"; @@ -3610,9 +3612,11 @@ StdCmdSelForward::StdCmdSelForward() { sGroup = "View"; sMenuText = QT_TR_NOOP("Selection Forward"); - sToolTipText = QT_TR_NOOP("

The Std SelForward command restores the next " - "recorded Tree view selection. Note that selections are only recorded if " - "Tree RecordSelection mode is switched on.

"); + static std::string toolTip = std::string("

") + + QT_TR_NOOP("Restore the next Tree view selection. " + "Only works if Tree RecordSelection mode is switched on.") + + "

"; + sToolTipText = toolTip.c_str(); sWhatsThis = "Std_SelForward"; sStatusTip = sToolTipText; sPixmap = "sel-forward";