History

merge new work into andrew/inertia

Andrew Meadows committed 12 years ago

Commit a7c4b022 parents 39252a8 b05a31554 files · +938 −883Browse files

Showing the changes to interface/src/Menu.cpp (1 of 54 files). Show all

Unified · Split

interface/src/Menu.cpp+23−10
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #include <QSlider>
2828 #include <QUuid>
2929 #include <QHBoxLayout>
30+#include <QDesktopServices>
3031
3132 #include <AccountManager.h>
3233 #include <XmppClient.h>
@@ -335,6 +336,8 @@ Menu::Menu() : · 302 unmodified lines
335336 addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false);
336337 addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::PlaySlaps, 0, false);
337338 addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::HandsCollideWithSelf, 0, false);
339+ addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::ShowIKConstraints, 0, false);
340+ addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::AlignForearmsWithWrists, 0, true);
338341
339342 addDisabledActionAndSeparator(developerMenu, "Testing");
340343
@@ -968,6 +971,17 @@ void Menu::goToUser(const QString& user) { · 627 unmodified lines
968971 connect(manager, &LocationManager::multipleDestinationsFound, this, &Menu::multipleDestinationsDecision);
969972 }
970973
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+
971985 void Menu::multipleDestinationsDecision(const QJsonObject& userData, const QJsonObject& placeData) {
972986 QMessageBox msgBox;
973987 msgBox.setText("Both user and location exists with same name");
@@ -1143,23 +1157,22 @@ void Menu::showScriptEditor() { · 169 unmodified lines
11431157 void Menu::showChat() {
11441158 QMainWindow* mainWindow = Application::getInstance()->getWindow();
11451159 if (!_chatWindow) {
1146− mainWindow->addDockWidget(Qt::RightDockWidgetArea, _chatWindow = new ChatWindow());
1160+ _chatWindow = new ChatWindow(mainWindow);
11471161 }
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();
11551164 }
11561165 }
11571166
11581167 void Menu::toggleChat() {
11591168 #ifdef HAVE_QXMPP
11601169 _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+ }
11631176 }
11641177 #endif
11651178 }