Merge lp:~unity-team/unity/unity.remote-urgent into lp:unity

Proposed by Jason Smith
Status: Merged
Merged at revision: 1093
Proposed branch: lp:~unity-team/unity/unity.remote-urgent
Merge into: lp:unity
Diff against target: 192 lines (+58/-2)
5 files modified
src/Launcher.cpp (+12/-2)
src/LauncherEntryRemote.cpp (+21/-0)
src/LauncherEntryRemote.h (+6/-0)
src/LauncherIcon.cpp (+16/-0)
src/LauncherIcon.h (+3/-0)
To merge this branch: bzr merge lp:~unity-team/unity/unity.remote-urgent
Reviewer Review Type Date Requested Status
Mikkel Kamstrup Erlandsen (community) Needs Fixing
Jay Taoko (community) Approve
Review via email: mp+56004@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jay Taoko (jaytaoko) :
review: Approve
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Can the emblem-related codepaths be removed before we merge this? Otherwise you can technically still put emblems on your launcher icon if you hack it over dbus.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Launcher.cpp'
2--- src/Launcher.cpp 2011-03-31 21:54:24 +0000
3+++ src/Launcher.cpp 2011-04-01 23:09:30 +0000
4@@ -1187,10 +1187,20 @@
5
6 // we dont need to show strays
7 if (!icon->GetQuirk (LauncherIcon::QUIRK_RUNNING))
8+ {
9+ if (icon->GetQuirk (LauncherIcon::QUIRK_URGENT))
10+ {
11+ arg.running_arrow = true;
12+ arg.window_indicators = 1;
13+ }
14+ else
15 arg.window_indicators = 0;
16+ }
17 else
18- arg.window_indicators = icon->RelatedWindows ();
19-
20+ {
21+ arg.window_indicators = icon->RelatedWindows ();
22+ }
23+
24 arg.backlight_intensity = IconBackgroundIntensity (icon, current);
25 arg.shimmer_progress = IconShimmerProgress (icon, current);
26
27
28=== modified file 'src/LauncherEntryRemote.cpp'
29--- src/LauncherEntryRemote.cpp 2011-02-08 10:11:00 +0000
30+++ src/LauncherEntryRemote.cpp 2011-04-01 23:09:30 +0000
31@@ -49,6 +49,8 @@
32 _count_visible = FALSE;
33 _progress_visible = FALSE;
34
35+ _urgent = FALSE;
36+
37 g_variant_ref_sink (val);
38 g_variant_get (val, "(sa{sv})", &app_uri, &prop_iter);
39
40@@ -159,6 +161,12 @@
41 return _progress_visible;
42 }
43
44+gboolean
45+LauncherEntryRemote::Urgent()
46+{
47+ return _urgent;
48+}
49+
50 /**
51 * Set the unique DBus name for the process owning the launcher entry.
52 *
53@@ -352,6 +360,16 @@
54 progress_visible_changed.emit (this);
55 }
56
57+void
58+LauncherEntryRemote::SetUrgent (gboolean urgent)
59+{
60+ if (_urgent == urgent)
61+ return;
62+
63+ _urgent = urgent;
64+ urgent_changed.emit (this);
65+}
66+
67 /**
68 * Set all properties from 'other' on 'this'.
69 */
70@@ -366,6 +384,7 @@
71 SetCount (other->Count ());
72 SetProgress (other->Progress ());
73 SetQuicklist (other->Quicklist());
74+ SetUrgent (other->Urgent ());
75
76 SetEmblemVisible (other->EmblemVisible ());
77 SetCountVisible(other->CountVisible ());
78@@ -402,6 +421,8 @@
79 SetCountVisible (g_variant_get_boolean (prop_value));
80 else if (g_str_equal ("progress-visible", prop_key))
81 SetProgressVisible (g_variant_get_boolean (prop_value));
82+ else if (g_str_equal ("urgent", prop_key))
83+ SetUrgent (g_variant_get_boolean (prop_value));
84 else if (g_str_equal ("quicklist", prop_key))
85 {
86 /* The value is the object path of the dbusmenu */
87
88=== modified file 'src/LauncherEntryRemote.h'
89--- src/LauncherEntryRemote.h 2011-02-03 17:31:47 +0000
90+++ src/LauncherEntryRemote.h 2011-04-01 23:09:30 +0000
91@@ -51,6 +51,7 @@
92 gboolean EmblemVisible();
93 gboolean CountVisible();
94 gboolean ProgressVisible();
95+ gboolean Urgent();
96
97 sigc::signal<void, LauncherEntryRemote *, const gchar * > dbus_name_changed; // gives the old name as arg
98 sigc::signal<void, LauncherEntryRemote *> emblem_changed;
99@@ -61,6 +62,8 @@
100 sigc::signal<void, LauncherEntryRemote *> emblem_visible_changed;
101 sigc::signal<void, LauncherEntryRemote *> count_visible_changed;
102 sigc::signal<void, LauncherEntryRemote *> progress_visible_changed;
103+
104+ sigc::signal<void, LauncherEntryRemote *> urgent_changed;
105
106 private:
107
108@@ -76,6 +79,7 @@
109 gboolean _emblem_visible;
110 gboolean _count_visible;
111 gboolean _progress_visible;
112+ gboolean _urgent;
113
114 void SetDBusName (const gchar *dbus_name);
115 void SetEmblem (const gchar *emblem);
116@@ -87,6 +91,8 @@
117 void SetEmblemVisible (gboolean visible);
118 void SetCountVisible (gboolean visible);
119 void SetProgressVisible (gboolean visible);
120+
121+ void SetUrgent (gboolean urgent);
122
123 void Update (LauncherEntryRemote *other);
124 void Update (GVariantIter *prop_iter);
125
126=== modified file 'src/LauncherIcon.cpp'
127--- src/LauncherIcon.cpp 2011-03-31 20:33:43 +0000
128+++ src/LauncherIcon.cpp 2011-04-01 23:09:30 +0000
129@@ -68,6 +68,7 @@
130 _background_color = nux::Color::White;
131 _glow_color = nux::Color::White;
132
133+ _remote_urgent = false;
134 _mouse_inside = false;
135 _has_visible_window = false;
136 _tooltip = new nux::Tooltip ();
137@@ -905,6 +906,8 @@
138 remote->count_visible_changed.connect (sigc::mem_fun(this, &LauncherIcon::OnRemoteCountVisibleChanged));
139 remote->progress_visible_changed.connect (sigc::mem_fun(this, &LauncherIcon::OnRemoteProgressVisibleChanged));
140
141+ remote->urgent_changed.connect (sigc::mem_fun(this, &LauncherIcon::OnRemoteUrgentChanged));
142+
143
144 if (remote->EmblemVisible ())
145 OnRemoteEmblemVisibleChanged (remote);
146@@ -914,6 +917,9 @@
147
148 if (remote->ProgressVisible ())
149 OnRemoteProgressVisibleChanged (remote);
150+
151+ if (remote->Urgent ())
152+ OnRemoteUrgentChanged (remote);
153 }
154
155 void
156@@ -926,6 +932,16 @@
157
158 DeleteEmblem ();
159 SetQuirk (QUIRK_PROGRESS, false);
160+
161+ if (_remote_urgent)
162+ SetQuirk (QUIRK_URGENT, false);
163+}
164+
165+void
166+LauncherIcon::OnRemoteUrgentChanged (LauncherEntryRemote *remote)
167+{
168+ _remote_urgent = remote->Urgent ();
169+ SetQuirk (QUIRK_URGENT, remote->Urgent ());
170 }
171
172 void
173
174=== modified file 'src/LauncherIcon.h'
175--- src/LauncherIcon.h 2011-03-31 20:33:43 +0000
176+++ src/LauncherIcon.h 2011-04-01 23:09:30 +0000
177@@ -210,6 +210,8 @@
178 void OnRemoteCountChanged (LauncherEntryRemote *remote);
179 void OnRemoteProgressChanged (LauncherEntryRemote *remote);
180 void OnRemoteQuicklistChanged (LauncherEntryRemote *remote);
181+
182+ void OnRemoteUrgentChanged (LauncherEntryRemote *remote);
183
184 void OnRemoteEmblemVisibleChanged (LauncherEntryRemote *remote);
185 void OnRemoteCountVisibleChanged (LauncherEntryRemote *remote);
186@@ -262,6 +264,7 @@
187 guint _time_delay_handle;
188 bool _quicklist_is_initialized;
189 bool _has_visible_window;
190+ bool _remote_urgent;
191
192 gint64 _shortcut;
193