mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
adding potential fix - moving methods to Application
This commit is contained in:
parent
01c4b57d11
commit
3994ec4176
3 changed files with 27 additions and 4 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <QtCore/QFileSelector>
|
||||
#include <QtConcurrent/QtConcurrentRun>
|
||||
|
||||
#include <QtGui/QClipboard>
|
||||
#include <QtGui/QScreen>
|
||||
#include <QtGui/QWindow>
|
||||
#include <QtGui/QDesktopServices>
|
||||
|
@ -1668,7 +1669,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
return qApp->getMyAvatar()->getSnapTurn() ? 1 : 0;
|
||||
});
|
||||
_applicationStateDevice->setInputVariant(STATE_ADVANCED_MOVEMENT_CONTROLS, []() -> float {
|
||||
return qApp->getMyAvatar()->useAdvancedMovementControls() ? 1 : 0;
|
||||
auto isAdvanced = qApp->getMyAvatar()->useAdvancedMovementControls();
|
||||
return isAdvanced ? 1 : 0;
|
||||
});
|
||||
|
||||
_applicationStateDevice->setInputVariant(STATE_GROUNDED, []() -> float {
|
||||
|
@ -8304,6 +8306,25 @@ void Application::saveNextPhysicsStats(QString filename) {
|
|||
_physicsEngine->saveNextPhysicsStats(filename);
|
||||
}
|
||||
|
||||
void Application::copyAddress() {
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QMetaObject::invokeMethod(this, "copyAddress");
|
||||
return;
|
||||
}
|
||||
|
||||
// assume that the address is being copied because the user wants a shareable address
|
||||
QApplication::clipboard()->setText(QString("copyAddress worked!"));
|
||||
}
|
||||
|
||||
void Application::copyPath() {
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QMetaObject::invokeMethod(this, "copyPath");
|
||||
return;
|
||||
}
|
||||
|
||||
QApplication::clipboard()->setText(QString("copyPath worked!"));
|
||||
}
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
void Application::enterBackground() {
|
||||
QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(),
|
||||
|
|
|
@ -368,6 +368,9 @@ public slots:
|
|||
void resetSensors(bool andReload = false);
|
||||
void setActiveFaceTracker() const;
|
||||
|
||||
void copyAddress();
|
||||
void copyPath();
|
||||
|
||||
#if (PR_BUILD || DEV_BUILD)
|
||||
void sendWrongProtocolVersionsSignature(bool checked) { ::sendWrongProtocolVersionsSignature(checked); }
|
||||
#endif
|
||||
|
|
|
@ -268,13 +268,12 @@ Menu::Menu() {
|
|||
locationBookmarks->setupMenus(this, navigateMenu);
|
||||
|
||||
// Navigate > Copy Address
|
||||
auto addressManager = DependencyManager::get<AddressManager>();
|
||||
addActionToQMenuAndActionHash(navigateMenu, MenuOption::CopyAddress, 0,
|
||||
addressManager.data(), SLOT(copyAddress()));
|
||||
qApp, SLOT(copyAddress()));
|
||||
|
||||
// Navigate > Copy Path
|
||||
addActionToQMenuAndActionHash(navigateMenu, MenuOption::CopyPath, 0,
|
||||
addressManager.data(), SLOT(copyPath()));
|
||||
qApp, SLOT(copyPath()));
|
||||
|
||||
|
||||
// Settings menu ----------------------------------
|
||||
|
|
Loading…
Reference in a new issue