Showing the changes to interface/src/Menu.cpp (1 of 54 files). Show all
Unified · Split
| @@ -27,6 +27,7 @@ · 26 unmodified lines | |||
| 27 | #include <QSlider> | 27 | #include <QSlider> |
| 28 | #include <QUuid> | 28 | #include <QUuid> |
| 29 | #include <QHBoxLayout> | 29 | #include <QHBoxLayout> |
| 30 | #include <QDesktopServices> | ||
| 30 | 31 | ||
| 31 | #include <AccountManager.h> | 32 | #include <AccountManager.h> |
| 32 | #include <XmppClient.h> | 33 | #include <XmppClient.h> |
| @@ -335,6 +336,8 @@ Menu::Menu() : · 302 unmodified lines | |||
| 335 | addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false); | 336 | addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false); |
| 336 | addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::PlaySlaps, 0, false); | 337 | addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::PlaySlaps, 0, false); |
| 337 | addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::HandsCollideWithSelf, 0, false); | 338 | addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::HandsCollideWithSelf, 0, false); |
| 339 | addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::ShowIKConstraints, 0, false); | ||
| 340 | addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::AlignForearmsWithWrists, 0, true); | ||
| 338 | 341 | ||
| 339 | addDisabledActionAndSeparator(developerMenu, "Testing"); | 342 | addDisabledActionAndSeparator(developerMenu, "Testing"); |
| 340 | 343 | ||
| @@ -968,6 +971,17 @@ void Menu::goToUser(const QString& user) { · 627 unmodified lines | |||
| 968 | connect(manager, &LocationManager::multipleDestinationsFound, this, &Menu::multipleDestinationsDecision); | 971 | connect(manager, &LocationManager::multipleDestinationsFound, this, &Menu::multipleDestinationsDecision); |
| 969 | } | 972 | } |
| 970 | 973 | ||
| 974 | /// Open a url, shortcutting any "hifi" scheme URLs to the local application. | ||
| 975 | void Menu::openUrl(const QUrl& url) { | ||
| 976 | if (url.scheme() == "hifi") { | ||
| 977 | QString path = url.toString(QUrl::RemoveScheme); | ||
| 978 | path = path.remove(QRegExp("^:?/*")); | ||
| 979 | goTo(path); | ||
| 980 | } else { | ||
| 981 | QDesktopServices::openUrl(url); | ||
| 982 | } | ||
| 983 | } | ||
| 984 | |||
| 971 | void Menu::multipleDestinationsDecision(const QJsonObject& userData, const QJsonObject& placeData) { | 985 | void Menu::multipleDestinationsDecision(const QJsonObject& userData, const QJsonObject& placeData) { |
| 972 | QMessageBox msgBox; | 986 | QMessageBox msgBox; |
| 973 | msgBox.setText("Both user and location exists with same name"); | 987 | msgBox.setText("Both user and location exists with same name"); |
| @@ -1143,23 +1157,22 @@ void Menu::showScriptEditor() { · 169 unmodified lines | |||
| 1143 | void Menu::showChat() { | 1157 | void Menu::showChat() { |
| 1144 | QMainWindow* mainWindow = Application::getInstance()->getWindow(); | 1158 | QMainWindow* mainWindow = Application::getInstance()->getWindow(); |
| 1145 | if (!_chatWindow) { | 1159 | if (!_chatWindow) { |
| 1146 | mainWindow->addDockWidget(Qt::RightDockWidgetArea, _chatWindow = new ChatWindow()); | 1160 | _chatWindow = new ChatWindow(mainWindow); |
| 1147 | } | 1161 | } |
| 1148 | if (!_chatWindow->toggleViewAction()->isChecked()) { | 1162 | if (_chatWindow->isHidden()) { |
| 1149 | const QRect& windowGeometry = mainWindow->geometry(); | 1163 | _chatWindow->show(); |
| 1150 | _chatWindow->move(windowGeometry.topRight().x() - _chatWindow->width(), | ||
| 1151 | windowGeometry.topRight().y() + (windowGeometry.height() / 2) - (_chatWindow->height() / 2)); | ||
| 1152 | |||
| 1153 | _chatWindow->resize(0, _chatWindow->height()); | ||
| 1154 | _chatWindow->toggleViewAction()->trigger(); | ||
| 1155 | } | 1164 | } |
| 1156 | } | 1165 | } |
| 1157 | 1166 | ||
| 1158 | void Menu::toggleChat() { | 1167 | void Menu::toggleChat() { |
| 1159 | #ifdef HAVE_QXMPP | 1168 | #ifdef HAVE_QXMPP |
| 1160 | _chatAction->setEnabled(XmppClient::getInstance().getXMPPClient().isConnected()); | 1169 | _chatAction->setEnabled(XmppClient::getInstance().getXMPPClient().isConnected()); |
| 1161 | if (!_chatAction->isEnabled() && _chatWindow && _chatWindow->toggleViewAction()->isChecked()) { | 1170 | if (!_chatAction->isEnabled() && _chatWindow) { |
| 1162 | _chatWindow->toggleViewAction()->trigger(); | 1171 | if (_chatWindow->isHidden()) { |
| 1172 | _chatWindow->show(); | ||
| 1173 | } else { | ||
| 1174 | _chatWindow->hide(); | ||
| 1175 | } | ||
| 1163 | } | 1176 | } |
| 1164 | #endif | 1177 | #endif |
| 1165 | } | 1178 | } |