From 68584c654b0612f1c7ff47c6326c61b973bfb2ce Mon Sep 17 00:00:00 2001 From: stojce Date: Wed, 12 Feb 2014 02:12:52 +0100 Subject: [PATCH 01/10] Allow drag-and-drop of snapshots into Interface --- interface/src/Application.cpp | 34 +++++++++- interface/src/Application.h | 3 +- interface/src/GLCanvas.cpp | 19 +++++- interface/src/GLCanvas.h | 3 + interface/src/Menu.cpp | 107 ++++++++++++++---------------- interface/src/Menu.h | 4 +- interface/src/ui/Snapshot.cpp | 63 ++++++++++++++++-- interface/src/ui/Snapshot.h | 27 ++++++-- libraries/shared/src/NodeList.cpp | 3 +- 9 files changed, 190 insertions(+), 73 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 160d6b7c2c..0bb5d03eaa 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -48,6 +48,8 @@ #include #include #include +#include +#include #include #include @@ -197,7 +199,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : connect(audioThread, SIGNAL(started()), &_audio, SLOT(start())); audioThread->start(); - + connect(nodeList, SIGNAL(domainChanged(const QString&)), SLOT(domainChanged(const QString&))); connect(nodeList, &NodeList::nodeAdded, this, &Application::nodeAdded); connect(nodeList, &NodeList::nodeKilled, this, &Application::nodeKilled); @@ -1378,6 +1380,32 @@ void Application::wheelEvent(QWheelEvent* event) { } } +void Application::dropEvent(QDropEvent *event) { + QString snapshotPath; + const QMimeData *mimeData = event->mimeData(); + foreach (QUrl url, mimeData->urls()) { + if (url.url().toLower().endsWith("jpg")) { + snapshotPath = url.url().remove("file://"); + break; + } + } + + SnapshotMetaData* snapshotData = Snapshot::parseSnapshotData(snapshotPath); + if (snapshotData != NULL) { + if (!snapshotData->getDomain().isEmpty()) { + Menu::getInstance()->goToDomain(snapshotData->getDomain()); + } + + _myAvatar->setPosition(snapshotData->getLocation()); + _myAvatar->setOrientation(snapshotData->getOrientation()); + } else { + QMessageBox msgBox; + msgBox.setText("No location details were found in this JPG, try dragging in an authentic Hifi snapshot."); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.exec(); + } +} + void Application::sendPingPackets() { QByteArray pingPacket = NodeList::getInstance()->constructPingPacket(); controlledBroadcastToNodes(pingPacket, NodeSet() << NodeType::VoxelServer @@ -3794,7 +3822,7 @@ void Application::updateWindowTitle(){ QString title = QString() + _profile.getUsername() + " " + nodeList->getSessionUUID().toString() + " @ " + nodeList->getDomainHostname() + buildVersion; - + qDebug("Application title set to: %s", title.toStdString().c_str()); _window->setWindowTitle(title); } @@ -4170,6 +4198,6 @@ void Application::takeSnapshot() { player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath())); player->play(); - Snapshot::saveSnapshot(_glWidget, _profile.getUsername(), _myAvatar->getPosition()); + Snapshot::saveSnapshot(_glWidget, &_profile, _myAvatar); } diff --git a/interface/src/Application.h b/interface/src/Application.h index ff6e08758b..9508c0c9a5 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -127,7 +127,8 @@ public: void touchUpdateEvent(QTouchEvent* event); void wheelEvent(QWheelEvent* event); - + void dropEvent(QDropEvent *event); + void makeVoxel(glm::vec3 position, float scale, unsigned char red, diff --git a/interface/src/GLCanvas.cpp b/interface/src/GLCanvas.cpp index cd6f49383e..cfff3b8696 100644 --- a/interface/src/GLCanvas.cpp +++ b/interface/src/GLCanvas.cpp @@ -9,6 +9,8 @@ #include "Application.h" #include "GLCanvas.h" +#include +#include GLCanvas::GLCanvas() : QGLWidget(QGLFormat(QGL::NoDepthBuffer, QGL::NoStencilBuffer)) { } @@ -16,6 +18,7 @@ GLCanvas::GLCanvas() : QGLWidget(QGLFormat(QGL::NoDepthBuffer, QGL::NoStencilBuf void GLCanvas::initializeGL() { Application::getInstance()->initializeGL(); setAttribute(Qt::WA_AcceptTouchEvents); + setAcceptDrops(true); } void GLCanvas::paintGL() { @@ -67,4 +70,18 @@ bool GLCanvas::event(QEvent* event) { void GLCanvas::wheelEvent(QWheelEvent* event) { Application::getInstance()->wheelEvent(event); -} \ No newline at end of file +} + +void GLCanvas::dragEnterEvent(QDragEnterEvent* event) { + const QMimeData *mimeData = event->mimeData(); + foreach (QUrl url, mimeData->urls()) { + if (url.url().toLower().endsWith("jpg")) { + event->acceptProposedAction(); + break; + } + } +} + +void GLCanvas::dropEvent(QDropEvent* event) { + Application::getInstance()->dropEvent(event); +} diff --git a/interface/src/GLCanvas.h b/interface/src/GLCanvas.h index ad181f4456..0f0cb5c7d0 100644 --- a/interface/src/GLCanvas.h +++ b/interface/src/GLCanvas.h @@ -31,6 +31,9 @@ protected: virtual bool event(QEvent* event); virtual void wheelEvent(QWheelEvent* event); + + virtual void dragEnterEvent(QDragEnterEvent *event); + virtual void dropEvent(QDropEvent* event); }; #endif /* defined(__hifi__GLCanvas__) */ diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 7eb5807c6f..a73506243d 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -109,7 +109,7 @@ Menu::Menu() : MenuOption::GoToDomain, Qt::CTRL | Qt::Key_D, this, - SLOT(goToDomain())); + SLOT(goToDomainDialog())); addActionToQMenuAndActionHash(fileMenu, MenuOption::GoToLocation, Qt::CTRL | Qt::SHIFT | Qt::Key_L, @@ -889,7 +889,18 @@ void Menu::editPreferences() { sendFakeEnterEvent(); } -void Menu::goToDomain() { +void Menu::goToDomain(const QString newDomain) { + if (NodeList::getInstance()->getDomainHostname() != newDomain) { + + // send a node kill request, indicating to other clients that they should play the "disappeared" effect + Application::getInstance()->getAvatar()->sendKillAvatar(); + + // give our nodeList the new domain-server hostname + NodeList::getInstance()->setDomainHostname(newDomain); + } +} + +void Menu::goToDomainDialog() { QString currentDomainHostname = NodeList::getInstance()->getDomainHostname(); @@ -913,17 +924,46 @@ void Menu::goToDomain() { // the user input a new hostname, use that newHostname = domainDialog.textValue(); } - - // send a node kill request, indicating to other clients that they should play the "disappeared" effect - Application::getInstance()->getAvatar()->sendKillAvatar(); - - // give our nodeList the new domain-server hostname - NodeList::getInstance()->setDomainHostname(domainDialog.textValue()); + + goToDomain(newHostname); } sendFakeEnterEvent(); } +bool Menu::goToDestination(QString destination) { + + QStringList coordinateItems = destination.split(QRegExp("_|,"), QString::SkipEmptyParts); + + const int NUMBER_OF_COORDINATE_ITEMS = 3; + const int X_ITEM = 0; + const int Y_ITEM = 1; + const int Z_ITEM = 2; + if (coordinateItems.size() == NUMBER_OF_COORDINATE_ITEMS) { + + double x = replaceLastOccurrence('-', '.', coordinateItems[X_ITEM].trimmed()).toDouble(); + double y = replaceLastOccurrence('-', '.', coordinateItems[Y_ITEM].trimmed()).toDouble(); + double z = replaceLastOccurrence('-', '.', coordinateItems[Z_ITEM].trimmed()).toDouble(); + + glm::vec3 newAvatarPos(x, y, z); + + MyAvatar* myAvatar = Application::getInstance()->getAvatar(); + glm::vec3 avatarPos = myAvatar->getPosition(); + if (newAvatarPos != avatarPos) { + // send a node kill request, indicating to other clients that they should play the "disappeared" effect + MyAvatar::sendKillAvatar(); + + qDebug("Going To Location: %f, %f, %f...", x, y, z); + myAvatar->setPosition(newAvatarPos); + } + + return true; + } + + // no coordinates were parsed + return false; +} + void Menu::goTo() { QInputDialog gotoDialog(Application::getInstance()->getWindow()); @@ -939,31 +979,8 @@ void Menu::goTo() { destination = gotoDialog.textValue(); - QStringList coordinateItems = destination.split(QRegExp("_|,"), QString::SkipEmptyParts); - - const int NUMBER_OF_COORDINATE_ITEMS = 3; - const int X_ITEM = 0; - const int Y_ITEM = 1; - const int Z_ITEM = 2; - if (coordinateItems.size() == NUMBER_OF_COORDINATE_ITEMS) { - - double x = replaceLastOccurrence('-', '.', coordinateItems[X_ITEM].trimmed()).toDouble(); - double y = replaceLastOccurrence('-', '.', coordinateItems[Y_ITEM].trimmed()).toDouble(); - double z = replaceLastOccurrence('-', '.', coordinateItems[Z_ITEM].trimmed()).toDouble(); - - glm::vec3 newAvatarPos(x, y, z); - - MyAvatar* myAvatar = Application::getInstance()->getAvatar(); - glm::vec3 avatarPos = myAvatar->getPosition(); - if (newAvatarPos != avatarPos) { - // send a node kill request, indicating to other clients that they should play the "disappeared" effect - MyAvatar::sendKillAvatar(); - - qDebug("Going To Location: %f, %f, %f...", x, y, z); - myAvatar->setPosition(newAvatarPos); - } - - } else { + // go to coordinate destination or to Username + if (!goToDestination(destination)) { // there's a username entered by the user, make a request to the data-server DataServerClient::getValuesForKeysAndUserString( QStringList() @@ -994,29 +1011,7 @@ void Menu::goToLocation() { int dialogReturn = coordinateDialog.exec(); if (dialogReturn == QDialog::Accepted && !coordinateDialog.textValue().isEmpty()) { - QByteArray newCoordinates; - - QString delimiterPattern(","); - QStringList coordinateItems = coordinateDialog.textValue().split(delimiterPattern); - - const int NUMBER_OF_COORDINATE_ITEMS = 3; - const int X_ITEM = 0; - const int Y_ITEM = 1; - const int Z_ITEM = 2; - if (coordinateItems.size() == NUMBER_OF_COORDINATE_ITEMS) { - double x = coordinateItems[X_ITEM].toDouble(); - double y = coordinateItems[Y_ITEM].toDouble(); - double z = coordinateItems[Z_ITEM].toDouble(); - glm::vec3 newAvatarPos(x, y, z); - - if (newAvatarPos != avatarPos) { - // send a node kill request, indicating to other clients that they should play the "disappeared" effect - MyAvatar::sendKillAvatar(); - - qDebug("Going To Location: %f, %f, %f...", x, y, z); - myAvatar->setPosition(newAvatarPos); - } - } + goToDestination(coordinateDialog.textValue()); } sendFakeEnterEvent(); diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 742b9fc66f..780face29a 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -84,6 +84,8 @@ public: const char* member = NULL, QAction::MenuRole role = QAction::NoRole); virtual void removeAction(QMenu* menu, const QString& actionName); + bool goToDestination(QString destination); + void goToDomain(const QString newDomain); public slots: void bandwidthDetails(); @@ -100,7 +102,7 @@ private slots: void aboutApp(); void login(); void editPreferences(); - void goToDomain(); + void goToDomainDialog(); void goToLocation(); void bandwidthDetailsClosed(); void voxelStatsDetailsClosed(); diff --git a/interface/src/ui/Snapshot.cpp b/interface/src/ui/Snapshot.cpp index f0fef33cee..33d2087594 100644 --- a/interface/src/ui/Snapshot.cpp +++ b/interface/src/ui/Snapshot.cpp @@ -14,6 +14,8 @@ #include #include +#include + // filename format: hifi-snap-by-%username%-on-%date%_%time%_@-%location%.jpg // %1 <= username, %2 <= date and time, %3 <= current location const QString FILENAME_PATH_FORMAT = "hifi-snap-by-%1-on-%2@%3.jpg"; @@ -21,18 +23,69 @@ const QString FILENAME_PATH_FORMAT = "hifi-snap-by-%1-on-%2@%3.jpg"; const QString DATETIME_FORMAT = "yyyy-MM-dd_hh-mm-ss"; const QString SNAPSHOTS_DIRECTORY = "Snapshots"; -void Snapshot::saveSnapshot(QGLWidget* widget, QString username, glm::vec3 location) { - QImage shot = widget->grabFrameBuffer(); +const QString LOCATION_X = "location-x"; +const QString LOCATION_Y = "location-y"; +const QString LOCATION_Z = "location-z"; +const QString ORIENTATION_X = "orientation-x"; +const QString ORIENTATION_Y = "orientation-y"; +const QString ORIENTATION_Z = "orientation-z"; +const QString ORIENTATION_W = "orientation-w"; + +const QString DOMAIN_KEY = "domain"; + + +SnapshotMetaData* Snapshot::parseSnapshotData(QString snapshotPath) { + + if (!QFile(snapshotPath).exists()) { + return NULL; + } + + QImage shot(snapshotPath); + + // no location data stored + if (shot.text(LOCATION_X).isEmpty() || shot.text(LOCATION_Y).isEmpty() || shot.text(LOCATION_Z).isEmpty()) { + return NULL; + } + + SnapshotMetaData* data = new SnapshotMetaData(); + data->setLocation(glm::vec3(shot.text(LOCATION_X).toFloat(), + shot.text(LOCATION_Y).toFloat(), + shot.text(LOCATION_Z).toFloat())); + + data->setOrientation(glm::quat(shot.text(ORIENTATION_X).toFloat(), + shot.text(ORIENTATION_Y).toFloat(), + shot.text(ORIENTATION_Z).toFloat(), + shot.text(ORIENTATION_W).toFloat())); + + data->setDomain(shot.text(DOMAIN_KEY)); + + return data; +} + +void Snapshot::saveSnapshot(QGLWidget* widget, Profile* profile, MyAvatar* avatar) { + QImage shot = widget->grabFrameBuffer(); + + glm::vec3 location = avatar->getPosition(); + glm::quat orientation = avatar->getHead().getOrientation(); + // add metadata - shot.setText("location-x", QString::number(location.x)); - shot.setText("location-y", QString::number(location.y)); - shot.setText("location-z", QString::number(location.z)); + shot.setText(LOCATION_X, QString::number(location.x)); + shot.setText(LOCATION_Y, QString::number(location.y)); + shot.setText(LOCATION_Z, QString::number(location.z)); + + shot.setText(ORIENTATION_X, QString::number(orientation.x)); + shot.setText(ORIENTATION_Y, QString::number(orientation.y)); + shot.setText(ORIENTATION_Z, QString::number(orientation.z)); + shot.setText(ORIENTATION_W, QString::number(orientation.w)); + + shot.setText(DOMAIN_KEY, profile->getLastDomain()); QString formattedLocation = QString("%1_%2_%3").arg(location.x).arg(location.y).arg(location.z); // replace decimal . with '-' formattedLocation.replace('.', '-'); + QString username = profile->getUsername(); // normalize username, replace all non alphanumeric with '-' username.replace(QRegExp("[^A-Za-z0-9_]"), "-"); diff --git a/interface/src/ui/Snapshot.h b/interface/src/ui/Snapshot.h index 26315678f9..05a2fc3147 100644 --- a/interface/src/ui/Snapshot.h +++ b/interface/src/ui/Snapshot.h @@ -13,15 +13,32 @@ #include #include -#include +#include "avatar/MyAvatar.h" +#include "avatar/Profile.h" + +class SnapshotMetaData { +public: + + QString getDomain() { return _domain; } + void setDomain(QString domain) { _domain = domain; } + + glm::vec3 getLocation() { return _location; } + void setLocation(glm::vec3 location) { _location = location; } + + glm::quat getOrientation() { return _orientation; } + void setOrientation(glm::quat orientation) { _orientation = orientation; } + +private: + QString _domain; + glm::vec3 _location; + glm::quat _orientation;; +}; class Snapshot { public: - static void saveSnapshot(QGLWidget* widget, QString username, glm::vec3 location); - -private: - QString _username; + static void saveSnapshot(QGLWidget* widget, Profile* profile, MyAvatar* avatar); + static SnapshotMetaData* parseSnapshotData(QString snapshotPath); }; #endif /* defined(__hifi__Snapshot__) */ diff --git a/libraries/shared/src/NodeList.cpp b/libraries/shared/src/NodeList.cpp index c0bc7f0010..8dd3857198 100644 --- a/libraries/shared/src/NodeList.cpp +++ b/libraries/shared/src/NodeList.cpp @@ -807,7 +807,8 @@ void NodeList::loadData(QSettings *settings) { } else { _domainHostname = DEFAULT_DOMAIN_HOSTNAME; } - + + emit domainChanged(_domainHostname); settings->endGroup(); } From 0244ead5dfc09b9ab7e5bdc11bc91fa0d55379c3 Mon Sep 17 00:00:00 2001 From: stojce Date: Wed, 12 Feb 2014 21:06:30 +0100 Subject: [PATCH 02/10] fixed glm::quat initialization --- interface/src/ui/Snapshot.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/ui/Snapshot.cpp b/interface/src/ui/Snapshot.cpp index 33d2087594..bd4de19c86 100644 --- a/interface/src/ui/Snapshot.cpp +++ b/interface/src/ui/Snapshot.cpp @@ -53,10 +53,10 @@ SnapshotMetaData* Snapshot::parseSnapshotData(QString snapshotPath) { shot.text(LOCATION_Y).toFloat(), shot.text(LOCATION_Z).toFloat())); - data->setOrientation(glm::quat(shot.text(ORIENTATION_X).toFloat(), + data->setOrientation(glm::quat(shot.text(ORIENTATION_W).toFloat(), + shot.text(ORIENTATION_X).toFloat(), shot.text(ORIENTATION_Y).toFloat(), - shot.text(ORIENTATION_Z).toFloat(), - shot.text(ORIENTATION_W).toFloat())); + shot.text(ORIENTATION_Z).toFloat())); data->setDomain(shot.text(DOMAIN_KEY)); From 08c8f47cd4cb2b2b9fa7cf2776ea64cd126c133a Mon Sep 17 00:00:00 2001 From: stojce Date: Thu, 13 Feb 2014 20:05:59 +0100 Subject: [PATCH 03/10] added SNAPSHOT_EXTENSION constant --- interface/src/Application.cpp | 2 +- interface/src/Application.h | 2 ++ interface/src/GLCanvas.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index eaaea9c5be..4ede4a9405 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1384,7 +1384,7 @@ void Application::dropEvent(QDropEvent *event) { QString snapshotPath; const QMimeData *mimeData = event->mimeData(); foreach (QUrl url, mimeData->urls()) { - if (url.url().toLower().endsWith("jpg")) { + if (url.url().toLower().endsWith(SNAPSHOT_EXTENSION)) { snapshotPath = url.url().remove("file://"); break; } diff --git a/interface/src/Application.h b/interface/src/Application.h index 9508c0c9a5..54a804ab72 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -93,6 +93,8 @@ static const float NODE_KILLED_RED = 1.0f; static const float NODE_KILLED_GREEN = 0.0f; static const float NODE_KILLED_BLUE = 0.0f; +static const QString SNAPSHOT_EXTENSION = ".jpg"; + class Application : public QApplication { Q_OBJECT diff --git a/interface/src/GLCanvas.cpp b/interface/src/GLCanvas.cpp index cfff3b8696..7bc79e56d8 100644 --- a/interface/src/GLCanvas.cpp +++ b/interface/src/GLCanvas.cpp @@ -75,7 +75,7 @@ void GLCanvas::wheelEvent(QWheelEvent* event) { void GLCanvas::dragEnterEvent(QDragEnterEvent* event) { const QMimeData *mimeData = event->mimeData(); foreach (QUrl url, mimeData->urls()) { - if (url.url().toLower().endsWith("jpg")) { + if (url.url().toLower().endsWith(SNAPSHOT_EXTENSION)) { event->acceptProposedAction(); break; } From 9e7597a6ada5fc945d06d02d4f1cc8f9b51ccce0 Mon Sep 17 00:00:00 2001 From: stojce Date: Mon, 17 Feb 2014 19:06:55 +0100 Subject: [PATCH 04/10] bad merge fix --- interface/src/Menu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 81cb5fd8d9..7ee13e0cb1 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -117,7 +117,6 @@ private slots: void login(); void editPreferences(); void goToDomainDialog(); - void goToDomain(); void goToLocation(); void bandwidthDetailsClosed(); void voxelStatsDetailsClosed(); From 2ba742675755394df0c350a224a26b33da2ecc97 Mon Sep 17 00:00:00 2001 From: stojce Date: Mon, 17 Feb 2014 19:25:53 +0100 Subject: [PATCH 05/10] windows build fix --- interface/src/ui/Snapshot.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/interface/src/ui/Snapshot.cpp b/interface/src/ui/Snapshot.cpp index bd4de19c86..d0a38eec4e 100644 --- a/interface/src/ui/Snapshot.cpp +++ b/interface/src/ui/Snapshot.cpp @@ -14,8 +14,6 @@ #include #include -#include - // filename format: hifi-snap-by-%username%-on-%date%_%time%_@-%location%.jpg // %1 <= username, %2 <= date and time, %3 <= current location const QString FILENAME_PATH_FORMAT = "hifi-snap-by-%1-on-%2@%3.jpg"; From 677e6f5ce9372e1c2f88daa9d48e1dda6c0f0126 Mon Sep 17 00:00:00 2001 From: stojce Date: Mon, 17 Feb 2014 20:19:35 +0100 Subject: [PATCH 06/10] windows build fix (2) --- interface/src/ui/Snapshot.h | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/src/ui/Snapshot.h b/interface/src/ui/Snapshot.h index 05a2fc3147..5ee8fb4f8d 100644 --- a/interface/src/ui/Snapshot.h +++ b/interface/src/ui/Snapshot.h @@ -13,6 +13,7 @@ #include #include +#include #include "avatar/MyAvatar.h" #include "avatar/Profile.h" From 0df0c23c327f1a486b01a95af8974e3fe92b398a Mon Sep 17 00:00:00 2001 From: stojce Date: Mon, 17 Feb 2014 21:14:28 +0100 Subject: [PATCH 07/10] Windows build fix (3) --- interface/src/ui/Snapshot.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interface/src/ui/Snapshot.h b/interface/src/ui/Snapshot.h index 5ee8fb4f8d..57a388020d 100644 --- a/interface/src/ui/Snapshot.h +++ b/interface/src/ui/Snapshot.h @@ -9,6 +9,8 @@ #ifndef __hifi__Snapshot__ #define __hifi__Snapshot__ +#include "InterfaceConfig.h" + #include #include #include From 6c2f3b687e7188b8ae31ff91a9a1e7410667fb89 Mon Sep 17 00:00:00 2001 From: stojce Date: Tue, 18 Feb 2014 01:50:55 +0100 Subject: [PATCH 08/10] removed unnecessary references --- interface/src/ui/Snapshot.cpp | 1 - interface/src/ui/Snapshot.h | 1 - 2 files changed, 2 deletions(-) diff --git a/interface/src/ui/Snapshot.cpp b/interface/src/ui/Snapshot.cpp index d0a38eec4e..8cfc759308 100644 --- a/interface/src/ui/Snapshot.cpp +++ b/interface/src/ui/Snapshot.cpp @@ -12,7 +12,6 @@ #include #include -#include // filename format: hifi-snap-by-%username%-on-%date%_%time%_@-%location%.jpg // %1 <= username, %2 <= date and time, %3 <= current location diff --git a/interface/src/ui/Snapshot.h b/interface/src/ui/Snapshot.h index 57a388020d..14c59552ec 100644 --- a/interface/src/ui/Snapshot.h +++ b/interface/src/ui/Snapshot.h @@ -15,7 +15,6 @@ #include #include -#include #include "avatar/MyAvatar.h" #include "avatar/Profile.h" From d36ced9b92884b7e4aa383cd36d3f6a3bcbed18e Mon Sep 17 00:00:00 2001 From: stojce Date: Tue, 18 Feb 2014 07:33:03 +0100 Subject: [PATCH 09/10] fixed misplaced #endif --- interface/src/devices/Transmitter.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/src/devices/Transmitter.h b/interface/src/devices/Transmitter.h index 1fa392a280..12f2b302f7 100644 --- a/interface/src/devices/Transmitter.h +++ b/interface/src/devices/Transmitter.h @@ -45,5 +45,6 @@ private: TouchState _touchState; timeval* _lastReceivedPacket; -#endif /* defined(__hifi__Transmitter__) */ }; + +#endif /* defined(__hifi__Transmitter__) */ From 7621d70c2453a73f4f5997b602ca16aa1ee381dd Mon Sep 17 00:00:00 2001 From: stojce Date: Tue, 18 Feb 2014 08:11:59 +0100 Subject: [PATCH 10/10] use base class - replaced MyAvatar with Avatar --- interface/src/ui/Snapshot.cpp | 2 +- interface/src/ui/Snapshot.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/ui/Snapshot.cpp b/interface/src/ui/Snapshot.cpp index 8cfc759308..e16b0c570d 100644 --- a/interface/src/ui/Snapshot.cpp +++ b/interface/src/ui/Snapshot.cpp @@ -60,7 +60,7 @@ SnapshotMetaData* Snapshot::parseSnapshotData(QString snapshotPath) { return data; } -void Snapshot::saveSnapshot(QGLWidget* widget, Profile* profile, MyAvatar* avatar) { +void Snapshot::saveSnapshot(QGLWidget* widget, Profile* profile, Avatar* avatar) { QImage shot = widget->grabFrameBuffer(); glm::vec3 location = avatar->getPosition(); diff --git a/interface/src/ui/Snapshot.h b/interface/src/ui/Snapshot.h index 14c59552ec..13c6945349 100644 --- a/interface/src/ui/Snapshot.h +++ b/interface/src/ui/Snapshot.h @@ -15,7 +15,7 @@ #include #include -#include "avatar/MyAvatar.h" +#include "avatar/Avatar.h" #include "avatar/Profile.h" class SnapshotMetaData { @@ -39,7 +39,7 @@ private: class Snapshot { public: - static void saveSnapshot(QGLWidget* widget, Profile* profile, MyAvatar* avatar); + static void saveSnapshot(QGLWidget* widget, Profile* profile, Avatar* avatar); static SnapshotMetaData* parseSnapshotData(QString snapshotPath); };