Merge lp:~mhr3/libunity/new-category-renderers into lp:libunity

Proposed by Michal Hruby
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 258
Merged at revision: 256
Proposed branch: lp:~mhr3/libunity/new-category-renderers
Merge into: lp:libunity
Diff against target: 172 lines (+46/-34)
5 files modified
configure.ac (+1/-1)
debian/changelog (+3/-2)
src/unity-category.vala (+40/-29)
test/data/unity/scopes/masterscope_b.scope (+1/-1)
test/vala/test-scope-discovery.vala (+1/-1)
To merge this branch: bzr merge lp:~mhr3/libunity/new-category-renderers
Reviewer Review Type Date Requested Status
Paweł Stołowski (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+174159@code.launchpad.net

Commit message

Use new category renderers.

Description of the change

Use new category renderers.

To post a comment you must log in.
257. By Michal Hruby

Bump versions

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
258. By Michal Hruby

Fix email

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2013-07-04 20:21:07 +0000
3+++ configure.ac 2013-07-11 12:21:26 +0000
4@@ -1,5 +1,5 @@
5 # When releasing also remember to update the soname as instructed below
6-AC_INIT(libunity, 7.0.8)
7+AC_INIT(libunity, 7.0.9)
8
9 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
10 AM_CONFIG_HEADER(config.h)
11
12=== modified file 'debian/changelog'
13--- debian/changelog 2013-07-04 16:41:36 +0000
14+++ debian/changelog 2013-07-11 12:21:26 +0000
15@@ -1,8 +1,9 @@
16-libunity (7.0.8-0ubuntu1) UNRELEASED; urgency=low
17+libunity (7.0.9-0ubuntu1) UNRELEASED; urgency=low
18
19 * Add support for diff models.
20+ * Introduce new category renderers.
21
22- -- Michal Hruby <michal.hruby@canonical.com> Thu, 04 Jul 2013 17:40:34 +0100
23+ -- Michal Hruby <michal.hruby@canonical.com> Thu, 11 Jul 2013 11:41:25 +0100
24
25 libunity (7.0.7+13.10.20130703.2-0ubuntu1) saucy; urgency=low
26
27
28=== modified file 'src/unity-category.vala'
29--- src/unity-category.vala 2013-06-25 11:19:09 +0000
30+++ src/unity-category.vala 2013-07-11 12:21:26 +0000
31@@ -24,32 +24,38 @@
32
33 public enum CategoryRenderer
34 {
35- VERTICAL_TILE,
36- HORIZONTAL_TILE,
37- LIST_TILE,
38- FLOW,
39- TABULAR_TILE,
40- DYNAMIC;
41+ DEFAULT = 0,
42+
43+ GRID = 1,
44+ CAROUSEL = 2,
45+ LIST = 3,
46+
47+ DYNAMIC = 1000,
48+ SPECIAL = 1001,
49+
50+ /* deprecated */
51+ VERTICAL_TILE = 0,
52+ HORIZONTAL_TILE = 1;
53
54 public static CategoryRenderer from_string (string renderer_name)
55 {
56 switch (renderer_name)
57 {
58- case "tile-vertical":
59- return CategoryRenderer.VERTICAL_TILE;
60- case "tile-horizontal":
61- return CategoryRenderer.HORIZONTAL_TILE;
62- case "tile-list":
63- return CategoryRenderer.LIST_TILE;
64- case "flow":
65- return CategoryRenderer.FLOW;
66- case "tile-tabular":
67- return CategoryRenderer.TABULAR_TILE;
68+ case "default":
69+ return CategoryRenderer.DEFAULT;
70+ case "grid":
71+ return CategoryRenderer.GRID;
72+ case "carousel":
73+ return CategoryRenderer.CAROUSEL;
74+ case "list":
75+ return CategoryRenderer.LIST;
76 case "dynamic":
77 return CategoryRenderer.DYNAMIC;
78+ case "special":
79+ return CategoryRenderer.SPECIAL;
80 default:
81 warning ("Unknown CategoryRenderer: %s", renderer_name);
82- return CategoryRenderer.VERTICAL_TILE; // reserve a value for unknown?
83+ return CategoryRenderer.DEFAULT;
84 }
85 }
86
87@@ -57,20 +63,20 @@
88 {
89 switch (val)
90 {
91- case CategoryRenderer.VERTICAL_TILE:
92- return "tile-vertical";
93- case CategoryRenderer.HORIZONTAL_TILE:
94- return "tile-horizontal";
95- case CategoryRenderer.LIST_TILE:
96- return "tile-list";
97- case CategoryRenderer.FLOW:
98- return "flow";
99- case CategoryRenderer.TABULAR_TILE:
100- return "tile-tabular";
101+ case CategoryRenderer.DEFAULT:
102+ return "default";
103+ case CategoryRenderer.GRID:
104+ return "grid";
105+ case CategoryRenderer.LIST:
106+ return "list";
107+ case CategoryRenderer.CAROUSEL:
108+ return "carousel";
109 case CategoryRenderer.DYNAMIC:
110 return "dynamic";
111+ case CategoryRenderer.SPECIAL:
112+ return "special";
113 default:
114- return "unknown-renderer";
115+ return "default";
116 }
117 }
118 }
119@@ -82,7 +88,8 @@
120 MUSIC,
121 VIDEO,
122 PLACES,
123- SOCIAL;
124+ SOCIAL,
125+ WEATHER;
126
127 public static CategoryContentType from_string (string content_type)
128 {
129@@ -98,6 +105,8 @@
130 return CategoryContentType.PLACES;
131 case "social":
132 return CategoryContentType.SOCIAL;
133+ case "weather":
134+ return CategoryContentType.WEATHER;
135 default:
136 return CategoryContentType.DEFAULT;
137 }
138@@ -117,6 +126,8 @@
139 return "places";
140 case CategoryContentType.SOCIAL:
141 return "social";
142+ case CategoryContentType.WEATHER:
143+ return "weather";
144 default:
145 return "default";
146 }
147
148=== modified file 'test/data/unity/scopes/masterscope_b.scope'
149--- test/data/unity/scopes/masterscope_b.scope 2013-06-25 11:19:09 +0000
150+++ test/data/unity/scopes/masterscope_b.scope 2013-07-11 12:21:26 +0000
151@@ -26,7 +26,7 @@
152 [Category cat2]
153 Name=Category #2
154 Icon=/usr/share/unity/category2_icon.svg
155-Renderer=vertical-tile
156+Renderer=list
157 ContentType=music
158 SortField=title
159
160
161=== modified file 'test/vala/test-scope-discovery.vala'
162--- test/vala/test-scope-discovery.vala 2013-06-25 11:19:09 +0000
163+++ test/vala/test-scope-discovery.vala 2013-07-11 12:21:26 +0000
164@@ -306,7 +306,7 @@
165 assert (category.icon == "/usr/share/unity/category2_icon.svg");
166 assert (category.dedup_field == null);
167 assert (category.sort_field == "title");
168- assert (category.renderer == "vertical-tile");
169+ assert (category.renderer == "list");
170 assert (category.content_type == "music");
171
172 var filters = metadata.get_filters ();

Subscribers

People subscribed via source and target branches