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
74 onClicked: previewData.execute(modelData.id, { })
85 objectName: "progressBar"
90 property var model: previewData.actions
93 service: "com.canonical.applications.Downloader"
94 dbusPath: previewData.infoMap["progressbar_source"] ? previewData.infoMap["progressbar_source"].value : ""
97 var percentage = parseInt(received * 100 / total);
98 progressBar.value = percentage;
102 previewData.execute(progressBar.model[0].id, { })
106 previewData.execute(progressBar.model[1].id, { "error": error });
114 id: descriptionComponent
120 anchors { left: parent.left; right: parent.right }
125 text: previewData.description.replace(/[\r\n]/g, "<br />")
128 wrapMode: Text.WordWrap
129 textFormat: Text.RichText
130 // FIXME: workaround for https://bugreports.qt-project.org/browse/QTBUG-33020
131 onWidthChanged: { wrapMode = Text.NoWrap; wrapMode = Text.WordWrap }
135 objectName: "infoHintColumn"
141 objectName: "infoHintRepeater"
142 model: previewData.infoHints
145 objectName: "infoHintItem" + index
151 property int columnWidth: (width - spacing) / 2
152 anchors.verticalCenter: parent.verticalCenter
155 objectName: "displayNameLabel"
156 visible: valueLabel.visible
160 horizontalAlignment: Text.AlignLeft
161 width: parent.columnWidth
162 text: modelData.displayName
168 objectName: "valueLabel"
169 visible: modelData.value != ""
173 horizontalAlignment: Text.AlignRight
174 width: parent.columnWidth
175 text: modelData.value ? modelData.value : ""
178 wrapMode: Text.WordWrap
181 ListItems.ThinDivider {
184 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