mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 14:21:10 +02:00
Merge pull request #4109 from ctrlaltdavid/20269
CR for Job #20269 - Add option to copy address and path to menu
This commit is contained in:
commit
eef5807fb4
2 changed files with 24 additions and 1 deletions
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
|
#include <QClipboard>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QDoubleSpinBox>
|
#include <QDoubleSpinBox>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
@ -123,7 +124,7 @@ Menu::Menu() :
|
||||||
addActionToQMenuAndActionHash(fileMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J,
|
addActionToQMenuAndActionHash(fileMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J,
|
||||||
appInstance, SLOT(toggleRunningScriptsWidget()));
|
appInstance, SLOT(toggleRunningScriptsWidget()));
|
||||||
|
|
||||||
addDisabledActionAndSeparator(fileMenu, "Go");
|
addDisabledActionAndSeparator(fileMenu, "Location");
|
||||||
addActionToQMenuAndActionHash(fileMenu, MenuOption::BookmarkLocation, 0,
|
addActionToQMenuAndActionHash(fileMenu, MenuOption::BookmarkLocation, 0,
|
||||||
this, SLOT(bookmarkLocation()));
|
this, SLOT(bookmarkLocation()));
|
||||||
_bookmarksMenu = fileMenu->addMenu(MenuOption::Bookmarks);
|
_bookmarksMenu = fileMenu->addMenu(MenuOption::Bookmarks);
|
||||||
|
@ -148,6 +149,10 @@ Menu::Menu() :
|
||||||
Qt::Key_Enter,
|
Qt::Key_Enter,
|
||||||
this,
|
this,
|
||||||
SLOT(toggleAddressBar()));
|
SLOT(toggleAddressBar()));
|
||||||
|
addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyAddress, 0,
|
||||||
|
this, SLOT(copyAddress()));
|
||||||
|
addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyPath, 0,
|
||||||
|
this, SLOT(copyPath()));
|
||||||
|
|
||||||
addDisabledActionAndSeparator(fileMenu, "Upload Avatar Model");
|
addDisabledActionAndSeparator(fileMenu, "Upload Avatar Model");
|
||||||
addActionToQMenuAndActionHash(fileMenu, MenuOption::UploadHead, 0,
|
addActionToQMenuAndActionHash(fileMenu, MenuOption::UploadHead, 0,
|
||||||
|
@ -1021,6 +1026,20 @@ void Menu::toggleAddressBar() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Menu::copyAddress() {
|
||||||
|
auto addressManager = DependencyManager::get<AddressManager>();
|
||||||
|
QString address = addressManager->currentAddress().toString();
|
||||||
|
QClipboard* clipboard = QApplication::clipboard();
|
||||||
|
clipboard->setText(address);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Menu::copyPath() {
|
||||||
|
auto addressManager = DependencyManager::get<AddressManager>();
|
||||||
|
QString path = addressManager->currentPath();
|
||||||
|
QClipboard* clipboard = QApplication::clipboard();
|
||||||
|
clipboard->setText(path);
|
||||||
|
}
|
||||||
|
|
||||||
void Menu::changeVSync() {
|
void Menu::changeVSync() {
|
||||||
Application::getInstance()->setVSyncEnabled(isOptionChecked(MenuOption::RenderTargetFramerateVSyncOn));
|
Application::getInstance()->setVSyncEnabled(isOptionChecked(MenuOption::RenderTargetFramerateVSyncOn));
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,6 +177,8 @@ public slots:
|
||||||
void importSettings();
|
void importSettings();
|
||||||
void exportSettings();
|
void exportSettings();
|
||||||
void toggleAddressBar();
|
void toggleAddressBar();
|
||||||
|
void copyAddress();
|
||||||
|
void copyPath();
|
||||||
|
|
||||||
void toggleLoginMenuItem();
|
void toggleLoginMenuItem();
|
||||||
void toggleSixense(bool shouldEnable);
|
void toggleSixense(bool shouldEnable);
|
||||||
|
@ -353,6 +355,8 @@ namespace MenuOption {
|
||||||
const QString CollideWithEnvironment = "Collide With World Boundaries";
|
const QString CollideWithEnvironment = "Collide With World Boundaries";
|
||||||
const QString Collisions = "Collisions";
|
const QString Collisions = "Collisions";
|
||||||
const QString Console = "Console...";
|
const QString Console = "Console...";
|
||||||
|
const QString CopyAddress = "Copy Address to Clipboard";
|
||||||
|
const QString CopyPath = "Copy Path to Clipboard";
|
||||||
const QString ControlWithSpeech = "Control With Speech";
|
const QString ControlWithSpeech = "Control With Speech";
|
||||||
const QString DeleteBookmark = "Delete Bookmark...";
|
const QString DeleteBookmark = "Delete Bookmark...";
|
||||||
const QString DontRenderEntitiesAsScene = "Don't Render Entities as Scene";
|
const QString DontRenderEntitiesAsScene = "Don't Render Entities as Scene";
|
||||||
|
|
Loading…
Reference in a new issue