10 import QtMultimediaKit 1.1
11 import com.nokia.meego 1.0
12 import org.kde.edu.marble 0.11
17 tools: ToolBarLayout {
19 iconSource:
main.
icon(
"actions/go-previous-view", 48 );
20 onClicked: pageStack.pop()
26 provider:
"http://edu.kde.org/marble/newstuff/maps-4.5.xml"
27 registryFile:
"~/.kde/share/apps/knewstuff3/marble.knsregistry"
34 model: themeInstallModel
35 delegate: themeDelegate
37 highlightMoveDuration: 200
43 flickableItem: themeView
53 property bool installing: transitioning
54 property bool selected: ListView.view.currentIndex === idx
55 property bool showDetails: selected || installing
56 property int idx: index
63 width: previewIcon.width
64 height: Math.max(previewIcon.height + (delegateRoot.showDetails ? versionLabel.height + 5 : 0), textItem.height)
68 anchors.top: parent.top
69 source: settings.workOffline ?
"" : preview
75 anchors.centerIn: parent
76 source:
"qrc:/icons/activity-virtualglobe.png"
79 opacity: (previewIcon.status == Image.Loading || settings.workOffline) ? 1.0 : 0.0
80 Behavior on opacity { NumberAnimation {} }
87 anchors.top: previewIcon.bottom
89 visible: delegateRoot.showDetails
90 text: delegateRoot.showDetails ?
"<p><font size=\"-1\">Version: " + version +
"<br />" + releasedate +
"<br />" + formatSize() +
"</font></p>" :
""
92 function formatSize() {
93 if (settings.workOffline) {
104 for (var i=0; i<9 && length >= 1000; ++i) {
110 case 0:
return length.toFixed(1) +
" byte"
111 case 1:
return length.toFixed(1) +
" kB"
112 case 2:
return length.toFixed(1) +
" MB"
113 case 3:
return length.toFixed(1) +
" GB"
114 case 4:
return length.toFixed(1) +
" TB"
115 case 5:
return length.toFixed(1) +
" PB"
116 case 6:
return length.toFixed(1) +
" EB"
117 case 7:
return length.toFixed(1) +
" ZB"
118 case 8:
return length.toFixed(1) +
" YB"
126 width: delegateRoot.width - row.spacing - previewIcon.width - 10
127 height: nameLabel.height + summaryLabel.height + (delegateRoot.showDetails ? installButton.height + 10 : 0)
133 font.bold: upgradable
139 anchors.top: nameLabel.bottom
140 property string details:
"<p><font size=\"-1\">Author: " + author +
"</font></p><p><font size=\"-1\">License: " + license +
"</font></p>"
141 text:
"<p><font size=\"-1\">" + summary + (delegateRoot.showDetails ? details :
"") +
"</font></p>"
146 visible: delegateRoot.installing
147 anchors.top: summaryLabel.bottom
148 width: parent.width - 50
155 target: themeInstallModel
156 onInstallationProgressed: {
157 if (newstuffindex === delegateRoot.idx) {
158 progressBar.indeterminate =
false
159 progressBar.value = progress
162 onInstallationFinished: {
163 if (newstuffindex === delegateRoot.idx) {
164 delegateRoot.installing =
false
167 onInstallationFailed: {
168 if (newstuffindex === delegateRoot.idx) {
169 delegateRoot.installing =
false
172 onUninstallationFinished: {
173 if (newstuffindex === delegateRoot.idx) {
174 delegateRoot.installing =
false
182 onClicked: delegateRoot.ListView.view.currentIndex = delegateRoot.idx
186 anchors.left: progressBar.right
187 anchors.leftMargin: 5
188 anchors.verticalCenter: progressBar.verticalCenter
189 visible: delegateRoot.installing
192 iconSource:
main.
icon(
"actions/dialog-cancel", 32 );
194 progressBar.indeterminate =
true
195 themeInstallModel.cancel(delegateRoot.idx)
201 text: installed && upgradable ?
"Upgrade" :
"Install"
202 enabled: !installed || upgradable
203 anchors.top: summaryLabel.bottom
204 anchors.left: parent.left
206 width: parent.width / 2 - 5
207 visible: delegateRoot.selected && !delegateRoot.installing
209 progressBar.indeterminate =
true
210 delegateRoot.installing =
true
211 themeInstallModel.install(delegateRoot.idx)
217 anchors.top: summaryLabel.bottom
218 anchors.right: parent.right
219 anchors.left: installButton.right
221 width: parent.width / 2 - 5
222 visible: delegateRoot.selected && !delegateRoot.installing
225 progressBar.indeterminate =
true
226 delegateRoot.installing =
true
227 themeInstallModel.uninstall(delegateRoot.idx)
static qreal radius(qreal zoom)