aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-send-recv.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-11-12 22:59:35 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-11-12 22:59:35 +0800
commitf9804e11931411358ce98ad5a7726de6d68f2115 (patch)
treea8fb046c3abbc7c0e07147c21557a3e22504dbda /mail/mail-send-recv.c
parent83f816df158441ca750b0bc12b7ccab2d43c0e43 (diff)
downloadgsoc2013-evolution-f9804e11931411358ce98ad5a7726de6d68f2115.tar
gsoc2013-evolution-f9804e11931411358ce98ad5a7726de6d68f2115.tar.gz
gsoc2013-evolution-f9804e11931411358ce98ad5a7726de6d68f2115.tar.bz2
gsoc2013-evolution-f9804e11931411358ce98ad5a7726de6d68f2115.tar.lz
gsoc2013-evolution-f9804e11931411358ce98ad5a7726de6d68f2115.tar.xz
gsoc2013-evolution-f9804e11931411358ce98ad5a7726de6d68f2115.tar.zst
gsoc2013-evolution-f9804e11931411358ce98ad5a7726de6d68f2115.zip
Commented out stuff that doesn't build yet. Also fixed idl build rule.
2002-11-13 Not Zed <NotZed@Ximian.com> * Makefile.am: Commented out stuff that doesn't build yet. Also fixed idl build rule. importers still not built. * main.c (main): bonobactivationise. remove push visual/colormap. (main): no longer activate activation, let bonobo_init do it. * mail-signature-editor.c (menu_help): Change help api. * mail-session.c (user_message_destroy_noreply): removed. Not used? * mail-local.c (load_metainfo): xml root->children. * mail-format.c (g_string_append_len): Removed, it exists now. 2002-11-12 Not Zed <NotZed@Ximian.com> * subscribe-dialog.c: gnome2ised, use gtkdialog. (subscribe_get_global_extras): use a weak ref rather than destroy signal. * message-tag-followup.c: gnome2ised. * message-tag-editor.c: gnome2ised & converted to gtkdialog. * message-list.c: gnome2ised. (message_list_finalise): From destroy method. maybe should be destroy still. * message-browser.c: port to gnome2 (message_browser_finalise): renamed from destroy method. * mail-stream-gtkhtml.c: removed redundant camel_class_get_global_classfuncs() call. * mail-signature-editor.c: gtkdialogised, & bonobo api changes. * mail-search-dialogue.c: gtkdialogised. * mail-folder-cache.c: cleaned up camel ref/hook casts. * mail-composer-prefs.c (mail_composer_prefs_get_type): convert to gtype. * mail-font-prefs.c (mail_font_prefs_destroy): from finalise. * mail-config.c: s/bonobo_config/e_config_listener/ Added /apps/Evolution prefix to the evolution keys. Changed to use e_config_listener, etc. (mail_config_init): remove bonobo_config stuff. (mail_config_check_service): gtk dialogise. (check_response): from check_cancelled. * mail-config-druid.c (mail_config_druid_destroy): renamed from _finalize, turned into destroy handler. (construct): set type to toplevel, GTK_WINDOW_DIALOG no longer exists. * mail-config-factory.c (mail_config_register_factory): bonobo api changes. * mail-crypto.c (mail_crypto_get_pgp_cipher_context): cleaned up unref casts. * mail-display.c (write_data_to_file): gnome->gtkdialog. (on_link_clicked): use ascii_str*cmp on url. (save_part): g_path stuff. (launch_cb): gtk dialog. (pixmap_press): de-oafify. (pixbuf_for_mime_type): gnome-vfs api changes. (do_attachment_header): Change the pixmap to a gtkimage. (do_signature): " (pixbuf_gen_idle): " (do_attachment_header): ascii_str*cmp (do_attachment_header): gnome pixmap->gtkimage. (mail_display_destroy): protect against gtk mentalness. (html_button_press_event): ascii_str*cmp (drag_data_get_cb): added comment for translators of filename. * mail-format.c (component_supports): de-oafise. (is_anonymous): ascii_strncmp (attachment_header): remove utf8<>locale stuff, and gnomevfs api changes. (format_mime_part): fix g_strdown call. (write_field_row_begin): kill utf8->gtk stuff. (write_address): " (default_header_index): ascii_strcasecmp (handle_text_plain): " (handle_text_enriched): " (handle_multipart_encrypted): remove utf/gtk stuff. (handle_message_external_body): ascii_str*cmp * mail-identify.c (mail_identify_mime_part): (identify_by_magic): gnome vfs api changes. * mail-importer.c: Converted. * mail-local.c (load_metainfo): xml childs -> children. (mls_get_folder): g_strerror. (mls_delete_folder): g_strerror. (reconfigure_got_folder): Gnome->GtkDialog (reconfigure_response): from reconfigure_clicked. * mail-mt.c (mail_msg_check_error): gnome -> gtk dialog (error_response): renmae from error_gone. destroy widget on any response. * mail-offline-handler.c (impl_finalise): renamed from impl_destroy since thats what it should be anyway. * mail-ops.c: removed utf8 widget conversion & camel_object_un/ref casts. * mail-preferences.c (mail_preferences_get_type): glib2'ised. * mail-search.c (mail_search_finalise): renmaed from destroy & properly chain. (mail_search_get_type): glib2 & make gtkdialog parent. (entry_run_search): run search when entry activated. not sure if gtkdialog has anohter way to do this on an arbitrary widget. * mail-send-recv.c (dialogue_response): renamed from clicked. Use gtkdialog. * mail-session.c (request_password_deleted): removed, redundant. (pass_response): rename from pass_got, changed for gtkdialog. (user_message_destroy): Removed, redundant. (user_message_response): Renamed from user_message_clicked. 2002-11-11 Not Zed <NotZed@Ximian.com> * mail-stream-gtkhtml.c (mail_stream_gtkhtml_class_init): dont use get_global_classfuncs, just get the type * mail-tools.c: converted gnome2 api's. * mail-vfolder.c (vfolder_editor_response): clicked->response. (vfolder_editor_destroy): Removed. (vfolder_edit): gtk dialog api (edit_rule_response): clicked->response. (vfolder_edit_rule): gnomedialog->gtkdialog. (vfolder_gui_add_rule): " (new_rule_clicked): clicked->response svn path=/trunk/; revision=18723
Diffstat (limited to 'mail/mail-send-recv.c')
-rw-r--r--mail/mail-send-recv.c74
1 files changed, 40 insertions, 34 deletions
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index c33b165a69..95e609e825 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -30,8 +30,8 @@
/* for the dialogue stuff */
#include <glib.h>
#include <gtk/gtkmain.h>
-#include <libgnomeui/gnome-stock.h>
-#include <libgnomeui/gnome-dialog.h>
+#include <gtk/gtkdialog.h>
+#include <gtk/gtkstock.h>
#include <libgnomeui/gnome-window-icon.h>
#include "filter/filter-filter.h"
@@ -72,7 +72,7 @@ struct _folder_info {
struct _send_data {
GList *infos;
- GnomeDialog *gd;
+ GtkDialog *gd;
int cancelled;
CamelFolder *inbox; /* since we're never asked to update this one, do it ourselves */
@@ -150,7 +150,7 @@ free_folder_info(void *key, struct _folder_info *info, void *data)
{
/*camel_folder_thaw (info->folder); */
mail_sync_folder(info->folder, NULL, NULL);
- camel_object_unref((CamelObject *)info->folder);
+ camel_object_unref(info->folder);
g_free(info->uri);
}
@@ -175,7 +175,7 @@ free_send_data(void)
if (data->inbox) {
mail_sync_folder(data->inbox, NULL, NULL);
/*camel_folder_thaw (data->inbox); */
- camel_object_unref((CamelObject *)data->inbox);
+ camel_object_unref(data->inbox);
}
g_list_free(data->infos);
@@ -206,28 +206,33 @@ static void hide_send_info(void *key, struct _send_info *info, void *data)
}
static void
-dialog_destroy (GtkProgressBar *bar, struct _send_data *data)
+dialog_destroy (struct _send_data *data, GtkProgressBar *bar)
{
g_hash_table_foreach (data->active, (GHFunc) hide_send_info, NULL);
data->gd = NULL;
}
static void
-dialogue_clicked(GnomeDialog *gd, int button, struct _send_data *data)
+dialogue_response(GtkDialog *gd, int button, struct _send_data *data)
{
switch(button) {
- case 0:
+ case GTK_RESPONSE_CANCEL:
d(printf("cancelled whole thing\n"));
if (!data->cancelled) {
data->cancelled = TRUE;
g_hash_table_foreach(data->active, (GHFunc)cancel_send_info, NULL);
}
- gnome_dialog_set_sensitive(gd, 0, FALSE);
+ gtk_dialog_set_response_sensitive(gd, GTK_RESPONSE_CANCEL, FALSE);
break;
- case -1: /* dialogue vanished, so make out its just hidden */
+ default:
+ /* FIXME: check this works */
d(printf("hiding dialogue\n"));
+ gtk_widget_destroy((GtkWidget *)gd);
+ g_object_unref(gd);
+#if 0
g_hash_table_foreach(data->active, (GHFunc)hide_send_info, NULL);
data->gd = NULL;
+#endif
break;
}
}
@@ -277,7 +282,7 @@ static send_info_t get_receive_type(const char *url)
static struct _send_data *
build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination)
{
- GnomeDialog *gd;
+ GtkDialog *gd;
GtkTable *table;
int row;
GList *list = NULL;
@@ -289,12 +294,12 @@ build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination)
GtkHSeparator *line;
struct _send_info *info;
char *pretty_url;
-
- gd = (GnomeDialog *)send_recv_dialogue = gnome_dialog_new (_("Send & Receive Mail"), NULL);
- gtk_signal_connect((GtkObject *)gd, "destroy", gtk_widget_destroyed, &send_recv_dialogue);
- gnome_dialog_append_button_with_pixmap (gd, _("Cancel All"), GNOME_STOCK_BUTTON_CANCEL);
-
- gtk_window_set_policy (GTK_WINDOW (gd), FALSE, FALSE, FALSE);
+
+ gd = (GtkDialog *)send_recv_dialogue = gtk_dialog_new_with_buttons(_("Send & Receive Mail"), NULL, 0, NULL);
+ stop = (GtkButton *)gtk_button_new_from_stock(GTK_STOCK_CANCEL);
+ gtk_button_set_label(stop, _("Cancel All"));
+ gtk_dialog_add_action_widget(gd, (GtkWidget *)stop, GTK_RESPONSE_CANCEL);
+ g_object_set(gd, "resizable", FALSE, NULL);
gnome_window_icon_set_from_file (GTK_WINDOW (gd), EVOLUTION_ICONSDIR "/send-receive.xpm");
table = (GtkTable *)gtk_table_new (g_slist_length (sources), 4, FALSE);
@@ -342,16 +347,15 @@ build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination)
} else if (info->timeout_id == 0)
info->timeout_id = gtk_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info);
- recv_icon = gnome_pixmap_new_from_file (EVOLUTION_BUTTONSDIR "/receive-24.png");
+ recv_icon = gtk_image_new_from_file (EVOLUTION_BUTTONSDIR "/receive-24.png");
pretty_url = format_url (source->url);
label = (GtkLabel *)gtk_label_new (pretty_url);
g_free (pretty_url);
bar = (GtkProgressBar *)gtk_progress_bar_new ();
- gtk_progress_set_show_text (GTK_PROGRESS (bar), FALSE);
- stop = (GtkButton *)gnome_stock_button (GNOME_STOCK_BUTTON_CANCEL);
+ stop = (GtkButton *)gtk_button_new_from_stock(GTK_STOCK_CANCEL);
status_label = (GtkLabel *)gtk_label_new ((info->type == SEND_UPDATE) ? _("Updating...") :
_("Waiting..."));
@@ -370,7 +374,7 @@ build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination)
info->stop = stop;
info->data = data;
- gtk_signal_connect (GTK_OBJECT (stop), "clicked", receive_cancel, info);
+ g_signal_connect(stop, "clicked", G_CALLBACK(receive_cancel), info);
sources = sources->next;
row = row + 2;
}
@@ -398,19 +402,18 @@ build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination)
} else if (info->timeout_id == 0)
info->timeout_id = gtk_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info);
- send_icon = gnome_pixmap_new_from_file (EVOLUTION_BUTTONSDIR "/send-24.png");
+ send_icon = gtk_image_new_from_file (EVOLUTION_BUTTONSDIR "/send-24.png");
pretty_url = format_url (destination);
label = (GtkLabel *)gtk_label_new (pretty_url);
g_free (pretty_url);
bar = (GtkProgressBar *)gtk_progress_bar_new ();
- stop = (GtkButton *)gnome_stock_button (GNOME_STOCK_BUTTON_CANCEL);
+ stop = (GtkButton *)gtk_button_new_from_stock(GTK_STOCK_CANCEL);
status_label = (GtkLabel *)gtk_label_new (_("Waiting..."));
gtk_misc_set_alignment (GTK_MISC (label), 0, .5);
gtk_misc_set_alignment (GTK_MISC (status_label), 0, .5);
- gtk_progress_set_show_text (GTK_PROGRESS (bar), FALSE);
gtk_table_attach (table, GTK_WIDGET (send_icon), 0, 1, row, row+2, GTK_EXPAND | GTK_FILL, 0, 3, 1);
gtk_table_attach (table, GTK_WIDGET (label), 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 3, 1);
@@ -423,14 +426,14 @@ build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination)
info->data = data;
info->status = status_label;
- gtk_signal_connect (GTK_OBJECT (stop), "clicked", receive_cancel, info);
+ g_signal_connect(stop, "clicked", G_CALLBACK(receive_cancel), info);
gtk_widget_show_all (GTK_WIDGET (table));
}
gtk_widget_show (GTK_WIDGET (gd));
- gtk_signal_connect (GTK_OBJECT (gd), "clicked", dialogue_clicked, data);
- gtk_signal_connect (GTK_OBJECT (gd), "destroy", dialog_destroy, data);
+ g_signal_connect(gd, "response", G_CALLBACK(dialogue_response), data);
+ g_signal_connect(gd, "destroy", G_CALLBACK(dialog_destroy), data);
data->infos = list;
data->gd = gd;
@@ -500,7 +503,7 @@ static int operation_status_timeout(void *data)
struct _send_info *info = data;
if (info->bar) {
- gtk_progress_set_percentage((GtkProgress *)info->bar, (gfloat)(info->pc/100.0));
+ gtk_progress_bar_set_fraction((GtkProgressBar *)info->bar, (gfloat)(info->pc/100.0));
gtk_label_set_text(info->status, info->what);
return TRUE;
}
@@ -533,7 +536,7 @@ receive_done (char *uri, void *data)
struct _send_info *info = data;
if (info->bar) {
- gtk_progress_set_percentage((GtkProgress *)info->bar, (gfloat)1.0);
+ gtk_progress_bar_set_fraction((GtkProgressBar *)info->bar, (gfloat)1.0);
switch(info->state) {
case SEND_CANCELLED:
@@ -554,8 +557,11 @@ receive_done (char *uri, void *data)
info->data->infos = g_list_remove(info->data->infos, info);
if (g_hash_table_size(info->data->active) == 0) {
- if (info->data->gd)
- gnome_dialog_close(info->data->gd);
+ /* FIXME: check this is right ... was gnome_dialog_close() */
+ if (info->data->gd) {
+ gtk_widget_destroy((GtkWidget *)info->data->gd);
+ g_object_unref(info->data->gd);
+ }
free_send_data();
}
@@ -585,7 +591,7 @@ receive_get_folder(CamelFilterDriver *d, const char *uri, void *data, CamelExcep
oldinfo = g_hash_table_lookup(info->data->folders, uri);
g_mutex_unlock(info->data->lock);
if (oldinfo) {
- camel_object_ref((CamelObject *)oldinfo->folder);
+ camel_object_ref(oldinfo->folder);
return oldinfo->folder;
}
folder = mail_tool_uri_to_folder (uri, 0, ex);
@@ -597,7 +603,7 @@ receive_get_folder(CamelFilterDriver *d, const char *uri, void *data, CamelExcep
g_mutex_lock(info->data->lock);
if (g_hash_table_lookup_extended(info->data->folders, uri, (void **)&oldkey, (void **)&oldinfo)) {
- camel_object_unref((CamelObject *)oldinfo->folder);
+ camel_object_unref(oldinfo->folder);
oldinfo->folder = folder;
} else {
/*camel_folder_freeze (folder); */
@@ -607,7 +613,7 @@ receive_get_folder(CamelFilterDriver *d, const char *uri, void *data, CamelExcep
g_hash_table_insert(info->data->folders, oldinfo->uri, oldinfo);
}
- camel_object_ref (CAMEL_OBJECT (folder));
+ camel_object_ref (folder);
g_mutex_unlock(info->data->lock);