diff options
Diffstat (limited to 'mail/component-factory.c')
-rw-r--r-- | mail/component-factory.c | 104 |
1 files changed, 53 insertions, 51 deletions
diff --git a/mail/component-factory.c b/mail/component-factory.c index 188b4c8302..fe10799347 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -27,6 +27,8 @@ #include <bonobo/bonobo-generic-factory.h> #include <gal/widgets/e-gui-utils.h> +#include <string.h> + #include "camel.h" #include "Evolution.h" @@ -438,7 +440,9 @@ populate_folder_context_menu (EvolutionShellComponent *shell_component, if ((strncmp(physical_uri, "vfolder:", 8) == 0 && strstr(physical_uri, "#" CAMEL_UNMATCHED_NAME) == NULL) || strncmp(physical_uri, "file:", 5) == 0) { - bonobo_ui_component_add_verb_full(uic, "ChangeFolderPropertiesPopUp", configure_folder_popup, g_strdup(physical_uri), g_free); + bonobo_ui_component_add_verb_full(uic, "ChangeFolderPropertiesPopUp", + g_cclosure_new(G_CALLBACK(configure_folder_popup), + g_strdup(physical_uri), (GClosureNotify)g_free)); bonobo_ui_component_set_translate (uic, EVOLUTION_SHELL_COMPONENT_POPUP_PLACEHOLDER, popup_xml, NULL); } } @@ -731,7 +735,7 @@ shell_client_destroy (GtkObject *object) } static void -warning_clicked (GtkWidget *dialog, gpointer user_data) +warning_response (GtkWidget *dialog, int button, gpointer user_data) { gtk_widget_destroy (dialog); } @@ -748,8 +752,7 @@ owner_set_cb (EvolutionShellComponent *shell_component, /* FIXME: should we ref this? */ global_shell_client = shell_client; - gtk_signal_connect (GTK_OBJECT (shell_client), "destroy", - shell_client_destroy, NULL); + g_signal_connect(shell_client, "destroy", G_CALLBACK(shell_client_destroy), NULL); evolution_dir = g_strdup (evolution_homedir); mail_session_init (); @@ -784,8 +787,8 @@ owner_set_cb (EvolutionShellComponent *shell_component, char *system = g_strdup (EVOLUTION_DATADIR "/evolution/vfoldertypes.xml"); search_context = rule_context_new (); - gtk_object_set_data_full (GTK_OBJECT (search_context), "user", user, g_free); - gtk_object_set_data_full (GTK_OBJECT (search_context), "system", system, g_free); + g_object_set_data_full(G_OBJECT(search_context), "user", user, g_free); + g_object_set_data_full(G_OBJECT(search_context), "system", system, g_free); rule_context_add_part_set (search_context, "partset", filter_part_get_type (), rule_context_add_part, rule_context_next_part); @@ -800,11 +803,11 @@ owner_set_cb (EvolutionShellComponent *shell_component, if (mail_config_is_corrupt ()) { GtkWidget *dialog; - - dialog = gnome_warning_dialog (_("Some of your mail settings seem corrupt, " + + dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, + _("Some of your mail settings seem corrupt, " "please check that everything is in order.")); - gtk_signal_connect (GTK_OBJECT (dialog), "clicked", warning_clicked, NULL); - gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); + g_signal_connect(dialog, "response", G_CALLBACK(warning_response), NULL); gtk_widget_show (dialog); } @@ -914,16 +917,16 @@ static void owner_unset_cb (EvolutionShellComponent *shell_component, gpointer u /* Table for signal handler setup/cleanup */ static struct { char *sig; - GtkSignalFunc func; + GCallback func; int hand; } shell_component_handlers[] = { - { "owner_set", owner_set_cb, }, - { "owner_unset", owner_unset_cb, }, - { "debug", debug_cb, }, - { "interactive", interactive_cb }, - { "destroy", owner_unset_cb, }, - { "handle_external_uri", handle_external_uri_cb, }, - { "user_create_new_item", user_create_new_item_cb } + { "owner_set", G_CALLBACK(owner_set_cb), }, + { "owner_unset", G_CALLBACK(owner_unset_cb), }, + { "debug", G_CALLBACK(debug_cb), }, + { "interactive", G_CALLBACK(interactive_cb) }, + { "destroy", G_CALLBACK(owner_unset_cb), }, + { "handle_external_uri", G_CALLBACK(handle_external_uri_cb), }, + { "user_create_new_item", G_CALLBACK(user_create_new_item_cb) } }; static void @@ -932,7 +935,7 @@ owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data) int i; for (i=0;i<sizeof(shell_component_handlers)/sizeof(shell_component_handlers[0]);i++) - gtk_signal_disconnect((GtkObject *)shell_component, shell_component_handlers[i].hand); + g_signal_handler_disconnect((GtkObject *)shell_component, shell_component_handlers[i].hand); if (mail_config_get_empty_trash_on_exit ()) empty_trash (NULL, NULL, NULL); @@ -943,7 +946,7 @@ owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data) global_shell_client = NULL; mail_session_set_interactive (FALSE); - gtk_object_unref (GTK_OBJECT (search_context)); + g_object_unref((search_context)); search_context = NULL; g_timeout_add(100, idle_quit, NULL); @@ -966,9 +969,11 @@ send_receive_cb (EvolutionShellComponent *shell_component, if (!account || !account->transport) { GtkWidget *dialog; - dialog = gnome_error_dialog (_("You have not set a mail transport method")); - gnome_dialog_set_close (GNOME_DIALOG (dialog), TRUE); - gtk_widget_show (dialog); + dialog = gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, + _("You have not set a mail transport method")); + gtk_dialog_run((GtkDialog *)dialog); + gtk_widget_destroy(dialog); + g_object_unref(dialog); return; } @@ -981,25 +986,22 @@ request_quit (EvolutionShellComponent *shell_component, void *closure) { GtkWidget *dialog; - + int resp; + if (!e_msg_composer_request_close_all ()) return FALSE; if (!outbox_folder || !camel_folder_get_message_count (outbox_folder)) return TRUE; - - dialog = gnome_message_box_new (_("You have unsent messages, do you wish to quit anyway?"), - GNOME_MESSAGE_BOX_QUESTION, - GNOME_STOCK_BUTTON_YES, /* Quit */ - GNOME_STOCK_BUTTON_NO, /* Don't quit */ - NULL); - - gtk_window_set_title (GTK_WINDOW (dialog), _("Warning: Unsent Messages")); - gnome_dialog_set_default (GNOME_DIALOG (dialog), 1); - if (gnome_dialog_run_and_close (GNOME_DIALOG (dialog)) == 0) - return TRUE; - - return FALSE; + + dialog = gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_INFO, GTK_BUTTONS_YES_NO, + _("You have unsent messages, do you wish to quit anyway?")); + gtk_dialog_set_default_response((GtkDialog *)dialog, GTK_RESPONSE_NO); + resp = gtk_dialog_run((GtkDialog *)dialog); + gtk_widget_destroy(dialog); + g_object_unref(dialog); + + return resp == GTK_RESPONSE_YES; } static BonoboObject * @@ -1022,8 +1024,8 @@ create_component (void) request_quit, NULL); - gtk_signal_connect (GTK_OBJECT (shell_component), "send_receive", - GTK_SIGNAL_FUNC (send_receive_cb), NULL); + g_signal_connect((shell_component), "send_receive", + G_CALLBACK (send_receive_cb), NULL); destination_interface = evolution_shell_component_dnd_destination_folder_new (destination_folder_handle_motion, destination_folder_handle_drop, @@ -1034,26 +1036,26 @@ create_component (void) evolution_mail_config_wizard_init (); - icon = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/new-message.xpm"); + icon = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/new-message.xpm", NULL); evolution_shell_component_add_user_creatable_item (shell_component, "message", _("New Mail Message"), _("_Mail Message"), _("Compose a new mail message"), "mail", 'm', icon); if (icon != NULL) - gdk_pixbuf_unref (icon); + g_object_unref (icon); - icon = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/post-message-16.png"); + icon = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/post-message-16.png", NULL); evolution_shell_component_add_user_creatable_item (shell_component, "post", _("New Message Post"), _("_Post Message"), _("Post a new mail message"), "mail/public", 'p', icon); if (icon != NULL) - gdk_pixbuf_unref (icon); + g_object_unref (icon); for (i=0;i<sizeof(shell_component_handlers)/sizeof(shell_component_handlers[0]);i++) { - shell_component_handlers[i].hand = gtk_signal_connect(GTK_OBJECT(shell_component), + shell_component_handlers[i].hand = g_signal_connect((shell_component), shell_component_handlers[i].sig, shell_component_handlers[i].func, NULL); } @@ -1071,12 +1073,12 @@ component_factory_init (void) int result; shell_component = create_component (); - result = oaf_active_server_register (COMPONENT_ID, bonobo_object_corba_objref (shell_component)); - if (result == OAF_REG_ERROR) { + result = bonobo_activation_active_server_register (COMPONENT_ID, bonobo_object_corba_objref (shell_component)); + if (result == Bonobo_ACTIVATION_REG_ERROR) { e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, _("Cannot initialize the Evolution mail component.")); exit (1); - } else if (result == OAF_REG_ALREADY_ACTIVE) { + } else if (result == Bonobo_ACTIVATION_REG_ALREADY_ACTIVE) { g_warning ("evolution-mail is already running"); exit (1); } @@ -1351,10 +1353,10 @@ add_storage (const char *name, const char *uri, CamelService *store, EvolutionStorageResult res; storage = evolution_storage_new (name, FALSE); - gtk_signal_connect (GTK_OBJECT (storage), "open_folder", storage_connect, store); - gtk_signal_connect (GTK_OBJECT (storage), "create_folder", storage_create_folder, store); - gtk_signal_connect (GTK_OBJECT (storage), "remove_folder", storage_remove_folder, store); - gtk_signal_connect ((GtkObject *)storage, "xfer_folder", storage_xfer_folder, store); + g_signal_connect(storage, "open_folder", G_CALLBACK(storage_connect), store); + g_signal_connect(storage, "create_folder", G_CALLBACK(storage_create_folder), store); + g_signal_connect(storage, "remove_folder", G_CALLBACK(storage_remove_folder), store); + g_signal_connect(storage, "xfer_folder", G_CALLBACK(storage_xfer_folder), store); res = evolution_storage_register_on_shell (storage, corba_shell); |