command to open folder with macros

This commit is contained in:
tarman3
2025-05-26 18:47:16 +03:00
committed by Kacper Donat
parent 8644498400
commit 239a05b242
3 changed files with 244 additions and 0 deletions

View File

@@ -23,6 +23,8 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <QApplication>
# include <QDesktopServices>
# include <QUrl>
#endif
#include "Command.h"
@@ -302,6 +304,35 @@ bool StdCmdToggleBreakpoint::isActive()
return getGuiApplication()->sendHasMsgToActiveView("ToggleBreakpoint");
}
DEF_STD_CMD_A(StdCmdMacrosFolder)
StdCmdMacrosFolder::StdCmdMacrosFolder()
: Command("Std_OpenMacrosFolder")
{
sGroup = "Macro";
sMenuText = QT_TR_NOOP("Open macros containing folder");
sToolTipText = QT_TR_NOOP("Open macros containing folder by default system file manager");
sWhatsThis = "Std_OpenMacrosFolder";
sStatusTip = QT_TR_NOOP("Open macros containing folder by default system file manager");
sPixmap = "MacroFolder";
sAccel = "";
eType = 0;
}
void StdCmdMacrosFolder::activated(int iMsg)
{
Q_UNUSED(iMsg);
QString path = QString::fromStdString(App::Application::getUserMacroDir());
QUrl url = QUrl::fromLocalFile(path);
QDesktopServices::openUrl(url);
}
bool StdCmdMacrosFolder::isActive()
{
return true;
}
namespace Gui {
void CreateMacroCommands()
@@ -309,6 +340,7 @@ void CreateMacroCommands()
CommandManager &rcCmdMgr = Application::Instance->commandManager();
rcCmdMgr.addCommand(new StdCmdDlgMacroRecord());
rcCmdMgr.addCommand(new StdCmdDlgMacroExecute());
rcCmdMgr.addCommand(new StdCmdMacrosFolder());
rcCmdMgr.addCommand(new StdCmdDlgMacroExecuteDirect());
rcCmdMgr.addCommand(new StdCmdMacroAttachDebugger());
rcCmdMgr.addCommand(new StdCmdMacroStartDebug());

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@@ -193,6 +193,7 @@
<file>Std_CoordinateSystem_alt.svg</file>
<file>Std_Placement.svg</file>
<file>MacroEditor.svg</file>
<file>MacroFolder.svg</file>
<file>Param_Bool.svg</file>
<file>Param_Float.svg</file>
<file>Param_Int.svg</file>