mirror of
https://github.com/overte-org/overte.git
synced 2025-04-09 10:45:24 +02:00
Remove Menu.isInfoViewVisible() and closeInfoView() from JavaScript API
This commit is contained in:
parent
efddec621f
commit
615e54620b
5 changed files with 0 additions and 45 deletions
|
@ -131,19 +131,3 @@ void MenuScriptingInterface::setMenuEnabled(const QString& menuOption, bool isCh
|
|||
void MenuScriptingInterface::triggerOption(const QString& menuOption) {
|
||||
QMetaObject::invokeMethod(Menu::getInstance(), "triggerOption", Q_ARG(const QString&, menuOption));
|
||||
}
|
||||
|
||||
void MenuScriptingInterface::closeInfoView(const QString& path) {
|
||||
QMetaObject::invokeMethod(Menu::getInstance(), "closeInfoView", Q_ARG(const QString&, path));
|
||||
}
|
||||
|
||||
bool MenuScriptingInterface::isInfoViewVisible(const QString& path) {
|
||||
if (QThread::currentThread() == qApp->thread()) {
|
||||
return Menu::getInstance()->isInfoViewVisible(path);
|
||||
}
|
||||
|
||||
bool result;
|
||||
BLOCKING_INVOKE_METHOD(Menu::getInstance(), "isInfoViewVisible",
|
||||
Q_RETURN_ARG(bool, result), Q_ARG(const QString&, path));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -215,12 +215,6 @@ public slots:
|
|||
*/
|
||||
void setMenuEnabled(const QString& menuName, bool isEnabled);
|
||||
|
||||
/**
|
||||
* TODO: Not used or useful; will not document until used.
|
||||
*/
|
||||
void closeInfoView(const QString& path);
|
||||
bool isInfoViewVisible(const QString& path);
|
||||
|
||||
signals:
|
||||
/**jsdoc
|
||||
* Triggered when a menu item is clicked (or triggered by {@link Menu.triggerOption}).
|
||||
|
|
|
@ -268,16 +268,6 @@ bool Menu::isOptionChecked(const QString& menuOption) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
void Menu::closeInfoView(const QString& path) {
|
||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||
offscreenUi->hide(path);
|
||||
}
|
||||
|
||||
bool Menu::isInfoViewVisible(const QString& path) {
|
||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||
return offscreenUi->isVisible(path);
|
||||
}
|
||||
|
||||
void Menu::triggerOption(const QString& menuOption) {
|
||||
QAction* action = _actionHash.value(menuOption);
|
||||
if (action) {
|
||||
|
|
|
@ -122,9 +122,6 @@ public slots:
|
|||
void toggleDeveloperMenus();
|
||||
void toggleAdvancedMenus();
|
||||
|
||||
bool isInfoViewVisible(const QString& path);
|
||||
void closeInfoView(const QString& path);
|
||||
|
||||
void triggerOption(const QString& menuOption);
|
||||
|
||||
static bool isSomeSubmenuShown() { return _isSomeSubmenuShown; }
|
||||
|
|
|
@ -47,22 +47,12 @@
|
|||
button.clicked.connect(onClicked);
|
||||
tablet.screenChanged.connect(onScreenChanged);
|
||||
|
||||
var POLL_RATE = 500;
|
||||
var interval = Script.setInterval(function () {
|
||||
var visible = Menu.isInfoViewVisible('InfoView_html/help.html');
|
||||
if (visible !== enabled) {
|
||||
enabled = visible;
|
||||
button.editProperties({isActive: enabled});
|
||||
}
|
||||
}, POLL_RATE);
|
||||
|
||||
Script.scriptEnding.connect(function () {
|
||||
if (onHelpScreen) {
|
||||
tablet.gotoHomeScreen();
|
||||
}
|
||||
button.clicked.disconnect(onClicked);
|
||||
tablet.screenChanged.disconnect(onScreenChanged);
|
||||
Script.clearInterval(interval);
|
||||
if (tablet) {
|
||||
tablet.removeButton(button);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue