~network-manager/network-manager-applet/ubuntu.hardy.0.7.1

« back to all changes in this revision

Viewing changes to patches/lp331799_sensible_notify_actions.patch

  • Committer: Alexander Sack
  • Date: 2009-04-29 09:37:19 UTC
  • mfrom: (31.1.11 ubuntu.0.7.1)
  • Revision ID: asac@ubuntu.com-20090429093719-2t42apdpxx6hi5qz
(merge) rev 42 from lp:~network-manager/network-manager-applet/ubuntu.0.7.1
* fix LP: #341940 - menu entries like device names can be overly long;
  we fix this by using ellipsized labels with proper tooltip to allow
  interested users to read the full text label
  - add patches/lp341940_use_ellipsized_menu_entries.patch
  - update patches/series
* point Vcs-Bzr header to proper branch
  - update control
* fix LP: #358526 - Notification shows wrong WiFi disconnected icon when
  resuming from suspend; we use the proper generic disconnected icon
  if we don't know which device type caused the "offline" event.
  - add patches/lp358526_generic_disconnected_notification_icon.patch
  - update patches/series
* New upstream release 0.7.1 rc4
  + svn-v3-trunk0:9c6bbc85-7128-0410-879a-9bbc9e4270e9:branches%2FNETWORKMANAGER_APPLET_0_7:1254
  + drop upstreamed patches
    - delete patches/lp331799_sensible_notify_actions.patch
    - update patches/series
  + adjust diverged patches to new upstream codebase
    - update patches/add_libmbca_support.patch
    - update patches/lp341684_device_sensitive_disconnect_notify.patch
  + fix build failure with our gcc introduced upstream (string format issue)
    - add patches/fix_upstream_buildfailure.patch
    - update patches/series
