Showing the changes to interface/src/Menu.cpp (1 of 54 files). Show all
Unified · Split
| @@ -27,6 +27,7 @@ · 26 unmodified lines | ||
| 27 | 27 | #include <QSlider> |
| 28 | 28 | #include <QUuid> |
| 29 | 29 | #include <QHBoxLayout> |
| 30 | +#include <QDesktopServices> | |
| 30 | 31 | |
| 31 | 32 | #include <AccountManager.h> |
| 32 | 33 | #include <XmppClient.h> |
| @@ -335,6 +336,8 @@ Menu::Menu() : · 302 unmodified lines | ||
| 335 | 336 | addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false); |
| 336 | 337 | addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::PlaySlaps, 0, false); |
| 337 | 338 | addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::HandsCollideWithSelf, 0, false); |
| 339 | + addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::ShowIKConstraints, 0, false); | |
| 340 | + addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::AlignForearmsWithWrists, 0, true); | |
| 338 | 341 | |
| 339 | 342 | addDisabledActionAndSeparator(developerMenu, "Testing"); |
| 340 | 343 | |
| @@ -968,6 +971,17 @@ void Menu::goToUser(const QString& user) { · 627 unmodified lines | ||
| 968 | 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 | 985 | void Menu::multipleDestinationsDecision(const QJsonObject& userData, const QJsonObject& placeData) { |
| 972 | 986 | QMessageBox msgBox; |
| 973 | 987 | msgBox.setText("Both user and location exists with same name"); |
| @@ -1143,23 +1157,22 @@ void Menu::showScriptEditor() { · 169 unmodified lines | ||
| 1143 | 1157 | void Menu::showChat() { |
| 1144 | 1158 | QMainWindow* mainWindow = Application::getInstance()->getWindow(); |
| 1145 | 1159 | if (!_chatWindow) { |
| 1146 | − mainWindow->addDockWidget(Qt::RightDockWidgetArea, _chatWindow = new ChatWindow()); | |
| 1160 | + _chatWindow = new ChatWindow(mainWindow); | |
| 1147 | 1161 | } |
| 1148 | − if (!_chatWindow->toggleViewAction()->isChecked()) { | |
| 1149 | − const QRect& windowGeometry = mainWindow->geometry(); | |
| 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(); | |
| 1162 | + if (_chatWindow->isHidden()) { | |
| 1163 | + _chatWindow->show(); | |
| 1155 | 1164 | } |
| 1156 | 1165 | } |
| 1157 | 1166 | |
| 1158 | 1167 | void Menu::toggleChat() { |
| 1159 | 1168 | #ifdef HAVE_QXMPP |
| 1160 | 1169 | _chatAction->setEnabled(XmppClient::getInstance().getXMPPClient().isConnected()); |
| 1161 | − if (!_chatAction->isEnabled() && _chatWindow && _chatWindow->toggleViewAction()->isChecked()) { | |
| 1162 | − _chatWindow->toggleViewAction()->trigger(); | |
| 1170 | + if (!_chatAction->isEnabled() && _chatWindow) { | |
| 1171 | + if (_chatWindow->isHidden()) { | |
| 1172 | + _chatWindow->show(); | |
| 1173 | + } else { | |
| 1174 | + _chatWindow->hide(); | |
| 1175 | + } | |
| 1163 | 1176 | } |
| 1164 | 1177 | #endif |
| 1165 | 1178 | } |