Merge lp:~unity-team/unity/panel-fixes-2011-03-17 into lp:unity
- panel-fixes-2011-03-17
- Merge into trunk
Proposed by
Neil J. Patel
Status: | Merged | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Gord Allott | ||||||||||||||||
Approved revision: | no longer in the source branch. | ||||||||||||||||
Merged at revision: | 967 | ||||||||||||||||
Proposed branch: | lp:~unity-team/unity/panel-fixes-2011-03-17 | ||||||||||||||||
Merge into: | lp:unity | ||||||||||||||||
Diff against target: |
556 lines (+206/-19) 17 files modified
services/panel-main.c (+29/-0) services/panel-marshal.list (+1/-0) services/panel-service.c (+31/-0) src/DeviceLauncherIcon.cpp (+6/-0) src/IndicatorObjectEntryProxy.h (+3/-1) src/IndicatorObjectEntryProxyRemote.cpp (+10/-1) src/IndicatorObjectEntryProxyRemote.h (+2/-0) src/IndicatorObjectFactoryRemote.cpp (+45/-11) src/IndicatorObjectFactoryRemote.h (+1/-0) src/IndicatorObjectProxyRemote.cpp (+1/-1) src/PanelIndicatorObjectEntryView.cpp (+33/-1) src/PanelIndicatorObjectEntryView.h (+1/-0) src/PanelMenuView.cpp (+22/-4) src/PanelMenuView.h (+2/-0) src/PlaceEntryHome.cpp (+15/-0) src/PlaceEntryHome.h (+1/-0) src/PlaceEntryRemote.cpp (+3/-0) |
||||||||||||||||
To merge this branch: | bzr merge lp:~unity-team/unity/panel-fixes-2011-03-17 | ||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jay Taoko (community) | Approve | ||
Review via email: mp+53824@code.launchpad.net |
Commit message
Description of the change
Bugs attached
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 | === modified file 'services/panel-main.c' | |||
2 | --- services/panel-main.c 2011-03-17 12:02:24 +0000 | |||
3 | +++ services/panel-main.c 2011-03-17 14:17:24 +0000 | |||
4 | @@ -89,6 +89,11 @@ | |||
5 | 89 | " <arg type='s' name='entry_id' />" | 89 | " <arg type='s' name='entry_id' />" |
6 | 90 | " </signal>" | 90 | " </signal>" |
7 | 91 | "" | 91 | "" |
8 | 92 | " <signal name='EntryShowNowChanged'>" | ||
9 | 93 | " <arg type='s' name='entry_id' />" | ||
10 | 94 | " <arg type='b' name='show_now_state' />" | ||
11 | 95 | " </signal>" | ||
12 | 96 | "" | ||
13 | 92 | " </interface>" | 97 | " </interface>" |
14 | 93 | "</node>"; | 98 | "</node>"; |
15 | 94 | 99 | ||
16 | @@ -278,6 +283,28 @@ | |||
17 | 278 | } | 283 | } |
18 | 279 | 284 | ||
19 | 280 | static void | 285 | static void |
20 | 286 | on_service_entry_show_now_changed (PanelService *service, | ||
21 | 287 | const gchar *entry_id, | ||
22 | 288 | gboolean show_now_state, | ||
23 | 289 | GDBusConnection *connection) | ||
24 | 290 | { | ||
25 | 291 | GError *error = NULL; | ||
26 | 292 | g_dbus_connection_emit_signal (connection, | ||
27 | 293 | S_NAME, | ||
28 | 294 | S_PATH, | ||
29 | 295 | S_IFACE, | ||
30 | 296 | "EntryShowNowChanged", | ||
31 | 297 | g_variant_new ("(sb)", entry_id, show_now_state), | ||
32 | 298 | &error); | ||
33 | 299 | |||
34 | 300 | if (error) | ||
35 | 301 | { | ||
36 | 302 | g_warning ("Unable to emit EntryShowNowChanged signal: %s", error->message); | ||
37 | 303 | g_error_free (error); | ||
38 | 304 | } | ||
39 | 305 | } | ||
40 | 306 | |||
41 | 307 | static void | ||
42 | 281 | on_bus_acquired (GDBusConnection *connection, | 308 | on_bus_acquired (GDBusConnection *connection, |
43 | 282 | const gchar *name, | 309 | const gchar *name, |
44 | 283 | gpointer user_data) | 310 | gpointer user_data) |
45 | @@ -300,6 +327,8 @@ | |||
46 | 300 | G_CALLBACK (on_service_active_menu_pointer_motion), connection); | 327 | G_CALLBACK (on_service_active_menu_pointer_motion), connection); |
47 | 301 | g_signal_connect (service, "entry-activate-request", | 328 | g_signal_connect (service, "entry-activate-request", |
48 | 302 | G_CALLBACK (on_service_entry_activate_request), connection); | 329 | G_CALLBACK (on_service_entry_activate_request), connection); |
49 | 330 | g_signal_connect (service, "entry-show-now-changed", | ||
50 | 331 | G_CALLBACK (on_service_entry_show_now_changed), connection); | ||
51 | 303 | 332 | ||
52 | 304 | g_debug ("%s", G_STRFUNC); | 333 | g_debug ("%s", G_STRFUNC); |
53 | 305 | g_assert (reg_id > 0); | 334 | g_assert (reg_id > 0); |
54 | 306 | 335 | ||
55 | === modified file 'services/panel-marshal.list' | |||
56 | --- services/panel-marshal.list 2011-03-01 15:39:36 +0000 | |||
57 | +++ services/panel-marshal.list 2011-03-17 14:17:24 +0000 | |||
58 | @@ -1,1 +1,2 @@ | |||
59 | 1 | NONE:OBJECT,POINTER,INT,INT,INT,INT | 1 | NONE:OBJECT,POINTER,INT,INT,INT,INT |
60 | 2 | VOID:STRING,BOOLEAN | ||
61 | 2 | 3 | ||
62 | === modified file 'services/panel-service.c' | |||
63 | --- services/panel-service.c 2011-03-14 08:51:09 +0000 | |||
64 | +++ services/panel-service.c 2011-03-17 14:17:24 +0000 | |||
65 | @@ -28,6 +28,8 @@ | |||
66 | 28 | #include <gtk/gtk.h> | 28 | #include <gtk/gtk.h> |
67 | 29 | #include <gdk/gdkx.h> | 29 | #include <gdk/gdkx.h> |
68 | 30 | 30 | ||
69 | 31 | #include "panel-marshal.h" | ||
70 | 32 | |||
71 | 31 | G_DEFINE_TYPE (PanelService, panel_service, G_TYPE_OBJECT); | 33 | G_DEFINE_TYPE (PanelService, panel_service, G_TYPE_OBJECT); |
72 | 32 | 34 | ||
73 | 33 | #define GET_PRIVATE(o) \ | 35 | #define GET_PRIVATE(o) \ |
74 | @@ -68,6 +70,7 @@ | |||
75 | 68 | RE_SYNC, | 70 | RE_SYNC, |
76 | 69 | ACTIVE_MENU_POINTER_MOTION, | 71 | ACTIVE_MENU_POINTER_MOTION, |
77 | 70 | ENTRY_ACTIVATE_REQUEST, | 72 | ENTRY_ACTIVATE_REQUEST, |
78 | 73 | ENTRY_SHOW_NOW_CHANGED, | ||
79 | 71 | GEOMETRIES_CHANGED, | 74 | GEOMETRIES_CHANGED, |
80 | 72 | 75 | ||
81 | 73 | LAST_SIGNAL | 76 | LAST_SIGNAL |
82 | @@ -192,6 +195,15 @@ | |||
83 | 192 | G_TYPE_OBJECT, G_TYPE_POINTER, | 195 | G_TYPE_OBJECT, G_TYPE_POINTER, |
84 | 193 | 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); |
85 | 194 | 197 | ||
86 | 198 | _service_signals[ENTRY_SHOW_NOW_CHANGED] = | ||
87 | 199 | g_signal_new ("entry-show-now-changed", | ||
88 | 200 | G_OBJECT_CLASS_TYPE (obj_class), | ||
89 | 201 | G_SIGNAL_RUN_LAST, | ||
90 | 202 | 0, | ||
91 | 203 | NULL, NULL, | ||
92 | 204 | panel_marshal_VOID__STRING_BOOLEAN, | ||
93 | 205 | G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_BOOLEAN); | ||
94 | 206 | |||
95 | 195 | 207 | ||
96 | 196 | g_type_class_add_private (obj_class, sizeof (PanelServicePrivate)); | 208 | g_type_class_add_private (obj_class, sizeof (PanelServicePrivate)); |
97 | 197 | } | 209 | } |
98 | @@ -540,6 +552,23 @@ | |||
99 | 540 | } | 552 | } |
100 | 541 | 553 | ||
101 | 542 | static void | 554 | static void |
102 | 555 | on_indicator_menu_show_now_changed (IndicatorObject *object, | ||
103 | 556 | IndicatorObjectEntry *entry, | ||
104 | 557 | gboolean show_now_changed, | ||
105 | 558 | PanelService *self) | ||
106 | 559 | { | ||
107 | 560 | gchar *entry_id; | ||
108 | 561 | |||
109 | 562 | g_return_if_fail (PANEL_IS_SERVICE (self)); | ||
110 | 563 | |||
111 | 564 | entry_id = g_strdup_printf ("%p", entry); | ||
112 | 565 | |||
113 | 566 | g_signal_emit (self, _service_signals[ENTRY_SHOW_NOW_CHANGED], 0, entry_id, show_now_changed); | ||
114 | 567 | |||
115 | 568 | g_free (entry_id); | ||
116 | 569 | } | ||
117 | 570 | |||
118 | 571 | static void | ||
119 | 543 | load_indicator (PanelService *self, IndicatorObject *object, const gchar *_name) | 572 | load_indicator (PanelService *self, IndicatorObject *object, const gchar *_name) |
120 | 544 | { | 573 | { |
121 | 545 | PanelServicePrivate *priv = self->priv; | 574 | PanelServicePrivate *priv = self->priv; |
122 | @@ -563,6 +592,8 @@ | |||
123 | 563 | G_CALLBACK (on_entry_moved), self); | 592 | G_CALLBACK (on_entry_moved), self); |
124 | 564 | g_signal_connect (object, INDICATOR_OBJECT_SIGNAL_MENU_SHOW, | 593 | g_signal_connect (object, INDICATOR_OBJECT_SIGNAL_MENU_SHOW, |
125 | 565 | G_CALLBACK (on_indicator_menu_show), self); | 594 | G_CALLBACK (on_indicator_menu_show), self); |
126 | 595 | g_signal_connect (object, INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED, | ||
127 | 596 | G_CALLBACK (on_indicator_menu_show_now_changed), self); | ||
128 | 566 | 597 | ||
129 | 567 | entries = indicator_object_get_entries (object); | 598 | entries = indicator_object_get_entries (object); |
130 | 568 | for (entry = entries; entry != NULL; entry = entry->next) | 599 | for (entry = entries; entry != NULL; entry = entry->next) |
131 | 569 | 600 | ||
132 | === modified file 'src/DeviceLauncherIcon.cpp' | |||
133 | --- src/DeviceLauncherIcon.cpp 2011-03-07 21:15:07 +0000 | |||
134 | +++ src/DeviceLauncherIcon.cpp 2011-03-17 14:17:24 +0000 | |||
135 | @@ -284,6 +284,7 @@ | |||
136 | 284 | void | 284 | void |
137 | 285 | DeviceLauncherIcon::OnRemoved (GVolume *volume, DeviceLauncherIcon *self) | 285 | DeviceLauncherIcon::OnRemoved (GVolume *volume, DeviceLauncherIcon *self) |
138 | 286 | { | 286 | { |
139 | 287 | self->_volume = NULL; | ||
140 | 287 | self->Remove (); | 288 | self->Remove (); |
141 | 288 | } | 289 | } |
142 | 289 | 290 | ||
143 | @@ -315,6 +316,11 @@ | |||
144 | 315 | { | 316 | { |
145 | 316 | GDrive *drive; | 317 | GDrive *drive; |
146 | 317 | 318 | ||
147 | 319 | if (!self || !G_IS_VOLUME (self->_volume)) | ||
148 | 320 | { | ||
149 | 321 | return; | ||
150 | 322 | } | ||
151 | 323 | |||
152 | 318 | drive = g_volume_get_drive (self->_volume); | 324 | drive = g_volume_get_drive (self->_volume); |
153 | 319 | g_drive_stop_finish (drive, result, NULL); | 325 | g_drive_stop_finish (drive, result, NULL); |
154 | 320 | g_object_unref (drive); | 326 | g_object_unref (drive); |
155 | 321 | 327 | ||
156 | === modified file 'src/IndicatorObjectEntryProxy.h' | |||
157 | --- src/IndicatorObjectEntryProxy.h 2011-01-11 15:48:03 +0000 | |||
158 | +++ src/IndicatorObjectEntryProxy.h 2011-03-17 14:17:24 +0000 | |||
159 | @@ -35,17 +35,19 @@ | |||
160 | 35 | virtual void SetActive (bool active) = 0; | 35 | virtual void SetActive (bool active) = 0; |
161 | 36 | virtual bool GetActive () = 0; | 36 | virtual bool GetActive () = 0; |
162 | 37 | virtual void ShowMenu (int x, int y, guint32 timestamp, guint32 button) = 0; | 37 | virtual void ShowMenu (int x, int y, guint32 timestamp, guint32 button) = 0; |
164 | 38 | virtual void Scroll (int delta) = 0; | 38 | virtual void Scroll (int delta) = 0; |
165 | 39 | 39 | ||
166 | 40 | // Signals | 40 | // Signals |
167 | 41 | sigc::signal<void> updated; | 41 | sigc::signal<void> updated; |
168 | 42 | sigc::signal<void, bool> active_changed; | 42 | sigc::signal<void, bool> active_changed; |
169 | 43 | sigc::signal<void, bool> show_now_changed; | ||
170 | 43 | 44 | ||
171 | 44 | public: | 45 | public: |
172 | 45 | bool label_visible; | 46 | bool label_visible; |
173 | 46 | bool label_sensitive; | 47 | bool label_sensitive; |
174 | 47 | bool icon_visible; | 48 | bool icon_visible; |
175 | 48 | bool icon_sensitive; | 49 | bool icon_sensitive; |
176 | 50 | bool show_now; | ||
177 | 49 | }; | 51 | }; |
178 | 50 | 52 | ||
179 | 51 | #endif // INDICATOR_OBJECT_ENTRY_PROXY_H | 53 | #endif // INDICATOR_OBJECT_ENTRY_PROXY_H |
180 | 52 | 54 | ||
181 | === modified file 'src/IndicatorObjectEntryProxyRemote.cpp' | |||
182 | --- src/IndicatorObjectEntryProxyRemote.cpp 2011-01-11 15:48:03 +0000 | |||
183 | +++ src/IndicatorObjectEntryProxyRemote.cpp 2011-03-17 14:17:24 +0000 | |||
184 | @@ -33,6 +33,7 @@ | |||
185 | 33 | label_sensitive = true; | 33 | label_sensitive = true; |
186 | 34 | icon_visible = false; | 34 | icon_visible = false; |
187 | 35 | icon_sensitive = true; | 35 | icon_sensitive = true; |
188 | 36 | show_now = false; | ||
189 | 36 | } | 37 | } |
190 | 37 | 38 | ||
191 | 38 | 39 | ||
192 | @@ -146,6 +147,14 @@ | |||
193 | 146 | updated.emit (); | 147 | updated.emit (); |
194 | 147 | } | 148 | } |
195 | 148 | 149 | ||
196 | 150 | void | ||
197 | 151 | IndicatorObjectEntryProxyRemote::OnShowNowChanged (bool show_now_state) | ||
198 | 152 | { | ||
199 | 153 | show_now = show_now_state; | ||
200 | 154 | show_now_changed.emit (show_now_state); | ||
201 | 155 | updated.emit (); | ||
202 | 156 | } | ||
203 | 157 | |||
204 | 149 | const char * | 158 | const char * |
205 | 150 | IndicatorObjectEntryProxyRemote::GetId () | 159 | IndicatorObjectEntryProxyRemote::GetId () |
206 | 151 | { | 160 | { |
207 | @@ -162,4 +171,4 @@ | |||
208 | 162 | IndicatorObjectEntryProxyRemote::Scroll (int delta) | 171 | IndicatorObjectEntryProxyRemote::Scroll (int delta) |
209 | 163 | { | 172 | { |
210 | 164 | OnScroll.emit(_id, delta); | 173 | OnScroll.emit(_id, delta); |
211 | 165 | } | ||
212 | 166 | \ No newline at end of file | 174 | \ No newline at end of file |
213 | 175 | } | ||
214 | 167 | 176 | ||
215 | === modified file 'src/IndicatorObjectEntryProxyRemote.h' | |||
216 | --- src/IndicatorObjectEntryProxyRemote.h 2011-01-11 15:48:03 +0000 | |||
217 | +++ src/IndicatorObjectEntryProxyRemote.h 2011-03-17 14:17:24 +0000 | |||
218 | @@ -58,6 +58,8 @@ | |||
219 | 58 | bool __image_sensitive, | 58 | bool __image_sensitive, |
220 | 59 | bool __image_visible); | 59 | bool __image_visible); |
221 | 60 | 60 | ||
222 | 61 | void OnShowNowChanged (bool show_now_state); | ||
223 | 62 | |||
224 | 61 | // Signals | 63 | // Signals |
225 | 62 | sigc::signal<void, const char *, int, int, guint32, guint32> OnShowMenuRequest; | 64 | sigc::signal<void, const char *, int, int, guint32, guint32> OnShowMenuRequest; |
226 | 63 | sigc::signal<void, const char *, int> OnScroll; | 65 | sigc::signal<void, const char *, int> OnScroll; |
227 | 64 | 66 | ||
228 | === modified file 'src/IndicatorObjectFactoryRemote.cpp' | |||
229 | --- src/IndicatorObjectFactoryRemote.cpp 2011-03-17 09:28:30 +0000 | |||
230 | +++ src/IndicatorObjectFactoryRemote.cpp 2011-03-17 14:17:24 +0000 | |||
231 | @@ -246,14 +246,14 @@ | |||
232 | 246 | { | 246 | { |
233 | 247 | std::vector<IndicatorObjectProxy*>::iterator it; | 247 | std::vector<IndicatorObjectProxy*>::iterator it; |
234 | 248 | 248 | ||
236 | 249 | for (it = _indicators.begin(); it != _indicators.end(); it++) | 249 | for (it = _indicators.begin(); it != _indicators.end(); ++it) |
237 | 250 | { | 250 | { |
238 | 251 | IndicatorObjectProxyRemote *object = static_cast<IndicatorObjectProxyRemote *> (*it); | 251 | IndicatorObjectProxyRemote *object = static_cast<IndicatorObjectProxyRemote *> (*it); |
240 | 252 | std::vector<IndicatorObjectEntryProxy*>::iterator it; | 252 | std::vector<IndicatorObjectEntryProxy*>::iterator it2; |
241 | 253 | 253 | ||
243 | 254 | for (it = object->GetEntries ().begin(); it != object->GetEntries ().end(); it++) | 254 | for (it2 = object->GetEntries ().begin(); it2 != object->GetEntries ().end(); ++it2) |
244 | 255 | { | 255 | { |
246 | 256 | IndicatorObjectEntryProxyRemote *entry = static_cast<IndicatorObjectEntryProxyRemote *> (*it); | 256 | IndicatorObjectEntryProxyRemote *entry = static_cast<IndicatorObjectEntryProxyRemote *> (*it2); |
247 | 257 | 257 | ||
248 | 258 | entry->SetActive (g_strcmp0 (entry_id, entry->GetId ()) == 0); | 258 | entry->SetActive (g_strcmp0 (entry_id, entry->GetId ()) == 0); |
249 | 259 | } | 259 | } |
250 | @@ -268,6 +268,29 @@ | |||
251 | 268 | OnEntryActivateRequest.emit (entry_id); | 268 | OnEntryActivateRequest.emit (entry_id); |
252 | 269 | } | 269 | } |
253 | 270 | 270 | ||
254 | 271 | void | ||
255 | 272 | IndicatorObjectFactoryRemote::OnEntryShowNowChanged (const char *entry_id, bool show_now_state) | ||
256 | 273 | { | ||
257 | 274 | std::vector<IndicatorObjectProxy*>::iterator it; | ||
258 | 275 | |||
259 | 276 | for (it = _indicators.begin(); it != _indicators.end(); ++it) | ||
260 | 277 | { | ||
261 | 278 | IndicatorObjectProxyRemote *object = static_cast<IndicatorObjectProxyRemote *> (*it); | ||
262 | 279 | std::vector<IndicatorObjectEntryProxy*>::iterator it2; | ||
263 | 280 | |||
264 | 281 | for (it2 = object->GetEntries ().begin(); it2 != object->GetEntries ().end(); ++it2) | ||
265 | 282 | { | ||
266 | 283 | IndicatorObjectEntryProxyRemote *entry = static_cast<IndicatorObjectEntryProxyRemote *> (*it2); | ||
267 | 284 | |||
268 | 285 | if (g_strcmp0 (entry_id, entry->GetId ()) == 0) | ||
269 | 286 | { | ||
270 | 287 | entry->OnShowNowChanged (show_now_state); | ||
271 | 288 | return; | ||
272 | 289 | } | ||
273 | 290 | } | ||
274 | 291 | } | ||
275 | 292 | } | ||
276 | 293 | |||
277 | 271 | IndicatorObjectProxyRemote * | 294 | IndicatorObjectProxyRemote * |
278 | 272 | IndicatorObjectFactoryRemote::IndicatorForID (const char *id) | 295 | IndicatorObjectFactoryRemote::IndicatorForID (const char *id) |
279 | 273 | { | 296 | { |
280 | @@ -498,13 +521,24 @@ | |||
281 | 498 | remote); | 521 | remote); |
282 | 499 | } | 522 | } |
283 | 500 | else if (g_strcmp0 (signal_name, "ActiveMenuPointerMotion") == 0) | 523 | else if (g_strcmp0 (signal_name, "ActiveMenuPointerMotion") == 0) |
291 | 501 | { | 524 | { |
292 | 502 | int x=0, y=0; | 525 | int x=0, y=0; |
293 | 503 | 526 | ||
294 | 504 | g_variant_get (parameters, "(ii)", &x, &y); | 527 | g_variant_get (parameters, "(ii)", &x, &y); |
295 | 505 | 528 | ||
296 | 506 | remote->OnMenuPointerMoved.emit (x, y); | 529 | remote->OnMenuPointerMoved.emit (x, y); |
297 | 507 | } | 530 | } |
298 | 531 | else if (g_strcmp0 (signal_name, "EntryShowNowChanged") == 0) | ||
299 | 532 | { | ||
300 | 533 | gchar *id = NULL; | ||
301 | 534 | bool show_now_state; | ||
302 | 535 | |||
303 | 536 | g_variant_get (parameters, "(sb)", &id, &show_now_state); | ||
304 | 537 | |||
305 | 538 | remote->OnEntryShowNowChanged (id, show_now_state ? true : false); | ||
306 | 539 | |||
307 | 540 | g_free (id); | ||
308 | 541 | } | ||
309 | 508 | } | 542 | } |
310 | 509 | 543 | ||
311 | 510 | static void | 544 | static void |
312 | 511 | 545 | ||
313 | === modified file 'src/IndicatorObjectFactoryRemote.h' | |||
314 | --- src/IndicatorObjectFactoryRemote.h 2011-01-11 15:48:03 +0000 | |||
315 | +++ src/IndicatorObjectFactoryRemote.h 2011-03-17 14:17:24 +0000 | |||
316 | @@ -46,6 +46,7 @@ | |||
317 | 46 | void Sync (GVariant *args); | 46 | void Sync (GVariant *args); |
318 | 47 | void OnEntryActivateRequestReceived (const char *entry_id); | 47 | void OnEntryActivateRequestReceived (const char *entry_id); |
319 | 48 | void Reconnect (); | 48 | void Reconnect (); |
320 | 49 | void OnEntryShowNowChanged (const char *entry_id, bool show_now_state); | ||
321 | 49 | 50 | ||
322 | 50 | void AddProperties (GVariantBuilder *builder); | 51 | void AddProperties (GVariantBuilder *builder); |
323 | 51 | 52 | ||
324 | 52 | 53 | ||
325 | === modified file 'src/IndicatorObjectProxyRemote.cpp' | |||
326 | --- src/IndicatorObjectProxyRemote.cpp 2011-01-11 15:48:03 +0000 | |||
327 | +++ src/IndicatorObjectProxyRemote.cpp 2011-03-17 14:17:24 +0000 | |||
328 | @@ -149,7 +149,7 @@ | |||
329 | 149 | 149 | ||
330 | 150 | void | 150 | void |
331 | 151 | IndicatorObjectProxyRemote::OnScrollReceived (const char *entry_id, | 151 | IndicatorObjectProxyRemote::OnScrollReceived (const char *entry_id, |
333 | 152 | int delta) | 152 | int delta) |
334 | 153 | { | 153 | { |
335 | 154 | OnScroll.emit(entry_id, delta); | 154 | OnScroll.emit(entry_id, delta); |
336 | 155 | } | 155 | } |
337 | 156 | 156 | ||
338 | === modified file 'src/PanelIndicatorObjectEntryView.cpp' | |||
339 | --- src/PanelIndicatorObjectEntryView.cpp 2011-03-10 13:39:09 +0000 | |||
340 | +++ src/PanelIndicatorObjectEntryView.cpp 2011-03-17 14:17:24 +0000 | |||
341 | @@ -126,9 +126,10 @@ | |||
342 | 126 | PanelIndicatorObjectEntryView::Refresh () | 126 | PanelIndicatorObjectEntryView::Refresh () |
343 | 127 | { | 127 | { |
344 | 128 | GdkPixbuf *pixbuf = _proxy->GetPixbuf (); | 128 | GdkPixbuf *pixbuf = _proxy->GetPixbuf (); |
346 | 129 | char *label = fix_string (_proxy->GetLabel ()); | 129 | char *label = NULL; |
347 | 130 | PangoLayout *layout = NULL; | 130 | PangoLayout *layout = NULL; |
348 | 131 | PangoFontDescription *desc = NULL; | 131 | PangoFontDescription *desc = NULL; |
349 | 132 | PangoAttrList *attrs = NULL; | ||
350 | 132 | GtkSettings *settings = gtk_settings_get_default (); | 133 | GtkSettings *settings = gtk_settings_get_default (); |
351 | 133 | cairo_t *cr; | 134 | cairo_t *cr; |
352 | 134 | char *font_description = NULL; | 135 | char *font_description = NULL; |
353 | @@ -147,6 +148,25 @@ | |||
354 | 147 | nux::Color textcol = style->GetTextColor (); | 148 | nux::Color textcol = style->GetTextColor (); |
355 | 148 | nux::Color textshadowcol = style->GetTextShadow (); | 149 | nux::Color textshadowcol = style->GetTextShadow (); |
356 | 149 | 150 | ||
357 | 151 | if (_proxy->show_now) | ||
358 | 152 | { | ||
359 | 153 | if (!pango_parse_markup (_proxy->GetLabel (), | ||
360 | 154 | -1, | ||
361 | 155 | '_', | ||
362 | 156 | &attrs, | ||
363 | 157 | &label, | ||
364 | 158 | NULL, | ||
365 | 159 | NULL)) | ||
366 | 160 | { | ||
367 | 161 | label = g_strdup (_proxy->GetLabel ()); | ||
368 | 162 | g_debug ("failed"); | ||
369 | 163 | } | ||
370 | 164 | } | ||
371 | 165 | else | ||
372 | 166 | { | ||
373 | 167 | label = fix_string (_proxy->GetLabel ()); | ||
374 | 168 | } | ||
375 | 169 | |||
376 | 150 | // First lets figure out our size | 170 | // First lets figure out our size |
377 | 151 | if (pixbuf && _proxy->icon_visible) | 171 | if (pixbuf && _proxy->icon_visible) |
378 | 152 | { | 172 | { |
379 | @@ -169,6 +189,12 @@ | |||
380 | 169 | pango_font_description_set_weight (desc, PANGO_WEIGHT_NORMAL); | 189 | pango_font_description_set_weight (desc, PANGO_WEIGHT_NORMAL); |
381 | 170 | 190 | ||
382 | 171 | layout = pango_cairo_create_layout (cr); | 191 | layout = pango_cairo_create_layout (cr); |
383 | 192 | if (attrs) | ||
384 | 193 | { | ||
385 | 194 | pango_layout_set_attributes (layout, attrs); | ||
386 | 195 | pango_attr_list_unref (attrs); | ||
387 | 196 | } | ||
388 | 197 | |||
389 | 172 | pango_layout_set_font_description (layout, desc); | 198 | pango_layout_set_font_description (layout, desc); |
390 | 173 | pango_layout_set_text (layout, label, -1); | 199 | pango_layout_set_text (layout, label, -1); |
391 | 174 | 200 | ||
392 | @@ -395,3 +421,9 @@ | |||
393 | 395 | 421 | ||
394 | 396 | g_variant_builder_add (builder, "{sv}", "active", g_variant_new_boolean (_proxy->GetActive ())); | 422 | g_variant_builder_add (builder, "{sv}", "active", g_variant_new_boolean (_proxy->GetActive ())); |
395 | 397 | } | 423 | } |
396 | 424 | |||
397 | 425 | bool | ||
398 | 426 | PanelIndicatorObjectEntryView::GetShowNow () | ||
399 | 427 | { | ||
400 | 428 | return _proxy ? _proxy->show_now : false; | ||
401 | 429 | } | ||
402 | 398 | 430 | ||
403 | === modified file 'src/PanelIndicatorObjectEntryView.h' | |||
404 | --- src/PanelIndicatorObjectEntryView.h 2011-01-25 15:35:00 +0000 | |||
405 | +++ src/PanelIndicatorObjectEntryView.h 2011-03-17 14:17:24 +0000 | |||
406 | @@ -43,6 +43,7 @@ | |||
407 | 43 | void OnMouseWheel (int x, int y, int delta, unsigned long mouse_state, unsigned long key_state); | 43 | void OnMouseWheel (int x, int y, int delta, unsigned long mouse_state, unsigned long key_state); |
408 | 44 | void Activate (); | 44 | void Activate (); |
409 | 45 | void OnActiveChanged (bool is_active); | 45 | void OnActiveChanged (bool is_active); |
410 | 46 | bool GetShowNow (); | ||
411 | 46 | 47 | ||
412 | 47 | const gchar * GetName (); | 48 | const gchar * GetName (); |
413 | 48 | void AddProperties (GVariantBuilder *builder); | 49 | void AddProperties (GVariantBuilder *builder); |
414 | 49 | 50 | ||
415 | === modified file 'src/PanelMenuView.cpp' | |||
416 | --- src/PanelMenuView.cpp 2011-03-13 21:40:17 +0000 | |||
417 | +++ src/PanelMenuView.cpp 2011-03-17 14:17:24 +0000 | |||
418 | @@ -65,7 +65,8 @@ | |||
419 | 65 | _last_active_view (NULL), | 65 | _last_active_view (NULL), |
420 | 66 | _last_width (0), | 66 | _last_width (0), |
421 | 67 | _last_height (0), | 67 | _last_height (0), |
423 | 68 | _places_showing (false) | 68 | _places_showing (false), |
424 | 69 | _show_now_activated (false) | ||
425 | 69 | { | 70 | { |
426 | 70 | WindowManager *win_manager; | 71 | WindowManager *win_manager; |
427 | 71 | 72 | ||
428 | @@ -255,12 +256,12 @@ | |||
429 | 255 | } | 256 | } |
430 | 256 | else if (_is_maximized) | 257 | else if (_is_maximized) |
431 | 257 | { | 258 | { |
433 | 258 | if (!_is_inside && !_last_active_view) | 259 | if (!_is_inside && !_last_active_view && !_show_now_activated) |
434 | 259 | gPainter.PushDrawLayer (GfxContext, GetGeometry (), _title_layer); | 260 | gPainter.PushDrawLayer (GfxContext, GetGeometry (), _title_layer); |
435 | 260 | } | 261 | } |
436 | 261 | else | 262 | else |
437 | 262 | { | 263 | { |
439 | 263 | if ((_is_inside || _last_active_view) && _entries.size ()) | 264 | if ((_is_inside || _last_active_view || _show_now_activated) && _entries.size ()) |
440 | 264 | { | 265 | { |
441 | 265 | if (_gradient_texture == NULL) | 266 | if (_gradient_texture == NULL) |
442 | 266 | { | 267 | { |
443 | @@ -349,7 +350,7 @@ | |||
444 | 349 | 350 | ||
445 | 350 | if (!_is_own_window && !_places_showing) | 351 | if (!_is_own_window && !_places_showing) |
446 | 351 | { | 352 | { |
448 | 352 | if (_is_inside || _last_active_view) | 353 | if (_is_inside || _last_active_view || _show_now_activated) |
449 | 353 | { | 354 | { |
450 | 354 | _layout->ProcessDraw (GfxContext, force_draw); | 355 | _layout->ProcessDraw (GfxContext, force_draw); |
451 | 355 | } | 356 | } |
452 | @@ -603,6 +604,7 @@ | |||
453 | 603 | PanelIndicatorObjectEntryView *view = new PanelIndicatorObjectEntryView (proxy, 6); | 604 | PanelIndicatorObjectEntryView *view = new PanelIndicatorObjectEntryView (proxy, 6); |
454 | 604 | view->active_changed.connect (sigc::mem_fun (this, &PanelMenuView::OnActiveChanged)); | 605 | view->active_changed.connect (sigc::mem_fun (this, &PanelMenuView::OnActiveChanged)); |
455 | 605 | view->refreshed.connect (sigc::mem_fun (this, &PanelMenuView::OnEntryRefreshed)); | 606 | view->refreshed.connect (sigc::mem_fun (this, &PanelMenuView::OnEntryRefreshed)); |
456 | 607 | proxy->show_now_changed.connect (sigc::mem_fun (this, &PanelMenuView::UpdateShowNow)); | ||
457 | 606 | _menu_layout->AddView (view, 0, nux::eCenter, nux::eFull); | 608 | _menu_layout->AddView (view, 0, nux::eCenter, nux::eFull); |
458 | 607 | _menu_layout->SetContentDistribution (nux::eStackLeft); | 609 | _menu_layout->SetContentDistribution (nux::eStackLeft); |
459 | 608 | 610 | ||
460 | @@ -914,3 +916,19 @@ | |||
461 | 914 | self->QueueDraw (); | 916 | self->QueueDraw (); |
462 | 915 | } | 917 | } |
463 | 916 | 918 | ||
464 | 919 | void | ||
465 | 920 | PanelMenuView::UpdateShowNow (bool ignore) | ||
466 | 921 | { | ||
467 | 922 | std::vector<PanelIndicatorObjectEntryView *>::iterator it; | ||
468 | 923 | _show_now_activated = false; | ||
469 | 924 | |||
470 | 925 | for (it = _entries.begin(); it != _entries.end(); it++) | ||
471 | 926 | { | ||
472 | 927 | PanelIndicatorObjectEntryView *view = static_cast<PanelIndicatorObjectEntryView *> (*it); | ||
473 | 928 | if (view->GetShowNow ()) | ||
474 | 929 | _show_now_activated = true; | ||
475 | 930 | |||
476 | 931 | } | ||
477 | 932 | QueueDraw (); | ||
478 | 933 | } | ||
479 | 934 | |||
480 | 917 | 935 | ||
481 | === modified file 'src/PanelMenuView.h' | |||
482 | --- src/PanelMenuView.h 2011-03-13 21:40:17 +0000 | |||
483 | +++ src/PanelMenuView.h 2011-03-17 14:17:24 +0000 | |||
484 | @@ -95,6 +95,7 @@ | |||
485 | 95 | gchar * GetActiveViewName (); | 95 | gchar * GetActiveViewName (); |
486 | 96 | static void OnPlaceViewShown (GVariant *data, PanelMenuView *self); | 96 | static void OnPlaceViewShown (GVariant *data, PanelMenuView *self); |
487 | 97 | static void OnPlaceViewHidden (GVariant *data, PanelMenuView *self); | 97 | static void OnPlaceViewHidden (GVariant *data, PanelMenuView *self); |
488 | 98 | void UpdateShowNow (bool ignore); | ||
489 | 98 | 99 | ||
490 | 99 | private: | 100 | private: |
491 | 100 | BamfMatcher* _matcher; | 101 | BamfMatcher* _matcher; |
492 | @@ -123,5 +124,6 @@ | |||
493 | 123 | int _last_height; | 124 | int _last_height; |
494 | 124 | 125 | ||
495 | 125 | bool _places_showing; | 126 | bool _places_showing; |
496 | 127 | bool _show_now_activated; | ||
497 | 126 | }; | 128 | }; |
498 | 127 | #endif | 129 | #endif |
499 | 128 | 130 | ||
500 | === modified file 'src/PlaceEntryHome.cpp' | |||
501 | --- src/PlaceEntryHome.cpp 2011-03-15 10:39:09 +0000 | |||
502 | +++ src/PlaceEntryHome.cpp 2011-03-17 14:17:24 +0000 | |||
503 | @@ -21,6 +21,7 @@ | |||
504 | 21 | #include "PlaceEntryHome.h" | 21 | #include "PlaceEntryHome.h" |
505 | 22 | 22 | ||
506 | 23 | #include <glib/gi18n-lib.h> | 23 | #include <glib/gi18n-lib.h> |
507 | 24 | #include <algorithm> | ||
508 | 24 | 25 | ||
509 | 25 | class PlaceEntryGroupHome : public PlaceEntryGroup | 26 | class PlaceEntryGroupHome : public PlaceEntryGroup |
510 | 26 | { | 27 | { |
511 | @@ -95,6 +96,20 @@ | |||
512 | 95 | PlaceEntry *entry = static_cast<PlaceEntry *> (*i); | 96 | PlaceEntry *entry = static_cast<PlaceEntry *> (*i); |
513 | 96 | OnPlaceEntryAdded (entry); | 97 | OnPlaceEntryAdded (entry); |
514 | 97 | } | 98 | } |
515 | 99 | |||
516 | 100 | place->entry_removed.connect (sigc::mem_fun (this, &PlaceEntryHome::OnPlaceEntryRemoved)); | ||
517 | 101 | } | ||
518 | 102 | |||
519 | 103 | void | ||
520 | 104 | PlaceEntryHome::OnPlaceEntryRemoved (PlaceEntry *entry) | ||
521 | 105 | { | ||
522 | 106 | std::vector<PlaceEntry *>::iterator it; | ||
523 | 107 | |||
524 | 108 | it = std::find (_entries.begin (), _entries.end (), entry); | ||
525 | 109 | if (it != _entries.end ()) | ||
526 | 110 | { | ||
527 | 111 | _entries.erase (it); | ||
528 | 112 | } | ||
529 | 98 | } | 113 | } |
530 | 99 | 114 | ||
531 | 100 | void | 115 | void |
532 | 101 | 116 | ||
533 | === modified file 'src/PlaceEntryHome.h' | |||
534 | --- src/PlaceEntryHome.h 2011-03-15 10:39:09 +0000 | |||
535 | +++ src/PlaceEntryHome.h 2011-03-17 14:17:24 +0000 | |||
536 | @@ -79,6 +79,7 @@ | |||
537 | 79 | void LoadExistingEntries (); | 79 | void LoadExistingEntries (); |
538 | 80 | void OnPlaceAdded (Place *place); | 80 | void OnPlaceAdded (Place *place); |
539 | 81 | void OnPlaceEntryAdded (PlaceEntry *entry); | 81 | void OnPlaceEntryAdded (PlaceEntry *entry); |
540 | 82 | void OnPlaceEntryRemoved (PlaceEntry *entry); | ||
541 | 82 | void RefreshEntry (PlaceEntry *entry); | 83 | void RefreshEntry (PlaceEntry *entry); |
542 | 83 | 84 | ||
543 | 84 | void OnResultAdded (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result); | 85 | void OnResultAdded (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result); |
544 | 85 | 86 | ||
545 | === modified file 'src/PlaceEntryRemote.cpp' | |||
546 | --- src/PlaceEntryRemote.cpp 2011-03-15 10:39:09 +0000 | |||
547 | +++ src/PlaceEntryRemote.cpp 2011-03-17 14:17:24 +0000 | |||
548 | @@ -605,6 +605,9 @@ | |||
549 | 605 | DeeModelIter *iter = (DeeModelIter *)id; | 605 | DeeModelIter *iter = (DeeModelIter *)id; |
550 | 606 | DeeModelIter *group_iter; | 606 | DeeModelIter *group_iter; |
551 | 607 | 607 | ||
552 | 608 | if (iter == NULL || dee_model_is_last (_results_model, iter)) | ||
553 | 609 | return; | ||
554 | 610 | |||
555 | 608 | n_group = dee_model_get_uint32 (_results_model, iter, RESULT_GROUP_ID); | 611 | n_group = dee_model_get_uint32 (_results_model, iter, RESULT_GROUP_ID); |
556 | 609 | group_iter = dee_model_get_iter_at_row (_groups_model, n_group); | 612 | group_iter = dee_model_get_iter_at_row (_groups_model, n_group); |
557 | 610 | 613 |
Approved