From 591c1d32cd1a8a115a59bc843a298b445297c4ed Mon Sep 17 00:00:00 2001
From: Mark Ganson TheMarkster <39143564+mwganson@users.noreply.github.com>
Date: Fri, 31 Aug 2018 18:40:54 -0500
Subject: [PATCH] Add link button to Addon Manager to Macros dialog
Adds a button labeled Addons... to the macros dialog below the create, edit, delete, and rename buttons. Clicking the Addons... button will open the same dialog available from Tools -> Addon Manager menu.
Convenience for experienced users, but new users who might not know about the addon manager will be able to see it here, too.
---
src/Gui/DlgMacroExecute.ui | 13 +++++++++++++
src/Gui/DlgMacroExecuteImp.cpp | 11 +++++++++++
src/Gui/DlgMacroExecuteImp.h | 1 +
3 files changed, 25 insertions(+)
diff --git a/src/Gui/DlgMacroExecute.ui b/src/Gui/DlgMacroExecute.ui
index 319e916421..ed756ca81c 100644
--- a/src/Gui/DlgMacroExecute.ui
+++ b/src/Gui/DlgMacroExecute.ui
@@ -277,6 +277,16 @@
+ -
+
+
+ true
+
+
+ Addons...
+
+
+
@@ -298,7 +308,10 @@
createButton
deleteButton
editButton
+ renameButton
+ addonsButton
fileChooser
+
diff --git a/src/Gui/DlgMacroExecuteImp.cpp b/src/Gui/DlgMacroExecuteImp.cpp
index 1f7ada0133..1a46a96e6b 100644
--- a/src/Gui/DlgMacroExecuteImp.cpp
+++ b/src/Gui/DlgMacroExecuteImp.cpp
@@ -31,6 +31,7 @@
#include "DlgMacroExecuteImp.h"
#include "Application.h"
#include "BitmapFactory.h"
+#include "Command.h"
#include "MainWindow.h"
#include "FileDialog.h"
#include "Macro.h"
@@ -437,5 +438,15 @@ void DlgMacroExecuteImp::on_renameButton_clicked()
}
}
}
+/**
+ * convenience link button to open tools -> addon manager
+ * from within macro dialog
+ */
+void DlgMacroExecuteImp::on_addonsButton_clicked()
+{
+ CommandManager& rMgr=Application::Instance->commandManager();
+ rMgr.runCommandByName("Std_AddonMgr");
+ this->fillUpList();
+}
#include "moc_DlgMacroExecuteImp.cpp"
diff --git a/src/Gui/DlgMacroExecuteImp.h b/src/Gui/DlgMacroExecuteImp.h
index 3090fc1721..0f0f3fe0d3 100644
--- a/src/Gui/DlgMacroExecuteImp.h
+++ b/src/Gui/DlgMacroExecuteImp.h
@@ -51,6 +51,7 @@ public Q_SLOTS:
void on_deleteButton_clicked();
void on_editButton_clicked();
void on_renameButton_clicked();
+ void on_addonsButton_clicked();
protected Q_SLOTS:
void on_userMacroListBox_currentItemChanged(QTreeWidgetItem*);