~tiagoporangaba/ubuntu/saucy/network-manager-applet/fix-for-981472

« back to all changes in this revision

Viewing changes to debian/patches/lp341684_device_sensitive_disconnect_notify.patch

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2013-03-08 11:47:45 UTC
  • mfrom: (105.1.1 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130308114745-7p3ns9ikmfcluod4
Tags: 0.9.8.0-1ubuntu2
debian/control: add docbook-to-man to Build-Depends, missing in the
previous upload.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
        esc_ssid = get_ssid_utf8 (new);
16
16
+       g_object_set_data_full (G_OBJECT(device), "canonical-last-essid", g_strdup (esc_ssid), (GDestroyNotify) g_free);
17
17
        applet_do_notify_with_pref (applet,
 
18
                                    _("Connected"),
18
19
                                    esc_ssid ? esc_ssid : _("(none)"),
19
 
                                    _("Connection Established"),
20
20
Index: b/src/applet.c
21
21
===================================================================
22
22
--- a/src/applet.c
29
29
 #include <nm-device-ethernet.h>
30
30
 #include <nm-device-wifi.h>
31
31
 #include <nm-device-modem.h>
32
 
@@ -269,6 +270,19 @@ get_device_class_from_connection (NMConn
 
32
@@ -301,6 +302,19 @@ get_device_class_from_connection (NMConn
33
33
        return NULL;
34
34
 }
35
35
 
49
49
 static NMActiveConnection *
50
50
 applet_get_best_activating_connection (NMApplet *applet, NMDevice **device)
51
51
 {
52
 
@@ -2246,6 +2260,64 @@ applet_get_exported_connection_for_devic
 
52
@@ -2279,6 +2293,64 @@ applet_get_exported_connection_for_devic
53
53
        return NULL;
54
54
 }
55
55
 
60
60
+       /* only do something if this is about full offline state */
61
61
+       if(info->state != NM_STATE_UNKNOWN || info->device_state != NM_DEVICE_STATE_UNKNOWN) {
62
62
+               info->urgency = NOTIFY_URGENCY_NORMAL;
63
 
+               if (!info->title)
64
 
+                       info->title = g_strdup (_("Network"));
 
63
+               if (!info->text)
 
64
+                       info->text = g_strdup (_("Network"));
65
65
+               if (info->state == NM_STATE_DISCONNECTED || info->state == NM_STATE_ASLEEP) {
66
 
+                       info->text = _("Disconnected - you are now offline");
 
66
+                       info->title = _("Disconnected - you are now offline");
67
67
+               } else
68
 
+                       info->text = _("Disconnected");
 
68
+                       info->title = _("Disconnected");
69
69
+
70
70
+               switch (info->device_type) {
71
71
+                       case NM_DEVICE_TYPE_ETHERNET:
102
102
+                                         applet);
103
103
+       else
104
104
+               g_debug("no notification because merged found that we have nothing to say (e.g. not offline)");
105
 
+       if (info->title)
106
 
+               g_free (info->title);
107
 
+       info->title = NULL;
 
105
+       if (info->text)
 
106
+               g_free (info->text);
 
107
+       info->text = NULL;
108
108
+       g_free (applet->notification_queue_data);
109
109
+       applet->notification_queue_data = NULL;
110
110
+       applet->deferred_id = 0;
114
114
 static void
115
115
 applet_common_device_state_changed (NMDevice *device,
116
116
                                     NMDeviceState new_state,
117
 
@@ -2259,6 +2331,54 @@ applet_common_device_state_changed (NMDe
 
117
@@ -2292,6 +2364,54 @@ applet_common_device_state_changed (NMDe
118
118
        vpn_activating = applet_is_any_vpn_activating (applet);
119
119
 
120
120
        switch (new_state) {
136
136
+
137
137
+                       info->device_state = new_state;
138
138
+                       info->device_state_reason = reason;
139
 
+                       if (info->title) {
140
 
+                               g_free(info->title);
141
 
+                               info->title = NULL;
 
139
+                       if (info->text) {
 
140
+                               g_free(info->text);
 
141
+                               info->text = NULL;
142
142
+                       }
143
143
+                       if (NM_IS_DEVICE_WIFI (device)) {
144
144
+                               info->device_type = NM_DEVICE_TYPE_WIFI;
145
 
+                               info->title = g_strdup(g_object_get_data (G_OBJECT(device), "canonical-last-essid"));
146
 
+                               if (!info->title)
147
 
+                                       info->title = g_strdup (_("Wireless network"));
 
145
+                               info->text = g_strdup(g_object_get_data (G_OBJECT(device), "canonical-last-essid"));
 
146
+                               if (!info->text)
 
147
+                                       info->text = g_strdup (_("Wireless network"));
148
148
+                       } else if (NM_IS_DEVICE_ETHERNET (device)) {
149
149
+                               info->device_type = NM_DEVICE_TYPE_ETHERNET;
150
 
+                               info->title = g_strdup(_("Wired network"));
 
150
+                               info->text = g_strdup(_("Ethernet network"));
151
151
+                       } else if (NM_IS_DEVICE_MODEM (device)) {
152
152
+                               info->device_type = NM_DEVICE_TYPE_MODEM;
153
 
+                               info->title = g_strdup (_("Modem network"));
 
153
+                               info->text = g_strdup (_("Modem network"));
154
154
+                       } else {
155
155
+                               info->device_type = NM_DEVICE_TYPE_UNKNOWN;
156
 
+                               info->title = g_strdup (_("Network"));
 
156
+                               info->text = g_strdup (_("Network"));
157
157
+                       }
158
158
+
159
159
+                       if (applet->deferred_id)
169
169
        case NM_DEVICE_STATE_PREPARE:
170
170
        case NM_DEVICE_STATE_CONFIG:
171
171
        case NM_DEVICE_STATE_NEED_AUTH:
172
 
@@ -2330,13 +2450,26 @@ foo_client_state_changed_cb (NMClient *c
 
172
@@ -2363,13 +2483,26 @@ foo_client_state_changed_cb (NMClient *c
173
173
 {
174
174
        NMApplet *applet = NM_APPLET (user_data);
175
175
 
204
204
===================================================================
205
205
--- a/src/applet.h
206
206
+++ b/src/applet.h
207
 
@@ -175,6 +175,9 @@ typedef struct
 
207
@@ -187,6 +187,9 @@ typedef struct
208
208
 
209
209
        /* Tracker objects for secrets requests */
210
210
        GSList *        secrets_reqs;