* rename patch for disconnect states to match the bug it fixed (LP: #341684)
  - rename patches/lpXXX_device_sensitive_disconnect_notify.patch =>
    lp341684_device_sensitive_disconnect_notify.patch
  - update patche/series
* fix LP: #348612 - Wired disconnect icon is wrong; we fix a typo in icon name
  - update patches/lp341684_device_sensitive_disconnect_notify.patch
* fix LP: #354420 - offline notification should have NOTIFY_URGENCY_CRITICAL;
  normal disconnect notifications get NOTIFY_URGENCY_NORMAL
  - update patches/lp341684_device_sensitive_disconnect_notify.patch
* eliminate string changes from a few notification patches
  - update patches/lp330571_dxteam_wired_connect_text.patch
  - update patches/lp330608_dxteam_gsm_connect_text.patch
  and adjust follow up patches
  - update patches/lp337960_dxteam_notification_icon_names.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
=== modified file 'src/applet.c'
2
 
---
3
 
 src/applet.c |   13 ++++++++++++-
4
 
 src/applet.h |    3 +++
5
 
 2 files changed, 15 insertions(+), 1 deletion(-)
6
 
 
7
 
Index: network-manager-applet-0.7.1~rc1+20090219+bzr974/src/applet.c
8
 
===================================================================
9
 
--- network-manager-applet-0.7.1~rc1+20090219+bzr974.orig/src/applet.c
10
 
+++ network-manager-applet-0.7.1~rc1+20090219+bzr974/src/applet.c
11
 
@@ -65,16 +65,17 @@
12
 
 #include "applet-device-gsm.h"
13
 
 #include "applet-device-cdma.h"
14
 
 #include "applet-dialogs.h"
15
 
 #include "vpn-password-dialog.h"
16
 
 #include "applet-dbus-manager.h"
17
 
 #include "utils.h"
18
 
 #include "gconf-helpers.h"
19
 
 
20
 
+#define NOTIFY_CAPS_ACTIONS_KEY "actions"
21
 
 
22
 
 G_DEFINE_TYPE(NMApplet, nma, G_TYPE_OBJECT)
23
 
 
24
 
 static NMActiveConnection *
25
 
 applet_get_best_activating_connection (NMApplet *applet, NMDevice **device)
26
 
 {
27
 
        NMActiveConnection *best = NULL;
28
 
        NMDevice *best_dev = NULL;
29
 
@@ -391,17 +392,17 @@
30
 
        notify = notify_notification_new (summary, message,
31
 
                                          icon ? icon : GTK_STOCK_NETWORK, NULL);
32
 
        applet->notification = notify;
33
 
 
34
 
        notify_notification_attach_to_status_icon (notify, applet->status_icon);
35
 
        notify_notification_set_urgency (notify, urgency);
36
 
        notify_notification_set_timeout (notify, NOTIFY_EXPIRES_DEFAULT);
37
 
 
38
 
-       if (action1) {
39
 
+       if (applet->notify_with_actions && action1) {
40
 
                notify_notification_add_action (notify, action1, action1_label,
41
 
                                                action1_cb, action1_user_data, NULL);
42
 
        }
43
 
 
44
 
        if (!notify_notification_show (notify, &error)) {
45
 
                g_warning ("Failed to show notification: %s", error->message);
46
 
                g_error_free (error);
47
 
        }
48
 
@@ -2521,16 +2522,17 @@
49
 
 
50
 
 static GObject *
51
 
 constructor (GType type,
52
 
              guint n_props,
53
 
              GObjectConstructParam *construct_props)
54
 
 {
55
 
        NMApplet *applet;
56
 
        AppletDBusManager *dbus_mgr;
57
 
+       GList *server_caps;
58
 
 
59
 
        applet = NM_APPLET (G_OBJECT_CLASS (nma_parent_class)->constructor (type, n_props, construct_props));
60
 
 
61
 
        g_set_application_name (_("NetworkManager Applet"));
62
 
        gtk_window_set_default_icon_name (GTK_STOCK_NETWORK);
63
 
 
64
 
        applet->glade_file = g_build_filename (GLADEDIR, "applet.glade", NULL);
65
 
        if (!applet->glade_file || !g_file_test (applet->glade_file, G_FILE_TEST_IS_REGULAR)) {
66
 
@@ -2551,16 +2553,25 @@
67
 
        /* Load pixmaps and create applet widgets */
68
 
        if (!setup_widgets (applet))
69
 
                goto error;
70
 
        nma_icons_init (applet);
71
 
 
72
 
        if (!notify_is_initted ())
73
 
                notify_init ("NetworkManager");
74
 
 
75
 
+       server_caps = notify_get_server_caps();
76
 
+       if (g_list_find (server_caps, NOTIFY_CAPS_ACTIONS_KEY))
77
 
+               applet->notify_with_actions = TRUE;
78
 
+       else
79
 
+               applet->notify_with_actions = FALSE;
80
 
+
81
 
+       g_list_foreach (server_caps, (GFunc) g_free, NULL);
82
 
+       g_list_free (server_caps);
83
 
+
84
 
        dbus_mgr = applet_dbus_manager_get ();
85
 
        if (dbus_mgr == NULL) {
86
 
                nm_warning ("Couldn't initialize the D-Bus manager.");
87
 
                g_object_unref (applet);
88
 
                return NULL;
89
 
        }
90
 
 
91
 
        applet->dbus_settings = (NMDBusSettings *) nm_dbus_settings_system_new (applet_dbus_manager_get_connection (dbus_mgr));
92
 
Index: network-manager-applet-0.7.1~rc1+20090219+bzr974/src/applet.h
93
 
===================================================================
94
 
--- network-manager-applet-0.7.1~rc1+20090219+bzr974.orig/src/applet.h
95
 
+++ network-manager-applet-0.7.1~rc1+20090219+bzr974/src/applet.h
96
 
@@ -151,16 +151,19 @@
97
 
        GtkWidget *             wifi_enabled_item;
98
 
        guint           wifi_enabled_toggled_id;
99
 
        GtkWidget *             info_menu_item;
100
 
        GtkWidget *             connections_menu_item;
101
 
 
102
 
        GladeXML *              info_dialog_xml;
103
 
        NotifyNotification*     notification;
104
 
 
105
 
+       /* Notification stuff */
106
 
+       gboolean                notify_with_actions;
107
 
+
108
 
 #ifdef WITH_MBCA
109
 
        GSList *mbca_assistants; /* list of UdiAssistant */
110
 
        GModule *mbca_module;
111
 
        void (*mbca_assistant_abort_func) (MBCAAssistant*);
112
 
        void (*mbca_assistant_present_func) (MBCAAssistant*);
113
 
        MBCAAssistant* (*mbca_assistant_new_func) ();
114
 
        gint (*mbca_assistant_run_for_device_func) (MBCAAssistant*,
115
 
                                                                            MBCADeviceType,