summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2015-10-05 11:40:27 (GMT)
committerAleix Pol <aleixpol@kde.org>2015-10-05 11:40:27 (GMT)
commitee81507c467f224e7de2c1eab534393802dfd0d1 (patch)
tree78079175a22cb7e26ef811fd3f7d277d1b5aa4ae
parent47e50a342c1c376fe170b1dc5143986b2b4c3974 (diff)
Fix upgrade UI
Show some text when we don't have the progress information Center the text
-rw-r--r--discover/qml/PresentUpdatesPage.qml14
-rw-r--r--libmuon/resources/ResourcesUpdatesModel.cpp4
2 files changed, 11 insertions, 7 deletions
diff --git a/discover/qml/PresentUpdatesPage.qml b/discover/qml/PresentUpdatesPage.qml
index 1404ce8..cddabc7 100644
--- a/discover/qml/PresentUpdatesPage.qml
+++ b/discover/qml/PresentUpdatesPage.qml
@@ -63,6 +63,8 @@ ScrollView
}
componentTrue: ColumnLayout {
Label {
+ Layout.fillWidth: true
+ horizontalAlignment: Text.AlignHCenter
text: resourcesUpdatesModel.remainingTime
}
ProgressBar {
@@ -70,13 +72,13 @@ ScrollView
anchors.centerIn: parent
minimumValue: 0
maximumValue: 100
- }
- // Workaround for bug in Qt
- // https://bugreports.qt.io/browse/QTBUG-48598
- Connections {
- target: resourcesUpdatesModel
- onProgressChanged: pbar.value = resourcesUpdatesModel.progress
+ // Workaround for bug in Qt
+ // https://bugreports.qt.io/browse/QTBUG-48598
+ Connections {
+ target: resourcesUpdatesModel
+ onProgressChanged: pbar.value = resourcesUpdatesModel.progress
+ }
}
}
}
diff --git a/libmuon/resources/ResourcesUpdatesModel.cpp b/libmuon/resources/ResourcesUpdatesModel.cpp
index da699da..6c8efa4 100644
--- a/libmuon/resources/ResourcesUpdatesModel.cpp
+++ b/libmuon/resources/ResourcesUpdatesModel.cpp
@@ -157,8 +157,10 @@ QString ResourcesUpdatesModel::remainingTime() const
}
// Ignore ETA if it's larger than 2 days.
- if(maxEta==0 || maxEta > 2 * 24 * 60 * 60)
+ if(maxEta > 2 * 24 * 60 * 60)
return QString();
+ else if(maxEta==0)
+ return i18nc("@item:intext Unknown remaining time", "Updating...");
else
return i18nc("@item:intext Remaining time", "%1 remaining", KFormat().formatDuration(maxEta));
}