tag 360379 fixed-upstream patch thanks This problem was fixed upstream by
http://cvs.gnome.org/viewcvs/balsa/src/ab-main.c?r1=1.19&r2=1.20 and http://cvs.gnome.org/viewcvs/balsa/src/main.c?r1=1.195&r2=1.196 . The attached patch includes both of these patches. -- Matt
diff -Nru balsa-2.3.8-orig/src/ab-main.c balsa-2.3.8/src/ab-main.c
--- balsa-2.3.8-orig/src/ab-main.c 2006-04-14 15:13:17.000000000 -0700
+++ balsa-2.3.8/src/ab-main.c 2006-04-14 15:13:39.000000000 -0700
@@ -929,10 +929,15 @@
/* FIXME: do we need to allow a non-GUI mode? */
gtk_init_check(&argc, &argv);
gnome_program_init(PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc, argv,
+#ifndef GNOME_PARAM_GOPTION_CONTEXT
GNOME_PARAM_POPT_TABLE, NULL,
GNOME_PARAM_APP_PREFIX, BALSA_STD_PREFIX,
GNOME_PARAM_APP_DATADIR, BALSA_STD_PREFIX "/share",
NULL);
+#else
+ GNOME_PARAM_GOPTION_CONTEXT, NULL,
+ GNOME_PARAM_NONE);
+#endif
#ifdef GTKHTML_HAVE_GCONF
if (!gconf_init(argc, argv, &gconf_error))
diff -Nru balsa-2.3.8-orig/src/main.c balsa-2.3.8/src/main.c
--- balsa-2.3.8-orig/src/main.c 2006-04-14 15:13:17.000000000 -0700
+++ balsa-2.3.8/src/main.c 2006-04-14 15:13:40.000000000 -0700
@@ -204,9 +204,10 @@
static void
balsa_init(int argc, char **argv)
{
- poptContext context;
- int opt;
static char *attachment = NULL;
+#ifndef GNOME_PARAM_GOPTION_CONTEXT
+ int opt;
+ poptContext context;
static struct poptOption options[] = {
{"checkmail", 'c', POPT_ARG_NONE,
@@ -254,7 +255,59 @@
GNOME_PARAM_APP_DATADIR, BALSA_STD_PREFIX "/share",
GNOME_PARAM_HUMAN_READABLE_NAME, _("The Balsa E-Mail
Client"),
NULL);
-
+#else /* USE GOption interface */
+ static gchar **remaining_args = NULL;
+ static GOptionEntry option_entries[] = {
+ {"checkmail", 'c', 0, G_OPTION_ARG_NONE,
+ &(cmd_check_mail_on_startup),
+ N_("Get new mail on startup"), NULL},
+ {"compose", 'm', 0, G_OPTION_ARG_STRING, &(opt_compose_email),
+ N_("Compose a new email to [EMAIL PROTECTED]"), "[EMAIL PROTECTED]"},
+ {"attach", 'a', 0, G_OPTION_ARG_STRING, &(attachment),
+ N_("Attach file at PATH"), "PATH"},
+ {"open-mailbox", 'o', 0, G_OPTION_ARG_STRING,
+ &(cmd_line_open_mailboxes),
+ N_("Opens MAILBOXNAME"), N_("MAILBOXNAME")},
+ {"open-unread-mailbox", 'u', 0, G_OPTION_ARG_NONE,
+ &(cmd_open_unread_mailbox),
+ N_("Opens first unread mailbox"), NULL},
+ {"open-inbox", 'i', 0, G_OPTION_ARG_NONE,
+ &(cmd_open_inbox),
+ N_("Opens default Inbox on startup"), NULL},
+ {"get-stats", 's', 0, G_OPTION_ARG_NONE,
+ &(cmd_get_stats),
+ N_("Prints number unread and unsent messages"), NULL},
+ {"debug-pop", 'd', 0, G_OPTION_ARG_NONE, &PopDebug,
+ N_("Debug POP3 connection"), NULL},
+ {"debug-imap", 'D', 0, G_OPTION_ARG_NONE, &ImapDebug,
+ N_("Debug IMAP connection"), NULL},
+ /* last but not least a special option that collects filenames */
+ { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY,
+ &remaining_args,
+ "Special option that collects any remaining arguments for us" },
+ { NULL }
+ };
+ GOptionContext *option_context = g_option_context_new("balsa");
+ GnomeProgram *my_app;
+ g_option_context_add_main_entries(option_context, option_entries, NULL);
+
+ my_app = gnome_program_init(PACKAGE, VERSION,
+ LIBGNOMEUI_MODULE, argc, argv,
+ GNOME_PARAM_GOPTION_CONTEXT, option_context,
+ GNOME_PARAM_NONE);
+
+ if (remaining_args != NULL) {
+ gint i, num_args;
+
+ num_args = g_strv_length (remaining_args);
+ for (i = 0; i < num_args; ++i) {
+ /* process remaining_args[i] here */
+ /* we do nothing for now */
+ }
+ g_strfreev (remaining_args);
+ remaining_args = NULL;
+ }
+#endif /* OPTION HANDLING */
balsa_handle_automation_options();
}
signature.asc
Description: Digital signature

