1
=== modified file 'src/applet.c'
3
src/applet.c | 13 ++++++++++++-
5
2 files changed, 15 insertions(+), 1 deletion(-)
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
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"
18
#include "gconf-helpers.h"
20
+#define NOTIFY_CAPS_ACTIONS_KEY "actions"
22
G_DEFINE_TYPE(NMApplet, nma, G_TYPE_OBJECT)
24
static NMActiveConnection *
25
applet_get_best_activating_connection (NMApplet *applet, NMDevice **device)
27
NMActiveConnection *best = NULL;
28
NMDevice *best_dev = NULL;
30
notify = notify_notification_new (summary, message,
31
icon ? icon : GTK_STOCK_NETWORK, NULL);
32
applet->notification = notify;
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);
39
+ if (applet->notify_with_actions && action1) {
40
notify_notification_add_action (notify, action1, action1_label,
41
action1_cb, action1_user_data, NULL);
44
if (!notify_notification_show (notify, &error)) {
45
g_warning ("Failed to show notification: %s", error->message);
48
@@ -2521,16 +2522,17 @@
51
constructor (GType type,
53
GObjectConstructParam *construct_props)
56
AppletDBusManager *dbus_mgr;
59
applet = NM_APPLET (G_OBJECT_CLASS (nma_parent_class)->constructor (type, n_props, construct_props));
61
g_set_application_name (_("NetworkManager Applet"));
62
gtk_window_set_default_icon_name (GTK_STOCK_NETWORK);
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))
70
nma_icons_init (applet);
72
if (!notify_is_initted ())
73
notify_init ("NetworkManager");
75
+ server_caps = notify_get_server_caps();
76
+ if (g_list_find (server_caps, NOTIFY_CAPS_ACTIONS_KEY))
77
+ applet->notify_with_actions = TRUE;
79
+ applet->notify_with_actions = FALSE;
81
+ g_list_foreach (server_caps, (GFunc) g_free, NULL);
82
+ g_list_free (server_caps);
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);
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
97
GtkWidget * wifi_enabled_item;
98
guint wifi_enabled_toggled_id;
99
GtkWidget * info_menu_item;
100
GtkWidget * connections_menu_item;
102
GladeXML * info_dialog_xml;
103
NotifyNotification* notification;
105
+ /* Notification stuff */
106
+ gboolean notify_with_actions;
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*,