Merge lp:~kvalo/indicator-network/bug-740883 into lp:~indicator-applet-developers/indicator-network/indicator-network

Proposed by Kalle Valo
Status: Merged
Approved by: Ted Gould
Approved revision: 176
Merged at revision: 177
Proposed branch: lp:~kvalo/indicator-network/bug-740883
Merge into: lp:~indicator-applet-developers/indicator-network/indicator-network
Diff against target: 87 lines (+31/-0)
2 files modified
src/backend/manager.c (+30/-0)
src/backend/manager.h (+1/-0)
To merge this branch: bzr merge lp:~kvalo/indicator-network/bug-740883
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+54499@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/backend/manager.c'
2--- src/backend/manager.c 2011-03-08 16:19:17 +0000
3+++ src/backend/manager.c 2011-03-23 11:57:26 +0000
4@@ -97,6 +97,7 @@
5 gint connecting_state;
6 gchar *connecting_icons[CONNECTING_ICON_STAGES][CONNECTING_ICON_STATES];
7 gint signal_strength;
8+ gboolean offline;
9 ManagerState manager_state;
10 NetworkMenu *network_menu;
11 OfonoManager *ofono_manager;
12@@ -328,6 +329,12 @@
13
14 g_return_if_fail(self);
15
16+ if (priv->offline) {
17+ icon_name = ICON_OFFLINE_MODE;
18+ accessible_desc = _("Network (Flight Mode)");
19+ goto done;
20+ }
21+
22 if (service_manager_is_connecting(priv->service_manager)) {
23 start_connecting_animation(self);
24 manager_proxy_set_accessible_desc(priv->ns_dbus, _("Network (Connecting)"));
25@@ -400,6 +407,15 @@
26 g_debug("default service %s", path);
27 }
28
29+static void update_offline_mode(Manager *self)
30+{
31+ ManagerPrivate *priv = GET_PRIVATE(self);
32+
33+ priv->offline = connman_manager_get_offline_mode(priv->connman);
34+
35+ update_icon(self);
36+}
37+
38 /* FIXME: should follow priv->default_service strength */
39 static void strength_updated(ServiceManager *sm, guint strength,
40 gpointer user_data)
41@@ -420,6 +436,14 @@
42 update_default_service(self);
43 }
44
45+static void offline_notify(ConnmanManager *connman, GParamSpec *pspec,
46+ gpointer user_data)
47+{
48+ Manager *self = MANAGER(user_data);
49+
50+ update_offline_mode(self);
51+}
52+
53 static void update_services(Manager *self)
54 {
55 ManagerPrivate *priv = GET_PRIVATE(self);
56@@ -465,6 +489,8 @@
57
58 update_default_service(self);
59
60+ update_offline_mode(self);
61+
62 /* FIXME: create update_technologies() */
63
64 network_menu_enable(priv->network_menu);
65@@ -518,6 +544,10 @@
66 g_signal_connect(priv->connman, "notify::default-service",
67 G_CALLBACK(default_service_notify),
68 self);
69+
70+ g_signal_connect(priv->connman, "notify::offline-mode",
71+ G_CALLBACK(offline_notify),
72+ self);
73 }
74
75 static void ui_connected_notify(UIProxy *ui, GParamSpec *pspec,
76
77=== modified file 'src/backend/manager.h'
78--- src/backend/manager.h 2011-02-15 06:58:05 +0000
79+++ src/backend/manager.h 2011-03-23 11:57:26 +0000
80@@ -64,6 +64,7 @@
81 #define ICON_CONNECTED_BLUETOOTH "bluetooth-active"
82 #define ICON_CONNECTED_DEFAULT ICON_CONNECTED_WIRED
83 #define ICON_DISCONNECTED "nm-no-connection"
84+#define ICON_OFFLINE_MODE "flightmode"
85
86 #define ICON_NOTIFICATION_WIFI_FULL "notification-network-wireless-full"
87 #define ICON_NOTIFICATION_WIFI_DISCONNECTED "notification-network-wireless-disconnected"

Subscribers

People subscribed via source and target branches