Commit 572a5aa7 authored by Vincent Untz's avatar Vincent Untz Committed by Vincent Untz
Browse files

Use GOption instead of popt

2006-02-12  Vincent Untz  <vuntz@gnome.org>

	Use GOption instead of popt

	* Makefile.am: don't link with popt
	* gnome-desktop-item-edit.c: (main): use GOption
	* main.c: (main): ditto
parent 2bc1cc33
2006-02-12 Vincent Untz <vuntz@gnome.org>
Use GOption instead of popt
* Makefile.am: don't link with popt
* gnome-desktop-item-edit.c: (main): use GOption
* main.c: (main): ditto
2006-02-12 Vincent Untz <vuntz@gnome.org>
 
* menu.c: (create_item_context_menu): add accelerator for items
......
......@@ -176,8 +176,7 @@ gnome_panel_SOURCES = \
gnome_panel_LDADD = \
$(X_LIBS) \
$(PANEL_LIBS) \
-lpopt
$(PANEL_LIBS)
gnome_panel_LDFLAGS = -export-dynamic
......@@ -192,8 +191,7 @@ gnome_desktop_item_edit_LDFLAGS = -export-dynamic
gnome_desktop_item_edit_LDADD = \
$(X_LIBS) \
$(PANEL_LIBS) \
-lpopt
$(PANEL_LIBS)
gladedir = $(datadir)/gnome/panel/glade
glade_DATA = \
......
......@@ -21,12 +21,12 @@ GSList *panel_applet_list_applets (void) { return NULL; }
static int dialogs = 0;
static gboolean create_new = FALSE;
static char **desktops = NULL;
static struct poptOption options [] = {
{ "create-new", '\0', POPT_ARG_NONE,
&create_new, 0, N_("Create new file in the given directory"), NULL },
POPT_AUTOHELP
{ NULL, 0, 0, NULL, 0}
static const GOptionEntry options[] = {
{ "create-new", 0, 0, G_OPTION_ARG_NONE, &create_new, N_("Create new file in the given directory"), NULL },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &desktops, NULL, NULL },
{ NULL }
};
......@@ -73,9 +73,8 @@ get_uri (const char *arg)
int
main (int argc, char * argv[])
{
poptContext ctx;
GOptionContext *context;
GnomeProgram *program;
char **desktops;
int i;
GnomeVFSFileInfo *info;
......@@ -83,18 +82,19 @@ main (int argc, char * argv[])
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
context = g_option_context_new ("");
g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
program = gnome_program_init ("gnome-desktop-item-edit", VERSION,
LIBGNOMEUI_MODULE,
argc, argv,
GNOME_PARAM_POPT_TABLE, options,
GNOME_PARAM_GOPTION_CONTEXT, context,
NULL);
g_object_get (G_OBJECT (program),
GNOME_PARAM_POPT_CONTEXT, &ctx,
NULL);
gtk_window_set_default_icon_name ("launcher-program");
g_option_context_free (context);
desktops = (char **)poptGetArgs (ctx);
gtk_window_set_default_icon_name ("launcher-program");
if (desktops == NULL ||
desktops[0] == NULL) {
......
......@@ -34,24 +34,32 @@ GSList *panel_list = NULL;
GtkTooltips *panel_tooltips = NULL;
static const struct poptOption options[] = {
{NULL, '\0', 0, NULL, 0}
static const GOptionEntry options[] = {
{ NULL }
};
int
main (int argc, char **argv)
{
GOptionContext *context;
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
context = g_option_context_new ("");
g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
gnome_program_init ("gnome-panel", VERSION,
LIBGNOMEUI_MODULE,
argc, argv,
GNOME_PARAM_POPT_TABLE, options,
GNOME_PARAM_GOPTION_CONTEXT, context,
GNOME_PROGRAM_STANDARD_PROPERTIES,
NULL);
g_option_context_free (context);
gtk_window_set_default_icon_name ("gnome-panel");
if (!panel_shell_register ())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment