~dylanmccall/ubuntu/oneiric/network-manager-applet/lp852961-disable-autostart-for-gnome-shell

« back to all changes in this revision

Viewing changes to src/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Mercatante
  • Date: 2007-06-15 12:46:22 UTC
  • Revision ID: james.westby@ubuntu.com-20070615124622-01cyrnf0uxxun4lz
Tags: upstream-0.6.5
ImportĀ upstreamĀ versionĀ 0.6.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* NetworkManager Wireless Applet -- Display wireless access points and allow user control
 
2
 *
 
3
 * Dan Williams <dcbw@redhat.com>
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
18
 *
 
19
 * This applet used the GNOME Wireless Applet as a skeleton to build from.
 
20
 *
 
21
 * (C) Copyright 2005 Red Hat, Inc.
 
22
 */
 
23
 
 
24
#ifdef HAVE_CONFIG_H
 
25
# include <config.h>
 
26
#endif
 
27
 
 
28
#include <string.h>
 
29
#include <gtk/gtk.h>
 
30
#include <libgnomeui/libgnomeui.h>
 
31
#include <glib/gi18n-lib.h>
 
32
 
 
33
#include "applet.h"
 
34
#include "applet-dbus-vpn.h"
 
35
 
 
36
static void session_die (GnomeClient *client, gpointer client_data)
 
37
{
 
38
        NMApplet *applet = client_data;
 
39
        nma_dbus_vpn_deactivate_connection (applet->connection);
 
40
        gtk_main_quit ();
 
41
}
 
42
 
 
43
int main (int argc, char *argv[])
 
44
{
 
45
        NMApplet *      nma;
 
46
        GnomeClient *   client;
 
47
 
 
48
        gnome_program_init ("nm-applet", VERSION, LIBGNOMEUI_MODULE,
 
49
                            argc, argv, 
 
50
                            GNOME_PARAM_NONE, GNOME_PARAM_NONE);
 
51
 
 
52
        client = gnome_master_client ();
 
53
        gnome_client_set_restart_style (client, GNOME_RESTART_ANYWAY);
 
54
 
 
55
        bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
 
56
        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 
57
        textdomain (GETTEXT_PACKAGE);
 
58
 
 
59
        nma = nma_new ();
 
60
        if (!nma)
 
61
                exit (EXIT_FAILURE);
 
62
 
 
63
        g_signal_connect (client, "save_yourself", G_CALLBACK (gtk_true), NULL);
 
64
        g_signal_connect (client, "die", G_CALLBACK (session_die), nma);        
 
65
 
 
66
        gtk_widget_show_all (GTK_WIDGET (nma));
 
67
        gtk_main ();
 
68
 
 
69
        return 0;
 
70
}