Merge lp:~unity-team/unity/fixes-2011-04-11 into lp:unity
- fixes-2011-04-11
- Merge into trunk
Proposed by
Neil J. Patel
Status: | Merged | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 1105 | ||||||||||||||||||||
Proposed branch: | lp:~unity-team/unity/fixes-2011-04-11 | ||||||||||||||||||||
Merge into: | lp:unity | ||||||||||||||||||||
Diff against target: |
1011 lines (+315/-196) 18 files modified
services/panel-service.c (+39/-35) src/IndicatorObjectFactoryRemote.cpp (+46/-17) src/IndicatorObjectFactoryRemote.h (+26/-1) src/PanelMenuView.cpp (+8/-5) src/PanelMenuView.h (+3/-0) src/PlacesGroupController.cpp (+2/-1) src/PlacesSearchBar.cpp (+1/-1) src/PlacesSearchBarSpinner.cpp (+72/-42) src/PlacesSearchBarSpinner.h (+5/-4) src/PlacesSimpleTile.cpp (+2/-7) src/PlacesStyle.cpp (+50/-41) src/PlacesStyle.h (+10/-8) src/PlacesView.cpp (+10/-2) src/PlacesView.h (+2/-0) src/QuicklistView.cpp (+9/-4) src/StaticCairoText.cpp (+1/-1) src/UScreen.cpp (+7/-0) tests/TestPlacesBackend.cpp (+22/-27) |
||||||||||||||||||||
To merge this branch: | bzr merge lp:~unity-team/unity/fixes-2011-04-11 | ||||||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jason Smith (community) | Approve | ||
Review via email: mp+57092@code.launchpad.net |
Commit message
Description of the change
Bugs attached, there are some other changes too, largest being the spinner (which isn't really a large change)
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 | === removed file 'resources/search_clear_alone.png' | |||
2 | 0 | Binary files resources/search_clear_alone.png 2011-03-23 22:33:25 +0000 and resources/search_clear_alone.png 1970-01-01 00:00:00 +0000 differ | 0 | Binary files resources/search_clear_alone.png 2011-03-23 22:33:25 +0000 and resources/search_clear_alone.png 1970-01-01 00:00:00 +0000 differ |
3 | === removed file 'resources/search_clear_icon.png' | |||
4 | 1 | Binary files resources/search_clear_icon.png 2011-02-28 11:24:48 +0000 and resources/search_clear_icon.png 1970-01-01 00:00:00 +0000 differ | 1 | Binary files resources/search_clear_icon.png 2011-02-28 11:24:48 +0000 and resources/search_clear_icon.png 1970-01-01 00:00:00 +0000 differ |
5 | === removed file 'resources/search_clear_spinner.png' | |||
6 | 2 | Binary files resources/search_clear_spinner.png 2011-03-23 23:18:03 +0000 and resources/search_clear_spinner.png 1970-01-01 00:00:00 +0000 differ | 2 | Binary files resources/search_clear_spinner.png 2011-03-23 23:18:03 +0000 and resources/search_clear_spinner.png 1970-01-01 00:00:00 +0000 differ |
7 | === added file 'resources/search_close.png' | |||
8 | 3 | Binary files resources/search_close.png 1970-01-01 00:00:00 +0000 and resources/search_close.png 2011-04-10 23:52:24 +0000 differ | 3 | Binary files resources/search_close.png 1970-01-01 00:00:00 +0000 and resources/search_close.png 2011-04-10 23:52:24 +0000 differ |
9 | === added file 'resources/search_close_glow.png' | |||
10 | 4 | Binary files resources/search_close_glow.png 1970-01-01 00:00:00 +0000 and resources/search_close_glow.png 2011-04-10 23:52:24 +0000 differ | 4 | Binary files resources/search_close_glow.png 1970-01-01 00:00:00 +0000 and resources/search_close_glow.png 2011-04-10 23:52:24 +0000 differ |
11 | === added file 'resources/search_magnify.png' | |||
12 | 5 | Binary files resources/search_magnify.png 1970-01-01 00:00:00 +0000 and resources/search_magnify.png 2011-04-10 23:52:24 +0000 differ | 5 | Binary files resources/search_magnify.png 1970-01-01 00:00:00 +0000 and resources/search_magnify.png 2011-04-10 23:52:24 +0000 differ |
13 | === removed file 'resources/search_ready_icon.png' | |||
14 | 6 | Binary files resources/search_ready_icon.png 2011-02-28 11:24:48 +0000 and resources/search_ready_icon.png 1970-01-01 00:00:00 +0000 differ | 6 | Binary files resources/search_ready_icon.png 2011-02-28 11:24:48 +0000 and resources/search_ready_icon.png 1970-01-01 00:00:00 +0000 differ |
15 | === added file 'resources/search_spin.png' | |||
16 | 7 | Binary files resources/search_spin.png 1970-01-01 00:00:00 +0000 and resources/search_spin.png 2011-04-10 23:52:24 +0000 differ | 7 | Binary files resources/search_spin.png 1970-01-01 00:00:00 +0000 and resources/search_spin.png 2011-04-10 23:52:24 +0000 differ |
17 | === added file 'resources/search_spin_glow.png' | |||
18 | 8 | Binary files resources/search_spin_glow.png 1970-01-01 00:00:00 +0000 and resources/search_spin_glow.png 2011-04-10 23:52:24 +0000 differ | 8 | Binary files resources/search_spin_glow.png 1970-01-01 00:00:00 +0000 and resources/search_spin_glow.png 2011-04-10 23:52:24 +0000 differ |
19 | === modified file 'services/panel-service.c' | |||
20 | --- services/panel-service.c 2011-04-05 14:09:03 +0000 | |||
21 | +++ services/panel-service.c 2011-04-10 23:52:24 +0000 | |||
22 | @@ -1,4 +1,4 @@ | |||
24 | 1 | /* | 1 | /* |
25 | 2 | * Copyright (C) 2010 Canonical Ltd | 2 | * Copyright (C) 2010 Canonical Ltd |
26 | 3 | * | 3 | * |
27 | 4 | * This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
28 | @@ -186,14 +186,14 @@ | |||
29 | 186 | G_TYPE_NONE, 1, G_TYPE_STRING); | 186 | G_TYPE_NONE, 1, G_TYPE_STRING); |
30 | 187 | _service_signals[GEOMETRIES_CHANGED] = | 187 | _service_signals[GEOMETRIES_CHANGED] = |
31 | 188 | g_signal_new ("geometries-changed", | 188 | g_signal_new ("geometries-changed", |
40 | 189 | G_OBJECT_CLASS_TYPE (obj_class), | 189 | G_OBJECT_CLASS_TYPE (obj_class), |
41 | 190 | G_SIGNAL_RUN_LAST, | 190 | G_SIGNAL_RUN_LAST, |
42 | 191 | 0, | 191 | 0, |
43 | 192 | NULL, NULL, | 192 | NULL, NULL, |
44 | 193 | panel_marshal_VOID__OBJECT_POINTER_INT_INT_INT_INT, | 193 | panel_marshal_VOID__OBJECT_POINTER_INT_INT_INT_INT, |
45 | 194 | G_TYPE_NONE, 6, | 194 | G_TYPE_NONE, 6, |
46 | 195 | G_TYPE_OBJECT, G_TYPE_POINTER, | 195 | G_TYPE_OBJECT, G_TYPE_POINTER, |
47 | 196 | G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); | 196 | G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); |
48 | 197 | 197 | ||
49 | 198 | _service_signals[ENTRY_SHOW_NOW_CHANGED] = | 198 | _service_signals[ENTRY_SHOW_NOW_CHANGED] = |
50 | 199 | g_signal_new ("entry-show-now-changed", | 199 | g_signal_new ("entry-show-now-changed", |
51 | @@ -569,10 +569,10 @@ | |||
52 | 569 | } | 569 | } |
53 | 570 | 570 | ||
54 | 571 | static const gchar * indicator_environment[] = { | 571 | static const gchar * indicator_environment[] = { |
59 | 572 | "unity", | 572 | "unity", |
60 | 573 | "unity-3d", | 573 | "unity-3d", |
61 | 574 | "unity-panel-service", | 574 | "unity-panel-service", |
62 | 575 | NULL | 575 | NULL |
63 | 576 | }; | 576 | }; |
64 | 577 | 577 | ||
65 | 578 | static void | 578 | static void |
66 | @@ -657,16 +657,16 @@ | |||
67 | 657 | static gint | 657 | static gint |
68 | 658 | name2order (const gchar * name) | 658 | name2order (const gchar * name) |
69 | 659 | { | 659 | { |
71 | 660 | int i; | 660 | int i; |
72 | 661 | 661 | ||
74 | 662 | for (i = 0; indicator_order[i] != NULL; i++) | 662 | for (i = 0; indicator_order[i] != NULL; i++) |
75 | 663 | { | 663 | { |
77 | 664 | if (g_strcmp0(name, indicator_order[i]) == 0) | 664 | if (g_strcmp0(name, indicator_order[i]) == 0) |
78 | 665 | { | 665 | { |
83 | 666 | return i; | 666 | return i; |
84 | 667 | } | 667 | } |
85 | 668 | } | 668 | } |
86 | 669 | return -1; | 669 | return -1; |
87 | 670 | } | 670 | } |
88 | 671 | 671 | ||
89 | 672 | static int | 672 | static int |
90 | @@ -915,12 +915,12 @@ | |||
91 | 915 | 915 | ||
92 | 916 | void | 916 | void |
93 | 917 | panel_service_sync_geometry (PanelService *self, | 917 | panel_service_sync_geometry (PanelService *self, |
100 | 918 | const gchar *indicator_id, | 918 | const gchar *indicator_id, |
101 | 919 | const gchar *entry_id, | 919 | const gchar *entry_id, |
102 | 920 | gint x, | 920 | gint x, |
103 | 921 | gint y, | 921 | gint y, |
104 | 922 | gint width, | 922 | gint width, |
105 | 923 | gint height) | 923 | gint height) |
106 | 924 | { | 924 | { |
107 | 925 | PanelServicePrivate *priv = self->priv; | 925 | PanelServicePrivate *priv = self->priv; |
108 | 926 | IndicatorObjectEntry *entry = g_hash_table_lookup (priv->id2entry_hash, entry_id); | 926 | IndicatorObjectEntry *entry = g_hash_table_lookup (priv->id2entry_hash, entry_id); |
109 | @@ -940,13 +940,13 @@ | |||
110 | 940 | if (GTK_IS_LABEL (entry->label)) | 940 | if (GTK_IS_LABEL (entry->label)) |
111 | 941 | { | 941 | { |
112 | 942 | label_ok = gtk_widget_get_visible (GTK_WIDGET (entry->label)) | 942 | label_ok = gtk_widget_get_visible (GTK_WIDGET (entry->label)) |
114 | 943 | && gtk_widget_is_sensitive (GTK_WIDGET (entry->label)); | 943 | && gtk_widget_is_sensitive (GTK_WIDGET (entry->label)); |
115 | 944 | } | 944 | } |
116 | 945 | 945 | ||
117 | 946 | if (GTK_IS_IMAGE (entry->image)) | 946 | if (GTK_IS_IMAGE (entry->image)) |
118 | 947 | { | 947 | { |
119 | 948 | image_ok = gtk_widget_get_visible (GTK_WIDGET (entry->image)) | 948 | image_ok = gtk_widget_get_visible (GTK_WIDGET (entry->image)) |
121 | 949 | && gtk_widget_is_sensitive (GTK_WIDGET (entry->image)); | 949 | && gtk_widget_is_sensitive (GTK_WIDGET (entry->image)); |
122 | 950 | } | 950 | } |
123 | 951 | 951 | ||
124 | 952 | return !label_ok && !image_ok; | 952 | return !label_ok && !image_ok; |
125 | @@ -996,6 +996,8 @@ | |||
126 | 996 | new_object = g_slist_nth_data (indicators, new_object_index); | 996 | new_object = g_slist_nth_data (indicators, new_object_index); |
127 | 997 | } | 997 | } |
128 | 998 | 998 | ||
129 | 999 | if (!INDICATOR_IS_OBJECT (new_object)) | ||
130 | 1000 | return; | ||
131 | 999 | new_entries = indicator_object_get_entries (new_object); | 1001 | new_entries = indicator_object_get_entries (new_object); |
132 | 1000 | // if the indicator has no entries, move to the next/prev one until we find one with entries | 1002 | // if the indicator has no entries, move to the next/prev one until we find one with entries |
133 | 1001 | while (new_entries == NULL) | 1003 | while (new_entries == NULL) |
134 | @@ -1003,8 +1005,10 @@ | |||
135 | 1003 | gint cur_object_index = g_slist_index (indicators, new_object); | 1005 | gint cur_object_index = g_slist_index (indicators, new_object); |
136 | 1004 | gint new_object_index = cur_object_index + (direction == GTK_MENU_DIR_CHILD ? 1 : -1); | 1006 | gint new_object_index = cur_object_index + (direction == GTK_MENU_DIR_CHILD ? 1 : -1); |
137 | 1005 | new_object = g_slist_nth_data (indicators, new_object_index); | 1007 | new_object = g_slist_nth_data (indicators, new_object_index); |
138 | 1008 | if (!INDICATOR_IS_OBJECT (new_object)) | ||
139 | 1009 | return; | ||
140 | 1006 | new_entries = indicator_object_get_entries (new_object); | 1010 | new_entries = indicator_object_get_entries (new_object); |
142 | 1007 | } | 1011 | } |
143 | 1008 | 1012 | ||
144 | 1009 | new_entry = g_list_nth_data (new_entries, direction == GTK_MENU_DIR_PARENT ? g_list_length (new_entries) - 1 : 0); | 1013 | new_entry = g_list_nth_data (new_entries, direction == GTK_MENU_DIR_PARENT ? g_list_length (new_entries) - 1 : 0); |
145 | 1010 | 1014 | ||
146 | @@ -1013,9 +1017,9 @@ | |||
147 | 1013 | 1017 | ||
148 | 1014 | if (should_skip_menu (new_entry)) | 1018 | if (should_skip_menu (new_entry)) |
149 | 1015 | { | 1019 | { |
153 | 1016 | activate_next_prev_menu (self, new_object, new_entry, direction); | 1020 | activate_next_prev_menu (self, new_object, new_entry, direction); |
154 | 1017 | return; | 1021 | return; |
155 | 1018 | } | 1022 | } |
156 | 1019 | } | 1023 | } |
157 | 1020 | // changing within a group of indicators (for example, entries within appmenu) | 1024 | // changing within a group of indicators (for example, entries within appmenu) |
158 | 1021 | else | 1025 | else |
159 | @@ -1025,9 +1029,9 @@ | |||
160 | 1025 | 1029 | ||
161 | 1026 | if (should_skip_menu (new_entry)) | 1030 | if (should_skip_menu (new_entry)) |
162 | 1027 | { | 1031 | { |
166 | 1028 | activate_next_prev_menu (self, object, new_entry, direction); | 1032 | activate_next_prev_menu (self, object, new_entry, direction); |
167 | 1029 | return; | 1033 | return; |
168 | 1030 | } | 1034 | } |
169 | 1031 | } | 1035 | } |
170 | 1032 | 1036 | ||
171 | 1033 | id = g_strdup_printf ("%p", new_entry); | 1037 | id = g_strdup_printf ("%p", new_entry); |
172 | 1034 | 1038 | ||
173 | === modified file 'src/IndicatorObjectFactoryRemote.cpp' | |||
174 | --- src/IndicatorObjectFactoryRemote.cpp 2011-04-08 07:53:45 +0000 | |||
175 | +++ src/IndicatorObjectFactoryRemote.cpp 2011-04-10 23:52:24 +0000 | |||
176 | @@ -29,6 +29,7 @@ | |||
177 | 29 | #include "Nux/WindowThread.h" | 29 | #include "Nux/WindowThread.h" |
178 | 30 | #include "NuxGraphics/GLWindowManager.h" | 30 | #include "NuxGraphics/GLWindowManager.h" |
179 | 31 | #include <X11/Xlib.h> | 31 | #include <X11/Xlib.h> |
180 | 32 | #include <algorithm> | ||
181 | 32 | 33 | ||
182 | 33 | #define S_NAME "com.canonical.Unity.Panel.Service" | 34 | #define S_NAME "com.canonical.Unity.Panel.Service" |
183 | 34 | #define S_PATH "/com/canonical/Unity/Panel/Service" | 35 | #define S_PATH "/com/canonical/Unity/Panel/Service" |
184 | @@ -78,18 +79,33 @@ | |||
185 | 78 | IndicatorObjectFactoryRemote::~IndicatorObjectFactoryRemote () | 79 | IndicatorObjectFactoryRemote::~IndicatorObjectFactoryRemote () |
186 | 79 | { | 80 | { |
187 | 80 | if (G_IS_OBJECT (_proxy)) | 81 | if (G_IS_OBJECT (_proxy)) |
188 | 82 | { | ||
189 | 83 | g_signal_handler_disconnect (_proxy, _proxy_signal_id); | ||
190 | 84 | g_signal_handler_disconnect (_proxy, _proxy_name_id); | ||
191 | 81 | g_object_unref (_proxy); | 85 | g_object_unref (_proxy); |
192 | 86 | } | ||
193 | 82 | _proxy = NULL; | 87 | _proxy = NULL; |
194 | 83 | 88 | ||
195 | 84 | std::vector<IndicatorObjectProxy*>::iterator it; | ||
196 | 85 | |||
197 | 86 | for (it = _indicators.begin(); it != _indicators.end(); it++) | ||
198 | 87 | { | 89 | { |
201 | 88 | IndicatorObjectProxyRemote *remote = static_cast<IndicatorObjectProxyRemote *> (*it); | 90 | std::vector<IndicatorObjectProxy*>::iterator it; |
202 | 89 | delete remote; | 91 | for (it = _indicators.begin(); it != _indicators.end(); it++) |
203 | 92 | { | ||
204 | 93 | IndicatorObjectProxyRemote *remote = static_cast<IndicatorObjectProxyRemote *> (*it); | ||
205 | 94 | delete remote; | ||
206 | 95 | } | ||
207 | 96 | _indicators.erase (_indicators.begin (), _indicators.end ()); | ||
208 | 90 | } | 97 | } |
209 | 91 | 98 | ||
211 | 92 | _indicators.erase (_indicators.begin (), _indicators.end ()); | 99 | { // We cancel all our async callbacks from pending Sync() calls |
212 | 100 | std::vector<SyncData *>::iterator it, eit = _sync_cancellables.end (); | ||
213 | 101 | for (it = _sync_cancellables.begin (); it != eit; ++it) | ||
214 | 102 | { | ||
215 | 103 | SyncData *data = (*it); | ||
216 | 104 | g_cancellable_cancel (data->_cancel); | ||
217 | 105 | delete data; | ||
218 | 106 | } | ||
219 | 107 | _sync_cancellables.erase (_sync_cancellables.begin (), _sync_cancellables.end ()); | ||
220 | 108 | } | ||
221 | 93 | } | 109 | } |
222 | 94 | 110 | ||
223 | 95 | std::vector<IndicatorObjectProxy *>& | 111 | std::vector<IndicatorObjectProxy *>& |
224 | @@ -134,20 +150,22 @@ | |||
225 | 134 | _proxy = proxy; | 150 | _proxy = proxy; |
226 | 135 | 151 | ||
227 | 136 | // Connect to interesting signals | 152 | // Connect to interesting signals |
232 | 137 | g_signal_connect (_proxy, "g-signal", | 153 | _proxy_signal_id = g_signal_connect (_proxy, "g-signal", |
233 | 138 | G_CALLBACK (on_proxy_signal_received), this); | 154 | G_CALLBACK (on_proxy_signal_received), this); |
234 | 139 | g_signal_connect (_proxy, "notify::g-name-owner", | 155 | _proxy_name_id = g_signal_connect (_proxy, "notify::g-name-owner", |
235 | 140 | G_CALLBACK (on_proxy_name_owner_changed), this); | 156 | G_CALLBACK (on_proxy_name_owner_changed), this); |
236 | 141 | } | 157 | } |
237 | 142 | 158 | ||
238 | 159 | SyncData * data = new SyncData (this); | ||
239 | 160 | _sync_cancellables.push_back (data); | ||
240 | 143 | g_dbus_proxy_call (_proxy, | 161 | g_dbus_proxy_call (_proxy, |
241 | 144 | "Sync", | 162 | "Sync", |
242 | 145 | NULL, | 163 | NULL, |
243 | 146 | G_DBUS_CALL_FLAGS_NONE, | 164 | G_DBUS_CALL_FLAGS_NONE, |
244 | 147 | -1, | 165 | -1, |
246 | 148 | NULL, | 166 | data->_cancel, |
247 | 149 | on_sync_ready_cb, | 167 | on_sync_ready_cb, |
249 | 150 | this); | 168 | data); |
250 | 151 | } | 169 | } |
251 | 152 | 170 | ||
252 | 153 | static gboolean | 171 | static gboolean |
253 | @@ -518,17 +536,20 @@ | |||
254 | 518 | } | 536 | } |
255 | 519 | else if (g_strcmp0 (signal_name, "ReSync") == 0) | 537 | else if (g_strcmp0 (signal_name, "ReSync") == 0) |
256 | 520 | { | 538 | { |
259 | 521 | const gchar *id = g_variant_get_string (g_variant_get_child_value (parameters, 0), NULL); | 539 | const gchar *id = g_variant_get_string (g_variant_get_child_value (parameters, 0), NULL); |
260 | 522 | bool sync_one = !g_strcmp0 (id, "") == 0; | 540 | bool sync_one = !g_strcmp0 (id, "") == 0; |
261 | 523 | 541 | ||
262 | 542 | SyncData *data = new SyncData (remote); | ||
263 | 543 | remote->_sync_cancellables.push_back (data); | ||
264 | 544 | |||
265 | 524 | g_dbus_proxy_call (proxy, | 545 | g_dbus_proxy_call (proxy, |
266 | 525 | sync_one ? "SyncOne" : "Sync", | 546 | sync_one ? "SyncOne" : "Sync", |
267 | 526 | sync_one ? g_variant_new ("(s)", id) : NULL, | 547 | sync_one ? g_variant_new ("(s)", id) : NULL, |
268 | 527 | G_DBUS_CALL_FLAGS_NONE, | 548 | G_DBUS_CALL_FLAGS_NONE, |
269 | 528 | -1, | 549 | -1, |
271 | 529 | NULL, | 550 | data->_cancel, |
272 | 530 | on_sync_ready_cb, | 551 | on_sync_ready_cb, |
274 | 531 | remote); | 552 | data); |
275 | 532 | } | 553 | } |
276 | 533 | else if (g_strcmp0 (signal_name, "ActiveMenuPointerMotion") == 0) | 554 | else if (g_strcmp0 (signal_name, "ActiveMenuPointerMotion") == 0) |
277 | 534 | { | 555 | { |
278 | @@ -575,7 +596,8 @@ | |||
279 | 575 | GAsyncResult *res, | 596 | GAsyncResult *res, |
280 | 576 | gpointer data) | 597 | gpointer data) |
281 | 577 | { | 598 | { |
283 | 578 | IndicatorObjectFactoryRemote *remote = static_cast<IndicatorObjectFactoryRemote *> (data); | 599 | SyncData *sync_data = (SyncData *)data; |
284 | 600 | IndicatorObjectFactoryRemote *remote = (IndicatorObjectFactoryRemote*)sync_data->_self; | ||
285 | 579 | GVariant *args; | 601 | GVariant *args; |
286 | 580 | GError *error = NULL; | 602 | GError *error = NULL; |
287 | 581 | 603 | ||
288 | @@ -590,5 +612,12 @@ | |||
289 | 590 | 612 | ||
290 | 591 | remote->Sync (args); | 613 | remote->Sync (args); |
291 | 592 | 614 | ||
292 | 615 | std::vector<SyncData *>::iterator it = std::find (remote->_sync_cancellables.begin (), | ||
293 | 616 | remote->_sync_cancellables.end (), | ||
294 | 617 | sync_data); | ||
295 | 618 | if (it != remote->_sync_cancellables.end ()) | ||
296 | 619 | remote->_sync_cancellables.erase (it); | ||
297 | 620 | |||
298 | 593 | g_variant_unref (args); | 621 | g_variant_unref (args); |
299 | 622 | delete sync_data; | ||
300 | 594 | } | 623 | } |
301 | 595 | 624 | ||
302 | === modified file 'src/IndicatorObjectFactoryRemote.h' | |||
303 | --- src/IndicatorObjectFactoryRemote.h 2011-03-31 17:04:36 +0000 | |||
304 | +++ src/IndicatorObjectFactoryRemote.h 2011-04-10 23:52:24 +0000 | |||
305 | @@ -27,6 +27,27 @@ | |||
306 | 27 | #include "IndicatorObjectFactory.h" | 27 | #include "IndicatorObjectFactory.h" |
307 | 28 | #include "IndicatorObjectProxyRemote.h" | 28 | #include "IndicatorObjectProxyRemote.h" |
308 | 29 | 29 | ||
309 | 30 | class SyncData | ||
310 | 31 | { | ||
311 | 32 | public: | ||
312 | 33 | SyncData (IndicatorObjectFactory *self) | ||
313 | 34 | : _self (self), | ||
314 | 35 | _cancel (g_cancellable_new ()) | ||
315 | 36 | { | ||
316 | 37 | } | ||
317 | 38 | |||
318 | 39 | ~SyncData () | ||
319 | 40 | { | ||
320 | 41 | g_object_unref (_cancel); | ||
321 | 42 | _cancel = NULL; | ||
322 | 43 | _self = NULL; | ||
323 | 44 | } | ||
324 | 45 | |||
325 | 46 | IndicatorObjectFactory *_self; | ||
326 | 47 | GCancellable *_cancel; | ||
327 | 48 | }; | ||
328 | 49 | |||
329 | 50 | |||
330 | 30 | // Connects to the remote panel service (unity-panel-service) and translates | 51 | // Connects to the remote panel service (unity-panel-service) and translates |
331 | 31 | // that into something that the panel can show | 52 | // that into something that the panel can show |
332 | 32 | class IndicatorObjectFactoryRemote : public IndicatorObjectFactory | 53 | class IndicatorObjectFactoryRemote : public IndicatorObjectFactory |
333 | @@ -52,10 +73,14 @@ | |||
334 | 52 | 73 | ||
335 | 53 | GDBusProxy * GetRemoteProxy (); | 74 | GDBusProxy * GetRemoteProxy (); |
336 | 54 | 75 | ||
337 | 76 | std::vector<SyncData*> _sync_cancellables; | ||
338 | 77 | |||
339 | 55 | private: | 78 | private: |
340 | 56 | IndicatorObjectProxyRemote* IndicatorForID (const char *id); | 79 | IndicatorObjectProxyRemote* IndicatorForID (const char *id); |
341 | 57 | private: | 80 | private: |
343 | 58 | GDBusProxy *_proxy; | 81 | GDBusProxy *_proxy; |
344 | 82 | guint32 _proxy_signal_id; | ||
345 | 83 | guint32 _proxy_name_id; | ||
346 | 59 | }; | 84 | }; |
347 | 60 | 85 | ||
348 | 61 | #endif // INDICATOR_OBJECT_FACTORY_REMOTE_H | 86 | #endif // INDICATOR_OBJECT_FACTORY_REMOTE_H |
349 | 62 | 87 | ||
350 | === modified file 'src/PanelMenuView.cpp' | |||
351 | --- src/PanelMenuView.cpp 2011-04-07 10:22:48 +0000 | |||
352 | +++ src/PanelMenuView.cpp 2011-04-10 23:52:24 +0000 | |||
353 | @@ -121,10 +121,10 @@ | |||
354 | 121 | 121 | ||
355 | 122 | // Register for all the interesting events | 122 | // Register for all the interesting events |
356 | 123 | UBusServer *ubus = ubus_server_get_default (); | 123 | UBusServer *ubus = ubus_server_get_default (); |
358 | 124 | ubus_server_register_interest (ubus, UBUS_PLACE_VIEW_SHOWN, | 124 | _place_shown_interest = ubus_server_register_interest (ubus, UBUS_PLACE_VIEW_SHOWN, |
359 | 125 | (UBusCallback)PanelMenuView::OnPlaceViewShown, | 125 | (UBusCallback)PanelMenuView::OnPlaceViewShown, |
360 | 126 | this); | 126 | this); |
362 | 127 | ubus_server_register_interest (ubus, UBUS_PLACE_VIEW_HIDDEN, | 127 | _place_hidden_interest = ubus_server_register_interest (ubus, UBUS_PLACE_VIEW_HIDDEN, |
363 | 128 | (UBusCallback)PanelMenuView::OnPlaceViewHidden, | 128 | (UBusCallback)PanelMenuView::OnPlaceViewHidden, |
364 | 129 | this); | 129 | this); |
365 | 130 | 130 | ||
366 | @@ -169,6 +169,8 @@ | |||
367 | 169 | _window_buttons->UnReference (); | 169 | _window_buttons->UnReference (); |
368 | 170 | _panel_titlebar_grab_area->UnReference (); | 170 | _panel_titlebar_grab_area->UnReference (); |
369 | 171 | 171 | ||
370 | 172 | ubus_server_unregister_interest (ubus_server_get_default (), _place_shown_interest); | ||
371 | 173 | ubus_server_unregister_interest (ubus_server_get_default (), _place_hidden_interest); | ||
372 | 172 | } | 174 | } |
373 | 173 | 175 | ||
374 | 174 | void | 176 | void |
375 | @@ -372,9 +374,10 @@ | |||
376 | 372 | } | 374 | } |
377 | 373 | else | 375 | else |
378 | 374 | { | 376 | { |
382 | 375 | gPainter.PushDrawLayer (GfxContext, | 377 | if (_title_layer) |
383 | 376 | geo, | 378 | gPainter.PushDrawLayer (GfxContext, |
384 | 377 | _title_layer); | 379 | geo, |
385 | 380 | _title_layer); | ||
386 | 378 | } | 381 | } |
387 | 379 | } | 382 | } |
388 | 380 | 383 | ||
389 | 381 | 384 | ||
390 | === modified file 'src/PanelMenuView.h' | |||
391 | --- src/PanelMenuView.h 2011-03-29 17:51:28 +0000 | |||
392 | +++ src/PanelMenuView.h 2011-04-10 23:52:24 +0000 | |||
393 | @@ -161,5 +161,8 @@ | |||
394 | 161 | sigc::connection _on_panelstyle_changed_connection; | 161 | sigc::connection _on_panelstyle_changed_connection; |
395 | 162 | 162 | ||
396 | 163 | gulong _activate_window_changed_id; | 163 | gulong _activate_window_changed_id; |
397 | 164 | |||
398 | 165 | guint32 _place_shown_interest; | ||
399 | 166 | guint32 _place_hidden_interest; | ||
400 | 164 | }; | 167 | }; |
401 | 165 | #endif | 168 | #endif |
402 | 166 | 169 | ||
403 | === modified file 'src/PlacesGroupController.cpp' | |||
404 | --- src/PlacesGroupController.cpp 2011-03-31 21:38:40 +0000 | |||
405 | +++ src/PlacesGroupController.cpp 2011-04-10 23:52:24 +0000 | |||
406 | @@ -214,7 +214,8 @@ | |||
407 | 214 | void | 214 | void |
408 | 215 | PlacesGroupController::Clear () | 215 | PlacesGroupController::Clear () |
409 | 216 | { | 216 | { |
411 | 217 | 217 | if (_group->GetChildLayout ()) | |
412 | 218 | _group->GetChildLayout ()->Clear (); | ||
413 | 218 | } | 219 | } |
414 | 219 | 220 | ||
415 | 220 | void | 221 | void |
416 | 221 | 222 | ||
417 | === modified file 'src/PlacesSearchBar.cpp' | |||
418 | --- src/PlacesSearchBar.cpp 2011-04-06 17:53:41 +0000 | |||
419 | +++ src/PlacesSearchBar.cpp 2011-04-10 23:52:24 +0000 | |||
420 | @@ -53,7 +53,7 @@ | |||
421 | 53 | _live_search_timeout (0) | 53 | _live_search_timeout (0) |
422 | 54 | { | 54 | { |
423 | 55 | PlacesStyle *style = PlacesStyle::GetDefault (); | 55 | PlacesStyle *style = PlacesStyle::GetDefault (); |
425 | 56 | nux::BaseTexture *icon = style->GetSearchReadyIcon (); | 56 | nux::BaseTexture *icon = style->GetSearchMagnifyIcon (); |
426 | 57 | 57 | ||
427 | 58 | _bg_layer = new nux::ColorLayer (nux::Color (0xff595853), true); | 58 | _bg_layer = new nux::ColorLayer (nux::Color (0xff595853), true); |
428 | 59 | 59 | ||
429 | 60 | 60 | ||
430 | === modified file 'src/PlacesSearchBarSpinner.cpp' | |||
431 | --- src/PlacesSearchBarSpinner.cpp 2011-04-06 17:53:41 +0000 | |||
432 | +++ src/PlacesSearchBarSpinner.cpp 2011-04-10 23:52:24 +0000 | |||
433 | @@ -33,10 +33,11 @@ | |||
434 | 33 | { | 33 | { |
435 | 34 | PlacesStyle *style = PlacesStyle::GetDefault (); | 34 | PlacesStyle *style = PlacesStyle::GetDefault (); |
436 | 35 | 35 | ||
441 | 36 | _search_ready = style->GetSearchReadyIcon (); | 36 | _magnify = style->GetSearchMagnifyIcon (); |
442 | 37 | _clear_full = style->GetSearchClearIcon (); | 37 | _close = style->GetSearchCloseIcon (); |
443 | 38 | _clear_alone = style->GetSearchClearAloneIcon (); | 38 | _close_glow = style->GetSearchCloseGlowIcon (); |
444 | 39 | _clear_spinner = style->GetSearchClearSpinnerIcon (); | 39 | _spin = style->GetSearchSpinIcon (); |
445 | 40 | _spin_glow = style->GetSearchSpinGlowIcon (); | ||
446 | 40 | 41 | ||
447 | 41 | _2d_rotate.Identity (); | 42 | _2d_rotate.Identity (); |
448 | 42 | _2d_rotate.Rotate_z (0.0); | 43 | _2d_rotate.Rotate_z (0.0); |
449 | @@ -69,56 +70,85 @@ | |||
450 | 69 | texxform.min_filter = nux::TEXFILTER_LINEAR; | 70 | texxform.min_filter = nux::TEXFILTER_LINEAR; |
451 | 70 | texxform.mag_filter = nux::TEXFILTER_LINEAR; | 71 | texxform.mag_filter = nux::TEXFILTER_LINEAR; |
452 | 71 | 72 | ||
453 | 73 | GfxContext.QRP_1Tex (geo.x + ((geo.width - _spin_glow->GetWidth ())/2), | ||
454 | 74 | geo.y + ((geo.height - _spin_glow->GetHeight ())/2), | ||
455 | 75 | _spin_glow->GetWidth (), | ||
456 | 76 | _spin_glow->GetHeight (), | ||
457 | 77 | _spin_glow->GetDeviceTexture (), | ||
458 | 78 | texxform, | ||
459 | 79 | nux::Colors::White); | ||
460 | 80 | |||
461 | 72 | if (_state == STATE_READY) | 81 | if (_state == STATE_READY) |
462 | 73 | { | 82 | { |
468 | 74 | GfxContext.QRP_1Tex (geo.x + ((geo.width - _search_ready->GetWidth ())/2), | 83 | GfxContext.QRP_1Tex (geo.x + ((geo.width - _magnify->GetWidth ())/2), |
469 | 75 | geo.y + ((geo.height - _search_ready->GetHeight ())/2), | 84 | geo.y + ((geo.height - _magnify->GetHeight ())/2), |
470 | 76 | _search_ready->GetWidth (), | 85 | _magnify->GetWidth (), |
471 | 77 | _search_ready->GetHeight (), | 86 | _magnify->GetHeight (), |
472 | 78 | _search_ready->GetDeviceTexture (), | 87 | _magnify->GetDeviceTexture (), |
473 | 79 | texxform, | 88 | texxform, |
474 | 80 | nux::Colors::White); | 89 | nux::Colors::White); |
475 | 81 | } | 90 | } |
476 | 82 | else if (_state == STATE_SEARCHING) | 91 | else if (_state == STATE_SEARCHING) |
477 | 83 | { | 92 | { |
482 | 84 | nux::Geometry clear_geo (geo.x + ((geo.width - _clear_spinner->GetWidth ())/2), | 93 | nux::Geometry spin_geo (geo.x + ((geo.width - _spin->GetWidth ())/2), |
483 | 85 | geo.y + ((geo.height - _clear_spinner->GetHeight ())/2), | 94 | geo.y + ((geo.height - _spin->GetHeight ())/2), |
484 | 86 | _clear_spinner->GetWidth (), | 95 | _spin->GetWidth (), |
485 | 87 | _clear_spinner->GetHeight ()); | 96 | _spin->GetHeight ()); |
486 | 97 | int spin_offset_w = (geo.width % 2) ? 0 : 1; | ||
487 | 98 | int spin_offset_h = (geo.height % 2) ? 0 : 1; | ||
488 | 88 | 99 | ||
491 | 89 | GfxContext.PushModelViewMatrix (nux::Matrix4::TRANSLATE(-clear_geo.x - clear_geo.width / 2, | 100 | GfxContext.PushModelViewMatrix (nux::Matrix4::TRANSLATE(-spin_geo.x - (spin_geo.width + spin_offset_w) / 2.0f, |
492 | 90 | -clear_geo.y - clear_geo.height / 2, 0)); | 101 | -spin_geo.y - (spin_geo.height + spin_offset_h) / 2.0f, 0)); |
493 | 91 | GfxContext.PushModelViewMatrix (_2d_rotate); | 102 | GfxContext.PushModelViewMatrix (_2d_rotate); |
516 | 92 | GfxContext.PushModelViewMatrix (nux::Matrix4::TRANSLATE(clear_geo.x + clear_geo.width/ 2, | 103 | GfxContext.PushModelViewMatrix (nux::Matrix4::TRANSLATE(spin_geo.x + (spin_geo.width + spin_offset_w)/ 2.0f, |
517 | 93 | clear_geo.y + clear_geo.height / 2, 0)); | 104 | spin_geo.y + (spin_geo.height + spin_offset_h) / 2.0f, 0)); |
518 | 94 | 105 | ||
519 | 95 | GfxContext.QRP_1Tex (clear_geo.x, | 106 | GfxContext.QRP_1Tex (spin_geo.x, |
520 | 96 | clear_geo.y, | 107 | spin_geo.y, |
521 | 97 | clear_geo.width, | 108 | spin_geo.width, |
522 | 98 | clear_geo.height, | 109 | spin_geo.height, |
523 | 99 | _clear_spinner->GetDeviceTexture (), | 110 | _spin->GetDeviceTexture (), |
524 | 100 | texxform, | 111 | texxform, |
525 | 101 | nux::Colors::White); | 112 | nux::Colors::White); |
526 | 102 | 113 | ||
527 | 103 | GfxContext.PopModelViewMatrix (); | 114 | GfxContext.PopModelViewMatrix (); |
528 | 104 | GfxContext.PopModelViewMatrix (); | 115 | GfxContext.PopModelViewMatrix (); |
529 | 105 | GfxContext.PopModelViewMatrix (); | 116 | GfxContext.PopModelViewMatrix (); |
508 | 106 | |||
509 | 107 | GfxContext.QRP_1Tex (geo.x + ((geo.width - _clear_alone->GetWidth ())/2), | ||
510 | 108 | geo.y + ((geo.height - _clear_alone->GetHeight ())/2), | ||
511 | 109 | _clear_alone->GetWidth (), | ||
512 | 110 | _clear_alone->GetHeight (), | ||
513 | 111 | _clear_alone->GetDeviceTexture (), | ||
514 | 112 | texxform, | ||
515 | 113 | nux::Colors::White); | ||
530 | 114 | } | 117 | } |
531 | 115 | else | 118 | else |
532 | 116 | { | 119 | { |
538 | 117 | GfxContext.QRP_1Tex (geo.x + ((geo.width - _clear_full->GetWidth ())/2), | 120 | texxform.FlipVCoord (true); |
539 | 118 | geo.y + ((geo.height - _clear_full->GetHeight ())/2), | 121 | GfxContext.QRP_1Tex (geo.x + ((geo.width - _spin->GetWidth ())/2), |
540 | 119 | _clear_full->GetWidth (), | 122 | geo.y + ((geo.height - _spin->GetHeight ())/2), |
541 | 120 | _clear_full->GetHeight (), | 123 | _spin->GetWidth (), |
542 | 121 | _clear_full->GetDeviceTexture (), | 124 | _spin->GetHeight (), |
543 | 125 | _spin->GetDeviceTexture (), | ||
544 | 126 | texxform, | ||
545 | 127 | nux::Colors::White); | ||
546 | 128 | texxform.FlipVCoord (false); | ||
547 | 129 | |||
548 | 130 | GfxContext.QRP_1Tex (geo.x + ((geo.width - _spin->GetWidth ())/2), | ||
549 | 131 | geo.y + ((geo.height - _spin->GetHeight ())/2), | ||
550 | 132 | _spin->GetWidth (), | ||
551 | 133 | _spin->GetHeight (), | ||
552 | 134 | _spin->GetDeviceTexture (), | ||
553 | 135 | texxform, | ||
554 | 136 | nux::Colors::White); | ||
555 | 137 | |||
556 | 138 | |||
557 | 139 | GfxContext.QRP_1Tex (geo.x + ((geo.width - _close_glow->GetWidth ())/2), | ||
558 | 140 | geo.y + ((geo.height - _close_glow->GetHeight ())/2), | ||
559 | 141 | _close_glow->GetWidth (), | ||
560 | 142 | _close_glow->GetHeight (), | ||
561 | 143 | _close_glow->GetDeviceTexture (), | ||
562 | 144 | texxform, | ||
563 | 145 | nux::Colors::White); | ||
564 | 146 | |||
565 | 147 | GfxContext.QRP_1Tex (geo.x + ((geo.width - _close->GetWidth ())/2), | ||
566 | 148 | geo.y + ((geo.height - _close->GetHeight ())/2), | ||
567 | 149 | _close->GetWidth (), | ||
568 | 150 | _close->GetHeight (), | ||
569 | 151 | _close->GetDeviceTexture (), | ||
570 | 122 | texxform, | 152 | texxform, |
571 | 123 | nux::Colors::White); | 153 | nux::Colors::White); |
572 | 124 | } | 154 | } |
573 | 125 | 155 | ||
574 | === modified file 'src/PlacesSearchBarSpinner.h' | |||
575 | --- src/PlacesSearchBarSpinner.h 2011-03-23 23:18:03 +0000 | |||
576 | +++ src/PlacesSearchBarSpinner.h 2011-04-10 23:52:24 +0000 | |||
577 | @@ -58,10 +58,11 @@ | |||
578 | 58 | private: | 58 | private: |
579 | 59 | SpinnerState _state; | 59 | SpinnerState _state; |
580 | 60 | 60 | ||
585 | 61 | nux::BaseTexture *_search_ready; | 61 | nux::BaseTexture *_magnify; |
586 | 62 | nux::BaseTexture *_clear_full; | 62 | nux::BaseTexture *_close; |
587 | 63 | nux::BaseTexture *_clear_alone; | 63 | nux::BaseTexture *_close_glow; |
588 | 64 | nux::BaseTexture *_clear_spinner; | 64 | nux::BaseTexture *_spin; |
589 | 65 | nux::BaseTexture *_spin_glow; | ||
590 | 65 | 66 | ||
591 | 66 | nux::Matrix4 _2d_rotate; | 67 | nux::Matrix4 _2d_rotate; |
592 | 67 | float _rotation; | 68 | float _rotation; |
593 | 68 | 69 | ||
594 | === modified file 'src/PlacesSimpleTile.cpp' | |||
595 | --- src/PlacesSimpleTile.cpp 2011-04-07 12:36:20 +0000 | |||
596 | +++ src/PlacesSimpleTile.cpp 2011-04-10 23:52:24 +0000 | |||
597 | @@ -48,16 +48,16 @@ | |||
598 | 48 | 48 | ||
599 | 49 | _icontex = new IconTexture (_icon, icon_size, defer_icon_loading); | 49 | _icontex = new IconTexture (_icon, icon_size, defer_icon_loading); |
600 | 50 | _icontex->SetMinMaxSize (style->GetTileWidth (), icon_size); | 50 | _icontex->SetMinMaxSize (style->GetTileWidth (), icon_size); |
601 | 51 | _icontex->SinkReference (); | ||
602 | 52 | AddChild (_icontex); | 51 | AddChild (_icontex); |
603 | 53 | 52 | ||
604 | 53 | |||
605 | 54 | _cairotext = new nux::StaticCairoText (""); | 54 | _cairotext = new nux::StaticCairoText (""); |
606 | 55 | _cairotext->SetMaximumWidth (style->GetTileWidth ()); | 55 | _cairotext->SetMaximumWidth (style->GetTileWidth ()); |
607 | 56 | _cairotext->SinkReference (); | 56 | _cairotext->SinkReference (); |
608 | 57 | _cairotext->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_START); | 57 | _cairotext->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_START); |
609 | 58 | _cairotext->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_CENTRE); | 58 | _cairotext->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_CENTRE); |
610 | 59 | _cairotext->SetText (_label); | 59 | _cairotext->SetText (_label); |
612 | 60 | 60 | ||
613 | 61 | layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12)); | 61 | layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12)); |
614 | 62 | layout->AddView (_icontex, 0, nux::eCenter, nux::eFull); | 62 | layout->AddView (_icontex, 0, nux::eCenter, nux::eFull); |
615 | 63 | layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12)); | 63 | layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12)); |
616 | @@ -73,11 +73,6 @@ | |||
617 | 73 | 73 | ||
618 | 74 | PlacesSimpleTile::~PlacesSimpleTile () | 74 | PlacesSimpleTile::~PlacesSimpleTile () |
619 | 75 | { | 75 | { |
620 | 76 | _icontex->UnReference (); | ||
621 | 77 | _icontex = NULL; | ||
622 | 78 | _cairotext->UnReference (); | ||
623 | 79 | _cairotext = NULL; | ||
624 | 80 | |||
625 | 81 | g_free (_label); | 76 | g_free (_label); |
626 | 82 | g_free (_icon); | 77 | g_free (_icon); |
627 | 83 | g_free (_uri); | 78 | g_free (_uri); |
628 | 84 | 79 | ||
629 | === modified file 'src/PlacesStyle.cpp' | |||
630 | --- src/PlacesStyle.cpp 2011-04-10 15:08:29 +0000 | |||
631 | +++ src/PlacesStyle.cpp 2011-04-10 23:52:24 +0000 | |||
632 | @@ -38,10 +38,11 @@ | |||
633 | 38 | _dash_right_texture (NULL), | 38 | _dash_right_texture (NULL), |
634 | 39 | _dash_corner_texture (NULL), | 39 | _dash_corner_texture (NULL), |
635 | 40 | _dash_fullscreen_icon (NULL), | 40 | _dash_fullscreen_icon (NULL), |
640 | 41 | _search_ready_texture (NULL), | 41 | _search_magnify_texture (NULL), |
641 | 42 | _search_clear_texture (NULL), | 42 | _search_close_texture (NULL), |
642 | 43 | _search_clear_alone_texture (NULL), | 43 | _search_close_glow_texture (NULL), |
643 | 44 | _search_clear_spinner_texture (NULL), | 44 | _search_spin_texture (NULL), |
644 | 45 | _search_spin_glow_texture (NULL), | ||
645 | 45 | _group_unexpand_texture (NULL), | 46 | _group_unexpand_texture (NULL), |
646 | 46 | _group_expand_texture (NULL) | 47 | _group_expand_texture (NULL) |
647 | 47 | { | 48 | { |
648 | @@ -63,14 +64,14 @@ | |||
649 | 63 | _dash_corner_texture->UnReference (); | 64 | _dash_corner_texture->UnReference (); |
650 | 64 | if (_dash_fullscreen_icon) | 65 | if (_dash_fullscreen_icon) |
651 | 65 | _dash_fullscreen_icon->UnReference (); | 66 | _dash_fullscreen_icon->UnReference (); |
660 | 66 | if (_search_ready_texture) | 67 | if (_search_magnify_texture) |
661 | 67 | _search_ready_texture->UnReference (); | 68 | _search_magnify_texture->UnReference (); |
662 | 68 | if (_search_clear_texture) | 69 | if (_search_close_texture) |
663 | 69 | _search_clear_texture->UnReference (); | 70 | _search_close_texture->UnReference (); |
664 | 70 | if (_search_clear_alone_texture) | 71 | if (_search_close_glow_texture) |
665 | 71 | _search_clear_alone_texture->UnReference (); | 72 | _search_close_glow_texture->UnReference (); |
666 | 72 | if (_search_clear_spinner_texture) | 73 | if (_search_spin_texture) |
667 | 73 | _search_clear_spinner_texture->UnReference (); | 74 | _search_spin_texture->UnReference (); |
668 | 74 | if (_group_unexpand_texture) | 75 | if (_group_unexpand_texture) |
669 | 75 | _group_unexpand_texture->UnReference (); | 76 | _group_unexpand_texture->UnReference (); |
670 | 76 | if (_group_expand_texture) | 77 | if (_group_expand_texture) |
671 | @@ -176,35 +177,43 @@ | |||
672 | 176 | } | 177 | } |
673 | 177 | 178 | ||
674 | 178 | nux::BaseTexture * | 179 | nux::BaseTexture * |
704 | 179 | PlacesStyle::GetSearchReadyIcon () | 180 | PlacesStyle::GetSearchMagnifyIcon () |
705 | 180 | { | 181 | { |
706 | 181 | if (!_search_ready_texture) | 182 | if (!_search_magnify_texture) |
707 | 182 | _search_ready_texture = TextureFromFilename (PKGDATADIR"/search_ready_icon.png"); | 183 | _search_magnify_texture = TextureFromFilename (PKGDATADIR"/search_magnify.png"); |
708 | 183 | return _search_ready_texture; | 184 | return _search_magnify_texture; |
709 | 184 | } | 185 | } |
710 | 185 | 186 | ||
711 | 186 | nux::BaseTexture * | 187 | nux::BaseTexture * |
712 | 187 | PlacesStyle::GetSearchClearIcon () | 188 | PlacesStyle::GetSearchCloseIcon () |
713 | 188 | { | 189 | { |
714 | 189 | if (!_search_clear_texture) | 190 | if (!_search_close_texture) |
715 | 190 | _search_clear_texture = TextureFromFilename (PKGDATADIR"/search_clear_icon.png"); | 191 | _search_close_texture = TextureFromFilename (PKGDATADIR"/search_close.png"); |
716 | 191 | return _search_clear_texture; | 192 | return _search_close_texture; |
717 | 192 | } | 193 | } |
718 | 193 | 194 | ||
719 | 194 | nux::BaseTexture * | 195 | nux::BaseTexture * |
720 | 195 | PlacesStyle::GetSearchClearAloneIcon () | 196 | PlacesStyle::GetSearchCloseGlowIcon () |
721 | 196 | { | 197 | { |
722 | 197 | if (!_search_clear_alone_texture) | 198 | if (!_search_close_glow_texture) |
723 | 198 | _search_clear_alone_texture = TextureFromFilename (PKGDATADIR"/search_clear_alone.png"); | 199 | _search_close_glow_texture = TextureFromFilename (PKGDATADIR"/search_close_glow.png"); |
724 | 199 | return _search_clear_alone_texture; | 200 | return _search_close_glow_texture; |
725 | 200 | } | 201 | } |
726 | 201 | 202 | ||
727 | 202 | nux::BaseTexture * | 203 | nux::BaseTexture * |
728 | 203 | PlacesStyle::GetSearchClearSpinnerIcon () | 204 | PlacesStyle::GetSearchSpinIcon () |
729 | 204 | { | 205 | { |
730 | 205 | if (!_search_clear_spinner_texture) | 206 | if (!_search_spin_texture) |
731 | 206 | _search_clear_spinner_texture = TextureFromFilename (PKGDATADIR"/search_clear_spinner.png"); | 207 | _search_spin_texture = TextureFromFilename (PKGDATADIR"/search_spin.png"); |
732 | 207 | return _search_clear_spinner_texture; | 208 | return _search_spin_texture; |
733 | 209 | } | ||
734 | 210 | |||
735 | 211 | nux::BaseTexture * | ||
736 | 212 | PlacesStyle::GetSearchSpinGlowIcon () | ||
737 | 213 | { | ||
738 | 214 | if (!_search_spin_glow_texture) | ||
739 | 215 | _search_spin_glow_texture = TextureFromFilename (PKGDATADIR"/search_spin_glow.png"); | ||
740 | 216 | return _search_spin_glow_texture; | ||
741 | 208 | } | 217 | } |
742 | 209 | 218 | ||
743 | 210 | nux::BaseTexture * | 219 | nux::BaseTexture * |
744 | 211 | 220 | ||
745 | === modified file 'src/PlacesStyle.h' | |||
746 | --- src/PlacesStyle.h 2011-03-23 22:33:25 +0000 | |||
747 | +++ src/PlacesStyle.h 2011-04-10 23:52:24 +0000 | |||
748 | @@ -50,10 +50,11 @@ | |||
749 | 50 | nux::BaseTexture * GetDashCorner (); | 50 | nux::BaseTexture * GetDashCorner (); |
750 | 51 | nux::BaseTexture * GetDashFullscreenIcon (); | 51 | nux::BaseTexture * GetDashFullscreenIcon (); |
751 | 52 | 52 | ||
756 | 53 | nux::BaseTexture * GetSearchReadyIcon (); | 53 | nux::BaseTexture * GetSearchMagnifyIcon (); |
757 | 54 | nux::BaseTexture * GetSearchClearIcon (); | 54 | nux::BaseTexture * GetSearchCloseIcon (); |
758 | 55 | nux::BaseTexture * GetSearchClearAloneIcon (); | 55 | nux::BaseTexture * GetSearchCloseGlowIcon (); |
759 | 56 | nux::BaseTexture * GetSearchClearSpinnerIcon (); | 56 | nux::BaseTexture * GetSearchSpinIcon (); |
760 | 57 | nux::BaseTexture * GetSearchSpinGlowIcon (); | ||
761 | 57 | 58 | ||
762 | 58 | nux::BaseTexture * GetGroupUnexpandIcon (); | 59 | nux::BaseTexture * GetGroupUnexpandIcon (); |
763 | 59 | nux::BaseTexture * GetGroupExpandIcon (); | 60 | nux::BaseTexture * GetGroupExpandIcon (); |
764 | @@ -80,10 +81,11 @@ | |||
765 | 80 | nux::BaseTexture *_dash_corner_texture; | 81 | nux::BaseTexture *_dash_corner_texture; |
766 | 81 | nux::BaseTexture *_dash_fullscreen_icon; | 82 | nux::BaseTexture *_dash_fullscreen_icon; |
767 | 82 | 83 | ||
772 | 83 | nux::BaseTexture *_search_ready_texture; | 84 | nux::BaseTexture *_search_magnify_texture; |
773 | 84 | nux::BaseTexture *_search_clear_texture; | 85 | nux::BaseTexture *_search_close_texture; |
774 | 85 | nux::BaseTexture *_search_clear_alone_texture; | 86 | nux::BaseTexture *_search_close_glow_texture; |
775 | 86 | nux::BaseTexture *_search_clear_spinner_texture; | 87 | nux::BaseTexture *_search_spin_texture; |
776 | 88 | nux::BaseTexture *_search_spin_glow_texture; | ||
777 | 87 | 89 | ||
778 | 88 | nux::BaseTexture *_group_unexpand_texture; | 90 | nux::BaseTexture *_group_unexpand_texture; |
779 | 89 | nux::BaseTexture *_group_expand_texture; | 91 | nux::BaseTexture *_group_expand_texture; |
780 | 90 | 92 | ||
781 | === modified file 'src/PlacesView.cpp' | |||
782 | --- src/PlacesView.cpp 2011-04-06 17:53:41 +0000 | |||
783 | +++ src/PlacesView.cpp 2011-04-10 23:52:24 +0000 | |||
784 | @@ -51,7 +51,8 @@ | |||
785 | 51 | _resize_id (0), | 51 | _resize_id (0), |
786 | 52 | _alt_f2_entry (NULL), | 52 | _alt_f2_entry (NULL), |
787 | 53 | _searching_timeout (0), | 53 | _searching_timeout (0), |
789 | 54 | _pending_activation (false) | 54 | _pending_activation (false), |
790 | 55 | _search_empty (false) | ||
791 | 55 | { | 56 | { |
792 | 56 | LoadPlaces (); | 57 | LoadPlaces (); |
793 | 57 | _factory->place_added.connect (sigc::mem_fun (this, &PlacesView::OnPlaceAdded)); | 58 | _factory->place_added.connect (sigc::mem_fun (this, &PlacesView::OnPlaceAdded)); |
794 | @@ -424,7 +425,6 @@ | |||
795 | 424 | void | 425 | void |
796 | 425 | PlacesView::SetActiveEntry (PlaceEntry *entry, guint section_id, const char *search_string, bool signal) | 426 | PlacesView::SetActiveEntry (PlaceEntry *entry, guint section_id, const char *search_string, bool signal) |
797 | 426 | { | 427 | { |
798 | 427 | |||
799 | 428 | if (signal) | 428 | if (signal) |
800 | 429 | entry_changed.emit (entry); | 429 | entry_changed.emit (entry); |
801 | 430 | 430 | ||
802 | @@ -452,6 +452,7 @@ | |||
803 | 452 | 452 | ||
804 | 453 | _entry->SetActive (true); | 453 | _entry->SetActive (true); |
805 | 454 | _search_bar->SetActiveEntry (_entry, section_id, search_string); | 454 | _search_bar->SetActiveEntry (_entry, section_id, search_string); |
806 | 455 | _search_empty = (g_strcmp0 (search_string, "") == 0 && _entry == _home_entry); | ||
807 | 455 | 456 | ||
808 | 456 | _entry->ForeachGroup (sigc::mem_fun (this, &PlacesView::OnGroupAdded)); | 457 | _entry->ForeachGroup (sigc::mem_fun (this, &PlacesView::OnGroupAdded)); |
809 | 457 | _entry->ForeachResult (sigc::mem_fun (this, &PlacesView::OnResultAdded)); | 458 | _entry->ForeachResult (sigc::mem_fun (this, &PlacesView::OnResultAdded)); |
810 | @@ -619,6 +620,10 @@ | |||
811 | 619 | void | 620 | void |
812 | 620 | PlacesView::OnResultAdded (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result) | 621 | PlacesView::OnResultAdded (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result) |
813 | 621 | { | 622 | { |
814 | 623 | // We never show these so ignore them | ||
815 | 624 | if (_search_empty) | ||
816 | 625 | return; | ||
817 | 626 | |||
818 | 622 | _n_results++; | 627 | _n_results++; |
819 | 623 | 628 | ||
820 | 624 | if (_n_results <= 2 | 629 | if (_n_results <= 2 |
821 | @@ -729,12 +734,15 @@ | |||
822 | 729 | void | 734 | void |
823 | 730 | PlacesView::OnSearchChanged (const char *search_string) | 735 | PlacesView::OnSearchChanged (const char *search_string) |
824 | 731 | { | 736 | { |
825 | 737 | _search_empty = false; | ||
826 | 738 | |||
827 | 732 | if (_entry == _home_entry) | 739 | if (_entry == _home_entry) |
828 | 733 | { | 740 | { |
829 | 734 | if (g_strcmp0 (search_string, "") == 0) | 741 | if (g_strcmp0 (search_string, "") == 0) |
830 | 735 | { | 742 | { |
831 | 736 | _layered_layout->SetActiveLayer (_home_view); | 743 | _layered_layout->SetActiveLayer (_home_view); |
832 | 737 | _home_view->QueueDraw (); | 744 | _home_view->QueueDraw (); |
833 | 745 | _search_empty = true; | ||
834 | 738 | } | 746 | } |
835 | 739 | else | 747 | else |
836 | 740 | { | 748 | { |
837 | 741 | 749 | ||
838 | === modified file 'src/PlacesView.h' | |||
839 | --- src/PlacesView.h 2011-03-31 14:26:00 +0000 | |||
840 | +++ src/PlacesView.h 2011-04-10 23:52:24 +0000 | |||
841 | @@ -170,6 +170,8 @@ | |||
842 | 170 | guint _n_results; | 170 | guint _n_results; |
843 | 171 | guint _searching_timeout; | 171 | guint _searching_timeout; |
844 | 172 | bool _pending_activation; | 172 | bool _pending_activation; |
845 | 173 | |||
846 | 174 | bool _search_empty; | ||
847 | 173 | }; | 175 | }; |
848 | 174 | 176 | ||
849 | 175 | #endif // PANEL_HOME_BUTTON_H | 177 | #endif // PANEL_HOME_BUTTON_H |
850 | 176 | 178 | ||
851 | === modified file 'src/QuicklistView.cpp' | |||
852 | --- src/QuicklistView.cpp 2011-04-06 17:53:41 +0000 | |||
853 | +++ src/QuicklistView.cpp 2011-04-10 23:52:24 +0000 | |||
854 | @@ -126,14 +126,19 @@ | |||
855 | 126 | bool | 126 | bool |
856 | 127 | QuicklistView::IsMenuItemSeperator (int index) | 127 | QuicklistView::IsMenuItemSeperator (int index) |
857 | 128 | { | 128 | { |
861 | 129 | DbusmenuMenuitem* item = NULL; | 129 | QuicklistMenuItem* menu_item = NULL; |
862 | 130 | const gchar* label = NULL; | 130 | DbusmenuMenuitem* item = NULL; |
863 | 131 | bool result = false; | 131 | const gchar* label = NULL; |
864 | 132 | bool result = false; | ||
865 | 132 | 133 | ||
866 | 133 | if (index < 0) | 134 | if (index < 0) |
867 | 134 | return false; | 135 | return false; |
868 | 135 | 136 | ||
870 | 136 | item = GetNthItems (index)->_menuItem; | 137 | menu_item = GetNthItems (index); |
871 | 138 | if (!menu_item) | ||
872 | 139 | return false; | ||
873 | 140 | |||
874 | 141 | item = menu_item->_menuItem; | ||
875 | 137 | if (!item) | 142 | if (!item) |
876 | 138 | return false; | 143 | return false; |
877 | 139 | 144 | ||
878 | 140 | 145 | ||
879 | === modified file 'src/StaticCairoText.cpp' | |||
880 | --- src/StaticCairoText.cpp 2011-04-10 22:12:26 +0000 | |||
881 | +++ src/StaticCairoText.cpp 2011-04-10 23:52:24 +0000 | |||
882 | @@ -490,7 +490,7 @@ | |||
883 | 490 | 490 | ||
884 | 491 | _texture2D = GetThreadGLDeviceFactory()->CreateSystemCapableTexture (); | 491 | _texture2D = GetThreadGLDeviceFactory()->CreateSystemCapableTexture (); |
885 | 492 | _texture2D->Update (bitmap); | 492 | _texture2D->Update (bitmap); |
887 | 493 | 493 | ||
888 | 494 | delete bitmap; | 494 | delete bitmap; |
889 | 495 | 495 | ||
890 | 496 | cairo_destroy (cr); | 496 | cairo_destroy (cr); |
891 | 497 | 497 | ||
892 | === modified file 'src/UScreen.cpp' | |||
893 | --- src/UScreen.cpp 2011-03-22 16:44:47 +0000 | |||
894 | +++ src/UScreen.cpp 2011-04-10 23:52:24 +0000 | |||
895 | @@ -94,6 +94,7 @@ | |||
896 | 94 | { | 94 | { |
897 | 95 | GdkScreen *screen; | 95 | GdkScreen *screen; |
898 | 96 | int primary; | 96 | int primary; |
899 | 97 | nux::Geometry last_geo (0, 0, 1, 1); | ||
900 | 97 | 98 | ||
901 | 98 | screen = gdk_screen_get_default (); | 99 | screen = gdk_screen_get_default (); |
902 | 99 | primary = GetPrimaryMonitor (); | 100 | primary = GetPrimaryMonitor (); |
903 | @@ -109,6 +110,12 @@ | |||
904 | 109 | gdk_screen_get_monitor_geometry (screen, i, &rect); | 110 | gdk_screen_get_monitor_geometry (screen, i, &rect); |
905 | 110 | 111 | ||
906 | 111 | nux::Geometry geo (rect.x, rect.y, rect.width, rect.height); | 112 | nux::Geometry geo (rect.x, rect.y, rect.width, rect.height); |
907 | 113 | |||
908 | 114 | // Check for mirrored displays | ||
909 | 115 | if (geo == last_geo) | ||
910 | 116 | continue; | ||
911 | 117 | last_geo = geo; | ||
912 | 118 | |||
913 | 112 | _monitors.push_back (geo); | 119 | _monitors.push_back (geo); |
914 | 113 | 120 | ||
915 | 114 | g_print (" Monitor %d%s\n", i, i == primary ? "(primary)" : ""); | 121 | g_print (" Monitor %d%s\n", i, i == primary ? "(primary)" : ""); |
916 | 115 | 122 | ||
917 | === modified file 'tests/TestPlacesBackend.cpp' | |||
918 | --- tests/TestPlacesBackend.cpp 2011-02-26 16:48:18 +0000 | |||
919 | +++ tests/TestPlacesBackend.cpp 2011-04-10 23:52:24 +0000 | |||
920 | @@ -36,6 +36,10 @@ | |||
921 | 36 | 36 | ||
922 | 37 | _vbox = gtk_vbox_new (FALSE, 12); | 37 | _vbox = gtk_vbox_new (FALSE, 12); |
923 | 38 | gtk_container_add (GTK_CONTAINER (_window), _vbox); | 38 | gtk_container_add (GTK_CONTAINER (_window), _vbox); |
924 | 39 | |||
925 | 40 | _entry = gtk_entry_new (); | ||
926 | 41 | gtk_box_pack_start (GTK_BOX (_vbox), _entry, FALSE, FALSE, 0); | ||
927 | 42 | g_signal_connect (_entry, "changed", G_CALLBACK (OnEntryChanged), this); | ||
928 | 39 | 43 | ||
929 | 40 | _combo = gtk_combo_box_text_new (); | 44 | _combo = gtk_combo_box_text_new (); |
930 | 41 | gtk_box_pack_start (GTK_BOX (_vbox), _combo, FALSE, FALSE, 0); | 45 | gtk_box_pack_start (GTK_BOX (_vbox), _combo, FALSE, FALSE, 0); |
931 | @@ -48,6 +52,8 @@ | |||
932 | 48 | PopulateEntries (); | 52 | PopulateEntries (); |
933 | 49 | _factory->place_added.connect (sigc::mem_fun (this, &TestApp::OnPlaceAdded)); | 53 | _factory->place_added.connect (sigc::mem_fun (this, &TestApp::OnPlaceAdded)); |
934 | 50 | 54 | ||
935 | 55 | gtk_combo_box_set_active (GTK_COMBO_BOX (_combo), 0); | ||
936 | 56 | |||
937 | 51 | gtk_widget_show_all (_window); | 57 | gtk_widget_show_all (_window); |
938 | 52 | } | 58 | } |
939 | 53 | 59 | ||
940 | @@ -66,6 +72,8 @@ | |||
941 | 66 | PlaceEntry *entry = static_cast<PlaceEntry *> (*i); | 72 | PlaceEntry *entry = static_cast<PlaceEntry *> (*i); |
942 | 67 | gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (_combo), entry->GetName ()); | 73 | gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (_combo), entry->GetName ()); |
943 | 68 | } | 74 | } |
944 | 75 | |||
945 | 76 | gtk_combo_box_set_active (GTK_COMBO_BOX (_combo), 0); | ||
946 | 69 | } | 77 | } |
947 | 70 | 78 | ||
948 | 71 | void PopulateEntries () | 79 | void PopulateEntries () |
949 | @@ -87,6 +95,16 @@ | |||
950 | 87 | } | 95 | } |
951 | 88 | } | 96 | } |
952 | 89 | 97 | ||
953 | 98 | static void OnEntryChanged (GtkEditable *editable, TestApp *self) | ||
954 | 99 | { | ||
955 | 100 | if (self->_active) | ||
956 | 101 | { | ||
957 | 102 | std::map<gchar*, gchar*> hints; | ||
958 | 103 | self->_active->SetSearch (gtk_entry_get_text (GTK_ENTRY (self->_entry)), | ||
959 | 104 | hints); | ||
960 | 105 | } | ||
961 | 106 | } | ||
962 | 107 | |||
963 | 90 | static void OnComboChanged (GtkWidget *combo, TestApp *self) | 108 | static void OnComboChanged (GtkWidget *combo, TestApp *self) |
964 | 91 | { | 109 | { |
965 | 92 | self->OnComboChangedFoRealz (); | 110 | self->OnComboChangedFoRealz (); |
966 | @@ -110,33 +128,7 @@ | |||
967 | 110 | for (i = entries.begin (); i != entries.end (); ++i) | 128 | for (i = entries.begin (); i != entries.end (); ++i) |
968 | 111 | { | 129 | { |
969 | 112 | PlaceEntry *entry = static_cast<PlaceEntry *> (*i); | 130 | PlaceEntry *entry = static_cast<PlaceEntry *> (*i); |
997 | 113 | 131 | _active = entry; | |
971 | 114 | if (g_strcmp0 (txt, entry->GetName ()) == 0) | ||
972 | 115 | { | ||
973 | 116 | //FIXME : Update when we have sections support | ||
974 | 117 | #if 0 | ||
975 | 118 | DeeModel *sections = entry->GetSectionsModel (); | ||
976 | 119 | DeeModelIter *iter; | ||
977 | 120 | |||
978 | 121 | // Update the sections | ||
979 | 122 | |||
980 | 123 | for (gint i = 0; i < _n_secs; i++) | ||
981 | 124 | { | ||
982 | 125 | gtk_combo_box_remove_text (GTK_COMBO_BOX (_seccombo), 0); | ||
983 | 126 | } | ||
984 | 127 | |||
985 | 128 | iter = dee_model_get_first_iter (sections); | ||
986 | 129 | while (!dee_model_is_last(sections, iter)) | ||
987 | 130 | { | ||
988 | 131 | gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (_seccombo), dee_model_get_string (sections, iter, 0)); | ||
989 | 132 | _n_secs++; | ||
990 | 133 | |||
991 | 134 | iter = dee_model_next (sections, iter); | ||
992 | 135 | } | ||
993 | 136 | |||
994 | 137 | gtk_combo_box_set_active (GTK_COMBO_BOX (_seccombo), 0); | ||
995 | 138 | #endif | ||
996 | 139 | } | ||
998 | 140 | } | 132 | } |
999 | 141 | } | 133 | } |
1000 | 142 | 134 | ||
1001 | @@ -147,9 +139,12 @@ | |||
1002 | 147 | 139 | ||
1003 | 148 | GtkWidget *_window; | 140 | GtkWidget *_window; |
1004 | 149 | GtkWidget *_vbox; | 141 | GtkWidget *_vbox; |
1005 | 142 | GtkWidget *_entry; | ||
1006 | 150 | GtkWidget *_combo; | 143 | GtkWidget *_combo; |
1007 | 151 | GtkWidget *_seccombo; | 144 | GtkWidget *_seccombo; |
1008 | 152 | gint _n_secs; | 145 | gint _n_secs; |
1009 | 146 | |||
1010 | 147 | PlaceEntry *_active; | ||
1011 | 153 | }; | 148 | }; |
1012 | 154 | 149 | ||
1013 | 155 | 150 |
+1 looks good