File: main-menu.c

package info (click to toggle)
gnome-main-menu 1.8.0-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,748 kB
  • ctags: 724
  • sloc: ansic: 4,394; makefile: 150; sh: 17; xml: 2
file content (78 lines) | stat: -rw-r--r-- 2,357 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
 * This file is part of the Main Menu.
 *
 * Copyright (c) 2006, 2007 Novell, Inc.
 *
 * The Main Menu is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * The Main Menu is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * the Main Menu; if not, write to the Free Software Foundation, Inc., 51
 * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifdef HAVE_CONFIG_H
#	include <config.h>
#endif

#include <glib.h>
#include <glib/gi18n.h>
#include <mate-panel-applet.h>
#include <string.h>
#include <libmate-slab/slab.h>

#include "main-menu-ui.h"

static gboolean main_menu_applet_init (MatePanelApplet *, const gchar *, gpointer);


MATE_PANEL_APPLET_OUT_PROCESS_FACTORY ("GNOMEMainMenuFactory", PANEL_TYPE_APPLET, "Main Menu",
	main_menu_applet_init, NULL);

#define CHECKPOINT_CONFIG_BASENAME "main-menu-checkpoint.conf"
#define CHECKPOINT_FILE_BASENAME "main-menu"

static gboolean
main_menu_applet_init (MatePanelApplet *applet, const gchar *iid, gpointer user_data)
{

	libslab_checkpoint_init (CHECKPOINT_CONFIG_BASENAME, CHECKPOINT_FILE_BASENAME);

	libslab_checkpoint ("Main-menu starts up");

	if (strcmp (iid, "GNOMEMainMenu") != 0)
		return FALSE;

#ifdef ENABLE_NLS
	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");

	/* We need load messages of Network Connection Information
	   dialog from NetworkManager's mo files.
	 */
	bindtextdomain ("NetworkManager", GNOMELOCALEDIR);
	bind_textdomain_codeset ("NetworkManager", "UTF-8");

	textdomain (GETTEXT_PACKAGE);
#endif

	g_set_application_name (_("GNOME Main Menu"));

	libslab_checkpoint ("Creating user interface for whole applet");
	main_menu_ui_new (applet);

	libslab_checkpoint ("Showing all widgets in applet");
	gtk_widget_show_all (GTK_WIDGET (applet));

	libslab_thumbnail_factory_preinit ();

	libslab_checkpoint ("Finished initializing applet");
	return TRUE;
}