Permalink
Browse files

Fixed launching PNDs, faster implementation for generating star ratin…

…g strings, installed sidebar and package view tuning
  • Loading branch information...
1 parent 2ea865a commit 5e2abf7d1006229b15047243ce500fdaac9dcf47 @bzar committed Apr 10, 2012
@@ -34,6 +34,7 @@ View {
height: Math.floor(parent.height/rows) * rows
boundsBehavior: GridView.StopAtBounds
+ pressDelay: 1000
function openCurrent() {
stack.push(categoryView, {"pndManager": pndManager, "categories": currentItem.categoryFilter, "viewTitle": currentItem.categoryTitle});
@@ -48,16 +48,17 @@ Rectangle {
spacing: 4
ControlHelp { control: "use-dpad"; label: "Move cursor" }
ControlHelp { control: "game-b"; label: "Yes, more information, next" }
- ControlHelp { control: "game-a"; label: "No, install/remove, cancel" }
+ ControlHelp { control: "game-a"; label: "No, remove, cancel" }
ControlHelp { control: "shoulder-l"; label: "Change mode left" }
ControlHelp { control: "keyboardfnlayer-f1"; label: "Show/hide control hints" }
+ ControlHelp { control: "keyboard-enter"; label: "Launch PND / search" }
}
Column {
spacing: 4
ControlHelp { control: "start"; label: "Synchronize with server" }
ControlHelp { control: "game-x"; label: "Back" }
- ControlHelp { control: "game-y"; label: "Upgrade, upgrade all" }
+ ControlHelp { control: "game-y"; label: "Install/upgrade" }
ControlHelp { control: "shoulder-r"; label: "Change mode right" }
ControlHelp { control: "select"; label: "Change package sorting" }
}
@@ -69,13 +70,13 @@ Rectangle {
id: buttons
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
- anchors.margins: 16
+ anchors.margins: 8
spacing: 32
Button {
label: "Don't show next time"
- width: 256
- height: 64
+ width: 272
+ height: 48
radius: 8
onClicked: { dialog.dontShowAgain(); dialog.hide() }
color: Theme.colors.no
@@ -84,8 +85,8 @@ Rectangle {
Button {
label: "Show next time"
- width: 256
- height: 64
+ width: 272
+ height: 48
radius: 8
onClicked: dialog.hide()
color: Theme.colors.yes
@@ -205,15 +205,7 @@ View {
}
Text {
- function getRating() {
- var s = "";
- for(var i = 0; i < Math.ceil(pnd.rating/20); ++i) {
- s += "";
- }
- return s;
- }
-
- text: pnd.rating !== 0 ? getRating() : "(not rated)"
+ text: pndUtils.createRatingString(pnd)
font.pixelSize: 14
}
}
@@ -287,6 +287,7 @@ View {
color: "#f8f8f8"
Rectangle {
+ id: infoSeparator
width: 1
height: parent.height
color: "#ccc"
@@ -318,26 +319,18 @@ View {
}
PackageInfoText {
label: "Rating"
- function getRating() {
- var s = "";
- for(var i = 0; i < Math.ceil(info.pnd.rating/20); ++i) {
- s += "";
- }
- return s;
- }
-
- text: info.pnd && info.pnd.rating !== 0 ? getRating() : "(not rated)"
+ text: pndUtils.createRatingString(info.pnd)
}
PackageInfoText {
- label: "Size"
+ label: "Size:"
text: info.pnd ? Utils.prettySize(info.pnd.size) : "-"
}
PackageInfoText {
- label: "Version"
+ label: "Version:"
text: info.pnd ? Utils.versionString(info.pnd.version) : "-"
}
PackageInfoText {
- label: "Location"
+ label: "Location:"
text: info.pnd ? info.pnd.mount : "-"
}
Rectangle {
@@ -346,13 +339,19 @@ View {
color: "#ddd"
visible: info.pnd !== null && info.pnd.upgradeCandidate !== null
}
+ Text {
+ font.pixelSize: 14
+ text: "Upgrade"
+ font.bold: Font.DemiBold
+ visible: info.pnd !== null && info.pnd.upgradeCandidate !== null && !info.pnd.isDownloading
+ }
PackageInfoText {
- label: "Upgrade size"
+ label: "Size:"
text: visible ? Utils.prettySize(info.pnd.upgradeCandidate.size) : ""
visible: info.pnd !== null && info.pnd.upgradeCandidate !== null && !info.pnd.isDownloading
}
PackageInfoText {
- label: "Upgrade version"
+ label: "Version:"
text: visible ? Utils.versionString(info.pnd.upgradeCandidate.version) : ""
visible: info.pnd !== null && info.pnd.upgradeCandidate !== null && !info.pnd.isDownloading
}
@@ -443,9 +442,13 @@ View {
text: info.pnd ? info.pnd.description.split("\n")[0] : ""
width: parent.width
wrapMode: Text.WordWrap
+ elide: Text.ElideRight
+ maximumLineCount: 4
}
}
+
Button {
+ id: showButton
label: "Show"
control: "game-b"
color: "#555"
@@ -8,7 +8,7 @@ Item {
Text {
id: label
font.pixelSize: 14
- width: 112
+ width: 72
}
Text {
id: content
@@ -80,7 +80,7 @@ View {
id: buttons
anchors.top: titleText.bottom
anchors.horizontalCenter: parent.horizontalCenter
- spacing: 16
+ spacing: pnd.installed && !pnd.isDownloading && pnd.hasUpgrade ? 8 : 16
Button {
label: "Launch"
sublabel: Utils.prettySize(pnd.size)
@@ -89,7 +89,7 @@ View {
width: 256
height: 64
radius: 4
- visible: pnd.installed
+ visible: pnd.installed && !pnd.isDownloading
onClicked: execute()
}
Button {
@@ -271,22 +271,13 @@ View {
anchors.left: parent.left
anchors.right: parent.right
label: "Rating:"
-
- function getRating() {
- var s = "";
- for(var i = 0; i < Math.ceil(pnd.rating/20); ++i) {
- s += "";
- }
- return s;
- }
-
- text: pnd.rating !== 0 ? getRating() : "(not rated)"
+ text: pndUtils.createRatingString(pnd)
}
PackageInfoText {
anchors.left: parent.left
anchors.right: parent.right
- label: "Last updated:"
+ label: "Updated:"
text: Utils.prettyLastUpdatedString(pnd.modified)
}
}
@@ -346,6 +337,7 @@ View {
anchors.left: parent.horizontalCenter
anchors.right: parent.right
anchors.margins: 16
+ clip: true
Image {
id: image
@@ -355,7 +347,9 @@ View {
source: pnd.previewPictures.length > 0 ? pnd.previewPictures[0].src : ""
asynchronous: true
- sourceSize.width: parent.width
+ Component.onCompleted: {
+ sourceSize.width = parent.width
+ }
Text {
anchors.centerIn: parent
@@ -112,19 +112,11 @@ View {
}
Text {
- function getRating() {
- var s = "";
- for(var i = 0; i < Math.ceil(pnd.rating/20); ++i) {
- s += "";
- }
- return s;
- }
-
- text: getRating()
+ text: pndUtils.createRatingString(pnd)
visible: pnd.rating !== 0
font.pixelSize: 14
- anchors.top: categoriesText.bottom
+ anchors.bottom: categoriesText.bottom
anchors.right: parent.right
anchors.rightMargin: 32
}
@@ -81,11 +81,6 @@ PanoramaUI {
PNDUtils { id: pndUtils }
Keys.onPressed: {
- if(!runtime.isActiveWindow) {
- event.accepted = true;
- return;
- }
-
if(!Pandora.controlsActive) {
event.accepted = true;
if(event.key === Qt.Key_PageDown) {
@@ -127,11 +122,6 @@ PanoramaUI {
Pandora.onPressed: {
- if(!runtime.isActiveWindow) {
- event.accepted = true;
- return;
- }
-
event.accepted = true;
if(event.key === Pandora.ButtonX) views.current.pop();
else if(event.key === Pandora.ButtonB) {
@@ -262,5 +262,5 @@ void PNDManager::saveRepositories()
void PNDManager::execute(const QString &pnd)
{
- QProcess::execute("pnd_run", QStringList(pnd));
+ QProcess::startDetached("pnd_run", QStringList(pnd));
}
@@ -22,3 +22,11 @@ QString PNDUtils::createCategoryString(Package *package)
return categories.join(", ");
}
+
+QString PNDUtils::createRatingString(Package *package)
+{
+ if(package && package->getRating())
+ return QString((package->getRating() + 10)/20, QChar(0x2605));
+ else
+ return "(not rated)";
+}
@@ -10,6 +10,7 @@ class PNDUtils : public QObject
public:
explicit PNDUtils(QObject *parent = 0);
Q_INVOKABLE QString createCategoryString(Package* package);
+ Q_INVOKABLE QString createRatingString(Package* package);
signals:
public slots:

0 comments on commit 5e2abf7

Please sign in to comment.