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

« back to all changes in this revision

Viewing changes to src/avahi.c

  • Committer: mvo
  • Date: 2006-02-20 13:59:01 UTC
  • Revision ID: gustavo@niemeyer.net-20060220135901-720c2a7ec5a58192
* removed the wretched intl again

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
 
                                     NULL);
24
 
        notify_notification_set_timeout (n, 60000);
25
 
        notify_notification_show (n, NULL);
26
 
 
27
 
        return FALSE;
28
 
}
29
 
 
30
 
gboolean
31
 
avahi_disabled_check()
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
 
}