[balsa/gtk3] Do not support BonoboActivation



commit 59f309c964120d702aebe2f1abc522a3112e4302
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Dec 28 21:15:29 2010 -0500

    Do not support BonoboActivation

 ChangeLog           |    7 +
 configure.in        |    9 +--
 src/Balsa.idl       |   47 -------
 src/Makefile.am     |   25 +----
 src/ab-main.c       |  122 ++++---------------
 src/balsa-bonobo.c  |  280 -------------------------------------------
 src/balsa-bonobo.h  |   99 ---------------
 src/main.c          |  330 ++++-----------------------------------------------
 src/toolbar-prefs.c |   93 +++-----------
 9 files changed, 80 insertions(+), 932 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2d7efa1..682f591 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-12-28  Peter Bloomfield
 
+	Do not support BonoboActivation
+
+	* src/balsa-bonobo.c: deleted.
+	* src/balsa-bonobo.h: ditto.
+
+2010-12-28  Peter Bloomfield
+
 	Initial commit for gtk3 development branch
 
 	* configure.in:
diff --git a/configure.in b/configure.in
index 43d08c2..d248263 100644
--- a/configure.in
+++ b/configure.in
@@ -190,7 +190,7 @@ AC_ARG_WITH(ssl,
 
 AC_ARG_WITH(unique,
    AC_HELP_STRING([--with-unique],
-                  [Use libUnique instead of BonoboActivation (default=no)]),
+                  [Use libUnique (default=no)]),
                   [with_unique=$withval],[with_unique=no])
 
 AC_ARG_WITH(gmime,
@@ -280,13 +280,6 @@ fi
 dnl #####################################################################
 dnl GNOME libs
 dnl #####################################################################
-if test x$with_gnome != xno; then
-   gnome_extras="libgnome-2.0 libgnomeui-2.0 libbonobo-2.0 gconf-2.0"
-   AC_DEFINE(HAVE_GNOME,1,[Defined when gnome libs are available.])
-else
-   gnome_extras=""
-fi
-AM_CONDITIONAL([BUILD_WITH_GNOME], [test $with_gnome = "yes"])
 
 AC_MSG_CHECKING([whether we have gnome-keyring])
 if $PKG_CONFIG --atleast-version=1.0 gnome-keyring-1; then
diff --git a/src/Makefile.am b/src/Makefile.am
index 54b241f..90a148c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -98,38 +98,15 @@ balsa_gtkspell_extra =		\
 		spell-check.h
 endif
 
-if BUILD_WITH_UNIQUE
-balsa_bonobo_extra_dist = balsa-bonobo.c balsa-bonobo.h Balsa.idl
-else
-if BUILD_WITH_GNOME
-balsa_bonobo_extra = balsa-bonobo.c balsa-bonobo.h
-balsa_bonobo_extra_dist = Balsa.idl
-balsa_IDL_SRCLIST = Balsa-common.c Balsa-skels.c Balsa-stubs.c Balsa.h
-balsa_IDL_OBJS    = Balsa-common.o Balsa-skels.o Balsa-stubs.o
-# see http://sources.redhat.com/automake/dependencies.html
-BUILT_SOURCES     = Balsa.h
-
-#auto* *SHOULD* figure this out *grr*
-$(srcdir)/balsa-bonobo.c: Balsa.h
-
-idldir = $(datadir)/idl
-idl_DATA = Balsa.idl
-
-endif
-endif
-
 balsa_SOURCES =			\
 	$(balsa_BASE_SRCLIST)	\
 	$(balsa_gtkspell_extra) \
-	$(balsa_bonobo_extra)   \
 	$(balsa_print_source)
 
 
 DISTCLEANFILES = $(balsa_IDL_SRCLIST)
 
-EXTRA_DIST =			\
-	$(balsa_gtkspell_extra_dist) \
-	$(balsa_bonobo_extra_dist)
+EXTRA_DIST = $(balsa_gtkspell_extra_dist)
 
 AM_CPPFLAGS = \
 	-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
diff --git a/src/ab-main.c b/src/ab-main.c
index b2bd49a..842f157 100644
--- a/src/ab-main.c
+++ b/src/ab-main.c
@@ -5,17 +5,17 @@
  *
  * This program 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, or (at your option) 
+ * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
- *  
+ *
  * This program 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  
+ * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
 
@@ -27,9 +27,6 @@
 #include <string.h>
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
-#if HAVE_GNOME
-#include <gnome.h>
-#endif
 #ifdef GTKHTML_HAVE_GCONF
 # include <gconf/gconf.h>
 #endif
@@ -78,17 +75,9 @@ struct ABMainWindow {
     GtkActionGroup *action_group;
     GtkUIManager *ui_manager;
 } contacts_app;
-    
 
-static void bab_cleanup(void);
 
-#if HAVE_GNOME
-static gint bab_save_session(GnomeClient * client, gint phase,
-                             GnomeSaveStyle save_style, gint is_shutdown,
-                             GnomeInteractStyle interact_style, gint is_fast,
-                             gpointer client_data);
-static gint bab_kill_session(GnomeClient * client, gpointer client_data);
-#endif
+static void bab_cleanup(void);
 
 static void ab_set_edit_widget(LibBalsaAddress * address,
                                gboolean can_remove);
@@ -182,7 +171,7 @@ bab_set_address_book(LibBalsaAddressBook *ab, GtkWidget* list,
 {
     LibBalsaABErr ab_err;
     GtkTreeModel* model = gtk_tree_view_get_model(GTK_TREE_VIEW(list));
-    
+
     g_return_val_if_fail(ab, FALSE);
     contacts_app.address_book = ab;
 
@@ -192,7 +181,7 @@ bab_set_address_book(LibBalsaAddressBook *ab, GtkWidget* list,
                                            (LibBalsaAddressBookLoadFunc)
                                            bab_load_cb, model))
         != LBABERR_OK) {
-        printf("error loading address book from %s: %d\n", 
+        printf("error loading address book from %s: %d\n",
                ab->name, ab_err);
     }
 
@@ -522,7 +511,7 @@ ab_remove_address(LibBalsaAddress* address)
 	    ab_clear_edit_widget();
 	    contacts_app.displayed_address = NULL;
 	}
-    } else 
+    } else
         ab_warning("Cannot remove: %s\n",
                    libbalsa_address_book_strerror(contacts_app.address_book,
                                                   err));
