Merge lp:~unity-team/unity/dash-niceness-2011-03-24 into lp:unity
- dash-niceness-2011-03-24
- Merge into trunk
Proposed by
Neil J. Patel
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 1018 | ||||||||
Proposed branch: | lp:~unity-team/unity/dash-niceness-2011-03-24 | ||||||||
Merge into: | lp:unity | ||||||||
Diff against target: |
1428 lines (+729/-51) (has conflicts) 25 files modified
src/IconLoader.cpp (+36/-13) src/IconLoader.h (+7/-3) src/IconTexture.cpp (+5/-0) src/PanelMenuView.cpp (+7/-0) src/PanelMenuView.h (+1/-0) src/PlaceEntry.h (+2/-0) src/PlaceEntryHome.cpp (+25/-1) src/PlaceEntryHome.h (+6/-0) src/PlaceEntryRemote.cpp (+13/-1) src/PlacesEmptyView.cpp (+88/-0) src/PlacesEmptyView.h (+55/-0) src/PlacesGroupController.cpp (+51/-0) src/PlacesGroupController.h (+2/-0) src/PlacesSearchBar.cpp (+15/-10) src/PlacesSearchBar.h (+4/-1) src/PlacesSearchBarSpinner.cpp (+183/-0) src/PlacesSearchBarSpinner.h (+72/-0) src/PlacesSimpleTile.cpp (+0/-11) src/PlacesStyle.cpp (+22/-0) src/PlacesStyle.h (+4/-0) src/PlacesView.cpp (+92/-7) src/PlacesView.h (+14/-0) src/StaticCairoText.cpp (+12/-4) src/StaticCairoText.h (+4/-0) tests/CMakeLists.txt (+9/-0) Text conflict in tests/CMakeLists.txt |
||||||||
To merge this branch: | bzr merge lp:~unity-team/unity/dash-niceness-2011-03-24 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jay Taoko (community) | Approve | ||
Review via email: mp+54637@code.launchpad.net |
Commit message
Description of the change
Lots of dash fixes, bugs linked where I could find them, off the top of my head:
- Shows no-results stuff for the individual places
- Shows a spinner during search (this will go into timeoutmode if you don't ahve very latest place daemons and libunity)
- Protects against pressing enter before we have all the restuls, but if you get impatient it activates whatever is there
- Fixes blur!
Some other stuff, have fun :)
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'resources/search_clear_alone.png' | |||
2 | 0 | Binary files resources/search_clear_alone.png 1970-01-01 00:00:00 +0000 and resources/search_clear_alone.png 2011-03-24 01:52:23 +0000 differ | 0 | Binary files resources/search_clear_alone.png 1970-01-01 00:00:00 +0000 and resources/search_clear_alone.png 2011-03-24 01:52:23 +0000 differ |
3 | === added file 'resources/search_clear_spinner.png' | |||
4 | 1 | Binary files resources/search_clear_spinner.png 1970-01-01 00:00:00 +0000 and resources/search_clear_spinner.png 2011-03-24 01:52:23 +0000 differ | 1 | Binary files resources/search_clear_spinner.png 1970-01-01 00:00:00 +0000 and resources/search_clear_spinner.png 2011-03-24 01:52:23 +0000 differ |
5 | === modified file 'src/IconLoader.cpp' | |||
6 | --- src/IconLoader.cpp 2011-02-09 20:44:45 +0000 | |||
7 | +++ src/IconLoader.cpp 2011-03-24 01:52:23 +0000 | |||
8 | @@ -109,23 +109,46 @@ | |||
9 | 109 | guint size, | 109 | guint size, |
10 | 110 | IconLoaderCallback slot) | 110 | IconLoaderCallback slot) |
11 | 111 | { | 111 | { |
12 | 112 | GFile *file; | ||
13 | 113 | gchar *uri; | ||
14 | 114 | |||
15 | 115 | g_return_if_fail (filename); | ||
16 | 116 | g_return_if_fail (size > 1); | ||
17 | 117 | |||
18 | 118 | if (_no_load) | ||
19 | 119 | return; | ||
20 | 120 | |||
21 | 121 | file = g_file_new_for_path (filename); | ||
22 | 122 | uri = g_file_get_uri (file); | ||
23 | 123 | |||
24 | 124 | LoadFromURI (uri, size, slot); | ||
25 | 125 | |||
26 | 126 | g_free (uri); | ||
27 | 127 | g_object_unref (file); | ||
28 | 128 | } | ||
29 | 129 | |||
30 | 130 | void | ||
31 | 131 | IconLoader::LoadFromURI (const char *uri, | ||
32 | 132 | guint size, | ||
33 | 133 | IconLoaderCallback slot) | ||
34 | 134 | { | ||
35 | 112 | char *key; | 135 | char *key; |
36 | 113 | 136 | ||
38 | 114 | g_return_if_fail (filename); | 137 | g_return_if_fail (uri); |
39 | 115 | g_return_if_fail (size > 1); | 138 | g_return_if_fail (size > 1); |
40 | 116 | 139 | ||
41 | 117 | if (_no_load) | 140 | if (_no_load) |
42 | 118 | return; | 141 | return; |
43 | 119 | 142 | ||
45 | 120 | key = Hash (filename, size); | 143 | key = Hash (uri, size); |
46 | 121 | 144 | ||
48 | 122 | if (CacheLookup (key, filename, size, slot)) | 145 | if (CacheLookup (key, uri, size, slot)) |
49 | 123 | { | 146 | { |
50 | 124 | g_free (key); | 147 | g_free (key); |
51 | 125 | return; | 148 | return; |
52 | 126 | } | 149 | } |
53 | 127 | 150 | ||
55 | 128 | QueueTask (key, filename, size, slot, REQUEST_TYPE_FILENAME); | 151 | QueueTask (key, uri, size, slot, REQUEST_TYPE_URI); |
56 | 129 | 152 | ||
57 | 130 | g_free (key); | 153 | g_free (key); |
58 | 131 | } | 154 | } |
59 | @@ -207,9 +230,9 @@ | |||
60 | 207 | { | 230 | { |
61 | 208 | task_complete = ProcessGIconTask (task); | 231 | task_complete = ProcessGIconTask (task); |
62 | 209 | } | 232 | } |
64 | 210 | else if (task->type == REQUEST_TYPE_FILENAME) | 233 | else if (task->type == REQUEST_TYPE_URI) |
65 | 211 | { | 234 | { |
67 | 212 | task_complete = ProcessFilenameTask (task); | 235 | task_complete = ProcessURITask (task); |
68 | 213 | } | 236 | } |
69 | 214 | else | 237 | else |
70 | 215 | { | 238 | { |
71 | @@ -285,9 +308,9 @@ | |||
72 | 285 | file = g_file_icon_get_file (G_FILE_ICON (icon)); | 308 | file = g_file_icon_get_file (G_FILE_ICON (icon)); |
73 | 286 | 309 | ||
74 | 287 | g_free (task->data); | 310 | g_free (task->data); |
78 | 288 | task->type = REQUEST_TYPE_FILENAME; | 311 | task->type = REQUEST_TYPE_URI; |
79 | 289 | task->data = g_file_get_path (file); | 312 | task->data = g_file_get_uri (file); |
80 | 290 | ret = ProcessFilenameTask (task); | 313 | ret = ProcessURITask (task); |
81 | 291 | 314 | ||
82 | 292 | g_object_unref (icon); | 315 | g_object_unref (icon); |
83 | 293 | 316 | ||
84 | @@ -362,11 +385,11 @@ | |||
85 | 362 | } | 385 | } |
86 | 363 | 386 | ||
87 | 364 | bool | 387 | bool |
89 | 365 | IconLoader::ProcessFilenameTask (IconLoaderTask *task) | 388 | IconLoader::ProcessURITask (IconLoaderTask *task) |
90 | 366 | { | 389 | { |
91 | 367 | GFile *file; | 390 | GFile *file; |
92 | 368 | 391 | ||
94 | 369 | file = g_file_new_for_path (task->data); | 392 | file = g_file_new_for_uri (task->data); |
95 | 370 | 393 | ||
96 | 371 | g_file_load_contents_async (file, | 394 | g_file_load_contents_async (file, |
97 | 372 | NULL, | 395 | NULL, |
98 | @@ -378,7 +401,7 @@ | |||
99 | 378 | } | 401 | } |
100 | 379 | 402 | ||
101 | 380 | void | 403 | void |
103 | 381 | IconLoader::ProcessFilenameTaskReady (IconLoaderTask *task, char *contents, gsize length) | 404 | IconLoader::ProcessURITaskReady (IconLoaderTask *task, char *contents, gsize length) |
104 | 382 | { | 405 | { |
105 | 383 | GdkPixbuf *pixbuf = NULL; | 406 | GdkPixbuf *pixbuf = NULL; |
106 | 384 | GInputStream *stream; | 407 | GInputStream *stream; |
107 | @@ -470,7 +493,7 @@ | |||
108 | 470 | 493 | ||
109 | 471 | if (g_file_load_contents_finish (G_FILE (obj), res, &contents, &length, NULL, &error)) | 494 | if (g_file_load_contents_finish (G_FILE (obj), res, &contents, &length, NULL, &error)) |
110 | 472 | { | 495 | { |
112 | 473 | task->self->ProcessFilenameTaskReady (task, contents, length); | 496 | task->self->ProcessURITaskReady (task, contents, length); |
113 | 474 | 497 | ||
114 | 475 | g_free (contents); | 498 | g_free (contents); |
115 | 476 | } | 499 | } |
116 | 477 | 500 | ||
117 | === modified file 'src/IconLoader.h' | |||
118 | --- src/IconLoader.h 2011-02-09 12:24:11 +0000 | |||
119 | +++ src/IconLoader.h 2011-03-24 01:52:23 +0000 | |||
120 | @@ -47,13 +47,17 @@ | |||
121 | 47 | void LoadFromFilename (const char *filename, | 47 | void LoadFromFilename (const char *filename, |
122 | 48 | guint size, | 48 | guint size, |
123 | 49 | IconLoaderCallback slot); | 49 | IconLoaderCallback slot); |
124 | 50 | |||
125 | 51 | void LoadFromURI (const char *uri, | ||
126 | 52 | guint size, | ||
127 | 53 | IconLoaderCallback slot); | ||
128 | 50 | private: | 54 | private: |
129 | 51 | 55 | ||
130 | 52 | enum IconLoaderRequestType | 56 | enum IconLoaderRequestType |
131 | 53 | { | 57 | { |
132 | 54 | REQUEST_TYPE_ICON_NAME=0, | 58 | REQUEST_TYPE_ICON_NAME=0, |
133 | 55 | REQUEST_TYPE_GICON_STRING, | 59 | REQUEST_TYPE_GICON_STRING, |
135 | 56 | REQUEST_TYPE_FILENAME | 60 | REQUEST_TYPE_URI, |
136 | 57 | }; | 61 | }; |
137 | 58 | 62 | ||
138 | 59 | struct IconLoaderTask | 63 | struct IconLoaderTask |
139 | @@ -80,8 +84,8 @@ | |||
140 | 80 | bool ProcessTask (IconLoaderTask *task); | 84 | bool ProcessTask (IconLoaderTask *task); |
141 | 81 | bool ProcessIconNameTask (IconLoaderTask *task); | 85 | bool ProcessIconNameTask (IconLoaderTask *task); |
142 | 82 | bool ProcessGIconTask (IconLoaderTask *task); | 86 | bool ProcessGIconTask (IconLoaderTask *task); |
145 | 83 | bool ProcessFilenameTask (IconLoaderTask *task); | 87 | bool ProcessURITask (IconLoaderTask *task); |
146 | 84 | void ProcessFilenameTaskReady (IconLoaderTask *task, char *contents, gsize length); | 88 | void ProcessURITaskReady (IconLoaderTask *task, char *contents, gsize length); |
147 | 85 | bool Iteration (); | 89 | bool Iteration (); |
148 | 86 | void FreeTask (IconLoaderTask *task); | 90 | void FreeTask (IconLoaderTask *task); |
149 | 87 | 91 | ||
150 | 88 | 92 | ||
151 | === modified file 'src/IconTexture.cpp' | |||
152 | --- src/IconTexture.cpp 2011-03-13 19:01:59 +0000 | |||
153 | +++ src/IconTexture.cpp 2011-03-24 01:52:23 +0000 | |||
154 | @@ -113,6 +113,11 @@ | |||
155 | 113 | sigc::mem_fun (this, &IconTexture::IconLoaded)); | 113 | sigc::mem_fun (this, &IconTexture::IconLoaded)); |
156 | 114 | g_object_unref (icon); | 114 | g_object_unref (icon); |
157 | 115 | } | 115 | } |
158 | 116 | else if (g_str_has_prefix (_icon_name, "http://")) | ||
159 | 117 | { | ||
160 | 118 | IconLoader::GetDefault ()->LoadFromURI (_icon_name, | ||
161 | 119 | _size, sigc::mem_fun (this, &IconTexture::IconLoaded)); | ||
162 | 120 | } | ||
163 | 116 | else | 121 | else |
164 | 117 | { | 122 | { |
165 | 118 | IconLoader::GetDefault ()->LoadFromIconName (_icon_name, | 123 | IconLoader::GetDefault ()->LoadFromIconName (_icon_name, |
166 | 119 | 124 | ||
167 | === modified file 'src/PanelMenuView.cpp' | |||
168 | --- src/PanelMenuView.cpp 2011-03-23 16:43:07 +0000 | |||
169 | +++ src/PanelMenuView.cpp 2011-03-24 01:52:23 +0000 | |||
170 | @@ -458,6 +458,12 @@ | |||
171 | 458 | PanelMenuView::Refresh () | 458 | PanelMenuView::Refresh () |
172 | 459 | { | 459 | { |
173 | 460 | nux::Geometry geo = GetGeometry (); | 460 | nux::Geometry geo = GetGeometry (); |
174 | 461 | |||
175 | 462 | // We can get into a race that causes the geometry to be wrong as there hasn't been a layout | ||
176 | 463 | // cycle before the first callback. This is to protect from that. | ||
177 | 464 | if (geo.width > _monitor_geo.width) | ||
178 | 465 | return; | ||
179 | 466 | |||
180 | 461 | char *label = GetActiveViewName (); | 467 | char *label = GetActiveViewName (); |
181 | 462 | PangoLayout *layout = NULL; | 468 | PangoLayout *layout = NULL; |
182 | 463 | PangoFontDescription *desc = NULL; | 469 | PangoFontDescription *desc = NULL; |
183 | @@ -1026,6 +1032,7 @@ | |||
184 | 1026 | PanelMenuView::SetMonitor (int monitor) | 1032 | PanelMenuView::SetMonitor (int monitor) |
185 | 1027 | { | 1033 | { |
186 | 1028 | _monitor = monitor; | 1034 | _monitor = monitor; |
187 | 1035 | _monitor_geo = UScreen::GetDefault ()->GetMonitorGeometry (_monitor); | ||
188 | 1029 | } | 1036 | } |
189 | 1030 | 1037 | ||
190 | 1031 | bool | 1038 | bool |
191 | 1032 | 1039 | ||
192 | === modified file 'src/PanelMenuView.h' | |||
193 | --- src/PanelMenuView.h 2011-03-22 16:56:41 +0000 | |||
194 | +++ src/PanelMenuView.h 2011-03-24 01:52:23 +0000 | |||
195 | @@ -139,5 +139,6 @@ | |||
196 | 139 | int _monitor; | 139 | int _monitor; |
197 | 140 | guint32 _active_xid; | 140 | guint32 _active_xid; |
198 | 141 | guint32 _active_moved_id; | 141 | guint32 _active_moved_id; |
199 | 142 | nux::Geometry _monitor_geo; | ||
200 | 142 | }; | 143 | }; |
201 | 143 | #endif | 144 | #endif |
202 | 144 | 145 | ||
203 | === modified file 'src/PlaceEntry.h' | |||
204 | --- src/PlaceEntry.h 2011-03-15 10:39:09 +0000 | |||
205 | +++ src/PlaceEntry.h 2011-03-24 01:52:23 +0000 | |||
206 | @@ -162,6 +162,8 @@ | |||
207 | 162 | sigc::signal<void, PlaceEntry *, PlaceEntryGroup&> global_group_added; | 162 | sigc::signal<void, PlaceEntry *, PlaceEntryGroup&> global_group_added; |
208 | 163 | sigc::signal<void, PlaceEntry *, PlaceEntryGroup&, PlaceEntryResult&> global_result_added; | 163 | sigc::signal<void, PlaceEntry *, PlaceEntryGroup&, PlaceEntryResult&> global_result_added; |
209 | 164 | sigc::signal<void, PlaceEntry *, PlaceEntryGroup&, PlaceEntryResult&> global_result_removed; | 164 | sigc::signal<void, PlaceEntry *, PlaceEntryGroup&, PlaceEntryResult&> global_result_removed; |
210 | 165 | |||
211 | 166 | sigc::signal<void, const char *, guint32, std::map<const char *, const char *>&> search_finished; | ||
212 | 165 | }; | 167 | }; |
213 | 166 | 168 | ||
214 | 167 | #endif // PLACE_ENTRY_H | 169 | #endif // PLACE_ENTRY_H |
215 | 168 | 170 | ||
216 | === modified file 'src/PlaceEntryHome.cpp' | |||
217 | --- src/PlaceEntryHome.cpp 2011-03-17 13:56:52 +0000 | |||
218 | +++ src/PlaceEntryHome.cpp 2011-03-24 01:52:23 +0000 | |||
219 | @@ -62,7 +62,8 @@ | |||
220 | 62 | 62 | ||
221 | 63 | 63 | ||
222 | 64 | PlaceEntryHome::PlaceEntryHome (PlaceFactory *factory) | 64 | PlaceEntryHome::PlaceEntryHome (PlaceFactory *factory) |
224 | 65 | : _factory (factory) | 65 | : _factory (factory), |
225 | 66 | _n_searches_done (0) | ||
226 | 66 | { | 67 | { |
227 | 67 | LoadExistingEntries (); | 68 | LoadExistingEntries (); |
228 | 68 | _factory->place_added.connect (sigc::mem_fun (this, &PlaceEntryHome::OnPlaceAdded)); | 69 | _factory->place_added.connect (sigc::mem_fun (this, &PlaceEntryHome::OnPlaceAdded)); |
229 | @@ -117,10 +118,14 @@ | |||
230 | 117 | { | 118 | { |
231 | 118 | PlaceEntryGroupHome group (entry); | 119 | PlaceEntryGroupHome group (entry); |
232 | 119 | 120 | ||
233 | 121 | if (!entry->ShowInGlobal ()) | ||
234 | 122 | return; | ||
235 | 123 | |||
236 | 120 | _entries.push_back (entry); | 124 | _entries.push_back (entry); |
237 | 121 | 125 | ||
238 | 122 | entry->global_result_added.connect (sigc::mem_fun (this, &PlaceEntryHome::OnResultAdded)); | 126 | entry->global_result_added.connect (sigc::mem_fun (this, &PlaceEntryHome::OnResultAdded)); |
239 | 123 | entry->global_result_removed.connect (sigc::mem_fun (this, &PlaceEntryHome::OnResultRemoved)); | 127 | entry->global_result_removed.connect (sigc::mem_fun (this, &PlaceEntryHome::OnResultRemoved)); |
240 | 128 | entry->search_finished.connect (sigc::mem_fun (this, &PlaceEntryHome::OnSearchFinished)); | ||
241 | 124 | 129 | ||
242 | 125 | group_added.emit (this, group); | 130 | group_added.emit (this, group); |
243 | 126 | } | 131 | } |
244 | @@ -241,6 +246,9 @@ | |||
245 | 241 | { | 246 | { |
246 | 242 | std::vector<PlaceEntry *>::iterator it, eit = _entries.end (); | 247 | std::vector<PlaceEntry *>::iterator it, eit = _entries.end (); |
247 | 243 | 248 | ||
248 | 249 | _n_searches_done = 0; | ||
249 | 250 | _last_search = search; | ||
250 | 251 | |||
251 | 244 | for (it = _entries.begin (); it != eit; ++it) | 252 | for (it = _entries.begin (); it != eit; ++it) |
252 | 245 | { | 253 | { |
253 | 246 | (*it)->SetGlobalSearch (search, hints); | 254 | (*it)->SetGlobalSearch (search, hints); |
254 | @@ -313,3 +321,19 @@ | |||
255 | 313 | entry->ActivateGlobalResult (id); | 321 | entry->ActivateGlobalResult (id); |
256 | 314 | } | 322 | } |
257 | 315 | } | 323 | } |
258 | 324 | |||
259 | 325 | void | ||
260 | 326 | PlaceEntryHome::OnSearchFinished (const char *search_string, | ||
261 | 327 | guint32 section_id, | ||
262 | 328 | std::map<const char *, const char *>& hints) | ||
263 | 329 | { | ||
264 | 330 | if (_last_search == search_string) | ||
265 | 331 | { | ||
266 | 332 | _n_searches_done++; | ||
267 | 333 | if (_n_searches_done == _entries.size ()) | ||
268 | 334 | { | ||
269 | 335 | search_finished.emit (search_string, section_id, hints); | ||
270 | 336 | } | ||
271 | 337 | } | ||
272 | 338 | } | ||
273 | 339 | |||
274 | 316 | 340 | ||
275 | === modified file 'src/PlaceEntryHome.h' | |||
276 | --- src/PlaceEntryHome.h 2011-03-17 13:56:52 +0000 | |||
277 | +++ src/PlaceEntryHome.h 2011-03-24 01:52:23 +0000 | |||
278 | @@ -85,6 +85,9 @@ | |||
279 | 85 | void OnResultAdded (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result); | 85 | void OnResultAdded (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result); |
280 | 86 | void OnResultRemoved (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result); | 86 | void OnResultRemoved (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result); |
281 | 87 | void OnForeachResult (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result); | 87 | void OnForeachResult (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result); |
282 | 88 | void OnSearchFinished (const char *search_string, | ||
283 | 89 | guint32 section_id, | ||
284 | 90 | std::map<const char *, const char *>& hints); | ||
285 | 88 | 91 | ||
286 | 89 | public: | 92 | public: |
287 | 90 | PlaceFactory *_factory; | 93 | PlaceFactory *_factory; |
288 | @@ -94,6 +97,9 @@ | |||
289 | 94 | std::map<const void *, PlaceEntry *> _id_to_entry; | 97 | std::map<const void *, PlaceEntry *> _id_to_entry; |
290 | 95 | 98 | ||
291 | 96 | ResultForeachCallback _foreach_callback; | 99 | ResultForeachCallback _foreach_callback; |
292 | 100 | |||
293 | 101 | guint _n_searches_done; | ||
294 | 102 | std::string _last_search; | ||
295 | 97 | }; | 103 | }; |
296 | 98 | 104 | ||
297 | 99 | #endif // PLACE_ENTRY_HOME_H | 105 | #endif // PLACE_ENTRY_HOME_H |
298 | 100 | 106 | ||
299 | === modified file 'src/PlaceEntryRemote.cpp' | |||
300 | --- src/PlaceEntryRemote.cpp 2011-03-17 13:33:30 +0000 | |||
301 | +++ src/PlaceEntryRemote.cpp 2011-03-24 01:52:23 +0000 | |||
302 | @@ -1025,5 +1025,17 @@ | |||
303 | 1025 | { | 1025 | { |
304 | 1026 | PlaceEntryRemote *self = static_cast<PlaceEntryRemote *> (user_data); | 1026 | PlaceEntryRemote *self = static_cast<PlaceEntryRemote *> (user_data); |
305 | 1027 | 1027 | ||
307 | 1028 | g_debug ("%p: %s", self, sender_name); | 1028 | if (g_strcmp0 (signal_name, "SearchFinished") == 0) |
308 | 1029 | { | ||
309 | 1030 | guint32 section = 0; | ||
310 | 1031 | gchar *search_string = NULL; | ||
311 | 1032 | GVariantIter *iter; | ||
312 | 1033 | std::map<const char *, const char*> hints; | ||
313 | 1034 | |||
314 | 1035 | g_variant_get (parameters, "(usa{ss})", §ion, &search_string, &iter); | ||
315 | 1036 | self->search_finished.emit (search_string, section, hints); | ||
316 | 1037 | |||
317 | 1038 | g_free (search_string); | ||
318 | 1039 | g_variant_iter_free (iter); | ||
319 | 1040 | } | ||
320 | 1029 | } | 1041 | } |
321 | 1030 | 1042 | ||
322 | === added file 'src/PlacesEmptyView.cpp' | |||
323 | --- src/PlacesEmptyView.cpp 1970-01-01 00:00:00 +0000 | |||
324 | +++ src/PlacesEmptyView.cpp 2011-03-24 01:52:23 +0000 | |||
325 | @@ -0,0 +1,88 @@ | |||
326 | 1 | /* | ||
327 | 2 | * Copyright (C) 2010 Canonical Ltd | ||
328 | 3 | * | ||
329 | 4 | * This program is free software: you can redistribute it and/or modify | ||
330 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
331 | 6 | * published by the Free Software Foundation. | ||
332 | 7 | * | ||
333 | 8 | * This program is distributed in the hope that it will be useful, | ||
334 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
335 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
336 | 11 | * GNU General Public License for more details. | ||
337 | 12 | * | ||
338 | 13 | * You should have received a copy of the GNU General Public License | ||
339 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
340 | 15 | * | ||
341 | 16 | * Authored by: Neil Jagdish Patel <neil.patel@canonical.com> | ||
342 | 17 | */ | ||
343 | 18 | |||
344 | 19 | #include "PlacesEmptyView.h" | ||
345 | 20 | |||
346 | 21 | #include "PlacesStyle.h" | ||
347 | 22 | |||
348 | 23 | NUX_IMPLEMENT_OBJECT_TYPE (PlacesEmptyView); | ||
349 | 24 | |||
350 | 25 | PlacesEmptyView::PlacesEmptyView () | ||
351 | 26 | : nux::View (NUX_TRACKER_LOCATION) | ||
352 | 27 | { | ||
353 | 28 | SetLayout (new nux::HLayout (NUX_TRACKER_LOCATION)); | ||
354 | 29 | |||
355 | 30 | _text = new nux::StaticCairoText (""); | ||
356 | 31 | _text->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_END); | ||
357 | 32 | _text->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_CENTRE); | ||
358 | 33 | _text->SetTextVerticalAlignment (nux::StaticCairoText::NUX_ALIGN_CENTRE); | ||
359 | 34 | _text->SetTextColor (nux::Color (1.0f, 1.0f, 1.0f, 0.8f)); | ||
360 | 35 | |||
361 | 36 | GetCompositionLayout ()->AddSpace (1, 1); | ||
362 | 37 | GetCompositionLayout ()->AddView (_text, 1, nux::eCenter, nux::eFix); | ||
363 | 38 | GetCompositionLayout ()->AddSpace (1, 1); | ||
364 | 39 | } | ||
365 | 40 | |||
366 | 41 | PlacesEmptyView::~PlacesEmptyView () | ||
367 | 42 | { | ||
368 | 43 | |||
369 | 44 | } | ||
370 | 45 | |||
371 | 46 | long | ||
372 | 47 | PlacesEmptyView::ProcessEvent(nux::IEvent &ievent, long TraverseInfo, long ProcessEventInfo) | ||
373 | 48 | { | ||
374 | 49 | return GetCompositionLayout ()->ProcessEvent (ievent, TraverseInfo, ProcessEventInfo); | ||
375 | 50 | } | ||
376 | 51 | |||
377 | 52 | void | ||
378 | 53 | PlacesEmptyView::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) | ||
379 | 54 | { | ||
380 | 55 | } | ||
381 | 56 | |||
382 | 57 | void | ||
383 | 58 | PlacesEmptyView::DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw) | ||
384 | 59 | { | ||
385 | 60 | GetCompositionLayout ()->ProcessDraw (GfxContext, force_draw); | ||
386 | 61 | } | ||
387 | 62 | |||
388 | 63 | void | ||
389 | 64 | PlacesEmptyView::SetText (const char *text) | ||
390 | 65 | { | ||
391 | 66 | char *clean; | ||
392 | 67 | char *markup; | ||
393 | 68 | |||
394 | 69 | clean = g_markup_escape_text (text, -1); | ||
395 | 70 | markup = g_strdup_printf ("<big>%s</big>", clean); | ||
396 | 71 | |||
397 | 72 | _text->SetText (markup); | ||
398 | 73 | |||
399 | 74 | g_free (clean); | ||
400 | 75 | g_free (markup); | ||
401 | 76 | } | ||
402 | 77 | |||
403 | 78 | const gchar* | ||
404 | 79 | PlacesEmptyView::GetName () | ||
405 | 80 | { | ||
406 | 81 | return "PlacesEmptyView"; | ||
407 | 82 | } | ||
408 | 83 | |||
409 | 84 | void | ||
410 | 85 | PlacesEmptyView::AddProperties (GVariantBuilder *builder) | ||
411 | 86 | { | ||
412 | 87 | |||
413 | 88 | } | ||
414 | 0 | 89 | ||
415 | === added file 'src/PlacesEmptyView.h' | |||
416 | --- src/PlacesEmptyView.h 1970-01-01 00:00:00 +0000 | |||
417 | +++ src/PlacesEmptyView.h 2011-03-24 01:52:23 +0000 | |||
418 | @@ -0,0 +1,55 @@ | |||
419 | 1 | /* | ||
420 | 2 | * Copyright (C) 2010 Canonical Ltd | ||
421 | 3 | * | ||
422 | 4 | * This program is free software: you can redistribute it and/or modify | ||
423 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
424 | 6 | * published by the Free Software Foundation. | ||
425 | 7 | * | ||
426 | 8 | * This program is distributed in the hope that it will be useful, | ||
427 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
428 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
429 | 11 | * GNU General Public License for more details. | ||
430 | 12 | * | ||
431 | 13 | * You should have received a copy of the GNU General Public License | ||
432 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
433 | 15 | * | ||
434 | 16 | * Authored by: Neil Jagdish Patel <neil.patel@canonical.com> | ||
435 | 17 | */ | ||
436 | 18 | |||
437 | 19 | #ifndef PLACES_EMPTY_VIEW_H | ||
438 | 20 | #define PLACES_EMPTY_VIEW_H | ||
439 | 21 | |||
440 | 22 | #include <Nux/Nux.h> | ||
441 | 23 | #include <Nux/View.h> | ||
442 | 24 | #include <NuxGraphics/GraphicsEngine.h> | ||
443 | 25 | #include <Nux/HLayout.h> | ||
444 | 26 | #include <Nux/VLayout.h> | ||
445 | 27 | #include "Introspectable.h" | ||
446 | 28 | #include "StaticCairoText.h" | ||
447 | 29 | |||
448 | 30 | class PlacesEmptyView : public nux::View, public Introspectable | ||
449 | 31 | { | ||
450 | 32 | NUX_DECLARE_OBJECT_TYPE (PlacesEmptyView, nux::View); | ||
451 | 33 | public: | ||
452 | 34 | |||
453 | 35 | PlacesEmptyView (); | ||
454 | 36 | ~PlacesEmptyView (); | ||
455 | 37 | |||
456 | 38 | // nux::View overrides | ||
457 | 39 | long ProcessEvent(nux::IEvent &ievent, long TraverseInfo, long ProcessEventInfo); | ||
458 | 40 | void Draw(nux::GraphicsEngine& GfxContext, bool force_draw); | ||
459 | 41 | void DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw); | ||
460 | 42 | |||
461 | 43 | void SetText (const char *text); | ||
462 | 44 | |||
463 | 45 | protected: | ||
464 | 46 | |||
465 | 47 | const gchar* GetName (); | ||
466 | 48 | void AddProperties (GVariantBuilder *builder); | ||
467 | 49 | |||
468 | 50 | private: | ||
469 | 51 | |||
470 | 52 | nux::StaticCairoText *_text; | ||
471 | 53 | }; | ||
472 | 54 | |||
473 | 55 | #endif // PLACES_EMPTY_VIEW_H | ||
474 | 0 | 56 | ||
475 | === modified file 'src/PlacesGroupController.cpp' | |||
476 | --- src/PlacesGroupController.cpp 2011-03-23 17:55:51 +0000 | |||
477 | +++ src/PlacesGroupController.cpp 2011-03-24 01:52:23 +0000 | |||
478 | @@ -19,6 +19,7 @@ | |||
479 | 19 | #include "PlacesGroupController.h" | 19 | #include "PlacesGroupController.h" |
480 | 20 | 20 | ||
481 | 21 | #include <Nux/GridHLayout.h> | 21 | #include <Nux/GridHLayout.h> |
482 | 22 | #include <glib/gi18n-lib.h> | ||
483 | 22 | 23 | ||
484 | 23 | #include "PlacesStyle.h" | 24 | #include "PlacesStyle.h" |
485 | 24 | #include "PlacesSimpleTile.h" | 25 | #include "PlacesSimpleTile.h" |
486 | @@ -55,12 +56,22 @@ | |||
487 | 55 | 56 | ||
488 | 56 | _group->expanded.connect (sigc::mem_fun (this, &PlacesGroupController::CheckTiles)); | 57 | _group->expanded.connect (sigc::mem_fun (this, &PlacesGroupController::CheckTiles)); |
489 | 57 | style->columns_changed.connect (sigc::mem_fun (this, &PlacesGroupController::CheckTiles)); | 58 | style->columns_changed.connect (sigc::mem_fun (this, &PlacesGroupController::CheckTiles)); |
490 | 59 | |||
491 | 60 | _more_tile = new PlacesSimpleTile ("gtk-add", | ||
492 | 61 | _("Load more results..."), | ||
493 | 62 | style->GetTileIconSize (), | ||
494 | 63 | false, | ||
495 | 64 | "more-tile"); | ||
496 | 65 | _more_tile->Reference (); | ||
497 | 66 | _more_tile->sigClick.connect (sigc::mem_fun (this, &PlacesGroupController::MoreTileClicked)); | ||
498 | 58 | } | 67 | } |
499 | 59 | 68 | ||
500 | 60 | PlacesGroupController::~PlacesGroupController () | 69 | PlacesGroupController::~PlacesGroupController () |
501 | 61 | { | 70 | { |
502 | 62 | if (_check_tiles_id) | 71 | if (_check_tiles_id) |
503 | 63 | g_source_remove (_check_tiles_id); | 72 | g_source_remove (_check_tiles_id); |
504 | 73 | if (_more_tile) | ||
505 | 74 | _more_tile->UnReference (); | ||
506 | 64 | } | 75 | } |
507 | 65 | 76 | ||
508 | 66 | const void * | 77 | const void * |
509 | @@ -117,6 +128,13 @@ | |||
510 | 117 | } | 128 | } |
511 | 118 | 129 | ||
512 | 119 | void | 130 | void |
513 | 131 | PlacesGroupController::MoreTileClicked (PlacesTile *tile) | ||
514 | 132 | { | ||
515 | 133 | if (!_check_tiles_id) | ||
516 | 134 | _check_tiles_id = g_timeout_add (150, (GSourceFunc)CheckTilesTimeout, this); | ||
517 | 135 | } | ||
518 | 136 | |||
519 | 137 | void | ||
520 | 120 | PlacesGroupController::AddResult (PlaceEntryGroup& group, PlaceEntryResult& result) | 138 | PlacesGroupController::AddResult (PlaceEntryGroup& group, PlaceEntryResult& result) |
521 | 121 | { | 139 | { |
522 | 122 | PlacesStyle *style = PlacesStyle::GetDefault (); | 140 | PlacesStyle *style = PlacesStyle::GetDefault (); |
523 | @@ -178,6 +196,9 @@ | |||
524 | 178 | else | 196 | else |
525 | 179 | n_to_show = style->GetDefaultNColumns (); | 197 | n_to_show = style->GetDefaultNColumns (); |
526 | 180 | 198 | ||
527 | 199 | if (_more_tile->GetParentObject ()) | ||
528 | 200 | _group->GetChildLayout ()->RemoveChildObject (_more_tile); | ||
529 | 201 | |||
530 | 181 | if (_id_to_tile.size () == n_to_show) | 202 | if (_id_to_tile.size () == n_to_show) |
531 | 182 | { | 203 | { |
532 | 183 | // Hoorah | 204 | // Hoorah |
533 | @@ -185,6 +206,9 @@ | |||
534 | 185 | else if (_id_to_tile.size () < n_to_show) | 206 | else if (_id_to_tile.size () < n_to_show) |
535 | 186 | { | 207 | { |
536 | 187 | std::vector<const void *>::iterator it = _queue.begin (); | 208 | std::vector<const void *>::iterator it = _queue.begin (); |
537 | 209 | int max_rows_to_add = style->GetDefaultNColumns () * 15; | ||
538 | 210 | int max_rows_per_click = max_rows_to_add * 3; | ||
539 | 211 | int n_tiles = _id_to_tile.size (); | ||
540 | 188 | 212 | ||
541 | 189 | if (_queue.size () >= n_to_show) | 213 | if (_queue.size () >= n_to_show) |
542 | 190 | { | 214 | { |
543 | @@ -194,6 +218,33 @@ | |||
544 | 194 | { | 218 | { |
545 | 195 | _entry->GetResult ((*it), sigc::mem_fun (this, &PlacesGroupController::AddTile)); | 219 | _entry->GetResult ((*it), sigc::mem_fun (this, &PlacesGroupController::AddTile)); |
546 | 196 | it++; | 220 | it++; |
547 | 221 | n_tiles++; | ||
548 | 222 | |||
549 | 223 | if (n_tiles % max_rows_to_add == 0) | ||
550 | 224 | { | ||
551 | 225 | // What we do over here is add a "Load more results..." button which will then kick off | ||
552 | 226 | // another fill cycle. Generally the user will never need to see this, but in the case | ||
553 | 227 | // of large results sets, this gives us a chance of not blocking the entire WM for | ||
554 | 228 | // 20 secs as we load in 2000+ results. | ||
555 | 229 | if (n_tiles % max_rows_per_click == 0) | ||
556 | 230 | { | ||
557 | 231 | _group->GetChildLayout ()->AddView (_more_tile); | ||
558 | 232 | } | ||
559 | 233 | else | ||
560 | 234 | { | ||
561 | 235 | // The idea here is that we increase the timeouts of adding tiles in relation to | ||
562 | 236 | // how big the view is getting. In theory it shouldn't be needed but in reality with | ||
563 | 237 | // Nux having to do so many calculations it is needed. Ideally we'd be rendering | ||
564 | 238 | // the entire results view as a scene with re-usable tiles but that would have been | ||
565 | 239 | // too difficult to get right with a11y, so instead we need to just deal with this | ||
566 | 240 | // the best way we can. | ||
567 | 241 | if (!_check_tiles_id) | ||
568 | 242 | _check_tiles_id = g_timeout_add (350 * n_tiles/max_rows_to_add, | ||
569 | 243 | (GSourceFunc)CheckTilesTimeout, | ||
570 | 244 | this); | ||
571 | 245 | } | ||
572 | 246 | return; | ||
573 | 247 | } | ||
574 | 197 | } | 248 | } |
575 | 198 | } | 249 | } |
576 | 199 | } | 250 | } |
577 | 200 | 251 | ||
578 | === modified file 'src/PlacesGroupController.h' | |||
579 | --- src/PlacesGroupController.h 2011-03-13 21:22:04 +0000 | |||
580 | +++ src/PlacesGroupController.h 2011-03-24 01:52:23 +0000 | |||
581 | @@ -54,6 +54,7 @@ | |||
582 | 54 | void CheckTiles (); | 54 | void CheckTiles (); |
583 | 55 | static gboolean CheckTilesTimeout (PlacesGroupController *self); | 55 | static gboolean CheckTilesTimeout (PlacesGroupController *self); |
584 | 56 | void TileClicked (PlacesTile *tile); | 56 | void TileClicked (PlacesTile *tile); |
585 | 57 | void MoreTileClicked (PlacesTile *tile); | ||
586 | 57 | 58 | ||
587 | 58 | private: | 59 | private: |
588 | 59 | PlaceEntry *_entry; | 60 | PlaceEntry *_entry; |
589 | @@ -62,6 +63,7 @@ | |||
590 | 62 | std::map<const void *, PlacesTile *> _id_to_tile; | 63 | std::map<const void *, PlacesTile *> _id_to_tile; |
591 | 63 | guint _check_tiles_id; | 64 | guint _check_tiles_id; |
592 | 64 | std::vector<const void *> _queue; | 65 | std::vector<const void *> _queue; |
593 | 66 | PlacesTile *_more_tile; | ||
594 | 65 | }; | 67 | }; |
595 | 66 | 68 | ||
596 | 67 | #endif // PLACES_GROUP_CONTROLLER_H | 69 | #endif // PLACES_GROUP_CONTROLLER_H |
597 | 68 | 70 | ||
598 | === modified file 'src/PlacesSearchBar.cpp' | |||
599 | --- src/PlacesSearchBar.cpp 2011-03-23 15:44:45 +0000 | |||
600 | +++ src/PlacesSearchBar.cpp 2011-03-24 01:52:23 +0000 | |||
601 | @@ -60,12 +60,12 @@ | |||
602 | 60 | _layout = new nux::HLayout (NUX_TRACKER_LOCATION); | 60 | _layout = new nux::HLayout (NUX_TRACKER_LOCATION); |
603 | 61 | _layout->SetHorizontalInternalMargin (12); | 61 | _layout->SetHorizontalInternalMargin (12); |
604 | 62 | 62 | ||
611 | 63 | _search_icon = new nux::TextureArea (NUX_TRACKER_LOCATION); | 63 | _spinner = new PlacesSearchBarSpinner (); |
612 | 64 | _search_icon->SetTexture (icon); | 64 | _spinner->SetMinMaxSize (icon->GetWidth (), icon->GetHeight ()); |
613 | 65 | _search_icon->SetMinMaxSize (icon->GetWidth (), icon->GetHeight ()); | 65 | //_spinner->SetMaximumWidth (icon->GetWidth ()); |
614 | 66 | _layout->AddView (_search_icon, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL); | 66 | _layout->AddView (_spinner, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL); |
615 | 67 | _search_icon->OnMouseClick.connect (sigc::mem_fun (this, &PlacesSearchBar::OnClearClicked)); | 67 | _spinner->OnMouseClick.connect (sigc::mem_fun (this, &PlacesSearchBar::OnClearClicked)); |
616 | 68 | _search_icon->SetCanFocus (false); | 68 | _spinner->SetCanFocus (false); |
617 | 69 | 69 | ||
618 | 70 | _layered_layout = new nux::LayeredLayout (); | 70 | _layered_layout = new nux::LayeredLayout (); |
619 | 71 | 71 | ||
620 | @@ -243,8 +243,7 @@ | |||
621 | 243 | void | 243 | void |
622 | 244 | PlacesSearchBar::OnSearchChanged (nux::TextEntry *text_entry) | 244 | PlacesSearchBar::OnSearchChanged (nux::TextEntry *text_entry) |
623 | 245 | { | 245 | { |
626 | 246 | PlacesStyle *style = PlacesStyle::GetDefault (); | 246 | bool is_empty; |
625 | 247 | bool is_empty; | ||
627 | 248 | 247 | ||
628 | 249 | if (_live_search_timeout) | 248 | if (_live_search_timeout) |
629 | 250 | g_source_remove (_live_search_timeout); | 249 | g_source_remove (_live_search_timeout); |
630 | @@ -259,7 +258,7 @@ | |||
631 | 259 | 258 | ||
632 | 260 | is_empty = g_strcmp0 (_pango_entry->GetText ().c_str (), "") == 0; | 259 | is_empty = g_strcmp0 (_pango_entry->GetText ().c_str (), "") == 0; |
633 | 261 | _hint->SetVisible (is_empty); | 260 | _hint->SetVisible (is_empty); |
635 | 262 | _search_icon->SetTexture (is_empty ? style->GetSearchReadyIcon () : style->GetSearchClearIcon ()); | 261 | _spinner->SetState (is_empty ? STATE_READY : STATE_SEARCHING); |
636 | 263 | 262 | ||
637 | 264 | _hint->QueueDraw (); | 263 | _hint->QueueDraw (); |
638 | 265 | _pango_entry->QueueDraw (); | 264 | _pango_entry->QueueDraw (); |
639 | @@ -292,7 +291,7 @@ | |||
640 | 292 | if (_pango_entry->GetText () != "") | 291 | if (_pango_entry->GetText () != "") |
641 | 293 | { | 292 | { |
642 | 294 | _pango_entry->SetText (""); | 293 | _pango_entry->SetText (""); |
644 | 295 | _search_icon->SetTexture (PlacesStyle::GetDefault ()->GetSearchReadyIcon ()); | 294 | _spinner->SetState (STATE_READY); |
645 | 296 | EmitLiveSearch (); | 295 | EmitLiveSearch (); |
646 | 297 | } | 296 | } |
647 | 298 | } | 297 | } |
648 | @@ -310,6 +309,12 @@ | |||
649 | 310 | } | 309 | } |
650 | 311 | 310 | ||
651 | 312 | void | 311 | void |
652 | 312 | PlacesSearchBar::OnSearchFinished () | ||
653 | 313 | { | ||
654 | 314 | _spinner->SetState (STATE_CLEAR); | ||
655 | 315 | } | ||
656 | 316 | |||
657 | 317 | void | ||
658 | 313 | PlacesSearchBar::OnFontChanged (GObject *object, GParamSpec *pspec, PlacesSearchBar *self) | 318 | PlacesSearchBar::OnFontChanged (GObject *object, GParamSpec *pspec, PlacesSearchBar *self) |
659 | 314 | { | 319 | { |
660 | 315 | #define HOW_LARGE 8 | 320 | #define HOW_LARGE 8 |
661 | 316 | 321 | ||
662 | === modified file 'src/PlacesSearchBar.h' | |||
663 | --- src/PlacesSearchBar.h 2011-03-15 14:23:03 +0000 | |||
664 | +++ src/PlacesSearchBar.h 2011-03-24 01:52:23 +0000 | |||
665 | @@ -32,6 +32,8 @@ | |||
666 | 32 | #include "Nux/EditTextBox.h" | 32 | #include "Nux/EditTextBox.h" |
667 | 33 | #include "Nux/TextEntry.h" | 33 | #include "Nux/TextEntry.h" |
668 | 34 | 34 | ||
669 | 35 | #include "PlacesSearchBarSpinner.h" | ||
670 | 36 | |||
671 | 35 | #include "PlaceEntry.h" | 37 | #include "PlaceEntry.h" |
672 | 36 | 38 | ||
673 | 37 | class PlacesView; | 39 | class PlacesView; |
674 | @@ -53,6 +55,7 @@ | |||
675 | 53 | void SetActiveEntry (PlaceEntry *entry, | 55 | void SetActiveEntry (PlaceEntry *entry, |
676 | 54 | guint section_id, | 56 | guint section_id, |
677 | 55 | const char *search_string); | 57 | const char *search_string); |
678 | 58 | void OnSearchFinished (); | ||
679 | 56 | 59 | ||
680 | 57 | sigc::signal<void, const char *> search_changed; | 60 | sigc::signal<void, const char *> search_changed; |
681 | 58 | sigc::signal<void> activated; | 61 | sigc::signal<void> activated; |
682 | @@ -89,7 +92,7 @@ | |||
683 | 89 | guint _live_search_timeout; | 92 | guint _live_search_timeout; |
684 | 90 | 93 | ||
685 | 91 | friend class PlacesView; | 94 | friend class PlacesView; |
687 | 92 | nux::TextureArea *_search_icon; | 95 | PlacesSearchBarSpinner *_spinner; |
688 | 93 | nux::ComboBoxSimple *_combo; | 96 | nux::ComboBoxSimple *_combo; |
689 | 94 | }; | 97 | }; |
690 | 95 | 98 | ||
691 | 96 | 99 | ||
692 | === added file 'src/PlacesSearchBarSpinner.cpp' | |||
693 | --- src/PlacesSearchBarSpinner.cpp 1970-01-01 00:00:00 +0000 | |||
694 | +++ src/PlacesSearchBarSpinner.cpp 2011-03-24 01:52:23 +0000 | |||
695 | @@ -0,0 +1,183 @@ | |||
696 | 1 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- | ||
697 | 2 | /* | ||
698 | 3 | * Copyright (C) 2011 Canonical Ltd | ||
699 | 4 | * | ||
700 | 5 | * This program is free software: you can redistribute it and/or modify | ||
701 | 6 | * it under the terms of the GNU General Public License version 3 as | ||
702 | 7 | * published by the Free Software Foundation. | ||
703 | 8 | * | ||
704 | 9 | * This program is distributed in the hope that it will be useful, | ||
705 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
706 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
707 | 12 | * GNU General Public License for more details. | ||
708 | 13 | * | ||
709 | 14 | * You should have received a copy of the GNU General Public License | ||
710 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
711 | 16 | * | ||
712 | 17 | * Authored by: Neil Jagdish Patel <neil.patel@canonical.com> | ||
713 | 18 | */ | ||
714 | 19 | |||
715 | 20 | #include "PlacesSearchBarSpinner.h" | ||
716 | 21 | |||
717 | 22 | #include <Nux/VLayout.h> | ||
718 | 23 | |||
719 | 24 | #include "PlacesStyle.h" | ||
720 | 25 | |||
721 | 26 | NUX_IMPLEMENT_OBJECT_TYPE (PlacesSearchBarSpinner); | ||
722 | 27 | |||
723 | 28 | PlacesSearchBarSpinner::PlacesSearchBarSpinner () | ||
724 | 29 | : nux::View (NUX_TRACKER_LOCATION), | ||
725 | 30 | _state (STATE_READY), | ||
726 | 31 | _rotation (0.0f), | ||
727 | 32 | _spinner_timeout (0) | ||
728 | 33 | { | ||
729 | 34 | PlacesStyle *style = PlacesStyle::GetDefault (); | ||
730 | 35 | |||
731 | 36 | _search_ready = style->GetSearchReadyIcon (); | ||
732 | 37 | _clear_full = style->GetSearchClearIcon (); | ||
733 | 38 | _clear_alone = style->GetSearchClearAloneIcon (); | ||
734 | 39 | _clear_spinner = style->GetSearchClearSpinnerIcon (); | ||
735 | 40 | |||
736 | 41 | _2d_rotate.Identity (); | ||
737 | 42 | _2d_rotate.Rotate_z (0.0); | ||
738 | 43 | } | ||
739 | 44 | |||
740 | 45 | PlacesSearchBarSpinner::~PlacesSearchBarSpinner () | ||
741 | 46 | { | ||
742 | 47 | |||
743 | 48 | } | ||
744 | 49 | |||
745 | 50 | long | ||
746 | 51 | PlacesSearchBarSpinner::ProcessEvent (nux::IEvent &ievent, long TraverseInfo, long ProcessEventInfo) | ||
747 | 52 | { | ||
748 | 53 | return PostProcessEvent2 (ievent, TraverseInfo, ProcessEventInfo); | ||
749 | 54 | } | ||
750 | 55 | |||
751 | 56 | void | ||
752 | 57 | PlacesSearchBarSpinner::Draw (nux::GraphicsEngine& GfxContext, bool force_draw) | ||
753 | 58 | { | ||
754 | 59 | nux::Geometry geo = GetGeometry (); | ||
755 | 60 | nux::TexCoordXForm texxform; | ||
756 | 61 | |||
757 | 62 | GfxContext.PushClippingRectangle (geo); | ||
758 | 63 | |||
759 | 64 | nux::GetPainter ().PaintBackground (GfxContext, geo); | ||
760 | 65 | |||
761 | 66 | texxform.SetTexCoordType (nux::TexCoordXForm::OFFSET_COORD); | ||
762 | 67 | texxform.SetWrap (nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT); | ||
763 | 68 | texxform.min_filter = nux::TEXFILTER_LINEAR; | ||
764 | 69 | texxform.mag_filter = nux::TEXFILTER_LINEAR; | ||
765 | 70 | |||
766 | 71 | if (_state == STATE_READY) | ||
767 | 72 | { | ||
768 | 73 | GfxContext.QRP_1Tex (geo.x + ((geo.width - _search_ready->GetWidth ())/2), | ||
769 | 74 | geo.y + ((geo.height - _search_ready->GetHeight ())/2), | ||
770 | 75 | _search_ready->GetWidth (), | ||
771 | 76 | _search_ready->GetHeight (), | ||
772 | 77 | _search_ready->GetDeviceTexture (), | ||
773 | 78 | texxform, | ||
774 | 79 | nux::Color::White); | ||
775 | 80 | } | ||
776 | 81 | else if (_state == STATE_SEARCHING) | ||
777 | 82 | { | ||
778 | 83 | nux::Geometry clear_geo (geo.x + ((geo.width - _clear_spinner->GetWidth ())/2), | ||
779 | 84 | geo.y + ((geo.height - _clear_spinner->GetHeight ())/2), | ||
780 | 85 | _clear_spinner->GetWidth (), | ||
781 | 86 | _clear_spinner->GetHeight ()); | ||
782 | 87 | |||
783 | 88 | GfxContext.PushModelViewMatrix (nux::Matrix4::TRANSLATE(-clear_geo.x - clear_geo.width / 2, | ||
784 | 89 | -clear_geo.y - clear_geo.height / 2, 0)); | ||
785 | 90 | GfxContext.PushModelViewMatrix (_2d_rotate); | ||
786 | 91 | GfxContext.PushModelViewMatrix (nux::Matrix4::TRANSLATE(clear_geo.x + clear_geo.width/ 2, | ||
787 | 92 | clear_geo.y + clear_geo.height / 2, 0)); | ||
788 | 93 | |||
789 | 94 | GfxContext.QRP_1Tex (clear_geo.x, | ||
790 | 95 | clear_geo.y, | ||
791 | 96 | clear_geo.width, | ||
792 | 97 | clear_geo.height, | ||
793 | 98 | _clear_spinner->GetDeviceTexture (), | ||
794 | 99 | texxform, | ||
795 | 100 | nux::Color::White); | ||
796 | 101 | |||
797 | 102 | GfxContext.PopModelViewMatrix (); | ||
798 | 103 | GfxContext.PopModelViewMatrix (); | ||
799 | 104 | GfxContext.PopModelViewMatrix (); | ||
800 | 105 | |||
801 | 106 | GfxContext.QRP_1Tex (geo.x + ((geo.width - _clear_alone->GetWidth ())/2), | ||
802 | 107 | geo.y + ((geo.height - _clear_alone->GetHeight ())/2), | ||
803 | 108 | _clear_alone->GetWidth (), | ||
804 | 109 | _clear_alone->GetHeight (), | ||
805 | 110 | _clear_alone->GetDeviceTexture (), | ||
806 | 111 | texxform, | ||
807 | 112 | nux::Color::White); | ||
808 | 113 | } | ||
809 | 114 | else | ||
810 | 115 | { | ||
811 | 116 | GfxContext.QRP_1Tex (geo.x + ((geo.width - _clear_full->GetWidth ())/2), | ||
812 | 117 | geo.y + ((geo.height - _clear_full->GetHeight ())/2), | ||
813 | 118 | _clear_full->GetWidth (), | ||
814 | 119 | _clear_full->GetHeight (), | ||
815 | 120 | _clear_full->GetDeviceTexture (), | ||
816 | 121 | texxform, | ||
817 | 122 | nux::Color::White); | ||
818 | 123 | } | ||
819 | 124 | |||
820 | 125 | GfxContext.PopClippingRectangle (); | ||
821 | 126 | } | ||
822 | 127 | |||
823 | 128 | void | ||
824 | 129 | PlacesSearchBarSpinner::DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw) | ||
825 | 130 | { | ||
826 | 131 | } | ||
827 | 132 | |||
828 | 133 | gboolean | ||
829 | 134 | PlacesSearchBarSpinner::OnFrame (PlacesSearchBarSpinner *self) | ||
830 | 135 | { | ||
831 | 136 | self->_rotation += 0.1f; | ||
832 | 137 | |||
833 | 138 | if (self->_rotation >= 360.0f) | ||
834 | 139 | self->_rotation = 0.0f; | ||
835 | 140 | |||
836 | 141 | self->_2d_rotate.Rotate_z (self->_rotation); | ||
837 | 142 | |||
838 | 143 | self->QueueDraw (); | ||
839 | 144 | |||
840 | 145 | return TRUE; | ||
841 | 146 | } | ||
842 | 147 | |||
843 | 148 | void | ||
844 | 149 | PlacesSearchBarSpinner::SetState (SpinnerState state) | ||
845 | 150 | { | ||
846 | 151 | if (_state == state) | ||
847 | 152 | return; | ||
848 | 153 | |||
849 | 154 | _state = state; | ||
850 | 155 | |||
851 | 156 | if (_spinner_timeout) | ||
852 | 157 | g_source_remove (_spinner_timeout); | ||
853 | 158 | _2d_rotate.Rotate_z (0.0f); | ||
854 | 159 | _rotation = 0.0f; | ||
855 | 160 | |||
856 | 161 | if (_state == STATE_SEARCHING) | ||
857 | 162 | { | ||
858 | 163 | _spinner_timeout = g_timeout_add (15, (GSourceFunc)PlacesSearchBarSpinner::OnFrame, this); | ||
859 | 164 | } | ||
860 | 165 | |||
861 | 166 | QueueDraw (); | ||
862 | 167 | } | ||
863 | 168 | |||
864 | 169 | const gchar* | ||
865 | 170 | PlacesSearchBarSpinner::GetName () | ||
866 | 171 | { | ||
867 | 172 | return "PlacesSearchBarSpinner"; | ||
868 | 173 | } | ||
869 | 174 | |||
870 | 175 | void PlacesSearchBarSpinner::AddProperties (GVariantBuilder *builder) | ||
871 | 176 | { | ||
872 | 177 | nux::Geometry geo = GetGeometry (); | ||
873 | 178 | |||
874 | 179 | g_variant_builder_add (builder, "{sv}", "x", g_variant_new_int32 (geo.x)); | ||
875 | 180 | g_variant_builder_add (builder, "{sv}", "y", g_variant_new_int32 (geo.y)); | ||
876 | 181 | g_variant_builder_add (builder, "{sv}", "width", g_variant_new_int32 (geo.width)); | ||
877 | 182 | g_variant_builder_add (builder, "{sv}", "height", g_variant_new_int32 (geo.height)); | ||
878 | 183 | } | ||
879 | 0 | 184 | ||
880 | === added file 'src/PlacesSearchBarSpinner.h' | |||
881 | --- src/PlacesSearchBarSpinner.h 1970-01-01 00:00:00 +0000 | |||
882 | +++ src/PlacesSearchBarSpinner.h 2011-03-24 01:52:23 +0000 | |||
883 | @@ -0,0 +1,72 @@ | |||
884 | 1 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- | ||
885 | 2 | /* | ||
886 | 3 | * Copyright (C) 2011 Canonical Ltd | ||
887 | 4 | * | ||
888 | 5 | * This program is free software: you can redistribute it and/or modify | ||
889 | 6 | * it under the terms of the GNU General Public License version 3 as | ||
890 | 7 | * published by the Free Software Foundation. | ||
891 | 8 | * | ||
892 | 9 | * This program is distributed in the hope that it will be useful, | ||
893 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
894 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
895 | 12 | * GNU General Public License for more details. | ||
896 | 13 | * | ||
897 | 14 | * You should have received a copy of the GNU General Public License | ||
898 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
899 | 16 | * | ||
900 | 17 | * Authored by: Neil Jagdish Patel <neil.patel@canonical.com> | ||
901 | 18 | */ | ||
902 | 19 | |||
903 | 20 | #ifndef PLACES_SEARCH_BAR_SPINNER_H | ||
904 | 21 | #define PLACES_SEARCH_BAR_SPINNER_H | ||
905 | 22 | |||
906 | 23 | #include <Nux/Nux.h> | ||
907 | 24 | #include <Nux/View.h> | ||
908 | 25 | #include <NuxGraphics/GraphicsEngine.h> | ||
909 | 26 | #include <Nux/TextureArea.h> | ||
910 | 27 | #include <NuxCore/Math/Matrix4.h> | ||
911 | 28 | #include "Introspectable.h" | ||
912 | 29 | |||
913 | 30 | enum SpinnerState | ||
914 | 31 | { | ||
915 | 32 | STATE_READY, | ||
916 | 33 | STATE_SEARCHING, | ||
917 | 34 | STATE_CLEAR | ||
918 | 35 | }; | ||
919 | 36 | |||
920 | 37 | class PlacesSearchBarSpinner : public Introspectable, public nux::View | ||
921 | 38 | { | ||
922 | 39 | NUX_DECLARE_OBJECT_TYPE (PlacesSearchBarSpinner, nux::View); | ||
923 | 40 | public: | ||
924 | 41 | PlacesSearchBarSpinner (); | ||
925 | 42 | ~PlacesSearchBarSpinner (); | ||
926 | 43 | |||
927 | 44 | long ProcessEvent (nux::IEvent &ievent, long TraverseInfo, long ProcessEventInfo); | ||
928 | 45 | void Draw (nux::GraphicsEngine& GfxContext, bool force_draw); | ||
929 | 46 | void DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw); | ||
930 | 47 | |||
931 | 48 | void SetState (SpinnerState state); | ||
932 | 49 | |||
933 | 50 | protected: | ||
934 | 51 | // Introspectable methods | ||
935 | 52 | const gchar * GetName (); | ||
936 | 53 | void AddProperties (GVariantBuilder *builder); | ||
937 | 54 | static gboolean OnFrame (PlacesSearchBarSpinner *self); | ||
938 | 55 | |||
939 | 56 | private: | ||
940 | 57 | |||
941 | 58 | private: | ||
942 | 59 | SpinnerState _state; | ||
943 | 60 | |||
944 | 61 | nux::BaseTexture *_search_ready; | ||
945 | 62 | nux::BaseTexture *_clear_full; | ||
946 | 63 | nux::BaseTexture *_clear_alone; | ||
947 | 64 | nux::BaseTexture *_clear_spinner; | ||
948 | 65 | |||
949 | 66 | nux::Matrix4 _2d_rotate; | ||
950 | 67 | float _rotation; | ||
951 | 68 | |||
952 | 69 | guint32 _spinner_timeout; | ||
953 | 70 | }; | ||
954 | 71 | |||
955 | 72 | #endif | ||
956 | 0 | 73 | ||
957 | === modified file 'src/PlacesSimpleTile.cpp' | |||
958 | --- src/PlacesSimpleTile.cpp 2011-03-23 10:54:22 +0000 | |||
959 | +++ src/PlacesSimpleTile.cpp 2011-03-24 01:52:23 +0000 | |||
960 | @@ -40,10 +40,6 @@ | |||
961 | 40 | _icon (NULL), | 40 | _icon (NULL), |
962 | 41 | _uri (NULL) | 41 | _uri (NULL) |
963 | 42 | { | 42 | { |
964 | 43 | //GtkSettings *settings = gtk_settings_get_default (); | ||
965 | 44 | //gchar *font = NULL; | ||
966 | 45 | //gchar *fontstring = NULL; | ||
967 | 46 | |||
968 | 47 | nux::VLayout *layout = new nux::VLayout ("", NUX_TRACKER_LOCATION); | 43 | nux::VLayout *layout = new nux::VLayout ("", NUX_TRACKER_LOCATION); |
969 | 48 | 44 | ||
970 | 49 | _label = g_strdup (label); | 45 | _label = g_strdup (label); |
971 | @@ -57,10 +53,6 @@ | |||
972 | 57 | _cairotext = new nux::StaticCairoText (_label); | 53 | _cairotext = new nux::StaticCairoText (_label); |
973 | 58 | _cairotext->SinkReference (); | 54 | _cairotext->SinkReference (); |
974 | 59 | 55 | ||
975 | 60 | //g_object_get (settings, "gtk-font-name", &font, NULL); | ||
976 | 61 | //fontstring = g_strdup_printf ("%s normal 10", font); | ||
977 | 62 | |||
978 | 63 | //_cairotext->SetFont (fontstring); | ||
979 | 64 | _cairotext->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_START); | 56 | _cairotext->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_START); |
980 | 65 | _cairotext->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_CENTRE); | 57 | _cairotext->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_CENTRE); |
981 | 66 | _cairotext->SetMaximumWidth (140); | 58 | _cairotext->SetMaximumWidth (140); |
982 | @@ -75,9 +67,6 @@ | |||
983 | 75 | SetLayout (layout); | 67 | SetLayout (layout); |
984 | 76 | 68 | ||
985 | 77 | SetDndEnabled (true, false); | 69 | SetDndEnabled (true, false); |
986 | 78 | |||
987 | 79 | //g_free (font); | ||
988 | 80 | //g_free (fontstring); | ||
989 | 81 | } | 70 | } |
990 | 82 | 71 | ||
991 | 83 | 72 | ||
992 | 84 | 73 | ||
993 | === modified file 'src/PlacesStyle.cpp' | |||
994 | --- src/PlacesStyle.cpp 2011-02-28 15:56:44 +0000 | |||
995 | +++ src/PlacesStyle.cpp 2011-03-24 01:52:23 +0000 | |||
996 | @@ -40,6 +40,8 @@ | |||
997 | 40 | _dash_fullscreen_icon (NULL), | 40 | _dash_fullscreen_icon (NULL), |
998 | 41 | _search_ready_texture (NULL), | 41 | _search_ready_texture (NULL), |
999 | 42 | _search_clear_texture (NULL), | 42 | _search_clear_texture (NULL), |
1000 | 43 | _search_clear_alone_texture (NULL), | ||
1001 | 44 | _search_clear_spinner_texture (NULL), | ||
1002 | 43 | _group_unexpand_texture (NULL), | 45 | _group_unexpand_texture (NULL), |
1003 | 44 | _group_expand_texture (NULL) | 46 | _group_expand_texture (NULL) |
1004 | 45 | { | 47 | { |
1005 | @@ -65,6 +67,10 @@ | |||
1006 | 65 | _search_ready_texture->UnReference (); | 67 | _search_ready_texture->UnReference (); |
1007 | 66 | if (_search_clear_texture) | 68 | if (_search_clear_texture) |
1008 | 67 | _search_clear_texture->UnReference (); | 69 | _search_clear_texture->UnReference (); |
1009 | 70 | if (_search_clear_alone_texture) | ||
1010 | 71 | _search_clear_alone_texture->UnReference (); | ||
1011 | 72 | if (_search_clear_spinner_texture) | ||
1012 | 73 | _search_clear_spinner_texture->UnReference (); | ||
1013 | 68 | if (_group_unexpand_texture) | 74 | if (_group_unexpand_texture) |
1014 | 69 | _group_unexpand_texture->UnReference (); | 75 | _group_unexpand_texture->UnReference (); |
1015 | 70 | if (_group_expand_texture) | 76 | if (_group_expand_texture) |
1016 | @@ -186,6 +192,22 @@ | |||
1017 | 186 | } | 192 | } |
1018 | 187 | 193 | ||
1019 | 188 | nux::BaseTexture * | 194 | nux::BaseTexture * |
1020 | 195 | PlacesStyle::GetSearchClearAloneIcon () | ||
1021 | 196 | { | ||
1022 | 197 | if (!_search_clear_alone_texture) | ||
1023 | 198 | _search_clear_alone_texture = TextureFromFilename (PKGDATADIR"/search_clear_alone.png"); | ||
1024 | 199 | return _search_clear_alone_texture; | ||
1025 | 200 | } | ||
1026 | 201 | |||
1027 | 202 | nux::BaseTexture * | ||
1028 | 203 | PlacesStyle::GetSearchClearSpinnerIcon () | ||
1029 | 204 | { | ||
1030 | 205 | if (!_search_clear_spinner_texture) | ||
1031 | 206 | _search_clear_spinner_texture = TextureFromFilename (PKGDATADIR"/search_clear_spinner.png"); | ||
1032 | 207 | return _search_clear_spinner_texture; | ||
1033 | 208 | } | ||
1034 | 209 | |||
1035 | 210 | nux::BaseTexture * | ||
1036 | 189 | PlacesStyle::GetGroupUnexpandIcon () | 211 | PlacesStyle::GetGroupUnexpandIcon () |
1037 | 190 | { | 212 | { |
1038 | 191 | if (!_group_unexpand_texture) | 213 | if (!_group_unexpand_texture) |
1039 | 192 | 214 | ||
1040 | === modified file 'src/PlacesStyle.h' | |||
1041 | --- src/PlacesStyle.h 2011-02-28 15:56:44 +0000 | |||
1042 | +++ src/PlacesStyle.h 2011-03-24 01:52:23 +0000 | |||
1043 | @@ -52,6 +52,8 @@ | |||
1044 | 52 | 52 | ||
1045 | 53 | nux::BaseTexture * GetSearchReadyIcon (); | 53 | nux::BaseTexture * GetSearchReadyIcon (); |
1046 | 54 | nux::BaseTexture * GetSearchClearIcon (); | 54 | nux::BaseTexture * GetSearchClearIcon (); |
1047 | 55 | nux::BaseTexture * GetSearchClearAloneIcon (); | ||
1048 | 56 | nux::BaseTexture * GetSearchClearSpinnerIcon (); | ||
1049 | 55 | 57 | ||
1050 | 56 | nux::BaseTexture * GetGroupUnexpandIcon (); | 58 | nux::BaseTexture * GetGroupUnexpandIcon (); |
1051 | 57 | nux::BaseTexture * GetGroupExpandIcon (); | 59 | nux::BaseTexture * GetGroupExpandIcon (); |
1052 | @@ -80,6 +82,8 @@ | |||
1053 | 80 | 82 | ||
1054 | 81 | nux::BaseTexture *_search_ready_texture; | 83 | nux::BaseTexture *_search_ready_texture; |
1055 | 82 | nux::BaseTexture *_search_clear_texture; | 84 | nux::BaseTexture *_search_clear_texture; |
1056 | 85 | nux::BaseTexture *_search_clear_alone_texture; | ||
1057 | 86 | nux::BaseTexture *_search_clear_spinner_texture; | ||
1058 | 83 | 87 | ||
1059 | 84 | nux::BaseTexture *_group_unexpand_texture; | 88 | nux::BaseTexture *_group_unexpand_texture; |
1060 | 85 | nux::BaseTexture *_group_expand_texture; | 89 | nux::BaseTexture *_group_expand_texture; |
1061 | 86 | 90 | ||
1062 | === modified file 'src/PlacesView.cpp' | |||
1063 | --- src/PlacesView.cpp 2011-03-24 01:09:42 +0000 | |||
1064 | +++ src/PlacesView.cpp 2011-03-24 01:52:23 +0000 | |||
1065 | @@ -14,11 +14,13 @@ | |||
1066 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1067 | 15 | * | 15 | * |
1068 | 16 | * Authored by: Gordon Allott <gord.allott@canonical.com> | 16 | * Authored by: Gordon Allott <gord.allott@canonical.com> |
1069 | 17 | * Neil Jagdish Patel <neil.patel@canonical.com> | ||
1070 | 17 | */ | 18 | */ |
1071 | 18 | 19 | ||
1072 | 19 | #include "config.h" | 20 | #include "config.h" |
1073 | 20 | 21 | ||
1074 | 21 | #include "Nux/Nux.h" | 22 | #include "Nux/Nux.h" |
1075 | 23 | #include "Nux/ColorArea.h" | ||
1076 | 22 | #include "NuxGraphics/GLThread.h" | 24 | #include "NuxGraphics/GLThread.h" |
1077 | 23 | #include "UBusMessages.h" | 25 | #include "UBusMessages.h" |
1078 | 24 | 26 | ||
1079 | @@ -46,7 +48,9 @@ | |||
1080 | 46 | _target_height (1), | 48 | _target_height (1), |
1081 | 47 | _actual_height (1), | 49 | _actual_height (1), |
1082 | 48 | _resize_id (0), | 50 | _resize_id (0), |
1084 | 49 | _alt_f2_entry (NULL) | 51 | _alt_f2_entry (NULL), |
1085 | 52 | _searching_timeout (0), | ||
1086 | 53 | _pending_activation (false) | ||
1087 | 50 | { | 54 | { |
1088 | 51 | LoadPlaces (); | 55 | LoadPlaces (); |
1089 | 52 | _factory->place_added.connect (sigc::mem_fun (this, &PlacesView::OnPlaceAdded)); | 56 | _factory->place_added.connect (sigc::mem_fun (this, &PlacesView::OnPlaceAdded)); |
1090 | @@ -93,6 +97,9 @@ | |||
1091 | 93 | _layered_layout->AddLayer (_results_view); | 97 | _layered_layout->AddLayer (_results_view); |
1092 | 94 | _results_view->GetLayout ()->OnGeometryChanged.connect (sigc::mem_fun (this, &PlacesView::OnResultsViewGeometryChanged)); | 98 | _results_view->GetLayout ()->OnGeometryChanged.connect (sigc::mem_fun (this, &PlacesView::OnResultsViewGeometryChanged)); |
1093 | 95 | 99 | ||
1094 | 100 | _empty_view = new PlacesEmptyView (); | ||
1095 | 101 | _layered_layout->AddLayer (_empty_view); | ||
1096 | 102 | |||
1097 | 96 | _layered_layout->SetActiveLayer (_home_view); | 103 | _layered_layout->SetActiveLayer (_home_view); |
1098 | 97 | 104 | ||
1099 | 98 | SetLayout (_layout); | 105 | SetLayout (_layout); |
1100 | @@ -123,8 +130,6 @@ | |||
1101 | 123 | _icon_loader = IconLoader::GetDefault (); | 130 | _icon_loader = IconLoader::GetDefault (); |
1102 | 124 | 131 | ||
1103 | 125 | SetActiveEntry (_home_entry, 0, ""); | 132 | SetActiveEntry (_home_entry, 0, ""); |
1104 | 126 | |||
1105 | 127 | //_layout->SetFocused (true); | ||
1106 | 128 | } | 133 | } |
1107 | 129 | 134 | ||
1108 | 130 | PlacesView::~PlacesView () | 135 | PlacesView::~PlacesView () |
1109 | @@ -182,6 +187,7 @@ | |||
1110 | 182 | nux::Geometry geo_absolute = GetAbsoluteGeometry (); | 187 | nux::Geometry geo_absolute = GetAbsoluteGeometry (); |
1111 | 183 | PlacesSettings::DashBlurType type = PlacesSettings::GetDefault ()->GetDashBlurType (); | 188 | PlacesSettings::DashBlurType type = PlacesSettings::GetDefault ()->GetDashBlurType (); |
1112 | 184 | bool paint_blur = type != PlacesSettings::NO_BLUR; | 189 | bool paint_blur = type != PlacesSettings::NO_BLUR; |
1113 | 190 | nux::BaseTexture *corner = style->GetDashCorner (); | ||
1114 | 185 | 191 | ||
1115 | 186 | GfxContext.PushClippingRectangle (geo); | 192 | GfxContext.PushClippingRectangle (geo); |
1116 | 187 | 193 | ||
1117 | @@ -190,7 +196,6 @@ | |||
1118 | 190 | GfxContext.GetRenderStates ().SetBlend (true); | 196 | GfxContext.GetRenderStates ().SetBlend (true); |
1119 | 191 | GfxContext.GetRenderStates ().SetPremultipliedBlend (nux::SRC_OVER); | 197 | GfxContext.GetRenderStates ().SetPremultipliedBlend (nux::SRC_OVER); |
1120 | 192 | 198 | ||
1121 | 193 | geo.height = _actual_height; | ||
1122 | 194 | _bg_blur_geo = geo; | 199 | _bg_blur_geo = geo; |
1123 | 195 | 200 | ||
1124 | 196 | if ((_size_mode == SIZE_MODE_HOVER)) | 201 | if ((_size_mode == SIZE_MODE_HOVER)) |
1125 | @@ -237,17 +242,25 @@ | |||
1126 | 237 | rop.SrcBlend = GL_ONE; | 242 | rop.SrcBlend = GL_ONE; |
1127 | 238 | rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; | 243 | rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; |
1128 | 239 | 244 | ||
1129 | 245 | nux::Geometry bg_clip = geo; | ||
1130 | 246 | bg_clip.width -= corner->GetWidth (); | ||
1131 | 247 | bg_clip.height = _actual_height - corner->GetHeight (); | ||
1132 | 248 | |||
1133 | 249 | GfxContext.PushClippingRectangle (bg_clip); | ||
1134 | 250 | |||
1135 | 240 | gPainter.PushDrawTextureLayer (GfxContext, _bg_blur_geo, | 251 | gPainter.PushDrawTextureLayer (GfxContext, _bg_blur_geo, |
1136 | 241 | _bg_blur_texture, | 252 | _bg_blur_texture, |
1137 | 242 | texxform_blur__bg, | 253 | texxform_blur__bg, |
1138 | 243 | nux::Color::White, | 254 | nux::Color::White, |
1139 | 244 | true, | 255 | true, |
1140 | 245 | rop); | 256 | rop); |
1141 | 257 | |||
1142 | 258 | GfxContext.PopClippingRectangle (); | ||
1143 | 246 | } | 259 | } |
1144 | 260 | geo.height = _actual_height; | ||
1145 | 247 | 261 | ||
1146 | 248 | if (_size_mode == SIZE_MODE_HOVER) | 262 | if (_size_mode == SIZE_MODE_HOVER) |
1147 | 249 | { | 263 | { |
1148 | 250 | nux::BaseTexture *corner = style->GetDashCorner (); | ||
1149 | 251 | nux::BaseTexture *bottom = style->GetDashBottomTile (); | 264 | nux::BaseTexture *bottom = style->GetDashBottomTile (); |
1150 | 252 | nux::BaseTexture *right = style->GetDashRightTile (); | 265 | nux::BaseTexture *right = style->GetDashRightTile (); |
1151 | 253 | nux::BaseTexture *icon = style->GetDashFullscreenIcon (); | 266 | nux::BaseTexture *icon = style->GetDashFullscreenIcon (); |
1152 | @@ -412,8 +425,11 @@ | |||
1153 | 412 | _group_added_conn.disconnect (); | 425 | _group_added_conn.disconnect (); |
1154 | 413 | _result_added_conn.disconnect (); | 426 | _result_added_conn.disconnect (); |
1155 | 414 | _result_removed_conn.disconnect (); | 427 | _result_removed_conn.disconnect (); |
1156 | 428 | _search_finished_conn.disconnect (); | ||
1157 | 415 | 429 | ||
1158 | 416 | _results_controller->Clear (); | 430 | _results_controller->Clear (); |
1159 | 431 | |||
1160 | 432 | _n_results = 0; | ||
1161 | 417 | } | 433 | } |
1162 | 418 | 434 | ||
1163 | 419 | _entry = entry; | 435 | _entry = entry; |
1164 | @@ -427,6 +443,7 @@ | |||
1165 | 427 | _group_added_conn = _entry->group_added.connect (sigc::mem_fun (this, &PlacesView::OnGroupAdded)); | 443 | _group_added_conn = _entry->group_added.connect (sigc::mem_fun (this, &PlacesView::OnGroupAdded)); |
1166 | 428 | _result_added_conn = _entry->result_added.connect (sigc::mem_fun (this, &PlacesView::OnResultAdded)); | 444 | _result_added_conn = _entry->result_added.connect (sigc::mem_fun (this, &PlacesView::OnResultAdded)); |
1167 | 429 | _result_removed_conn = _entry->result_removed.connect (sigc::mem_fun (this, &PlacesView::OnResultRemoved)); | 445 | _result_removed_conn = _entry->result_removed.connect (sigc::mem_fun (this, &PlacesView::OnResultRemoved)); |
1168 | 446 | _search_finished_conn = _entry->search_finished.connect (sigc::mem_fun (this, &PlacesView::OnSearchFinished)); | ||
1169 | 430 | 447 | ||
1170 | 431 | if (_entry == _home_entry && (g_strcmp0 (search_string, "") == 0)) | 448 | if (_entry == _home_entry && (g_strcmp0 (search_string, "") == 0)) |
1171 | 432 | _layered_layout->SetActiveLayer (_home_view); | 449 | _layered_layout->SetActiveLayer (_home_view); |
1172 | @@ -586,12 +603,32 @@ | |||
1173 | 586 | void | 603 | void |
1174 | 587 | PlacesView::OnResultAdded (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result) | 604 | PlacesView::OnResultAdded (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result) |
1175 | 588 | { | 605 | { |
1176 | 606 | _n_results++; | ||
1177 | 607 | |||
1178 | 608 | if (_n_results <= 2 | ||
1179 | 609 | && (g_strcmp0 (group.GetRenderer (), "UnityEmptySearchRenderer") == 0 | ||
1180 | 610 | || g_strcmp0 (group.GetRenderer (), "UnityEmptySectionRenderer") == 0)) | ||
1181 | 611 | { | ||
1182 | 612 | if (_n_results == 1) | ||
1183 | 613 | _empty_view->SetText (result.GetName ()); | ||
1184 | 614 | _layered_layout->SetActiveLayerN (2); | ||
1185 | 615 | } | ||
1186 | 616 | |||
1187 | 589 | _results_controller->AddResult (entry, group, result); | 617 | _results_controller->AddResult (entry, group, result); |
1188 | 590 | } | 618 | } |
1189 | 591 | 619 | ||
1190 | 592 | void | 620 | void |
1191 | 593 | PlacesView::OnResultRemoved (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result) | 621 | PlacesView::OnResultRemoved (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result) |
1192 | 594 | { | 622 | { |
1193 | 623 | _n_results--; | ||
1194 | 624 | |||
1195 | 625 | if (_n_results <= 1 | ||
1196 | 626 | && (g_strcmp0 (group.GetRenderer (), "UnityEmptySearchRenderer") == 0 | ||
1197 | 627 | || g_strcmp0 (group.GetRenderer (), "UnityEmptySectionRenderer") == 0)) | ||
1198 | 628 | { | ||
1199 | 629 | _layered_layout->SetActiveLayerN (1); | ||
1200 | 630 | } | ||
1201 | 631 | |||
1202 | 595 | _results_controller->RemoveResult (entry, group, result); | 632 | _results_controller->RemoveResult (entry, group, result); |
1203 | 596 | } | 633 | } |
1204 | 597 | 634 | ||
1205 | @@ -694,6 +731,26 @@ | |||
1206 | 694 | _layered_layout->QueueDraw (); | 731 | _layered_layout->QueueDraw (); |
1207 | 695 | QueueDraw (); | 732 | QueueDraw (); |
1208 | 696 | } | 733 | } |
1209 | 734 | |||
1210 | 735 | if (_searching_timeout) | ||
1211 | 736 | g_source_remove (_searching_timeout); | ||
1212 | 737 | _searching_timeout = 0; | ||
1213 | 738 | |||
1214 | 739 | if (g_strcmp0 (search_string, "")) | ||
1215 | 740 | { | ||
1216 | 741 | _searching_timeout = g_timeout_add (5000, (GSourceFunc)PlacesView::OnSearchTimedOut, this); | ||
1217 | 742 | } | ||
1218 | 743 | } | ||
1219 | 744 | |||
1220 | 745 | gboolean | ||
1221 | 746 | PlacesView::OnSearchTimedOut (PlacesView *view) | ||
1222 | 747 | { | ||
1223 | 748 | std::map <const char *, const char *> hints; | ||
1224 | 749 | |||
1225 | 750 | view->_searching_timeout = 0; | ||
1226 | 751 | view->OnSearchFinished ( "", 0, hints); | ||
1227 | 752 | |||
1228 | 753 | return FALSE; | ||
1229 | 697 | } | 754 | } |
1230 | 698 | 755 | ||
1231 | 699 | // | 756 | // |
1232 | @@ -759,8 +816,17 @@ | |||
1233 | 759 | void | 816 | void |
1234 | 760 | PlacesView::OnEntryActivated () | 817 | PlacesView::OnEntryActivated () |
1235 | 761 | { | 818 | { |
1238 | 762 | if (!_results_controller->ActivateFirst ()) | 819 | if (_searching_timeout && !_pending_activation) |
1239 | 763 | g_debug ("Cannot activate anything"); | 820 | { |
1240 | 821 | _pending_activation = true; | ||
1241 | 822 | } | ||
1242 | 823 | else | ||
1243 | 824 | { | ||
1244 | 825 | if (!_results_controller->ActivateFirst ()) | ||
1245 | 826 | g_debug ("Cannot activate anything"); | ||
1246 | 827 | |||
1247 | 828 | _pending_activation = false; | ||
1248 | 829 | } | ||
1249 | 764 | } | 830 | } |
1250 | 765 | 831 | ||
1251 | 766 | void | 832 | void |
1252 | @@ -818,6 +884,25 @@ | |||
1253 | 818 | OnResultsViewGeometryChanged (_results_view, geo); | 884 | OnResultsViewGeometryChanged (_results_view, geo); |
1254 | 819 | } | 885 | } |
1255 | 820 | 886 | ||
1256 | 887 | void | ||
1257 | 888 | PlacesView::OnSearchFinished (const char *search_string, | ||
1258 | 889 | guint32 section_id, | ||
1259 | 890 | std::map<const char *, const char *>& hints) | ||
1260 | 891 | { | ||
1261 | 892 | if (_pending_activation) | ||
1262 | 893 | { | ||
1263 | 894 | if (!_results_controller->ActivateFirst ()) | ||
1264 | 895 | g_debug ("Cannot activate anything"); | ||
1265 | 896 | } | ||
1266 | 897 | _pending_activation = false; | ||
1267 | 898 | |||
1268 | 899 | if (_searching_timeout) | ||
1269 | 900 | g_source_remove (_searching_timeout); | ||
1270 | 901 | _searching_timeout = 0; | ||
1271 | 902 | |||
1272 | 903 | _search_bar->OnSearchFinished (); | ||
1273 | 904 | } | ||
1274 | 905 | |||
1275 | 821 | // | 906 | // |
1276 | 822 | // Introspection | 907 | // Introspection |
1277 | 823 | // | 908 | // |
1278 | 824 | 909 | ||
1279 | === modified file 'src/PlacesView.h' | |||
1280 | --- src/PlacesView.h 2011-03-13 14:52:14 +0000 | |||
1281 | +++ src/PlacesView.h 2011-03-24 01:52:23 +0000 | |||
1282 | @@ -14,6 +14,7 @@ | |||
1283 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1284 | 15 | * | 15 | * |
1285 | 16 | * Authored by: Gordon Allott <gord.allott@canonical.com> | 16 | * Authored by: Gordon Allott <gord.allott@canonical.com> |
1286 | 17 | * Neil Jagdish Patel <neil.patel@canonical.com> | ||
1287 | 17 | */ | 18 | */ |
1288 | 18 | 19 | ||
1289 | 19 | #ifndef PLACES_VIEW_H | 20 | #ifndef PLACES_VIEW_H |
1290 | @@ -36,6 +37,7 @@ | |||
1291 | 36 | 37 | ||
1292 | 37 | #include "PlacesSearchBar.h" | 38 | #include "PlacesSearchBar.h" |
1293 | 38 | #include "PlacesHomeView.h" | 39 | #include "PlacesHomeView.h" |
1294 | 40 | #include "PlacesEmptyView.h" | ||
1295 | 39 | 41 | ||
1296 | 40 | #include "PlacesResultsController.h" | 42 | #include "PlacesResultsController.h" |
1297 | 41 | #include "PlacesResultsView.h" | 43 | #include "PlacesResultsView.h" |
1298 | @@ -121,17 +123,25 @@ | |||
1299 | 121 | 123 | ||
1300 | 122 | static gboolean OnResizeFrame (PlacesView *self); | 124 | static gboolean OnResizeFrame (PlacesView *self); |
1301 | 123 | 125 | ||
1302 | 126 | void OnSearchFinished (const char *search_string, | ||
1303 | 127 | guint32 section_id, | ||
1304 | 128 | std::map<const char *, const char *>& hints); | ||
1305 | 129 | |||
1306 | 130 | static gboolean OnSearchTimedOut (PlacesView *view); | ||
1307 | 131 | |||
1308 | 124 | private: | 132 | private: |
1309 | 125 | PlaceFactory *_factory; | 133 | PlaceFactory *_factory; |
1310 | 126 | nux::HLayout *_layout; | 134 | nux::HLayout *_layout; |
1311 | 127 | nux::LayeredLayout *_layered_layout; | 135 | nux::LayeredLayout *_layered_layout; |
1312 | 128 | PlacesSearchBar *_search_bar; | 136 | PlacesSearchBar *_search_bar; |
1313 | 129 | PlacesHomeView *_home_view; | 137 | PlacesHomeView *_home_view; |
1314 | 138 | PlacesEmptyView *_empty_view; | ||
1315 | 130 | PlaceEntryHome *_home_entry; | 139 | PlaceEntryHome *_home_entry; |
1316 | 131 | PlaceEntry *_entry; | 140 | PlaceEntry *_entry; |
1317 | 132 | sigc::connection _group_added_conn; | 141 | sigc::connection _group_added_conn; |
1318 | 133 | sigc::connection _result_added_conn; | 142 | sigc::connection _result_added_conn; |
1319 | 134 | sigc::connection _result_removed_conn; | 143 | sigc::connection _result_removed_conn; |
1320 | 144 | sigc::connection _search_finished_conn; | ||
1321 | 135 | 145 | ||
1322 | 136 | PlacesResultsController *_results_controller; | 146 | PlacesResultsController *_results_controller; |
1323 | 137 | PlacesResultsView *_results_view; | 147 | PlacesResultsView *_results_view; |
1324 | @@ -154,6 +164,10 @@ | |||
1325 | 154 | gint64 _resize_start_time; | 164 | gint64 _resize_start_time; |
1326 | 155 | 165 | ||
1327 | 156 | PlaceEntry *_alt_f2_entry; | 166 | PlaceEntry *_alt_f2_entry; |
1328 | 167 | |||
1329 | 168 | guint _n_results; | ||
1330 | 169 | guint _searching_timeout; | ||
1331 | 170 | bool _pending_activation; | ||
1332 | 157 | }; | 171 | }; |
1333 | 158 | 172 | ||
1334 | 159 | #endif // PANEL_HOME_BUTTON_H | 173 | #endif // PANEL_HOME_BUTTON_H |
1335 | 160 | 174 | ||
1336 | === modified file 'src/StaticCairoText.cpp' | |||
1337 | --- src/StaticCairoText.cpp 2011-03-21 10:20:57 +0000 | |||
1338 | +++ src/StaticCairoText.cpp 2011-03-24 01:52:23 +0000 | |||
1339 | @@ -49,6 +49,7 @@ | |||
1340 | 49 | SetMinimumSize (1, 1); | 49 | SetMinimumSize (1, 1); |
1341 | 50 | _ellipsize = NUX_ELLIPSIZE_END; | 50 | _ellipsize = NUX_ELLIPSIZE_END; |
1342 | 51 | _align = NUX_ALIGN_LEFT; | 51 | _align = NUX_ALIGN_LEFT; |
1343 | 52 | _valign = NUX_ALIGN_TOP; | ||
1344 | 52 | _fontstring = NULL; | 53 | _fontstring = NULL; |
1345 | 53 | SetCanFocus (false); | 54 | SetCanFocus (false); |
1346 | 54 | } | 55 | } |
1347 | @@ -80,6 +81,13 @@ | |||
1348 | 80 | NeedRedraw (); | 81 | NeedRedraw (); |
1349 | 81 | } | 82 | } |
1350 | 82 | 83 | ||
1351 | 84 | void | ||
1352 | 85 | StaticCairoText::SetTextVerticalAlignment (AlignState state) | ||
1353 | 86 | { | ||
1354 | 87 | _valign = state; | ||
1355 | 88 | QueueDraw (); | ||
1356 | 89 | } | ||
1357 | 90 | |||
1358 | 83 | void StaticCairoText::PreLayoutManagement () | 91 | void StaticCairoText::PreLayoutManagement () |
1359 | 84 | { | 92 | { |
1360 | 85 | int textWidth = 0; | 93 | int textWidth = 0; |
1361 | @@ -169,10 +177,10 @@ | |||
1362 | 169 | Color col = Color::Black; | 177 | Color col = Color::Black; |
1363 | 170 | col.SetAlpha (0.0f); | 178 | col.SetAlpha (0.0f); |
1364 | 171 | gfxContext.QRP_Color (base.x, | 179 | gfxContext.QRP_Color (base.x, |
1369 | 172 | base.y, | 180 | base.y, |
1370 | 173 | base.width, | 181 | base.width, |
1371 | 174 | base.height, | 182 | base.height, |
1372 | 175 | col); | 183 | col); |
1373 | 176 | 184 | ||
1374 | 177 | gfxContext.QRP_1Tex (base.x, | 185 | gfxContext.QRP_1Tex (base.x, |
1375 | 178 | base.y + ((base.height - _cached_extent_height)/2), | 186 | base.y + ((base.height - _cached_extent_height)/2), |
1376 | 179 | 187 | ||
1377 | === modified file 'src/StaticCairoText.h' | |||
1378 | --- src/StaticCairoText.h 2011-03-10 12:42:07 +0000 | |||
1379 | +++ src/StaticCairoText.h 2011-03-24 01:52:23 +0000 | |||
1380 | @@ -54,6 +54,8 @@ | |||
1381 | 54 | NUX_ALIGN_LEFT, | 54 | NUX_ALIGN_LEFT, |
1382 | 55 | NUX_ALIGN_CENTRE, | 55 | NUX_ALIGN_CENTRE, |
1383 | 56 | NUX_ALIGN_RIGHT, | 56 | NUX_ALIGN_RIGHT, |
1384 | 57 | NUX_ALIGN_TOP = NUX_ALIGN_LEFT, | ||
1385 | 58 | NUX_ALIGN_BOTTOM = NUX_ALIGN_RIGHT | ||
1386 | 57 | } AlignState; | 59 | } AlignState; |
1387 | 58 | 60 | ||
1388 | 59 | StaticCairoText (const TCHAR* text, NUX_FILE_LINE_PROTO); | 61 | StaticCairoText (const TCHAR* text, NUX_FILE_LINE_PROTO); |
1389 | @@ -82,6 +84,7 @@ | |||
1390 | 82 | void SetTextColor (Color textColor); | 84 | void SetTextColor (Color textColor); |
1391 | 83 | void SetTextEllipsize (EllipsizeState state); | 85 | void SetTextEllipsize (EllipsizeState state); |
1392 | 84 | void SetTextAlignment (AlignState state); | 86 | void SetTextAlignment (AlignState state); |
1393 | 87 | void SetTextVerticalAlignment (AlignState state); | ||
1394 | 85 | void SetFont (const char *fontstring); | 88 | void SetFont (const char *fontstring); |
1395 | 86 | 89 | ||
1396 | 87 | void GetTextExtents (int &width, int &height); | 90 | void GetTextExtents (int &width, int &height); |
1397 | @@ -99,6 +102,7 @@ | |||
1398 | 99 | Color _textColor; | 102 | Color _textColor; |
1399 | 100 | EllipsizeState _ellipsize; | 103 | EllipsizeState _ellipsize; |
1400 | 101 | AlignState _align; | 104 | AlignState _align; |
1401 | 105 | AlignState _valign; | ||
1402 | 102 | char* _fontstring; | 106 | char* _fontstring; |
1403 | 103 | 107 | ||
1404 | 104 | CairoGraphics* _cairoGraphics; | 108 | CairoGraphics* _cairoGraphics; |
1405 | 105 | 109 | ||
1406 | === modified file 'tests/CMakeLists.txt' | |||
1407 | --- tests/CMakeLists.txt 2011-03-24 00:35:26 +0000 | |||
1408 | +++ tests/CMakeLists.txt 2011-03-24 01:52:23 +0000 | |||
1409 | @@ -153,10 +153,19 @@ | |||
1410 | 153 | add_executable (test-places | 153 | add_executable (test-places |
1411 | 154 | TestPlaces.cpp | 154 | TestPlaces.cpp |
1412 | 155 | ${PLACES_COMMON_SOURCE} | 155 | ${PLACES_COMMON_SOURCE} |
1413 | 156 | <<<<<<< TREE | ||
1414 | 157 | ======= | ||
1415 | 158 | ../src/PlacesController.cpp | ||
1416 | 159 | ../src/PlacesController.h | ||
1417 | 160 | ../src/PlacesEmptyView.cpp | ||
1418 | 161 | ../src/PlacesEmptyView.h | ||
1419 | 162 | >>>>>>> MERGE-SOURCE | ||
1420 | 156 | ../src/PlacesHomeView.cpp | 163 | ../src/PlacesHomeView.cpp |
1421 | 157 | ../src/PlacesHomeView.h | 164 | ../src/PlacesHomeView.h |
1422 | 158 | ../src/PlacesSearchBar.cpp | 165 | ../src/PlacesSearchBar.cpp |
1423 | 159 | ../src/PlacesSearchBar.h | 166 | ../src/PlacesSearchBar.h |
1424 | 167 | ../src/PlacesSearchBarSpinner.cpp | ||
1425 | 168 | ../src/PlacesSearchBarSpinner.h | ||
1426 | 160 | ../src/PlacesResultsController.cpp | 169 | ../src/PlacesResultsController.cpp |
1427 | 161 | ../src/PlacesResultsController.h | 170 | ../src/PlacesResultsController.h |
1428 | 162 | ../src/PlacesResultsView.h | 171 | ../src/PlacesResultsView.h |
Approved