2 * Copyright (C) 2013 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18import Ubuntu.Components 0.1
19import Ubuntu.Components.ListItems 0.1 as ListItems
20import Ubuntu.DownloadDaemonListener 0.1
21import "../../Components"
28 previewImages: previewImagesComponent
29 header: headerComponent
30 actions: (previewData.infoMap !== undefined && previewData.infoMap["show_progressbar"]) ? progressComponent : actionsComponent
31 description: descriptionComponent
34 id: previewImagesComponent
37 objectName: "genericPreviewImage"
43 source: genericPreview.previewData.image
51 title: previewData.title
52 subtitle: previewData.subtitle
63 objectName: "buttonList"
64 model: previewData.actions
67 objectName: "button" + index
69 height: buttonList.buttonHeight
70 color: Theme.palette.selected.foreground
71 text: modelData.displayName
72 iconSource: modelData.iconHint
75 previewData.execute(modelData.id, { })
76 genericPreview.showProcessingAction = true;
88 objectName: "progressBar"
93 property var model: previewData.actions
96 service: "com.canonical.applications.Downloader"
97 dbusPath: previewData.infoMap["progressbar_source"] ? previewData.infoMap["progressbar_source"].value : ""
100 var percentage = parseInt(received * 100 / total);
101 progressBar.value = percentage;
105 previewData.execute(progressBar.model[0].id, { })
109 previewData.execute(progressBar.model[1].id, { "error": error });
117 id: descriptionComponent
123 anchors { left: parent.left; right: parent.right }
128 text: previewData.description.replace(/[\r\n]/g, "<br />")
131 wrapMode: Text.WordWrap
132 textFormat: Text.RichText
133 // FIXME: workaround for https://bugreports.qt-project.org/browse/QTBUG-33020
134 onWidthChanged: { wrapMode = Text.NoWrap; wrapMode = Text.WordWrap }
138 objectName: "infoHintColumn"
144 objectName: "infoHintRepeater"
145 model: previewData.infoHints
148 objectName: "infoHintItem" + index
154 property int columnWidth: (width - spacing) / 2
155 anchors.verticalCenter: parent.verticalCenter
158 objectName: "displayNameLabel"
159 visible: valueLabel.visible
163 horizontalAlignment: Text.AlignLeft
164 width: parent.columnWidth
165 text: modelData.displayName
171 objectName: "valueLabel"
172 visible: modelData.value != ""
176 horizontalAlignment: Text.AlignRight
177 width: parent.columnWidth
178 text: modelData.value ? modelData.value : ""
181 wrapMode: Text.WordWrap
184 ListItems.ThinDivider {
187 bottom: parent.bottom
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list