1 --- src/screem-main.c 2006-04-17 00:25:57.000000000 +0100
2 +++ src/screem-main.c 2006-04-17 01:12:35.000000000 +0100
4 static gchar *session_filename = SESSION_LAST;
6 /* passed parameters stuff */
7 +#ifndef GNOME_PARAM_GOPTION_CONTEXT
8 static const struct poptOption options[] = {
9 { "load-session", 'l', POPT_ARG_STRING, &session_filename, 0,
10 N_("Load the given session file"),
12 { NULL, '\0', 0, NULL, 0, NULL, NULL }
14 +#else /* USE GOption interface */
15 +static const gchar **remaining_args = NULL;
16 +static GOptionEntry option_entries[] = {
17 + { "load-session", 'l', 0, G_OPTION_ARG_STRING, &(session_filename),
18 + N_("Load the given session file"), N_("FILE") },
19 + { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &remaining_args,
20 + "Special option that collects any remaining arguments for us" },
28 int main( int argc, char *argv[] )
30 GnomeProgram *program;
31 + const gchar** start_files;
32 +#ifndef GNOME_PARAM_GOPTION_CONTEXT
34 - const gchar** start_files;
40 bind_textdomain_codeset( GETTEXT_PACKAGE, "UTF-8" );
41 textdomain( GETTEXT_PACKAGE );
44 +#ifdef GNOME_PARAM_GOPTION_CONTEXT
45 + GOptionContext *option_context = g_option_context_new("screem");
46 + g_option_context_add_main_entries(option_context, option_entries, NULL);
49 program = gnome_program_init( PACKAGE, VERSION,
52 GNOME_PROGRAM_STANDARD_PROPERTIES,
53 +#ifndef GNOME_PARAM_GOPTION_CONTEXT
54 GNOME_PARAM_POPT_TABLE, options,
56 + GNOME_PARAM_GOPTION_CONTEXT, option_context,
58 GNOME_PARAM_APP_DATADIR, DATADIR,
59 LIBGNOMEUI_PARAM_DEFAULT_ICON,
60 DATADIR"/pixmaps/screem.png",
62 icon = DATADIR"/pixmaps/screem.png";
63 gtk_window_set_default_icon_from_file( icon, NULL );
65 +#ifndef GNOME_PARAM_GOPTION_CONTEXT
67 g_object_get( G_OBJECT( program ),
68 GNOME_PARAM_POPT_CONTEXT, &ctx, NULL );
69 start_files = parse_args( ctx, argc, argv );
71 + start_files = remaining_args;
75 gnome_authentication_manager_init();
80 +#ifndef GNOME_PARAM_GOPTION_CONTEXT
81 static const gchar **parse_args( poptContext ctx, int argc, char *argv[] )
83 const gchar** start_files;
90 static void screem_main_missing( MissingType type )