Merge lp:~osomon/unity-2d/dash-custom-home-screen into lp:unity-2d/3.0

Proposed by Olivier Tilloy
Status: Merged
Approved by: Florian Boucault
Approved revision: 514
Merged at revision: 516
Proposed branch: lp:~osomon/unity-2d/dash-custom-home-screen
Merge into: lp:unity-2d/3.0
Diff against target: 155 lines (+87/-53)
2 files modified
places/Home.qml (+11/-53)
places/HomeShortcuts.qml (+76/-0)
To merge this branch: bzr merge lp:~osomon/unity-2d/dash-custom-home-screen
Reviewer Review Type Date Requested Status
Florian Boucault (community) Approve
Review via email: mp+56598@code.launchpad.net

Commit message

[dash] Customizable dash home page.

Try to load a custom version of the shortcuts first, and fall back on the default version if a custom one doesn’t exist.
This will make customizations extremely easy as the custom shortcuts page can be shipped as part of another package.

To post a comment you must log in.
Revision history for this message
Florian Boucault (fboucault) wrote :

Works as advertised, nice!
Code makes sense.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'places/Home.qml'
2--- places/Home.qml 2011-04-04 09:16:17 +0000
3+++ places/Home.qml 2011-04-06 15:51:54 +0000
4@@ -180,59 +180,17 @@
5 onClicked: shortcutsActive = false
6 }
7
8- Flow {
9- anchors.fill: parent
10- anchors.topMargin: 26
11- anchors.bottomMargin: 35
12- anchors.leftMargin: 32
13- anchors.rightMargin: 32
14- spacing: 61
15-
16- /* FIXME: dummy icons need to be replaced by design's */
17- HomeButton {
18- label: u2d.tr("Media Apps")
19- icon: "artwork/find_media_apps.png"
20- onClicked: activatePlaceEntry("/usr/share/unity/places/applications.place", "Files", 9)
21- }
22-
23- HomeButton {
24- label: u2d.tr("Internet Apps")
25- icon: "artwork/find_internet_apps.png"
26- onClicked: activatePlaceEntry("/usr/share/unity/places/applications.place", "Files", 8)
27- }
28-
29- HomeButton {
30- label: u2d.tr("More Apps")
31- icon: "artwork/find_more_apps.png"
32- onClicked: activatePlaceEntry("/usr/share/unity/places/applications.place", "Files", 0)
33- }
34-
35- HomeButton {
36- label: u2d.tr("Find Files")
37- icon: "artwork/find_files.png"
38- onClicked: activatePlaceEntry("/usr/share/unity/places/files.place", "Files", 0)
39- }
40-
41- /* FIXME: use user's preferred applications instead of hardcoding them */
42- HomeButtonApplication {
43- label: u2d.tr("Browse the Web")
44- key: "/desktop/gnome/applications/browser/exec"
45- }
46-
47- HomeButtonApplication {
48- label: u2d.tr("View Photos")
49- desktopFile: "shotwell.desktop"
50- }
51-
52- HomeButtonApplication {
53- label: u2d.tr("Check Email")
54- key: "/desktop/gnome/url-handlers/mailto/command"
55- }
56-
57- HomeButtonApplication {
58- label: u2d.tr("Listen to Music")
59- key: "/desktop/gnome/applications/media/exec"
60- }
61+ /* Try to load a custom version of the shortcuts first, and fall back
62+ on the default version if a custom one doesn’t exist. */
63+ Loader {
64+ id: customShortcutsLoader
65+ anchors.fill: parent
66+ source: "HomeShortcutsCustomized.qml"
67+ }
68+ Loader {
69+ id: defaultShortcutsLoader
70+ anchors.fill: parent
71+ source: (customShortcutsLoader.status == Loader.Error) ? "HomeShortcuts.qml" : ""
72 }
73 }
74 }
75
76=== added file 'places/HomeShortcuts.qml'
77--- places/HomeShortcuts.qml 1970-01-01 00:00:00 +0000
78+++ places/HomeShortcuts.qml 2011-04-06 15:51:54 +0000
79@@ -0,0 +1,76 @@
80+/*
81+ * This file is part of unity-2d
82+ *
83+ * Copyright 2010-2011 Canonical Ltd.
84+ *
85+ * This program is free software; you can redistribute it and/or modify
86+ * it under the terms of the GNU General Public License as published by
87+ * the Free Software Foundation; version 3.
88+ *
89+ * This program is distributed in the hope that it will be useful,
90+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
91+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
92+ * GNU General Public License for more details.
93+ *
94+ * You should have received a copy of the GNU General Public License
95+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
96+ */
97+
98+import Qt 4.7
99+import UnityApplications 1.0 /* Necessary for the ImageProvider serving image://icons/theme_name/icon_name */
100+
101+Flow {
102+ anchors.fill: parent
103+ anchors.topMargin: 26
104+ anchors.bottomMargin: 35
105+ anchors.leftMargin: 32
106+ anchors.rightMargin: 32
107+ spacing: 61
108+
109+ /* FIXME: dummy icons need to be replaced by design's */
110+ HomeButton {
111+ label: u2d.tr("Media Apps")
112+ icon: "artwork/find_media_apps.png"
113+ onClicked: activatePlaceEntry("/usr/share/unity/places/applications.place", "Files", 9)
114+ }
115+
116+ HomeButton {
117+ label: u2d.tr("Internet Apps")
118+ icon: "artwork/find_internet_apps.png"
119+ onClicked: activatePlaceEntry("/usr/share/unity/places/applications.place", "Files", 8)
120+ }
121+
122+ HomeButton {
123+ label: u2d.tr("More Apps")
124+ icon: "artwork/find_more_apps.png"
125+ onClicked: activatePlaceEntry("/usr/share/unity/places/applications.place", "Files", 0)
126+ }
127+
128+ HomeButton {
129+ label: u2d.tr("Find Files")
130+ icon: "artwork/find_files.png"
131+ onClicked: activatePlaceEntry("/usr/share/unity/places/files.place", "Files", 0)
132+ }
133+
134+ /* FIXME: use user's preferred applications instead of hardcoding them */
135+ HomeButtonApplication {
136+ label: u2d.tr("Browse the Web")
137+ key: "/desktop/gnome/applications/browser/exec"
138+ }
139+
140+ HomeButtonApplication {
141+ label: u2d.tr("View Photos")
142+ desktopFile: "shotwell.desktop"
143+ }
144+
145+ HomeButtonApplication {
146+ label: u2d.tr("Check Email")
147+ key: "/desktop/gnome/url-handlers/mailto/command"
148+ }
149+
150+ HomeButtonApplication {
151+ label: u2d.tr("Listen to Music")
152+ key: "/desktop/gnome/applications/media/exec"
153+ }
154+}
155+

Subscribers

People subscribed via source and target branches