@@ -653,14 +642,14 @@ get_main_menu(GtkWidget * window, GtkWidget ** menubar,
 
     for (ab = address_books; ab; ab = ab->next)
         add_address_book(LIBBALSA_ADDRESS_BOOK(ab->data));
-    
+
 #if HAVE_MACOSX_DESKTOP
     ige_mac_menu_set_menu_bar(GTK_MENU_SHELL(gtk_ui_manager_get_widget(ui_manager, "/MainMenu")));
     ige_mac_menu_set_quit_menu_item(GTK_MENU_ITEM(gtk_ui_manager_get_widget(ui_manager, "/MainMenu/FileMenu/Quit")));
 
     group = ige_mac_menu_add_app_menu_group();
     ige_mac_menu_add_app_menu_item(group,
-				   GTK_MENU_ITEM(gtk_ui_manager_get_widget(ui_manager, "/MainMenu/HelpMenu/About")), 
+				   GTK_MENU_ITEM(gtk_ui_manager_get_widget(ui_manager, "/MainMenu/HelpMenu/About")),
                                    NULL);
 #endif
 
@@ -747,11 +736,11 @@ list_row_activated_cb(GtkTreeView *tree, gpointer data)
     contacts_app.displayed_address = address;
 }
 
-static void 
-addrlist_drag_get_cb(GtkWidget* widget, GdkDragContext* drag_context, 
+static void
+addrlist_drag_get_cb(GtkWidget* widget, GdkDragContext* drag_context,
                      GtkSelectionData* sel_data, guint target_type,
                      guint time, gpointer user_data)
-{ 
+{
     GtkTreeView *addrlist;
     GtkTreeModel *model;
     GtkTreeSelection *selection;
@@ -807,9 +796,9 @@ bab_window_list_new(gpointer cb_data)
     g_object_unref(store);
     selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree));
     gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
-    g_signal_connect(G_OBJECT(selection), "changed", 
+    g_signal_connect(G_OBJECT(selection), "changed",
                      G_CALLBACK(list_selection_changed_cb), cb_data);
-    g_signal_connect(G_OBJECT(tree), "row-activated", 
+    g_signal_connect(G_OBJECT(tree), "row-activated",
                      G_CALLBACK(list_row_activated_cb), cb_data);
 
     renderer = gtk_cell_renderer_text_new();
@@ -821,7 +810,7 @@ bab_window_list_new(gpointer cb_data)
     gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
 
 
-    gtk_drag_source_set(GTK_WIDGET(tree), 
+    gtk_drag_source_set(GTK_WIDGET(tree),
                         GDK_BUTTON1_MASK,
                         libbalsa_address_target_list, 2,
                         GDK_ACTION_COPY);
@@ -890,8 +879,8 @@ apply_button_cb(GtkWidget * w, gpointer data)
         if (!gtk_tree_selection_get_selected(selection, NULL, NULL))
             ab_clear_edit_widget();
 	gtk_notebook_set_current_page(GTK_NOTEBOOK(contacts_app.notebook), 0);
-	
-    } else 
+
+    } else
         ab_warning(contacts_app.displayed_address ?
                    "Cannot modify: %s\n" : "Cannot add: %s\n",
                    libbalsa_address_book_strerror(contacts_app.address_book,
@@ -917,7 +906,7 @@ bab_get_edit_button_box(struct ABMainWindow *abmw)
     GtkWidget *box;
     box = gtk_hbutton_box_new();
     gtk_container_add(GTK_CONTAINER(box),
-                      abmw->apply_button = 
+                      abmw->apply_button =
                       gtk_button_new_from_stock(GTK_STOCK_APPLY));
     g_signal_connect(G_OBJECT(abmw->apply_button), "clicked",
                      G_CALLBACK(apply_button_cb), (gpointer) NULL);
@@ -927,7 +916,7 @@ bab_get_edit_button_box(struct ABMainWindow *abmw)
     g_signal_connect(G_OBJECT(abmw->remove_button), "clicked",
                      G_CALLBACK(remove_button_cb), (gpointer) NULL);
     gtk_container_add(GTK_CONTAINER(box),
-                      abmw->cancel_button = 
+                      abmw->cancel_button =
                       gtk_button_new_from_stock(GTK_STOCK_CANCEL));
     g_signal_connect(G_OBJECT(abmw->cancel_button), "clicked",
                      G_CALLBACK(cancel_button_cb), abmw);
@@ -1019,13 +1008,13 @@ bab_window_new()
     /* Entry widget for finding an address */
     gtk_box_pack_start(GTK_BOX(browse_widget),
                        bab_get_filter_box(), FALSE, FALSE, 1);
- 
+
     scroll = gtk_scrolled_window_new(NULL, NULL);
     gtk_widget_show(scroll);
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
 				   GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
     gtk_box_pack_start(GTK_BOX(browse_widget), scroll, TRUE, TRUE, 1);
-    
+
     contacts_app.entry_list = bab_window_list_new(&contacts_app);
     gtk_container_add(GTK_CONTAINER(scroll), contacts_app.entry_list);
 
@@ -1033,7 +1022,7 @@ bab_window_new()
 			     gtk_label_new("Browse"));
 
     edit_widget = gtk_vbox_new(FALSE, 1);
-    contacts_app.edit_widget = 
+    contacts_app.edit_widget =
         libbalsa_address_get_edit_widget(NULL, contacts_app.entries,
                                          G_CALLBACK(address_changed_cb),
                                          &contacts_app);
@@ -1109,10 +1098,6 @@ information_real(void)
 int
 main(int argc, char *argv[])
 {
-#if HAVE_GNOME
-    GnomeClient *client;
-#endif
-
 #ifdef ENABLE_NLS
     /* Initialize the i18n stuff */
     bindtextdomain(PACKAGE, GNOMELOCALEDIR);
@@ -1123,18 +1108,6 @@ main(int argc, char *argv[])
 
     /* FIXME: do we need to allow a non-GUI mode? */
     gtk_init_check(&argc, &argv);
-#if HAVE_GNOME
-    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
-#endif
 
 #ifdef GTKHTML_HAVE_GCONF
     gconf_init(argc, argv, NULL);
@@ -1172,13 +1145,6 @@ main(int argc, char *argv[])
                      G_CALLBACK(bab_delete_ok), NULL);
 
     /* session management */
-#if HAVE_GNOME
-    client = gnome_master_client();
-    g_signal_connect(G_OBJECT(client), "save_yourself",
-		     G_CALLBACK(bab_save_session), argv[0]);
-    g_signal_connect(G_OBJECT(client), "die",
-		     G_CALLBACK(bab_kill_session), NULL);
-#endif
 
     gtk_widget_show_all(ab_window);
     gtk_widget_hide(contacts_app.edit_widget);
@@ -1189,7 +1155,7 @@ main(int argc, char *argv[])
     gdk_threads_enter();
     gtk_main();
     gdk_threads_leave();
-  
+
     /* Proper shutdown here */
     g_list_foreach(contacts_app.address_book_list, (GFunc)g_object_unref, NULL);
     g_list_free(contacts_app.address_book_list);
@@ -1197,44 +1163,8 @@ main(int argc, char *argv[])
     return 0;
 }
 
-
 static void
 bab_cleanup(void)
 {
-#if (defined(HAVE_GNOME) && !defined(GNOME_DISABLE_DEPRECATED))
-    gnome_sound_shutdown();
-#endif
     gtk_main_quit();
 }
-
-#if HAVE_GNOME
-static gint
-bab_kill_session(GnomeClient * client, gpointer client_data)
-{
-    /* save data here */
-    gtk_main_quit(); 
-    return TRUE;
-}
-
-
-static gint
-bab_save_session(GnomeClient * client, gint phase,
-                 GnomeSaveStyle save_style, gint is_shutdown,
-                 GnomeInteractStyle interact_style, gint is_fast,
-                 gpointer client_data)
-{
-    gchar **argv;
-    guint argc;
-
-    /* allocate 0-filled so it will be NULL terminated */
-    argv = g_malloc0(sizeof(gchar *) * 2);
-
-    argc = 1;
-    argv[0] = client_data;
-
-    gnome_client_set_clone_command(client, argc, argv);
-    gnome_client_set_restart_command(client, argc, argv);
-
-    return TRUE;
-}
-#endif /* HAVE_GNOME */
diff --git a/src/main.c b/src/main.c
index f073e45..d9441fe 100644
--- a/src/main.c
+++ b/src/main.c
@@ -5,17 +5,17 @@
  *
  * This program 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, or (at your option) 
+ * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
- *  
+ *
  * This program 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  
+ * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
 
@@ -28,10 +28,6 @@
 #include <unique/unique.h>
 #endif                          /* HAVE_UNIQUE */
 
-#if HAVE_GNOME
-#include <gnome.h>
-#endif
-
 #ifdef GTKHTML_HAVE_GCONF
 # include <gconf/gconf.h>
 #endif
@@ -69,13 +65,6 @@
 
 #include "libinit_balsa/assistant_init.h"
 
-#if !HAVE_UNIQUE && HAVE_GNOME
-#include "Balsa.h"
-#include "balsa-bonobo.h"
-#include <bonobo-activation/bonobo-activation.h>
-#include <bonobo/bonobo-exception.h>
-#endif                          /* HAVE_UNIQUE */
-
 #ifdef HAVE_GPGME
 #include <string.h>
 #include <gpgme.h>
@@ -103,19 +92,12 @@ static gboolean balsa_init(int argc, char **argv);
 static void config_init(gboolean check_only);
 static void mailboxes_init(gboolean check_only);
 static void balsa_cleanup(void);
-#if HAVE_GNOME
-static gint balsa_kill_session(GnomeClient * client, gpointer client_data);
-static gint balsa_save_session(GnomeClient * client, gint phase,
-			       GnomeSaveStyle save_style, gint is_shutdown,
-			       GnomeInteractStyle interact_style,
-			       gint is_fast, gpointer client_data);
-#endif
-gboolean initial_open_unread_mailboxes(void); 
+gboolean initial_open_unread_mailboxes(void);
 /* yes void is there cause gcc is tha suck */
 gboolean initial_open_inbox(void);
 
-/* We need separate variable for storing command line requests to check the 
-   mail because such selection cannot be stored in balsa_app and later 
+/* We need separate variable for storing command line requests to check the
+   mail because such selection cannot be stored in balsa_app and later
    saved to the configuration file.
 */
 static gchar *cmd_line_open_mailboxes;
@@ -196,11 +178,7 @@ mw_message_received_cb(UniqueApp         *app,
         balsa_get_stats(&unread, &unsent);
         text =
             g_strdup_printf("Unread: %ld Unsent: %ld\n", unread, unsent);
-#if UNIQUE_CHECK_VERSION(1, 0, 2)
         filename = unique_message_data_get_filename(message);
-#else                           /* UNIQUE_CHECK_VERSION(1, 0, 2) */
-        filename = unique_message_data_get_text(message);
-#endif                          /* UNIQUE_CHECK_VERSION(1, 0, 2) */
         if (!g_file_set_contents(filename, text, -1, &err)) {
             balsa_information_parented(window,
                                        LIBBALSA_INFORMATION_WARNING,
@@ -279,11 +257,7 @@ balsa_handle_automation_options(UniqueApp * app)
             close(fd);
 
             message = unique_message_data_new();
-#if UNIQUE_CHECK_VERSION(1, 0, 2)
             unique_message_data_set_filename(message, name_used);
-#else                           /* UNIQUE_CHECK_VERSION(1, 0, 2) */
-            unique_message_data_set_text(message, name_used, -1);
-#endif                          /* UNIQUE_CHECK_VERSION(1, 0, 2) */
             response =
                 unique_app_send_message(app, COMMAND_GET_STATS, message);
             unique_message_data_free(message);
@@ -341,91 +315,6 @@ balsa_handle_automation_options(UniqueApp * app)
         unique_message_data_free(message);
     }
 }
-#elif HAVE_GNOME
-static void
-balsa_handle_automation_options() {
-   CORBA_Object factory;
-   CORBA_Environment ev, *ev_p = &ev;
-   BonoboObject *balsacomposer;
-   BonoboObject *balsaapp;
- 
-   CORBA_exception_init (&ev);
-
-   factory = bonobo_activation_activate_from_id 
-       ("OAFIID:GNOME_Balsa_Application_Factory",
-	Bonobo_ACTIVATION_FLAG_EXISTING_ONLY,
-	NULL, &ev);
-   
-   if ( !(BONOBO_EX (ev_p) || factory == CORBA_OBJECT_NIL) ) {
-       /* there already is a server. good */
-       CORBA_Object app;
-       printf("Another Balsa found. Talking to it...\n");
-       app =  
-	   bonobo_activation_activate_from_id ("OAFIID:GNOME_Balsa_Application",
-						   0, NULL, &ev);
-
-       if (cmd_check_mail_on_startup) 
-	   GNOME_Balsa_Application_checkmail (app, &ev);
-
-       if (cmd_open_unread_mailbox)
-	   GNOME_Balsa_Application_openUnread (app, &ev);
-
-       if (cmd_open_inbox)
-	   GNOME_Balsa_Application_openInbox (app, &ev);
-
-       if (cmd_get_stats) {
-           CORBA_long unread = 0, unsent = 0;
-	   GNOME_Balsa_Application_getStats (app, &unread, &unsent, &ev);
-           printf("Unread: %ld Unsent: %ld\n", (long)unread, (long)unsent);
-       }
-
-       if (cmd_line_open_mailboxes)
-	   GNOME_Balsa_Application_openMailbox (app,
-					       cmd_line_open_mailboxes,
-					       &ev);
-
-       if (opt_compose_email || opt_attach_list) {
-	   GNOME_Balsa_Composer_attachs *attachs;
-	   CORBA_Object server;
-	   
-	   attachs = CORBA_sequence_CORBA_string__alloc();
-	   server =  
-	       bonobo_activation_activate_from_id ("OAFIID:GNOME_Balsa_Composer",
-						   0, NULL, &ev);
-	   if(opt_attach_list) {
-	       gint i,l;
-	       l = g_slist_length(opt_attach_list);
-	       attachs->_buffer = 
-		   CORBA_sequence_CORBA_string_allocbuf(l);
-	       attachs->_length = l;
-	       
-	       
-	       for( i = 0 ; i < l; i++) {
-		   attachs->_buffer[i] = 
-		       g_slist_nth_data( opt_attach_list, i );
-	       }
-	   } else 
-	       attachs->_length = 0;
-	   CORBA_sequence_set_release( attachs, TRUE);
-
-	   GNOME_Balsa_Composer_sendMessage(server,
-					    "",
-					    opt_compose_email ? opt_compose_email : "",
-					    "",
-					    "",
-					    attachs,
-					    0, 
-					    &ev );
-           CORBA_exception_free( &ev );
-       }
-
-       exit(0);
-   } else {
-       balsacomposer = balsa_composer_new ();
-       balsaapp = balsa_application_new ();
-   }
-   
-}
 #endif                          /* HAVE_UNIQUE */
 
 /* balsa_init:
@@ -434,58 +323,6 @@ balsa_handle_automation_options() {
 static gboolean
 balsa_init(int argc, char **argv)
 {
-#if (HAVE_GNOME && !defined(GNOME_PARAM_GOPTION_CONTEXT))
-    static char *attachment = NULL;
-    int opt;
-    poptContext context;
-    static struct poptOption options[] = {
-
-	{"checkmail", 'c', POPT_ARG_NONE,
-	 &(cmd_check_mail_on_startup), 0,
-	 N_("Get new mail on startup"), NULL},
-	{"compose", 'm', POPT_ARG_STRING, &(opt_compose_email),
-	 0, N_("Compose a new email to EMAIL ADDRESS"), "EMAIL ADDRESS"},
-	{"attach", 'a', POPT_ARG_STRING, &(attachment),
-	 'a', N_("Attach file at PATH"), "PATH"},
-	{"open-mailbox", 'o', POPT_ARG_STRING, &(cmd_line_open_mailboxes),
-	 0, N_("Opens MAILBOXNAME"), N_("MAILBOXNAME")},
-	{"open-unread-mailbox", 'u', POPT_ARG_NONE,
-	 &(cmd_open_unread_mailbox), 0,
-	 N_("Opens first unread mailbox"), NULL},
-	{"open-inbox", 'i', POPT_ARG_NONE,
-	 &(cmd_open_inbox), 0,
-	 N_("Opens default Inbox on startup"), NULL},
-	{"get-stats", 's', POPT_ARG_NONE,
-	 &(cmd_get_stats), 0,
-	 N_("Prints number unread and unsent messages"), NULL},
-	{"debug-pop", 'd', POPT_ARG_NONE, &PopDebug, 0, 
-	 N_("Debug POP3 connection"), NULL},
-	{"debug-imap", 'D', POPT_ARG_NONE, &ImapDebug, 0, 
-	 N_("Debug IMAP connection"), NULL},
-	{NULL, '\0', 0, NULL, 0}	/* end the list */
-    };
-
-
-    context = poptGetContext(PACKAGE, argc, (const char **)argv, options, 0);
-    while((opt = poptGetNextOpt(context)) > 0) {
-        switch (opt) {
-	    case 'a':
-	        opt_attach_list = g_slist_append(opt_attach_list, 
-						 g_strdup(attachment));
-		break;
-	}
-    }
-    poptFreeContext(context);
-
-    /* Process remaining options,  */
-    
-    gnome_program_init(PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc, argv,
-                       GNOME_PARAM_POPT_TABLE, options,
-                       GNOME_PARAM_APP_PREFIX, BALSA_STD_PREFIX,
-                       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 gchar **attach_vect = NULL;
     static GOptionEntry option_entries[] = {
@@ -518,19 +355,6 @@ balsa_init(int argc, char **argv)
           "Special option that collects any remaining arguments for us" },
         { NULL }
     };
-#if HAVE_GNOME
-    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_APP_DATADIR,
-                                BALSA_STD_PREFIX "/share",
-                                GNOME_PARAM_NONE);
-    gtk_init_check(&argc, &argv);
-#else /* HAVE_GNOME */
     GError *err = NULL;
 
     if (!gtk_init_with_args(&argc, &argv, PACKAGE, option_entries, NULL,
@@ -541,11 +365,10 @@ balsa_init(int argc, char **argv)
         g_error_free(err);
         return FALSE;
     }
-#endif  /* HAVE_GNOME */
 
     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 */
@@ -556,7 +379,7 @@ balsa_init(int argc, char **argv)
     }
     if (attach_vect != NULL) {
         gint i, num_args;
-        
+
         num_args = g_strv_length (attach_vect);
         for (i = 0; i < num_args; ++i) {
             opt_attach_list = g_slist_append(opt_attach_list, attach_vect[i]);
@@ -564,18 +387,13 @@ balsa_init(int argc, char **argv)
         g_free(attach_vect);
         attach_vect = NULL;
     }
-#endif /* OPTION HANDLING */
-
-#if !HAVE_UNIQUE && HAVE_GNOME
-    balsa_handle_automation_options();
-#endif /* HAVE_UNIQUE */
 
     return TRUE;
 }
 
-/* check_special_mailboxes: 
+/* check_special_mailboxes:
    check for special mailboxes. Cannot use GUI because main window is not
-   initialized yet.  
+   initialized yet.
 */
 static gboolean
 check_special_mailboxes(void)
@@ -646,7 +464,7 @@ static void
 threads_init(void)
 {
     g_thread_init(NULL);
-    
+
     libbalsa_threads_init();
     gdk_threads_init();
 
@@ -659,9 +477,9 @@ threads_init(void)
     mail_thread_msg_receive =
 	g_io_channel_unix_new(mail_thread_pipes[0]);
     g_io_add_watch(mail_thread_msg_receive, G_IO_IN,
-		   (GIOFunc) mail_progress_notify_cb, 
+		   (GIOFunc) mail_progress_notify_cb,
                    &balsa_app.main_window);
-    
+
     if (pipe(send_thread_pipes) < 0) {
 	g_log("BALSA Init", G_LOG_LEVEL_DEBUG,
 	      "Error opening pipes.\n");
@@ -719,14 +537,14 @@ initial_open_inbox()
     gdk_threads_enter();
     balsa_mblist_open_mailbox_hidden(balsa_app.inbox);
     gdk_threads_leave();
-    
+
     return FALSE;
 }
 
 void
 balsa_get_stats(long *unread, long *unsent)
 {
-    
+
     if(balsa_app.inbox && libbalsa_mailbox_open(balsa_app.inbox, NULL) ) {
         /* set threading type to load messages */
         gdk_threads_enter();
@@ -788,7 +606,7 @@ scan_mailboxes_idle_cb()
         printf("Unread: %ld Unsent: %ld\n", unread, unsent);
     }
 
-    return FALSE; 
+    return FALSE;
 }
 
 /* periodic_expunge_func makes sure that even the open mailboxes get
@@ -877,7 +695,7 @@ balsa_progress_set_text(LibBalsaProgress * progress, const gchar * text,
         LIBBALSA_PROGRESS_YES : LIBBALSA_PROGRESS_NO;
 }
 
-/* 
+/*
  * Set the fraction in the progress bar.
  */
 
@@ -948,9 +766,6 @@ int
 main(int argc, char *argv[])
 {
     GtkWidget *window;
-#if HAVE_GNOME
-    GnomeClient *client;
-#endif
     gchar *default_icon;
 #if HAVE_UNIQUE
     UniqueApp *app;
@@ -1045,7 +860,7 @@ main(int argc, char *argv[])
     libbalsa_progress_set_text     = balsa_progress_set_text;
     libbalsa_progress_set_fraction = balsa_progress_set_fraction;
     libbalsa_progress_set_activity = balsa_progress_set_activity;
-    
+
     /* checking for valid config files */
     config_init(cmd_get_stats);
 
@@ -1062,9 +877,6 @@ main(int argc, char *argv[])
     }
 
     signal( SIGPIPE, SIG_IGN );
-#if HAVE_GNOME
-    gnome_triggers_do("", "program", "balsa", "startup", NULL);
-#endif
 
     window = balsa_window_new();
     balsa_app.main_window = BALSA_WINDOW(window);
@@ -1099,17 +911,8 @@ main(int argc, char *argv[])
         exit(0);
     }
 
-    /* session management */
-#if HAVE_GNOME
-    client = gnome_master_client();
-    g_signal_connect(G_OBJECT(client), "save_yourself",
-		     G_CALLBACK(balsa_save_session), argv[0]);
-    g_signal_connect(G_OBJECT(client), "die",
-		     G_CALLBACK(balsa_kill_session), NULL);
-#endif
-
 #ifdef HAVE_GPGME
-    balsa_app.has_openpgp = 
+    balsa_app.has_openpgp =
         libbalsa_check_crypto_engine(GPGME_PROTOCOL_OpenPGP);
 #ifdef HAVE_SMIME
     balsa_app.has_smime =
@@ -1118,7 +921,7 @@ main(int argc, char *argv[])
     balsa_app.has_smime = FALSE;
 #endif /* HAVE_SMIME */
 #endif /* HAVE_GPGME */
-    
+
     if (opt_compose_email || opt_attach_list) {
         BalsaSendmsg *snd;
         GSList *lst;
@@ -1162,22 +965,6 @@ main(int argc, char *argv[])
     return 0;
 }
 
-
-
-#if 0
-static void
-force_close_mailbox(LibBalsaMailbox * mailbox)
-{
-    if (!mailbox)
-	return;
-    if (balsa_app.debug)
-	g_print("Mailbox: %s Ref: %d\n", mailbox->name, mailbox->open_ref);
-    while (mailbox->open_ref > 0)
-	libbalsa_mailbox_close(mailbox);
-}
-#endif /* 0 */
-
-
 static void
 balsa_cleanup(void)
 {
@@ -1190,8 +977,8 @@ balsa_cleanup(void)
         /* We want to quit but there is a checking thread active.
            The alternatives are to:
            a. wait for the checking thread to finish - but it could be
-           time consuming.  
-           b. send cancel signal to it. 
+           time consuming.
+           b. send cancel signal to it.
         */
         pthread_cancel(get_mail_thread);
         printf("Mail check thread cancelled. I know it is rough.\n");
@@ -1203,72 +990,5 @@ balsa_cleanup(void)
     g_hash_table_destroy(libbalsa_mailbox_view_table);
     libbalsa_mailbox_view_table = NULL;
 
-#if (defined(HAVE_GNOME) && !defined(GNOME_DISABLE_DEPRECATED))
-    gnome_sound_shutdown();
-#endif
     libbalsa_conf_drop_all();
 }
-
-#if HAVE_GNOME
-static gint
-balsa_kill_session(GnomeClient * client, gpointer client_data)
-{
-    gtk_main_quit(); /* FIXME: this won't save composed messages; 
-			but it never did. */
-    return TRUE;
-}
-
-
-static gint
-balsa_save_session(GnomeClient * client, gint phase,
-		   GnomeSaveStyle save_style, gint is_shutdown,
-		   GnomeInteractStyle interact_style, gint is_fast,
-		   gpointer client_data)
-{
-    gchar **argv;
-    guint argc;
-
-    /* allocate 0-filled so it will be NULL terminated */
-    argv = g_malloc0(sizeof(gchar *) * 7);
-
-    argc = 1;
-    argv[0] = client_data;
-
-    if (balsa_app.open_unread_mailbox) {
-	argv[argc] = g_strdup("--open-unread-mailbox");
-	argc++;
-    }
-
-    if (balsa_app.check_mail_upon_startup) {
-	argv[argc] = g_strdup("--checkmail");
-	argc++;
-    }
-
-    /* FIXME: I don't think this is needed?
-     * We already save the open mailboes in save-restore.c 
-     * so we should just open them when loading prefs...
-     */
-#if 0
-    if (balsa_app.open_mailbox) {
-	argv[argc] = g_strdup("--open-mailbox");
-	argc++;
-
-	argv[argc] = g_strconcat("'", balsa_app.open_mailbox, "'", NULL);
-	argc++;
-    }
-#endif
-
-    if (opt_compose_email) {
-	argv[argc] = g_strdup("--compose");
-	argc++;
-
-	argv[argc] = g_strdup(opt_compose_email);
-	argc++;
-    }
-
-    gnome_client_set_clone_command(client, argc, argv);
-    gnome_client_set_restart_command(client, argc, argv);
-
-    return TRUE;
-}
-#endif /* HAVE_GNOME */
diff --git a/src/toolbar-prefs.c b/src/toolbar-prefs.c
index db38b5b..eb3a459 100644
--- a/src/toolbar-prefs.c
+++ b/src/toolbar-prefs.c
@@ -5,17 +5,17 @@
  *
  * This program 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, or (at your option) 
+ * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
- *  
+ *
  * This program 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  
+ * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
 
@@ -42,13 +42,6 @@
 #define MAX(a, b) ((a) > (b) ? (a) : (b))
 #endif
 
-#ifdef HAVE_GNOME
-#define OLD_BALSA_COMPATIBILITY_TRANSLATION
-#endif
-#ifdef OLD_BALSA_COMPATIBILITY_TRANSLATION
-#include <gnome.h> /* for GNOME_STOCK_* pixmaps */
-#endif
-
 /* Enumeration for GtkTreeModel columns. */
 enum {
     TP_TEXT_COLUMN,
@@ -188,7 +181,7 @@ customize_dialog_cb(GtkWidget * widget, gpointer data)
     option_box = gtk_vbox_new(FALSE, 6);
     gtk_container_set_border_width(GTK_CONTAINER(option_box), 6);
     gtk_container_add(GTK_CONTAINER(option_frame), option_box);
-    
+
     wrap_button =
         gtk_check_button_new_with_mnemonic(_("_Wrap button labels"));
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wrap_button),
@@ -214,37 +207,6 @@ customize_dialog_cb(GtkWidget * widget, gpointer data)
 int
 get_toolbar_button_index(const char *id)
 {
-#ifdef OLD_BALSA_COMPATIBILITY_TRANSLATION
-    static const struct {
-        gchar *new;
-        gchar *old;
-    } button_converter[] = {
-        { BALSA_PIXMAP_ATTACHMENT,   GNOME_STOCK_ATTACH },
-        { BALSA_PIXMAP_COMPOSE,      GNOME_STOCK_MAIL_NEW },
-        { BALSA_PIXMAP_CONTINUE,     GNOME_STOCK_MAIL },
-        { BALSA_PIXMAP_RECEIVE,      GNOME_STOCK_MAIL_RCV },
-        { BALSA_PIXMAP_REPLY,        GNOME_STOCK_MAIL_RPL },
-        { BALSA_PIXMAP_REPLY_ALL,    "reply_to_all" },
-        { BALSA_PIXMAP_REPLY_GROUP,  "reply_to_group" },
-        { BALSA_PIXMAP_FORWARD,      GNOME_STOCK_MAIL_FWD },
-        { BALSA_PIXMAP_NEXT,         GTK_STOCK_GO_FORWARD },
-        { BALSA_PIXMAP_PREVIOUS,     GTK_STOCK_GO_BACK },
-	{ GTK_STOCK_PRINT,           BALSA_OLD_PIXMAP_PRINT },
-	{ GTK_STOCK_SAVE,            BALSA_OLD_PIXMAP_SAVE },
-        { BALSA_PIXMAP_SEND,         GNOME_STOCK_MAIL_SND },
-	{ GTK_STOCK_DELETE,          BALSA_OLD_PIXMAP_TRASH },
-        { BALSA_PIXMAP_TRASH_EMPTY,  "empty_trash" },
-        { BALSA_PIXMAP_NEXT_UNREAD,  "next_unread" },
-        { BALSA_PIXMAP_NEXT_FLAGGED, "next_flagged" },
-        { BALSA_PIXMAP_SHOW_HEADERS, "show_all_headers" },
-        { BALSA_PIXMAP_SHOW_PREVIEW, "show_preview" },
-        { BALSA_PIXMAP_MARKED_NEW,   "flag_unread" },
-        { BALSA_PIXMAP_MARK_ALL,     "mark_all" },
-        { BALSA_PIXMAP_IDENTITY,     "identity" },
-	{ GTK_STOCK_CANCEL,          BALSA_OLD_PIXMAP_CLOSE_MBOX },
-        { NULL, NULL }
-    };
-#endif
     int i;
 
     g_return_val_if_fail(id, -1);
@@ -253,21 +215,6 @@ get_toolbar_button_index(const char *id)
 	if(!strcmp(id, toolbar_buttons[i].pixmap_id))
 	    return i;
     }
-#ifdef OLD_BALSA_COMPATIBILITY_TRANSLATION
-    /* you have got a second chance.... */
-    
-    for(i=0; button_converter[i].new; i++) {
-        if(!strcmp(id, button_converter[i].old)) {
-            int j;
-            for(j=0; j<toolbar_button_count; j++) {
-                if(!strcmp(button_converter[i].new,
-                           toolbar_buttons[j].pixmap_id))
-                    return j;
-            }
-            return -1;
-        }
-    }
-#endif
     return -1;
 }
 
