diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index cfe4ec0c87..f233f27817 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -123,7 +124,7 @@ Menu::Menu() : addActionToQMenuAndActionHash(fileMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J, appInstance, SLOT(toggleRunningScriptsWidget())); - addDisabledActionAndSeparator(fileMenu, "Go"); + addDisabledActionAndSeparator(fileMenu, "Location"); addActionToQMenuAndActionHash(fileMenu, MenuOption::BookmarkLocation, 0, this, SLOT(bookmarkLocation())); _bookmarksMenu = fileMenu->addMenu(MenuOption::Bookmarks); @@ -148,6 +149,10 @@ Menu::Menu() : Qt::Key_Enter, this, SLOT(toggleAddressBar())); + addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyAddress, 0, + this, SLOT(copyAddress())); + addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyPath, 0, + this, SLOT(copyPath())); addDisabledActionAndSeparator(fileMenu, "Upload Avatar Model"); addActionToQMenuAndActionHash(fileMenu, MenuOption::UploadHead, 0, @@ -1021,6 +1026,20 @@ void Menu::toggleAddressBar() { } } +void Menu::copyAddress() { + auto addressManager = DependencyManager::get(); + QString address = addressManager->currentAddress().toString(); + QClipboard* clipboard = QApplication::clipboard(); + clipboard->setText(address); +} + +void Menu::copyPath() { + auto addressManager = DependencyManager::get(); + QString path = addressManager->currentPath(); + QClipboard* clipboard = QApplication::clipboard(); + clipboard->setText(path); +} + void Menu::changeVSync() { Application::getInstance()->setVSyncEnabled(isOptionChecked(MenuOption::RenderTargetFramerateVSyncOn)); } diff --git a/interface/src/Menu.h b/interface/src/Menu.h index bf17fe46df..7db9e637b2 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -177,6 +177,8 @@ public slots: void importSettings(); void exportSettings(); void toggleAddressBar(); + void copyAddress(); + void copyPath(); void toggleLoginMenuItem(); void toggleSixense(bool shouldEnable); @@ -353,6 +355,8 @@ namespace MenuOption { const QString CollideWithEnvironment = "Collide With World Boundaries"; const QString Collisions = "Collisions"; 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 DeleteBookmark = "Delete Bookmark..."; const QString DontRenderEntitiesAsScene = "Don't Render Entities as Scene";