Gui: expose link actions to toolbar

This commit is contained in:
Zheng, Lei
2019-09-26 12:49:54 +08:00
committed by wmayer
parent 4eadbd038d
commit fbfad66d2b
2 changed files with 30 additions and 6 deletions

View File

@@ -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());
}

View File

@@ -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;
}