Merge branch 'PAL_v2' of https://github.com/highfidelity/hifi into PAL_v2

This commit is contained in:
howard-stearns 2017-03-15 15:20:28 -07:00
commit c0c92fd8d1

View file

@ -17,6 +17,7 @@ import QtGraphicalEffects 1.0
import Qt.labs.settings 1.0 import Qt.labs.settings 1.0
import "../styles-uit" import "../styles-uit"
import "../controls-uit" as HifiControls import "../controls-uit" as HifiControls
import HFWebEngineProfile 1.0
// references HMD, Users, UserActivityLogger from root context // references HMD, Users, UserActivityLogger from root context
@ -285,7 +286,9 @@ Rectangle {
pal.sendToScript({method: 'refreshConnections'}); pal.sendToScript({method: 'refreshConnections'});
} }
activeTab = "connectionsTab"; activeTab = "connectionsTab";
connectionsLoading.visible = false;
connectionsLoading.visible = true; connectionsLoading.visible = true;
connectionsRefreshProblemText.visible = false;
} }
} }
@ -307,6 +310,7 @@ Rectangle {
width: reloadConnections.height; width: reloadConnections.height;
glyph: hifi.glyphs.reload; glyph: hifi.glyphs.reload;
onClicked: { onClicked: {
connectionsLoading.visible = false;
connectionsLoading.visible = true; connectionsLoading.visible = true;
pal.sendToScript({method: 'refreshConnections'}); pal.sendToScript({method: 'refreshConnections'});
} }
@ -795,6 +799,35 @@ Rectangle {
height: width; height: width;
anchors.centerIn: parent; anchors.centerIn: parent;
visible: true; visible: true;
onVisibleChanged: {
if (visible) {
connectionsTimeoutTimer.start();
} else {
connectionsTimeoutTimer.stop();
connectionsRefreshProblemText.visible = false;
}
}
}
// "This is taking too long..." text
FiraSansSemiBold {
id: connectionsRefreshProblemText
// Properties
text: "This is taking longer than normal.\nIf you get stuck, try refreshing the Connections tab.";
// Anchors
anchors.top: connectionsLoading.bottom;
anchors.topMargin: 10;
anchors.left: parent.left;
anchors.bottom: parent.bottom;
width: parent.width;
// Text Size
size: 16;
// Text Positioning
verticalAlignment: Text.AlignTop;
horizontalAlignment: Text.AlignHCenter;
wrapMode: Text.WordWrap;
// Style
color: hifi.colors.darkGray;
} }
// This TableView refers to the Connections Table (on the "Connections" tab below the current user's NameCard) // This TableView refers to the Connections Table (on the "Connections" tab below the current user's NameCard)
@ -945,7 +978,7 @@ Rectangle {
Rectangle { Rectangle {
id: navigationContainer; id: navigationContainer;
visible: userInfoViewer.visible; visible: userInfoViewer.visible;
height: 70; height: 60;
anchors { anchors {
top: parent.top; top: parent.top;
left: parent.left; left: parent.left;
@ -959,7 +992,7 @@ Rectangle {
top: parent.top; top: parent.top;
left: parent.left; left: parent.left;
} }
height: parent.height - urlBar.height; height: parent.height - addressBar.height;
width: parent.width/2; width: parent.width/2;
FiraSansSemiBold { FiraSansSemiBold {
@ -979,7 +1012,11 @@ Rectangle {
id: backButtonMouseArea; id: backButtonMouseArea;
anchors.fill: parent anchors.fill: parent
hoverEnabled: enabled hoverEnabled: enabled
onClicked: userInfoViewer.goBack(); onClicked: {
if (userInfoViewer.canGoBack) {
userInfoViewer.goBack();
}
}
} }
} }
} }
@ -990,7 +1027,7 @@ Rectangle {
top: parent.top; top: parent.top;
right: parent.right; right: parent.right;
} }
height: parent.height - urlBar.height; height: parent.height - addressBar.height;
width: parent.width/2; width: parent.width/2;
FiraSansSemiBold { FiraSansSemiBold {
@ -1018,7 +1055,7 @@ Rectangle {
} }
Item { Item {
id: urlBar id: addressBar
anchors { anchors {
top: closeButtonContainer.bottom; top: closeButtonContainer.bottom;
left: parent.left; left: parent.left;
@ -1033,17 +1070,14 @@ Rectangle {
elide: Text.ElideRight; elide: Text.ElideRight;
// Anchors // Anchors
anchors.fill: parent; anchors.fill: parent;
anchors.leftMargin: 5;
// Text Size // Text Size
size: 14; size: 14;
// Text Positioning // Text Positioning
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter; horizontalAlignment: Text.AlignLeft;
// Style // Style
color: hifi.colors.lightGray; color: hifi.colors.lightGray;
MouseArea {
anchors.fill: parent
onClicked: userInfoViewer.visible = false;
}
} }
} }
} }
@ -1062,9 +1096,11 @@ Rectangle {
HifiControls.WebView { HifiControls.WebView {
id: userInfoViewer; id: userInfoViewer;
profile: HFWebEngineProfile {
storageName: "qmlWebEngine"
}
anchors { anchors {
top: navigationContainer.bottom; top: navigationContainer.bottom;
topMargin: 5;
bottom: parent.bottom; bottom: parent.bottom;
left: parent.left; left: parent.left;
right: parent.right; right: parent.right;
@ -1093,6 +1129,15 @@ Rectangle {
} }
} }
// Timer used when refreshing the Connections tab
Timer {
id: connectionsTimeoutTimer;
interval: 3000; // 3 seconds
onTriggered: {
connectionsRefreshProblemText.visible = true;
}
}
function rowColor(selected, alternate) { function rowColor(selected, alternate) {
return selected ? hifi.colors.orangeHighlight : alternate ? hifi.colors.tableRowLightEven : hifi.colors.tableRowLightOdd; return selected ? hifi.colors.orangeHighlight : alternate ? hifi.colors.tableRowLightEven : hifi.colors.tableRowLightOdd;
} }
@ -1135,6 +1180,7 @@ Rectangle {
connectionsUserModelData = data; connectionsUserModelData = data;
sortConnectionsModel(); sortConnectionsModel();
connectionsLoading.visible = false; connectionsLoading.visible = false;
connectionsRefreshProblemText.visible = false;
break; break;
case 'select': case 'select':
var sessionIds = message.params[0]; var sessionIds = message.params[0];