~ubuntu-branches/ubuntu/oneiric/gnome-panel/oneiric

« back to all changes in this revision

Viewing changes to gnome-panel/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-01-14 22:20:05 UTC
  • mto: (2.1.6 squeeze) (1.3.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 171.
  • Revision ID: james.westby@ubuntu.com-20100114222005-rll7tw9fojl3ac6z
Tags: upstream-2.29.5.1
ImportĀ upstreamĀ versionĀ 2.29.5.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#include <sys/wait.h>
14
14
 
15
15
#include <glib/gi18n.h>
16
 
#include <libgnomeui/gnome-client.h>
17
 
#include <libgnomeui/gnome-ui-init.h>
 
16
 
 
17
#include <libegg/eggdesktopfile.h>
 
18
#include <libegg/eggsmclient.h>
18
19
 
19
20
#include <libpanel-util/panel-cleanup.h>
 
21
#include <libpanel-util/panel-glib.h>
20
22
 
21
23
#include "panel-gconf.h"
22
24
#include "panel-profile.h"
49
51
int
50
52
main (int argc, char **argv)
51
53
{
 
54
        char           *desktopfile;
52
55
        GOptionContext *context;
53
 
        GnomeProgram   *program;
 
56
        GError         *error;
54
57
 
55
58
        bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
56
59
        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
57
60
        textdomain (GETTEXT_PACKAGE);
58
61
 
 
62
        /* We will register explicitly when we're ready -- see panel-session.c */
 
63
        egg_sm_client_set_mode (EGG_SM_CLIENT_MODE_DISABLED);
 
64
 
 
65
        g_set_prgname ("gnome-panel");
 
66
 
 
67
        desktopfile = panel_g_lookup_in_applications_dirs ("gnome-panel.desktop");
 
68
        if (desktopfile) {
 
69
                egg_set_desktop_file (desktopfile);
 
70
                g_free (desktopfile);
 
71
        }
 
72
 
59
73
        context = g_option_context_new ("");
60
 
 
 
74
        g_option_context_add_group (context,
 
75
                                    egg_sm_client_get_option_group ());
 
76
        g_option_context_add_group (context, gtk_get_option_group (TRUE));
61
77
        g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
62
78
 
63
 
        program = gnome_program_init ("gnome-panel", VERSION,
64
 
                                      LIBGNOMEUI_MODULE,
65
 
                                      argc, argv,
66
 
                                      GNOME_CLIENT_PARAM_SM_CONNECT, FALSE,
67
 
                                      GNOME_PARAM_GOPTION_CONTEXT, context,
68
 
                                      GNOME_PROGRAM_STANDARD_PROPERTIES,
69
 
                                      NULL);
70
 
        panel_cleanup_register (PANEL_CLEAN_FUNC (g_object_unref), program);
71
 
 
72
 
        g_set_application_name (_("Panel"));
73
 
        gtk_window_set_default_icon_name (PANEL_ICON_PANEL);
 
79
        gtk_init (&argc, &argv);
 
80
 
 
81
        if (!bonobo_init (&argc, argv)) {
 
82
                g_printerr ("Cannot initialize bonobo.\n");
 
83
                return 1;
 
84
        }
 
85
 
 
86
        error = NULL;
 
87
        if (!g_option_context_parse (context, &argc, &argv, &error)) {
 
88
                g_printerr ("%s\n", error->message);
 
89
                g_error_free (error);
 
90
                g_option_context_free (context);
 
91
 
 
92
                return 1;
 
93
        }
 
94
 
 
95
        g_option_context_free (context);
 
96
 
 
97
        if (!egg_get_desktop_file ()) {
 
98
                g_set_application_name (_("Panel"));
 
99
                gtk_window_set_default_icon_name (PANEL_ICON_PANEL);
 
100
        }
74
101
 
75
102
        if (!panel_shell_register (replace)) {
76
103
                panel_cleanup_do ();