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

« back to all changes in this revision

Viewing changes to src/avahi.c

  • Committer: Michael Terry
  • Date: 2013-02-01 15:13:06 UTC
  • mto: This revision was merged to the branch mainline in revision 780.
  • Revision ID: michael.terry@canonical.com-20130201151306-famyx1w1k3o5xg1j
Install a policykit policy file to replace last gksu use for
cddistupgrader.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 "
 
19
                                       "network service discovery. The service "
 
20
                                       "has been disabled."
 
21
                                       ),
 
22
                                     GTK_STOCK_DIALOG_INFO);
 
23
        notify_notification_set_timeout (n, 60000);
 
24
        notify_notification_show (n, NULL);
 
25
        g_object_unref (n);
 
26
 
 
27
        return FALSE;
 
28
}
 
29
 
 
30
gboolean
 
31
avahi_disabled_check(void)
 
32
{
 
33
        if (g_file_test (UNICAST_LOCAL_AVAHI_FILE, G_FILE_TEST_EXISTS)) {
 
34
                /* Show the notification, after a delay so it doesn't look ugly
 
35
                 * if we've just logged in */
 
36
                g_timeout_add(5000, (GSourceFunc)(show_notification), NULL);
 
37
        }
 
38
 
 
39
        return TRUE;
 
40
}