From c34ee6e7539ada567dcaf423976fb40e1702ff2c Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Thu, 26 Sep 2019 12:49:54 +0800 Subject: [PATCH] Gui: expose link actions to toolbar --- src/Gui/CommandLink.cpp | 34 +++++++++++++++++++++++++++++----- src/Gui/Workbench.cpp | 2 +- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/Gui/CommandLink.cpp b/src/Gui/CommandLink.cpp index c745c456d8..3a6e6f3c2a 100644 --- a/src/Gui/CommandLink.cpp +++ b/src/Gui/CommandLink.cpp @@ -855,6 +855,34 @@ public: virtual const char* className() const {return "StdCmdLinkSelectActions";} }; +//====================================================================== +// Std_LinkActions +//=========================================================================== + +class StdCmdLinkActions : public GroupCommand +{ +public: + StdCmdLinkActions() + : GroupCommand("Std_LinkActions") + { + sGroup = QT_TR_NOOP("View"); + sMenuText = QT_TR_NOOP("Link actions"); + sToolTipText = QT_TR_NOOP("Link actions"); + sWhatsThis = "Std_LinkActions"; + sStatusTip = QT_TR_NOOP("Link actions"); + eType = AlterDoc; + bCanLog = false; + + addCommand(new StdCmdLinkMakeRelative()); + addCommand(new StdCmdLinkReplace()); + addCommand(new StdCmdLinkUnlink()); + addCommand(new StdCmdLinkImport()); + addCommand(new StdCmdLinkImportAll()); + } + + virtual const char* className() const {return "StdCmdLinkActions";} +}; + //=========================================================================== // Instantiation //=========================================================================== @@ -866,12 +894,8 @@ void CreateLinkCommands(void) { CommandManager &rcCmdMgr = Application::Instance->commandManager(); rcCmdMgr.addCommand(new StdCmdLinkMake()); - rcCmdMgr.addCommand(new StdCmdLinkMakeRelative()); + rcCmdMgr.addCommand(new StdCmdLinkActions()); rcCmdMgr.addCommand(new StdCmdLinkMakeGroup()); - rcCmdMgr.addCommand(new StdCmdLinkReplace()); - rcCmdMgr.addCommand(new StdCmdLinkUnlink()); - rcCmdMgr.addCommand(new StdCmdLinkImport()); - rcCmdMgr.addCommand(new StdCmdLinkImportAll()); rcCmdMgr.addCommand(new StdCmdLinkSelectActions()); } diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index f6180cf50f..48f6c419a8 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -668,7 +668,7 @@ ToolBarItem* StdWorkbench::setupToolBars() const // Structure ToolBarItem* structure = new ToolBarItem( root ); structure->setCommand("Structure"); - *structure << "Std_Part" << "Std_Group" << "Std_LinkMake" << "Std_LinkMakeRelative"; + *structure << "Std_Part" << "Std_Group" << "Std_LinkMake" << "Std_LinkActions"; return root; }