mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-27 02:45:33 +02:00
Add menu items that copy location address and location path
And Rename File > Go to File > Location
This commit is contained in:
parent
89967fbe7a
commit
544d412122
2 changed files with 24 additions and 1 deletions
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include <QBoxLayout>
|
||||
#include <QColorDialog>
|
||||
#include <QClipboard>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QFileDialog>
|
||||
|
@ -122,7 +123,7 @@ Menu::Menu() :
|
|||
addActionToQMenuAndActionHash(fileMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J,
|
||||
appInstance, SLOT(toggleRunningScriptsWidget()));
|
||||
|
||||
addDisabledActionAndSeparator(fileMenu, "Go");
|
||||
addDisabledActionAndSeparator(fileMenu, "Location");
|
||||
addActionToQMenuAndActionHash(fileMenu,
|
||||
MenuOption::NameLocation,
|
||||
Qt::CTRL | Qt::Key_N,
|
||||
|
@ -138,6 +139,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,
|
||||
|
@ -1006,6 +1011,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() {
|
||||
Application::getInstance()->setVSyncEnabled(isOptionChecked(MenuOption::RenderTargetFramerateVSyncOn));
|
||||
}
|
||||
|
|
|
@ -177,6 +177,8 @@ public slots:
|
|||
void importSettings();
|
||||
void exportSettings();
|
||||
void toggleAddressBar();
|
||||
void copyAddress();
|
||||
void copyPath();
|
||||
|
||||
void toggleLoginMenuItem();
|
||||
void toggleSixense(bool shouldEnable);
|
||||
|
@ -343,6 +345,8 @@ namespace MenuOption {
|
|||
const QString CollideWithEnvironment = "Collide With World Boundaries";
|
||||
const QString Collisions = "Collisions";
|
||||
const QString Console = "Console...";
|
||||
const QString CopyAddress = "Copy Address";
|
||||
const QString CopyPath = "Copy Path";
|
||||
const QString ControlWithSpeech = "Control With Speech";
|
||||
const QString DontRenderEntitiesAsScene = "Don't Render Entities as Scene";
|
||||
const QString DontDoPrecisionPicking = "Don't Do Precision Picking";
|
||||
|
|
Loading…
Reference in a new issue