diff --git a/src/Gui/Dialogs/DlgMacroExecuteImp.cpp b/src/Gui/Dialogs/DlgMacroExecuteImp.cpp index 7dcd6212e5..c92d7f2585 100644 --- a/src/Gui/Dialogs/DlgMacroExecuteImp.cpp +++ b/src/Gui/Dialogs/DlgMacroExecuteImp.cpp @@ -124,6 +124,8 @@ DlgMacroExecuteImp::DlgMacroExecuteImp(QWidget* parent, Qt::WindowFlags fl) } fillUpList(); ui->LineEditFind->setFocus(); + ui->addonsButton->setEnabled( + Application::Instance->commandManager().getCommandByName("Std_AddonMgr") != nullptr); } /** diff --git a/src/Gui/Dialogs/DlgPreferencePackManagementImp.cpp b/src/Gui/Dialogs/DlgPreferencePackManagementImp.cpp index 54d0a66852..14c0482c9b 100644 --- a/src/Gui/Dialogs/DlgPreferencePackManagementImp.cpp +++ b/src/Gui/Dialogs/DlgPreferencePackManagementImp.cpp @@ -42,7 +42,12 @@ DlgPreferencePackManagementImp::DlgPreferencePackManagementImp(QWidget* parent) , ui(new Ui_DlgPreferencePackManagement) { ui->setupUi(this); - connect(ui->pushButtonOpenAddonManager, &QPushButton::clicked, this, &DlgPreferencePackManagementImp::showAddonManager); + if (Application::Instance->commandManager().getCommandByName("Std_AddonMgr")) { + connect(ui->pushButtonOpenAddonManager, &QPushButton::clicked, this, &DlgPreferencePackManagementImp::showAddonManager); + } + else { + ui->pushButtonOpenAddonManager->setDisabled(true); + } connect(this, &DlgPreferencePackManagementImp::packVisibilityChanged, this, &DlgPreferencePackManagementImp::updateTree); updateTree(); } diff --git a/src/Gui/PreferencePages/DlgSettingsGeneral.cpp b/src/Gui/PreferencePages/DlgSettingsGeneral.cpp index 81daec9541..564338af49 100644 --- a/src/Gui/PreferencePages/DlgSettingsGeneral.cpp +++ b/src/Gui/PreferencePages/DlgSettingsGeneral.cpp @@ -127,6 +127,8 @@ DlgSettingsGeneral::DlgSettingsGeneral( QWidget* parent ) const auto visible = UnitsApi::isMultiUnitLength(); ui->comboBox_FracInch->setVisible(visible); ui->fractionalInchLabel->setVisible(visible); + ui->moreThemesLabel->setEnabled( + Application::Instance->commandManager().getCommandByName("Std_AddonMgr") != nullptr); } /** diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index 276428afc1..71990367e1 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -718,8 +718,10 @@ MenuItem* StdWorkbench::setupMenuBar() const auto tool = new MenuItem( menuBar ); tool->setCommand("&Tools"); #ifdef BUILD_ADDONMGR - *tool << "Std_AddonMgr" - << "Separator"; + if (Application::Instance->commandManager().getCommandByName("Std_AddonMgr")) { + *tool << "Std_AddonMgr" + << "Separator"; + } #endif *tool << "Std_Measure" << "Std_ClarifySelection" diff --git a/src/Mod/Start/Gui/ThemeSelectorWidget.cpp b/src/Mod/Start/Gui/ThemeSelectorWidget.cpp index 83a9043caf..a17ecc9c3f 100644 --- a/src/Mod/Start/Gui/ThemeSelectorWidget.cpp +++ b/src/Mod/Start/Gui/ThemeSelectorWidget.cpp @@ -236,8 +236,13 @@ bool ThemeSelectorWidget::eventFilter(QObject* object, QEvent* event) void ThemeSelectorWidget::retranslateUi() { _titleLabel->setText(QLatin1String("

") + tr("Theme") + QLatin1String("

")); - _descriptionLabel->setText(tr("Looking for more themes? You can obtain them using " - "Addon Manager.")); + if (Gui::Application::Instance->commandManager().getCommandByName("Std_AddonMgr")) { + _descriptionLabel->setText(tr("Looking for more themes? You can obtain them using " + "Addon Manager.")); + } + else { + _descriptionLabel->hide(); + } _buttons[static_cast(Theme::Dark)]->setText(tr("FreeCAD Dark", "Visual theme name")); _buttons[static_cast(Theme::Light)]->setText(tr("FreeCAD Light", "Visual theme name")); _buttons[static_cast(Theme::Classic)]->setText(tr("FreeCAD Classic", "Visual theme name"));