History

Merge pull request #9546 from sethalves/tablet-ui

Tablet ui

Seth Alves committed 9 years ago

Commit 116eef02 parents 149fdcd ac475304 files · +32 −9Browse files

Unified · Split

4 files
  1. assignment-client/src/Agent.cpp +11 −2
  2. assignment-client/src/entities/EntityServer.cpp +8 −0
  3. interface/resources/qml/hifi/Pal.qml +8 −2
  4. libraries/avatars/src/AvatarData.cpp +5 −5
assignment-client/src/Agent.cpp+11−2
@@ -266,6 +266,9 @@ void Agent::handleSelectedAudioFormat(QSharedPointer<ReceivedMessage> message) { · 265 unmodified lines
266}266}
267 267
268void Agent::selectAudioFormat(const QString& selectedCodecName) {268void Agent::selectAudioFormat(const QString& selectedCodecName) {
269 if (_selectedCodecName == selectedCodecName) {
270 return;
271 }
269 _selectedCodecName = selectedCodecName;272 _selectedCodecName = selectedCodecName;
270 273
271 qDebug() << "Selected Codec:" << _selectedCodecName;274 qDebug() << "Selected Codec:" << _selectedCodecName;
@@ -351,9 +354,15 @@ void Agent::executeScript() { · 79 unmodified lines
351 Transform audioTransform;354 Transform audioTransform;
352 audioTransform.setTranslation(scriptedAvatar->getPosition());355 audioTransform.setTranslation(scriptedAvatar->getPosition());
353 audioTransform.setRotation(scriptedAvatar->getOrientation());356 audioTransform.setRotation(scriptedAvatar->getOrientation());
354 AbstractAudioInterface::emitAudioPacket(audio.data(), audio.size(), audioSequenceNumber,357 QByteArray encodedBuffer;
358 if (_encoder) {
359 _encoder->encode(audio, encodedBuffer);
360 } else {
361 encodedBuffer = audio;
362 }
363 AbstractAudioInterface::emitAudioPacket(encodedBuffer.data(), encodedBuffer.size(), audioSequenceNumber,
355 audioTransform, scriptedAvatar->getPosition(), glm::vec3(0),364 audioTransform, scriptedAvatar->getPosition(), glm::vec3(0),
356 PacketType::MicrophoneAudioNoEcho);365 PacketType::MicrophoneAudioNoEcho, _selectedCodecName);
357 });366 });
358 367
359 auto avatarHashMap = DependencyManager::set<AvatarHashMap>();368 auto avatarHashMap = DependencyManager::set<AvatarHashMap>();
assignment-client/src/entities/EntityServer.cpp+8−0
@@ -314,7 +314,9 @@ void EntityServer::readAdditionalConfiguration(const QJsonObject& settingsSectio · 313 unmodified lines
314 // FIXME: handle atp rquests setup here. See Agent::requestScript()314 // FIXME: handle atp rquests setup here. See Agent::requestScript()
315 qInfo() << "Requesting script at URL" << qPrintable(scriptRequest->getUrl().toString());315 qInfo() << "Requesting script at URL" << qPrintable(scriptRequest->getUrl().toString());
316 scriptRequest->send();316 scriptRequest->send();
317 qDebug() << "script request sent";
317 _scriptRequestLoop.exec(); // Block here, but allow the request to be processed and its signals to be handled.318 _scriptRequestLoop.exec(); // Block here, but allow the request to be processed and its signals to be handled.
319 qDebug() << "script request event loop complete";
318 }320 }
319}321}
320 322
@@ -351,6 +353,7 @@ static bool hadUncaughtExceptions(QScriptEngine& engine, const QString& fileName · 30 unmodified lines
351 return false;353 return false;
352}354}
353void EntityServer::scriptRequestFinished() {355void EntityServer::scriptRequestFinished() {
356 qDebug() << "script request completed";
354 auto scriptRequest = qobject_cast<ResourceRequest*>(sender());357 auto scriptRequest = qobject_cast<ResourceRequest*>(sender());
355 const QString urlString = scriptRequest->getUrl().toString();358 const QString urlString = scriptRequest->getUrl().toString();
356 if (scriptRequest && scriptRequest->getResult() == ResourceRequest::Success) {359 if (scriptRequest && scriptRequest->getResult() == ResourceRequest::Success) {
@@ -364,9 +367,11 @@ void EntityServer::scriptRequestFinished() { · 7 unmodified lines
364 return hadUncaughtExceptions(_entityEditFilterEngine, _entityEditFilter);367 return hadUncaughtExceptions(_entityEditFilterEngine, _entityEditFilter);
365 });368 });
366 scriptRequest->deleteLater();369 scriptRequest->deleteLater();
370 qDebug() << "script request ending event loop. running:" << _scriptRequestLoop.isRunning();
367 if (_scriptRequestLoop.isRunning()) {371 if (_scriptRequestLoop.isRunning()) {
368 _scriptRequestLoop.quit();372 _scriptRequestLoop.quit();
369 }373 }
374 qDebug() << "script request event loop quit";
370 return;375 return;
371 }376 }
372 }377 }
@@ -379,10 +384,13 @@ void EntityServer::scriptRequestFinished() { · 6 unmodified lines
379 }384 }
380 // Hard stop of the assignment client on failure. We don't want anyone to think they have a filter in place when they don't.385 // Hard stop of the assignment client on failure. We don't want anyone to think they have a filter in place when they don't.
381 // Alas, only indications will be the above logging with assignment client restarting repeatedly, and clients will not see any entities.386 // Alas, only indications will be the above logging with assignment client restarting repeatedly, and clients will not see any entities.
387 qDebug() << "script request failure causing stop";
382 stop();388 stop();
389 qDebug() << "script request ending event loop. running:" << _scriptRequestLoop.isRunning();
383 if (_scriptRequestLoop.isRunning()) {390 if (_scriptRequestLoop.isRunning()) {
384 _scriptRequestLoop.quit();391 _scriptRequestLoop.quit();
385 }392 }
393 qDebug() << "script request event loop quit";
386}394}
387 395
388void EntityServer::nodeAdded(SharedNodePointer node) {396void EntityServer::nodeAdded(SharedNodePointer node) {
interface/resources/qml/hifi/Pal.qml+8−2
@@ -158,8 +158,9 @@ Rectangle { · 157 unmodified lines
158 onSortIndicatorOrderChanged: sortModel()158 onSortIndicatorOrderChanged: sortModel()
159 159
160 TableViewColumn {160 TableViewColumn {
161 id: displayNameHeader
161 role: "displayName"162 role: "displayName"
162 title: "NAMES"163 title: table.rowCount + (table.rowCount === 1 ? " NAME" : " NAMES")
163 width: nameCardWidth164 width: nameCardWidth
164 movable: false165 movable: false
165 resizable: false166 resizable: false
@@ -351,6 +352,11 @@ Rectangle { · 185 unmodified lines
351 visible: iAmAdmin352 visible: iAmAdmin
352 color: hifi.colors.lightGrayText353 color: hifi.colors.lightGrayText
353 }354 }
355 TextMetrics {
356 id: displayNameHeaderMetrics
357 text: displayNameHeader.title
358 font: displayNameHeader.font
359 }
354 // This Rectangle refers to the [?] popup button next to "NAMES"360 // This Rectangle refers to the [?] popup button next to "NAMES"
355 Rectangle {361 Rectangle {
356 color: hifi.colors.tableBackgroundLight362 color: hifi.colors.tableBackgroundLight
@@ -359,7 +365,7 @@ Rectangle { · 2 unmodified lines
359 anchors.left: table.left365 anchors.left: table.left
360 anchors.top: table.top366 anchors.top: table.top
361 anchors.topMargin: 1367 anchors.topMargin: 1
362 anchors.leftMargin: nameCardWidth/2 + 24368 anchors.leftMargin: nameCardWidth/2 + displayNameHeaderMetrics.width/2 + 6
363 RalewayRegular {369 RalewayRegular {
364 id: helpText370 id: helpText
365 text: "[?]"371 text: "[?]"
libraries/avatars/src/AvatarData.cpp+5−5
@@ -1742,7 +1742,7 @@ static const QString JSON_AVATAR_HEAD_MODEL = QStringLiteral("headModel"); · 1741 unmodified lines
1742static const QString JSON_AVATAR_BODY_MODEL = QStringLiteral("bodyModel");1742static const QString JSON_AVATAR_BODY_MODEL = QStringLiteral("bodyModel");
1743static const QString JSON_AVATAR_DISPLAY_NAME = QStringLiteral("displayName");1743static const QString JSON_AVATAR_DISPLAY_NAME = QStringLiteral("displayName");
1744// It isn't meaningful to persist sessionDisplayName.1744// It isn't meaningful to persist sessionDisplayName.
1745static const QString JSON_AVATAR_ATTACHEMENTS = QStringLiteral("attachments");1745static const QString JSON_AVATAR_ATTACHMENTS = QStringLiteral("attachments");
1746static const QString JSON_AVATAR_ENTITIES = QStringLiteral("attachedEntities");1746static const QString JSON_AVATAR_ENTITIES = QStringLiteral("attachedEntities");
1747static const QString JSON_AVATAR_SCALE = QStringLiteral("scale");1747static const QString JSON_AVATAR_SCALE = QStringLiteral("scale");
1748static const QString JSON_AVATAR_VERSION = QStringLiteral("version");1748static const QString JSON_AVATAR_VERSION = QStringLiteral("version");
@@ -1785,7 +1785,7 @@ QJsonObject AvatarData::toJson() const { · 36 unmodified lines
1785 for (auto attachment : getAttachmentData()) {1785 for (auto attachment : getAttachmentData()) {
1786 attachmentsJson.push_back(attachment.toJson());1786 attachmentsJson.push_back(attachment.toJson());
1787 }1787 }
1788 root[JSON_AVATAR_ATTACHEMENTS] = attachmentsJson;1788 root[JSON_AVATAR_ATTACHMENTS] = attachmentsJson;
1789 }1789 }
1790 1790
1791 _avatarEntitiesLock.withReadLock([&] {1791 _avatarEntitiesLock.withReadLock([&] {
@@ -1898,8 +1898,8 @@ void AvatarData::fromJson(const QJsonObject& json) { · 106 unmodified lines
1898 setTargetScale((float)json[JSON_AVATAR_SCALE].toDouble());1898 setTargetScale((float)json[JSON_AVATAR_SCALE].toDouble());
1899 }1899 }
1900 1900
1901 if (json.contains(JSON_AVATAR_ATTACHEMENTS) && json[JSON_AVATAR_ATTACHEMENTS].isArray()) {1901 if (json.contains(JSON_AVATAR_ATTACHMENTS) && json[JSON_AVATAR_ATTACHMENTS].isArray()) {
1902 QJsonArray attachmentsJson = json[JSON_AVATAR_ATTACHEMENTS].toArray();1902 QJsonArray attachmentsJson = json[JSON_AVATAR_ATTACHMENTS].toArray();
1903 QVector<AttachmentData> attachments;1903 QVector<AttachmentData> attachments;
1904 for (auto attachmentJson : attachmentsJson) {1904 for (auto attachmentJson : attachmentsJson) {
1905 AttachmentData attachment;1905 AttachmentData attachment;
@@ -1910,7 +1910,7 @@ void AvatarData::fromJson(const QJsonObject& json) { · 4 unmodified lines
1910 }1910 }
1911 1911
1912 // if (json.contains(JSON_AVATAR_ENTITIES) && json[JSON_AVATAR_ENTITIES].isArray()) {1912 // if (json.contains(JSON_AVATAR_ENTITIES) && json[JSON_AVATAR_ENTITIES].isArray()) {
1913 // QJsonArray attachmentsJson = json[JSON_AVATAR_ATTACHEMENTS].toArray();1913 // QJsonArray attachmentsJson = json[JSON_AVATAR_ATTACHMENTS].toArray();
1914 // for (auto attachmentJson : attachmentsJson) {1914 // for (auto attachmentJson : attachmentsJson) {
1915 // // TODO -- something1915 // // TODO -- something
1916 // }1916 // }