1
/* Gnome panel: Initialization routines
2
* (C) 1997,1998,1999,2000 the Free Software Foundation
5
* Authors: Federico Mena
15
#include <glib/gi18n.h>
17
#include <libegg/eggdesktopfile.h>
18
#include <libegg/eggsmclient.h>
20
#include <libpanel-util/panel-cleanup.h>
21
#include <libpanel-util/panel-glib.h>
23
#include "panel-shell.h"
24
#include "panel-multiscreen.h"
25
#include "panel-session.h"
26
#include "panel-stock-icons.h"
27
#include "panel-action-protocol.h"
28
#include "panel-icon-names.h"
29
#include "panel-layout.h"
35
GSList *panels = NULL;
36
GSList *panel_list = NULL;
38
static gboolean replace = FALSE;
40
static const GOptionEntry options[] = {
41
{ "replace", 0, 0, G_OPTION_ARG_NONE, &replace, N_("Replace a currently running panel"), NULL },
46
main (int argc, char **argv)
49
GOptionContext *context;
52
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
53
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
54
textdomain (GETTEXT_PACKAGE);
56
/* We will register explicitly when we're ready -- see panel-session.c */
57
egg_sm_client_set_mode (EGG_SM_CLIENT_MODE_DISABLED);
59
g_set_prgname ("gnome-panel");
61
desktopfile = panel_g_lookup_in_applications_dirs ("gnome-panel.desktop");
63
egg_set_desktop_file (desktopfile);
67
context = g_option_context_new ("");
68
g_option_context_add_group (context,
69
egg_sm_client_get_option_group ());
70
g_option_context_add_group (context, gtk_get_option_group (TRUE));
71
g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
73
gtk_init (&argc, &argv);
76
if (!g_option_context_parse (context, &argc, &argv, &error)) {
77
g_printerr ("%s\n", error->message);
79
g_option_context_free (context);
84
g_option_context_free (context);
86
if (!egg_get_desktop_file ()) {
87
g_set_application_name (_("Panel"));
88
gtk_window_set_default_icon_name (PANEL_ICON_PANEL);
91
if (!panel_shell_register (replace)) {
96
panel_action_protocol_init ();
97
panel_multiscreen_init ();
98
panel_init_stock_icons_and_items ();
100
if (!panel_layout_load ()) {
107
/* Flush to make sure our struts are seen by everyone starting
108
* immediate after (eg, the nautilus desktop). */
111
/* Do this at the end, to be sure that we're really ready when
112
* connecting to the session manager */
113
panel_session_init ();