~ubuntu-core-dev/update-notifier/ubuntu

273.1.1 by martin at piware
* Add check for /var/run/avahi-daemon/disabled-for-unicast-local, which
1
#ifdef HAVE_CONFIG_H
2
#include "config.h"
3
#endif
4
5
#include <libnotify/notify.h>
6
7
#include "update-notifier.h"
8
9
static gint
10
show_notification (void* data)
11
{
12
	NotifyNotification *n;
13
14
	/* Create and show the notification */
15
	n = notify_notification_new (_("Network service discovery disabled"),
16
                                     _("Your current network has a .local "
17
                                       "domain, which is not recommended "
18
                                       "and incompatible with the Avahi "
276 by martin at piware
* src/avahi.c: Fix string quotes to fix FTBFS on the buildds (worked just
19
                                       "network service discovery. The service "
20
                                       "has been disabled."
273.1.1 by martin at piware
* Add check for /var/run/avahi-daemon/disabled-for-unicast-local, which
21
				       ),
628 by Martin Pitt
Port to current libnotify 0.7 API. Bump libnotify-dev build dependency.
22
				     GTK_STOCK_DIALOG_INFO);
273.1.1 by martin at piware
* Add check for /var/run/avahi-daemon/disabled-for-unicast-local, which
23
	notify_notification_set_timeout (n, 60000);
24
	notify_notification_show (n, NULL);
25
26
	return FALSE;
27
}
28
29
gboolean
30
avahi_disabled_check()
31
{
32
        if (g_file_test (UNICAST_LOCAL_AVAHI_FILE, G_FILE_TEST_EXISTS)) {
33
                /* Show the notification, after a delay so it doesn't look ugly
34
                 * if we've just logged in */
35
                g_timeout_add(5000, (GSourceFunc)(show_notification), NULL);
36
        }
37
38
        return TRUE;
39
}