diff --git a/src/Gui/DlgMacroExecuteImp.cpp b/src/Gui/DlgMacroExecuteImp.cpp index 29f0244a7b..cca56f1078 100644 --- a/src/Gui/DlgMacroExecuteImp.cpp +++ b/src/Gui/DlgMacroExecuteImp.cpp @@ -465,14 +465,13 @@ Note: your changes will be applied when you next switch workbenches\n")); /** check if user already has this macro command created, if so skip dialog 1 **/ bool hasMacroCommand = false; QString macroMenuText; - std::vector > macroGroups = - App::GetApplication().GetParameterGroupByPath(QByteArray("User parameter:BaseApp/Macro/Macros"))->GetGroups(); - for (std::vector>::iterator it = macroGroups.begin(); it != macroGroups.end(); ++it){ - QString script = QString::fromUtf8((*it)->GetASCII("Script").c_str()); //macro filename - if(script == fn){ + CommandManager & cCmdMgr = Application::Instance->commandManager(); + std::vector aCmds = cCmdMgr.getGroupCommands("Macros"); + for (std::vector::iterator it = aCmds.begin(); it != aCmds.end(); ++it) { + MacroCommand* mc = (MacroCommand*)(*it); + if(QString::fromLatin1(mc->getScriptName()) == fn){ hasMacroCommand = true; - macroMenuText = QString::fromUtf8((*it)->GetASCII("Menu").c_str()); //this text is in the command list in the toolbars tab - break; + macroMenuText = QString::fromLatin1(mc->getMenuText()); } } @@ -575,7 +574,7 @@ Note: your changes will be applied when you next switch workbenches\n")); } else { /** find the Global workbench and select it for the user **/ - int globalIdx = workbenchBox->findText(tr("Global")); + int globalIdx = workbenchBox->findText(QString::fromLatin1("Global"));; if (globalIdx != -1){ workbenchBox->setCurrentIndex(globalIdx); setupToolbarPage->on_workbenchBox_activated(globalIdx); diff --git a/src/Gui/DlgToolbarsImp.cpp b/src/Gui/DlgToolbarsImp.cpp index 062672d4d2..a52ee2d7b1 100644 --- a/src/Gui/DlgToolbarsImp.cpp +++ b/src/Gui/DlgToolbarsImp.cpp @@ -112,7 +112,7 @@ DlgCustomToolbars::DlgCustomToolbars(DlgCustomToolbars::Type t, QWidget* parent) QStringList workbenches = Application::Instance->workbenches(); workbenches.sort(); index = 1; - workbenchBox->addItem(QApplication::windowIcon(), tr("Global")); + workbenchBox->addItem(QApplication::windowIcon(), QString::fromLatin1("Global")); workbenchBox->setItemData(0, QVariant(QString::fromLatin1("Global")), Qt::UserRole); for (QStringList::Iterator it = workbenches.begin(); it != workbenches.end(); ++it) { QPixmap px = Application::Instance->workbenchIcon(*it);