mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 08:48:53 +02:00
Remove Menu.addActionGroup() and removeActionGroup() from JavaScript API
This commit is contained in:
parent
42498314f1
commit
efddec621f
5 changed files with 1 additions and 44 deletions
|
@ -210,6 +210,7 @@ Menu::Menu() {
|
||||||
auto avatarEntitiesBookmarks = DependencyManager::get<AvatarEntitiesBookmarks>();
|
auto avatarEntitiesBookmarks = DependencyManager::get<AvatarEntitiesBookmarks>();
|
||||||
avatarEntitiesBookmarks->setupMenus(this, avatarMenu);
|
avatarEntitiesBookmarks->setupMenus(this, avatarMenu);
|
||||||
|
|
||||||
|
|
||||||
// Display menu ----------------------------------
|
// Display menu ----------------------------------
|
||||||
// FIXME - this is not yet matching Alan's spec because it doesn't have
|
// FIXME - this is not yet matching Alan's spec because it doesn't have
|
||||||
// menus for "2D"/"3D" - we need to add support for detecting the appropriate
|
// menus for "2D"/"3D" - we need to add support for detecting the appropriate
|
||||||
|
|
|
@ -94,22 +94,6 @@ bool MenuScriptingInterface::menuItemExists(const QString& menu, const QString&
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuScriptingInterface::addActionGroup(const QString& groupName, const QStringList& actionList,
|
|
||||||
const QString& selected) {
|
|
||||||
static const char* slot = SLOT(menuItemTriggered());
|
|
||||||
QMetaObject::invokeMethod(Menu::getInstance(), "addActionGroup",
|
|
||||||
Q_ARG(const QString&, groupName),
|
|
||||||
Q_ARG(const QStringList&, actionList),
|
|
||||||
Q_ARG(const QString&, selected),
|
|
||||||
Q_ARG(QObject*, this),
|
|
||||||
Q_ARG(const char*, slot));
|
|
||||||
}
|
|
||||||
|
|
||||||
void MenuScriptingInterface::removeActionGroup(const QString& groupName) {
|
|
||||||
QMetaObject::invokeMethod(Menu::getInstance(), "removeActionGroup",
|
|
||||||
Q_ARG(const QString&, groupName));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MenuScriptingInterface::isOptionChecked(const QString& menuOption) {
|
bool MenuScriptingInterface::isOptionChecked(const QString& menuOption) {
|
||||||
if (QThread::currentThread() == qApp->thread()) {
|
if (QThread::currentThread() == qApp->thread()) {
|
||||||
return Menu::getInstance()->isOptionChecked(menuOption);
|
return Menu::getInstance()->isOptionChecked(menuOption);
|
||||||
|
|
|
@ -163,13 +163,6 @@ public slots:
|
||||||
*/
|
*/
|
||||||
bool menuItemExists(const QString& menuName, const QString& menuitem);
|
bool menuItemExists(const QString& menuName, const QString& menuitem);
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: Not working; don't document until fixed.
|
|
||||||
*/
|
|
||||||
void addActionGroup(const QString& groupName, const QStringList& actionList,
|
|
||||||
const QString& selected = QString());
|
|
||||||
void removeActionGroup(const QString& groupName);
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Check whether a checkable menu item is checked.
|
* Check whether a checkable menu item is checked.
|
||||||
* @function Menu.isOptionChecked
|
* @function Menu.isOptionChecked
|
||||||
|
|
|
@ -539,24 +539,6 @@ void Menu::setGroupingIsVisible(const QString& grouping, bool isVisible) {
|
||||||
QMenuBar::repaint();
|
QMenuBar::repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::addActionGroup(const QString& groupName, const QStringList& actionList, const QString& selected, QObject* receiver, const char* slot) {
|
|
||||||
auto menu = addMenu(groupName);
|
|
||||||
|
|
||||||
QActionGroup* actionGroup = new QActionGroup(menu);
|
|
||||||
actionGroup->setExclusive(true);
|
|
||||||
|
|
||||||
for (auto action : actionList) {
|
|
||||||
auto item = addCheckableActionToQMenuAndActionHash(menu, action, 0, action == selected, receiver, slot);
|
|
||||||
actionGroup->addAction(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
QMenuBar::repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Menu::removeActionGroup(const QString& groupName) {
|
|
||||||
removeMenu(groupName);
|
|
||||||
}
|
|
||||||
|
|
||||||
MenuWrapper::MenuWrapper(ui::Menu& rootMenu, QMenu* menu) : _rootMenu(rootMenu), _realMenu(menu) {
|
MenuWrapper::MenuWrapper(ui::Menu& rootMenu, QMenu* menu) : _rootMenu(rootMenu), _realMenu(menu) {
|
||||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||||
offscreenUi->addMenuInitializer([=](VrMenu* vrMenu) {
|
offscreenUi->addMenuInitializer([=](VrMenu* vrMenu) {
|
||||||
|
|
|
@ -110,9 +110,6 @@ public slots:
|
||||||
void removeSeparator(const QString& menuName, const QString& separatorName);
|
void removeSeparator(const QString& menuName, const QString& separatorName);
|
||||||
void removeMenuItem(const QString& menuName, const QString& menuitem);
|
void removeMenuItem(const QString& menuName, const QString& menuitem);
|
||||||
bool menuItemExists(const QString& menuName, const QString& menuitem);
|
bool menuItemExists(const QString& menuName, const QString& menuitem);
|
||||||
void addActionGroup(const QString& groupName, const QStringList& actionList, const QString& selected = QString(),
|
|
||||||
QObject* receiver = nullptr, const char* slot = nullptr);
|
|
||||||
void removeActionGroup(const QString& groupName);
|
|
||||||
bool isOptionChecked(const QString& menuOption) const;
|
bool isOptionChecked(const QString& menuOption) const;
|
||||||
void setIsOptionChecked(const QString& menuOption, bool isChecked);
|
void setIsOptionChecked(const QString& menuOption, bool isChecked);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue