Showing the changes to interface/src/scripting/MenuScriptingInterface.cpp (1 of 4 files). Show all
Unified · Split
| @@ -126,6 +126,23 @@ void MenuScriptingInterface::setIsOptionChecked(const QString& menuOption, bool · 125 unmodified lines | |||
| 126 | Q_ARG(bool, isChecked)); | 126 | Q_ARG(bool, isChecked)); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | bool MenuScriptingInterface::isMenuEnabled(const QString& menuOption) { | ||
| 130 | if (QThread::currentThread() == qApp->thread()) { | ||
| 131 | return Menu::getInstance()->isOptionChecked(menuOption); | ||
| 132 | } | ||
| 133 | bool result; | ||
| 134 | QMetaObject::invokeMethod(Menu::getInstance(), "isMenuEnabled", Qt::BlockingQueuedConnection, | ||
| 135 | Q_RETURN_ARG(bool, result), | ||
| 136 | Q_ARG(const QString&, menuOption)); | ||
| 137 | return result; | ||
| 138 | } | ||
| 139 | |||
| 140 | void MenuScriptingInterface::setMenuEnabled(const QString& menuOption, bool isChecked) { | ||
| 141 | QMetaObject::invokeMethod(Menu::getInstance(), "setMenuEnabled", | ||
| 142 | Q_ARG(const QString&, menuOption), | ||
| 143 | Q_ARG(bool, isChecked)); | ||
| 144 | } | ||
| 145 | |||
| 129 | void MenuScriptingInterface::triggerOption(const QString& menuOption) { | 146 | void MenuScriptingInterface::triggerOption(const QString& menuOption) { |
| 130 | QMetaObject::invokeMethod(Menu::getInstance(), "triggerOption", Q_ARG(const QString&, menuOption)); | 147 | QMetaObject::invokeMethod(Menu::getInstance(), "triggerOption", Q_ARG(const QString&, menuOption)); |
| 131 | } | 148 | } |