@@ -282,7 +229,7 @@ wrap_toggled_cb(GtkWidget * widget, GtkNotebook * notebook)
     gint i;
     GtkWidget *child;
     ToolbarPage *page;
-    
+
     balsa_app.toolbar_wrap_button_text =
         gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
 
@@ -486,7 +433,7 @@ create_toolbar_page(BalsaToolbarModel * model, GtkUIManager * ui_manager)
     gtk_container_add(GTK_CONTAINER(button_box), style_button);
 
     /* Done with preview */
-	
+
     /* Box for lower half of window */
     lower_ctlbox=gtk_hbox_new(FALSE, 5);
     gtk_container_set_border_width(GTK_CONTAINER(lower_ctlbox), 5);
@@ -514,7 +461,7 @@ create_toolbar_page(BalsaToolbarModel * model, GtkUIManager * ui_manager)
 
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(destination_scroll),
 				   GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-	
+
     destination_frame=gtk_frame_new(_("Current toolbar"));
     page->current = tp_list_new();
 
@@ -673,7 +620,7 @@ tp_page_refresh_current(ToolbarPage * page)
         tp_store_set(GTK_LIST_STORE(model), &iter, item);
     }
 
-    if (gtk_tree_model_get_iter(model, &iter, path) 
+    if (gtk_tree_model_get_iter(model, &iter, path)
         || gtk_tree_path_prev(path)) {
         gtk_tree_selection_select_path(selection, path);
         gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(page->current),
@@ -691,7 +638,7 @@ tp_page_refresh_preview(ToolbarPage * page)
         gtk_tree_view_get_model(GTK_TREE_VIEW(page->current));
     GtkTreeIter iter;
     gboolean valid;
-    
+
     balsa_toolbar_model_clear(page->model);
     for (valid = gtk_tree_model_get_iter_first(model, &iter);
          valid;
@@ -700,7 +647,7 @@ tp_page_refresh_preview(ToolbarPage * page)
 
         gtk_tree_model_get(model, &iter, TP_ITEM_COLUMN, &item, -1);
         if (item >= 0 && item < toolbar_button_count)
-            balsa_toolbar_model_insert_icon(page->model, 
+            balsa_toolbar_model_insert_icon(page->model,
                                             toolbar_buttons[item].pixmap_id,
                                             -1);
     }
@@ -743,7 +690,7 @@ tp_list_new(void)
 
 /* Test whether the iter addresses the first row.
  */
-static gboolean 
+static gboolean
 tp_list_iter_is_first(GtkWidget * list, GtkTreeIter * iter)
 {
     GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(list));
@@ -755,7 +702,7 @@ tp_list_iter_is_first(GtkWidget * list, GtkTreeIter * iter)
 
 /* Test whether the iter addresses the last row.
  */
-static gboolean 
+static gboolean
 tp_list_iter_is_last(GtkWidget * list, GtkTreeIter * iter)
 {
     GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(list));
@@ -813,7 +760,7 @@ tp_page_swap_rows(ToolbarPage * page, gboolean forward)
 }
 
 /* Add an item to a GtkTreeView's GtkListStore.
- */ 
+ */
 static void
 tp_store_set(GtkListStore * store, GtkTreeIter * iter, gint item)
 {
@@ -858,13 +805,13 @@ tp_page_add_selected(ToolbarPage * page)
     selection =
         gtk_tree_view_get_selection(GTK_TREE_VIEW(page->current));
     if (gtk_tree_selection_get_selected(selection, &model, &sibling))
-        gtk_list_store_insert_before(GTK_LIST_STORE(model), &iter, 
+        gtk_list_store_insert_before(GTK_LIST_STORE(model), &iter,
                                      &sibling);
     else
         gtk_list_store_append(GTK_LIST_STORE(model), &iter);
 
     tp_store_set(GTK_LIST_STORE(model), &iter, item);
-	
+
     path = gtk_tree_model_get_path(model, &iter);
     gtk_tree_selection_select_path(selection, path);
     gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(page->current), path, NULL,
@@ -887,14 +834,14 @@ tp_page_remove_selected(ToolbarPage * page)
     GtkTreeModel *model;
     GtkTreeIter iter;
     GtkTreePath *path;
-    
+
     if (!gtk_tree_selection_get_selected(selection, &model, &iter))
         return;
     path = gtk_tree_model_get_path(model, &iter);
 
     gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
 
-    if (gtk_tree_model_get_iter(model, &iter, path) 
+    if (gtk_tree_model_get_iter(model, &iter, path)
         || gtk_tree_path_prev(path)) {
         gtk_tree_selection_select_path(selection, path);
         gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(page->current),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]