Merge lp:~unity-team/unity/panel-fixes-2011-03-17 into lp:unity

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
Reviewer Review Type Date Requested Status
Jay Taoko (community) Approve
Review via email: mp+53824@code.launchpad.net

Description of the change

Bugs attached

To post a comment you must log in.
Revision history for this message
Jay Taoko (jaytaoko) wrote :

Approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'services/panel-main.c'
--- services/panel-main.c 2011-03-17 12:02:24 +0000
+++ services/panel-main.c 2011-03-17 14:17:24 +0000
@@ -89,6 +89,11 @@
89 " <arg type='s' name='entry_id' />"89 " <arg type='s' name='entry_id' />"
90 " </signal>"90 " </signal>"
91 ""91 ""
92 " <signal name='EntryShowNowChanged'>"
93 " <arg type='s' name='entry_id' />"
94 " <arg type='b' name='show_now_state' />"
95 " </signal>"
96 ""
92 " </interface>"97 " </interface>"
93 "</node>";98 "</node>";
9499
@@ -278,6 +283,28 @@
278}283}
279284
280static void285static void
286on_service_entry_show_now_changed (PanelService *service,
287 const gchar *entry_id,
288 gboolean show_now_state,
289 GDBusConnection *connection)
290{
291 GError *error = NULL;
292 g_dbus_connection_emit_signal (connection,
293 S_NAME,
294 S_PATH,
295 S_IFACE,
296 "EntryShowNowChanged",
297 g_variant_new ("(sb)", entry_id, show_now_state),
298 &error);
299
300 if (error)
301 {
302 g_warning ("Unable to emit EntryShowNowChanged signal: %s", error->message);
303 g_error_free (error);
304 }
305}
306
307static void
281on_bus_acquired (GDBusConnection *connection,308on_bus_acquired (GDBusConnection *connection,
282 const gchar *name,309 const gchar *name,
283 gpointer user_data)310 gpointer user_data)
@@ -300,6 +327,8 @@
300 G_CALLBACK (on_service_active_menu_pointer_motion), connection);327 G_CALLBACK (on_service_active_menu_pointer_motion), connection);
301 g_signal_connect (service, "entry-activate-request",328 g_signal_connect (service, "entry-activate-request",
302 G_CALLBACK (on_service_entry_activate_request), connection);329 G_CALLBACK (on_service_entry_activate_request), connection);
330 g_signal_connect (service, "entry-show-now-changed",
331 G_CALLBACK (on_service_entry_show_now_changed), connection);
303332
304 g_debug ("%s", G_STRFUNC);333 g_debug ("%s", G_STRFUNC);
305 g_assert (reg_id > 0);334 g_assert (reg_id > 0);
306335
=== modified file 'services/panel-marshal.list'
--- services/panel-marshal.list 2011-03-01 15:39:36 +0000
+++ services/panel-marshal.list 2011-03-17 14:17:24 +0000
@@ -1,1 +1,2 @@
1NONE:OBJECT,POINTER,INT,INT,INT,INT1NONE:OBJECT,POINTER,INT,INT,INT,INT
2VOID:STRING,BOOLEAN
23
=== modified file 'services/panel-service.c'
--- services/panel-service.c 2011-03-14 08:51:09 +0000
+++ services/panel-service.c 2011-03-17 14:17:24 +0000
@@ -28,6 +28,8 @@
28#include <gtk/gtk.h>28#include <gtk/gtk.h>
29#include <gdk/gdkx.h>29#include <gdk/gdkx.h>
3030
31#include "panel-marshal.h"
32
31G_DEFINE_TYPE (PanelService, panel_service, G_TYPE_OBJECT);33G_DEFINE_TYPE (PanelService, panel_service, G_TYPE_OBJECT);
3234
33#define GET_PRIVATE(o) \35#define GET_PRIVATE(o) \
@@ -68,6 +70,7 @@
68 RE_SYNC,70 RE_SYNC,
69 ACTIVE_MENU_POINTER_MOTION,71 ACTIVE_MENU_POINTER_MOTION,
70 ENTRY_ACTIVATE_REQUEST,72 ENTRY_ACTIVATE_REQUEST,
73 ENTRY_SHOW_NOW_CHANGED,
71 GEOMETRIES_CHANGED,74 GEOMETRIES_CHANGED,
7275
73 LAST_SIGNAL76 LAST_SIGNAL
@@ -192,6 +195,15 @@
192 G_TYPE_OBJECT, G_TYPE_POINTER,195 G_TYPE_OBJECT, G_TYPE_POINTER,
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);
194197
198 _service_signals[ENTRY_SHOW_NOW_CHANGED] =
199 g_signal_new ("entry-show-now-changed",
200 G_OBJECT_CLASS_TYPE (obj_class),
201 G_SIGNAL_RUN_LAST,
202 0,
203 NULL, NULL,
204 panel_marshal_VOID__STRING_BOOLEAN,
205 G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_BOOLEAN);
206
195207
196 g_type_class_add_private (obj_class, sizeof (PanelServicePrivate));208 g_type_class_add_private (obj_class, sizeof (PanelServicePrivate));
197}209}
@@ -540,6 +552,23 @@
540}552}
541553
542static void554static void
555on_indicator_menu_show_now_changed (IndicatorObject *object,
556 IndicatorObjectEntry *entry,
557 gboolean show_now_changed,
558 PanelService *self)
559{
560 gchar *entry_id;
561
562 g_return_if_fail (PANEL_IS_SERVICE (self));
563
564 entry_id = g_strdup_printf ("%p", entry);
565
566 g_signal_emit (self, _service_signals[ENTRY_SHOW_NOW_CHANGED], 0, entry_id, show_now_changed);
567
568 g_free (entry_id);
569}
570
571static void
543load_indicator (PanelService *self, IndicatorObject *object, const gchar *_name)572load_indicator (PanelService *self, IndicatorObject *object, const gchar *_name)
544{573{
545 PanelServicePrivate *priv = self->priv;574 PanelServicePrivate *priv = self->priv;
@@ -563,6 +592,8 @@
563 G_CALLBACK (on_entry_moved), self);592 G_CALLBACK (on_entry_moved), self);
564 g_signal_connect (object, INDICATOR_OBJECT_SIGNAL_MENU_SHOW,593 g_signal_connect (object, INDICATOR_OBJECT_SIGNAL_MENU_SHOW,
565 G_CALLBACK (on_indicator_menu_show), self);594 G_CALLBACK (on_indicator_menu_show), self);
595 g_signal_connect (object, INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED,
596 G_CALLBACK (on_indicator_menu_show_now_changed), self);
566597
567 entries = indicator_object_get_entries (object);598 entries = indicator_object_get_entries (object);
568 for (entry = entries; entry != NULL; entry = entry->next)599 for (entry = entries; entry != NULL; entry = entry->next)
569600
=== modified file 'src/DeviceLauncherIcon.cpp'
--- src/DeviceLauncherIcon.cpp 2011-03-07 21:15:07 +0000
+++ src/DeviceLauncherIcon.cpp 2011-03-17 14:17:24 +0000
@@ -284,6 +284,7 @@
284void284void
285DeviceLauncherIcon::OnRemoved (GVolume *volume, DeviceLauncherIcon *self)285DeviceLauncherIcon::OnRemoved (GVolume *volume, DeviceLauncherIcon *self)
286{286{
287 self->_volume = NULL;
287 self->Remove ();288 self->Remove ();
288}289}
289290
@@ -315,6 +316,11 @@
315{316{
316 GDrive *drive;317 GDrive *drive;
317318
319 if (!self || !G_IS_VOLUME (self->_volume))
320 {
321 return;
322 }
323
318 drive = g_volume_get_drive (self->_volume);324 drive = g_volume_get_drive (self->_volume);
319 g_drive_stop_finish (drive, result, NULL);325 g_drive_stop_finish (drive, result, NULL);
320 g_object_unref (drive);326 g_object_unref (drive);
321327
=== modified file 'src/IndicatorObjectEntryProxy.h'
--- src/IndicatorObjectEntryProxy.h 2011-01-11 15:48:03 +0000
+++ src/IndicatorObjectEntryProxy.h 2011-03-17 14:17:24 +0000
@@ -35,17 +35,19 @@
35 virtual void SetActive (bool active) = 0;35 virtual void SetActive (bool active) = 0;
36 virtual bool GetActive () = 0;36 virtual bool GetActive () = 0;
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;
38 virtual void Scroll (int delta) = 0; 38 virtual void Scroll (int delta) = 0;
3939
40 // Signals40 // Signals
41 sigc::signal<void> updated;41 sigc::signal<void> updated;
42 sigc::signal<void, bool> active_changed;42 sigc::signal<void, bool> active_changed;
43 sigc::signal<void, bool> show_now_changed;
4344
44public:45public:
45 bool label_visible;46 bool label_visible;
46 bool label_sensitive;47 bool label_sensitive;
47 bool icon_visible;48 bool icon_visible;
48 bool icon_sensitive;49 bool icon_sensitive;
50 bool show_now;
49};51};
5052
51#endif // INDICATOR_OBJECT_ENTRY_PROXY_H53#endif // INDICATOR_OBJECT_ENTRY_PROXY_H
5254
=== modified file 'src/IndicatorObjectEntryProxyRemote.cpp'
--- src/IndicatorObjectEntryProxyRemote.cpp 2011-01-11 15:48:03 +0000
+++ src/IndicatorObjectEntryProxyRemote.cpp 2011-03-17 14:17:24 +0000
@@ -33,6 +33,7 @@
33 label_sensitive = true;33 label_sensitive = true;
34 icon_visible = false;34 icon_visible = false;
35 icon_sensitive = true;35 icon_sensitive = true;
36 show_now = false;
36}37}
3738
3839
@@ -146,6 +147,14 @@
146 updated.emit ();147 updated.emit ();
147}148}
148149
150void
151IndicatorObjectEntryProxyRemote::OnShowNowChanged (bool show_now_state)
152{
153 show_now = show_now_state;
154 show_now_changed.emit (show_now_state);
155 updated.emit ();
156}
157
149const char *158const char *
150IndicatorObjectEntryProxyRemote::GetId ()159IndicatorObjectEntryProxyRemote::GetId ()
151{160{
@@ -162,4 +171,4 @@
162IndicatorObjectEntryProxyRemote::Scroll (int delta)171IndicatorObjectEntryProxyRemote::Scroll (int delta)
163{172{
164 OnScroll.emit(_id, delta);173 OnScroll.emit(_id, delta);
165}
166\ No newline at end of file174\ No newline at end of file
175}
167176
=== modified file 'src/IndicatorObjectEntryProxyRemote.h'
--- src/IndicatorObjectEntryProxyRemote.h 2011-01-11 15:48:03 +0000
+++ src/IndicatorObjectEntryProxyRemote.h 2011-03-17 14:17:24 +0000
@@ -58,6 +58,8 @@
58 bool __image_sensitive,58 bool __image_sensitive,
59 bool __image_visible);59 bool __image_visible);
6060
61 void OnShowNowChanged (bool show_now_state);
62
61 // Signals63 // Signals
62 sigc::signal<void, const char *, int, int, guint32, guint32> OnShowMenuRequest;64 sigc::signal<void, const char *, int, int, guint32, guint32> OnShowMenuRequest;
63 sigc::signal<void, const char *, int> OnScroll;65 sigc::signal<void, const char *, int> OnScroll;
6466
=== modified file 'src/IndicatorObjectFactoryRemote.cpp'
--- src/IndicatorObjectFactoryRemote.cpp 2011-03-17 09:28:30 +0000
+++ src/IndicatorObjectFactoryRemote.cpp 2011-03-17 14:17:24 +0000
@@ -246,14 +246,14 @@
246{246{
247 std::vector<IndicatorObjectProxy*>::iterator it;247 std::vector<IndicatorObjectProxy*>::iterator it;
248 248
249 for (it = _indicators.begin(); it != _indicators.end(); it++)249 for (it = _indicators.begin(); it != _indicators.end(); ++it)
250 {250 {
251 IndicatorObjectProxyRemote *object = static_cast<IndicatorObjectProxyRemote *> (*it);251 IndicatorObjectProxyRemote *object = static_cast<IndicatorObjectProxyRemote *> (*it);
252 std::vector<IndicatorObjectEntryProxy*>::iterator it;252 std::vector<IndicatorObjectEntryProxy*>::iterator it2;
253 253
254 for (it = object->GetEntries ().begin(); it != object->GetEntries ().end(); it++)254 for (it2 = object->GetEntries ().begin(); it2 != object->GetEntries ().end(); ++it2)
255 {255 {
256 IndicatorObjectEntryProxyRemote *entry = static_cast<IndicatorObjectEntryProxyRemote *> (*it);256 IndicatorObjectEntryProxyRemote *entry = static_cast<IndicatorObjectEntryProxyRemote *> (*it2);
257257
258 entry->SetActive (g_strcmp0 (entry_id, entry->GetId ()) == 0);258 entry->SetActive (g_strcmp0 (entry_id, entry->GetId ()) == 0);
259 }259 }
@@ -268,6 +268,29 @@
268 OnEntryActivateRequest.emit (entry_id);268 OnEntryActivateRequest.emit (entry_id);
269}269}
270270
271void
272IndicatorObjectFactoryRemote::OnEntryShowNowChanged (const char *entry_id, bool show_now_state)
273{
274 std::vector<IndicatorObjectProxy*>::iterator it;
275
276 for (it = _indicators.begin(); it != _indicators.end(); ++it)
277 {
278 IndicatorObjectProxyRemote *object = static_cast<IndicatorObjectProxyRemote *> (*it);
279 std::vector<IndicatorObjectEntryProxy*>::iterator it2;
280
281 for (it2 = object->GetEntries ().begin(); it2 != object->GetEntries ().end(); ++it2)
282 {
283 IndicatorObjectEntryProxyRemote *entry = static_cast<IndicatorObjectEntryProxyRemote *> (*it2);
284
285 if (g_strcmp0 (entry_id, entry->GetId ()) == 0)
286 {
287 entry->OnShowNowChanged (show_now_state);
288 return;
289 }
290 }
291 }
292}
293
271IndicatorObjectProxyRemote *294IndicatorObjectProxyRemote *
272IndicatorObjectFactoryRemote::IndicatorForID (const char *id)295IndicatorObjectFactoryRemote::IndicatorForID (const char *id)
273{296{
@@ -498,13 +521,24 @@
498 remote);521 remote);
499 }522 }
500 else if (g_strcmp0 (signal_name, "ActiveMenuPointerMotion") == 0)523 else if (g_strcmp0 (signal_name, "ActiveMenuPointerMotion") == 0)
501 {524 {
502 int x=0, y=0;525 int x=0, y=0;
503526
504 g_variant_get (parameters, "(ii)", &x, &y);527 g_variant_get (parameters, "(ii)", &x, &y);
505528
506 remote->OnMenuPointerMoved.emit (x, y);529 remote->OnMenuPointerMoved.emit (x, y);
507 }530 }
531 else if (g_strcmp0 (signal_name, "EntryShowNowChanged") == 0)
532 {
533 gchar *id = NULL;
534 bool show_now_state;
535
536 g_variant_get (parameters, "(sb)", &id, &show_now_state);
537
538 remote->OnEntryShowNowChanged (id, show_now_state ? true : false);
539
540 g_free (id);
541 }
508}542}
509543
510static void544static void
511545
=== modified file 'src/IndicatorObjectFactoryRemote.h'
--- src/IndicatorObjectFactoryRemote.h 2011-01-11 15:48:03 +0000
+++ src/IndicatorObjectFactoryRemote.h 2011-03-17 14:17:24 +0000
@@ -46,6 +46,7 @@
46 void Sync (GVariant *args);46 void Sync (GVariant *args);
47 void OnEntryActivateRequestReceived (const char *entry_id);47 void OnEntryActivateRequestReceived (const char *entry_id);
48 void Reconnect ();48 void Reconnect ();
49 void OnEntryShowNowChanged (const char *entry_id, bool show_now_state);
4950
50 void AddProperties (GVariantBuilder *builder);51 void AddProperties (GVariantBuilder *builder);
5152
5253
=== modified file 'src/IndicatorObjectProxyRemote.cpp'
--- src/IndicatorObjectProxyRemote.cpp 2011-01-11 15:48:03 +0000
+++ src/IndicatorObjectProxyRemote.cpp 2011-03-17 14:17:24 +0000
@@ -149,7 +149,7 @@
149149
150void150void
151IndicatorObjectProxyRemote::OnScrollReceived (const char *entry_id,151IndicatorObjectProxyRemote::OnScrollReceived (const char *entry_id,
152 int delta)152 int delta)
153{153{
154 OnScroll.emit(entry_id, delta);154 OnScroll.emit(entry_id, delta);
155}155}
156156
=== modified file 'src/PanelIndicatorObjectEntryView.cpp'
--- src/PanelIndicatorObjectEntryView.cpp 2011-03-10 13:39:09 +0000
+++ src/PanelIndicatorObjectEntryView.cpp 2011-03-17 14:17:24 +0000
@@ -126,9 +126,10 @@
126PanelIndicatorObjectEntryView::Refresh ()126PanelIndicatorObjectEntryView::Refresh ()
127{127{
128 GdkPixbuf *pixbuf = _proxy->GetPixbuf ();128 GdkPixbuf *pixbuf = _proxy->GetPixbuf ();
129 char *label = fix_string (_proxy->GetLabel ());129 char *label = NULL;
130 PangoLayout *layout = NULL;130 PangoLayout *layout = NULL;
131 PangoFontDescription *desc = NULL;131 PangoFontDescription *desc = NULL;
132 PangoAttrList *attrs = NULL;
132 GtkSettings *settings = gtk_settings_get_default ();133 GtkSettings *settings = gtk_settings_get_default ();
133 cairo_t *cr;134 cairo_t *cr;
134 char *font_description = NULL;135 char *font_description = NULL;
@@ -147,6 +148,25 @@
147 nux::Color textcol = style->GetTextColor ();148 nux::Color textcol = style->GetTextColor ();
148 nux::Color textshadowcol = style->GetTextShadow ();149 nux::Color textshadowcol = style->GetTextShadow ();
149150
151 if (_proxy->show_now)
152 {
153 if (!pango_parse_markup (_proxy->GetLabel (),
154 -1,
155 '_',
156 &attrs,
157 &label,
158 NULL,
159 NULL))
160 {
161 label = g_strdup (_proxy->GetLabel ());
162 g_debug ("failed");
163 }
164 }
165 else
166 {
167 label = fix_string (_proxy->GetLabel ());
168 }
169
150 // First lets figure out our size170 // First lets figure out our size
151 if (pixbuf && _proxy->icon_visible)171 if (pixbuf && _proxy->icon_visible)
152 {172 {
@@ -169,6 +189,12 @@
169 pango_font_description_set_weight (desc, PANGO_WEIGHT_NORMAL);189 pango_font_description_set_weight (desc, PANGO_WEIGHT_NORMAL);
170190
171 layout = pango_cairo_create_layout (cr);191 layout = pango_cairo_create_layout (cr);
192 if (attrs)
193 {
194 pango_layout_set_attributes (layout, attrs);
195 pango_attr_list_unref (attrs);
196 }
197
172 pango_layout_set_font_description (layout, desc);198 pango_layout_set_font_description (layout, desc);
173 pango_layout_set_text (layout, label, -1);199 pango_layout_set_text (layout, label, -1);
174 200
@@ -395,3 +421,9 @@
395421
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 ()));
397}423}
424
425bool
426PanelIndicatorObjectEntryView::GetShowNow ()
427{
428 return _proxy ? _proxy->show_now : false;
429}
398430
=== modified file 'src/PanelIndicatorObjectEntryView.h'
--- src/PanelIndicatorObjectEntryView.h 2011-01-25 15:35:00 +0000
+++ src/PanelIndicatorObjectEntryView.h 2011-03-17 14:17:24 +0000
@@ -43,6 +43,7 @@
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);
44 void Activate ();44 void Activate ();
45 void OnActiveChanged (bool is_active);45 void OnActiveChanged (bool is_active);
46 bool GetShowNow ();
4647
47 const gchar * GetName ();48 const gchar * GetName ();
48 void AddProperties (GVariantBuilder *builder);49 void AddProperties (GVariantBuilder *builder);
4950
=== modified file 'src/PanelMenuView.cpp'
--- src/PanelMenuView.cpp 2011-03-13 21:40:17 +0000
+++ src/PanelMenuView.cpp 2011-03-17 14:17:24 +0000
@@ -65,7 +65,8 @@
65 _last_active_view (NULL),65 _last_active_view (NULL),
66 _last_width (0),66 _last_width (0),
67 _last_height (0),67 _last_height (0),
68 _places_showing (false)68 _places_showing (false),
69 _show_now_activated (false)
69{70{
70 WindowManager *win_manager;71 WindowManager *win_manager;
7172
@@ -255,12 +256,12 @@
255 }256 }
256 else if (_is_maximized)257 else if (_is_maximized)
257 {258 {
258 if (!_is_inside && !_last_active_view)259 if (!_is_inside && !_last_active_view && !_show_now_activated)
259 gPainter.PushDrawLayer (GfxContext, GetGeometry (), _title_layer);260 gPainter.PushDrawLayer (GfxContext, GetGeometry (), _title_layer);
260 }261 }
261 else262 else
262 {263 {
263 if ((_is_inside || _last_active_view) && _entries.size ())264 if ((_is_inside || _last_active_view || _show_now_activated) && _entries.size ())
264 {265 {
265 if (_gradient_texture == NULL)266 if (_gradient_texture == NULL)
266 {267 {
@@ -349,7 +350,7 @@
349350
350 if (!_is_own_window && !_places_showing)351 if (!_is_own_window && !_places_showing)
351 {352 {
352 if (_is_inside || _last_active_view)353 if (_is_inside || _last_active_view || _show_now_activated)
353 {354 {
354 _layout->ProcessDraw (GfxContext, force_draw);355 _layout->ProcessDraw (GfxContext, force_draw);
355 }356 }
@@ -603,6 +604,7 @@
603 PanelIndicatorObjectEntryView *view = new PanelIndicatorObjectEntryView (proxy, 6);604 PanelIndicatorObjectEntryView *view = new PanelIndicatorObjectEntryView (proxy, 6);
604 view->active_changed.connect (sigc::mem_fun (this, &PanelMenuView::OnActiveChanged));605 view->active_changed.connect (sigc::mem_fun (this, &PanelMenuView::OnActiveChanged));
605 view->refreshed.connect (sigc::mem_fun (this, &PanelMenuView::OnEntryRefreshed));606 view->refreshed.connect (sigc::mem_fun (this, &PanelMenuView::OnEntryRefreshed));
607 proxy->show_now_changed.connect (sigc::mem_fun (this, &PanelMenuView::UpdateShowNow));
606 _menu_layout->AddView (view, 0, nux::eCenter, nux::eFull);608 _menu_layout->AddView (view, 0, nux::eCenter, nux::eFull);
607 _menu_layout->SetContentDistribution (nux::eStackLeft);609 _menu_layout->SetContentDistribution (nux::eStackLeft);
608610
@@ -914,3 +916,19 @@
914 self->QueueDraw ();916 self->QueueDraw ();
915}917}
916918
919void
920PanelMenuView::UpdateShowNow (bool ignore)
921{
922 std::vector<PanelIndicatorObjectEntryView *>::iterator it;
923 _show_now_activated = false;
924
925 for (it = _entries.begin(); it != _entries.end(); it++)
926 {
927 PanelIndicatorObjectEntryView *view = static_cast<PanelIndicatorObjectEntryView *> (*it);
928 if (view->GetShowNow ())
929 _show_now_activated = true;
930
931 }
932 QueueDraw ();
933}
934
917935
=== modified file 'src/PanelMenuView.h'
--- src/PanelMenuView.h 2011-03-13 21:40:17 +0000
+++ src/PanelMenuView.h 2011-03-17 14:17:24 +0000
@@ -95,6 +95,7 @@
95 gchar * GetActiveViewName ();95 gchar * GetActiveViewName ();
96 static void OnPlaceViewShown (GVariant *data, PanelMenuView *self);96 static void OnPlaceViewShown (GVariant *data, PanelMenuView *self);
97 static void OnPlaceViewHidden (GVariant *data, PanelMenuView *self);97 static void OnPlaceViewHidden (GVariant *data, PanelMenuView *self);
98 void UpdateShowNow (bool ignore);
98 99
99private:100private:
100 BamfMatcher* _matcher;101 BamfMatcher* _matcher;
@@ -123,5 +124,6 @@
123 int _last_height;124 int _last_height;
124125
125 bool _places_showing;126 bool _places_showing;
127 bool _show_now_activated;
126};128};
127#endif129#endif
128130
=== modified file 'src/PlaceEntryHome.cpp'
--- src/PlaceEntryHome.cpp 2011-03-15 10:39:09 +0000
+++ src/PlaceEntryHome.cpp 2011-03-17 14:17:24 +0000
@@ -21,6 +21,7 @@
21#include "PlaceEntryHome.h"21#include "PlaceEntryHome.h"
2222
23#include <glib/gi18n-lib.h>23#include <glib/gi18n-lib.h>
24#include <algorithm>
2425
25class PlaceEntryGroupHome : public PlaceEntryGroup26class PlaceEntryGroupHome : public PlaceEntryGroup
26{27{
@@ -95,6 +96,20 @@
95 PlaceEntry *entry = static_cast<PlaceEntry *> (*i);96 PlaceEntry *entry = static_cast<PlaceEntry *> (*i);
96 OnPlaceEntryAdded (entry);97 OnPlaceEntryAdded (entry);
97 }98 }
99
100 place->entry_removed.connect (sigc::mem_fun (this, &PlaceEntryHome::OnPlaceEntryRemoved));
101}
102
103void
104PlaceEntryHome::OnPlaceEntryRemoved (PlaceEntry *entry)
105{
106 std::vector<PlaceEntry *>::iterator it;
107
108 it = std::find (_entries.begin (), _entries.end (), entry);
109 if (it != _entries.end ())
110 {
111 _entries.erase (it);
112 }
98}113}
99114
100void115void
101116
=== modified file 'src/PlaceEntryHome.h'
--- src/PlaceEntryHome.h 2011-03-15 10:39:09 +0000
+++ src/PlaceEntryHome.h 2011-03-17 14:17:24 +0000
@@ -79,6 +79,7 @@
79 void LoadExistingEntries ();79 void LoadExistingEntries ();
80 void OnPlaceAdded (Place *place);80 void OnPlaceAdded (Place *place);
81 void OnPlaceEntryAdded (PlaceEntry *entry);81 void OnPlaceEntryAdded (PlaceEntry *entry);
82 void OnPlaceEntryRemoved (PlaceEntry *entry);
82 void RefreshEntry (PlaceEntry *entry);83 void RefreshEntry (PlaceEntry *entry);
8384
84 void OnResultAdded (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result);85 void OnResultAdded (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result);
8586
=== modified file 'src/PlaceEntryRemote.cpp'
--- src/PlaceEntryRemote.cpp 2011-03-15 10:39:09 +0000
+++ src/PlaceEntryRemote.cpp 2011-03-17 14:17:24 +0000
@@ -605,6 +605,9 @@
605 DeeModelIter *iter = (DeeModelIter *)id;605 DeeModelIter *iter = (DeeModelIter *)id;
606 DeeModelIter *group_iter;606 DeeModelIter *group_iter;
607607
608 if (iter == NULL || dee_model_is_last (_results_model, iter))
609 return;
610
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);
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);
610 613