diff options
author | Not Zed <NotZed@Ximian.com> | 2002-11-13 12:40:07 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-11-13 12:40:07 +0800 |
commit | 9e4f25d532f59d85034cbef768bb941f748fb1f2 (patch) | |
tree | a255e1471c9723e60590d85c32f1f0ba4ce834f0 /mail/mail-accounts.c | |
parent | 4dece891604244df7d9dea34b9f1e18efe27f09a (diff) | |
download | gsoc2013-evolution-9e4f25d532f59d85034cbef768bb941f748fb1f2.tar gsoc2013-evolution-9e4f25d532f59d85034cbef768bb941f748fb1f2.tar.gz gsoc2013-evolution-9e4f25d532f59d85034cbef768bb941f748fb1f2.tar.bz2 gsoc2013-evolution-9e4f25d532f59d85034cbef768bb941f748fb1f2.tar.lz gsoc2013-evolution-9e4f25d532f59d85034cbef768bb941f748fb1f2.tar.xz gsoc2013-evolution-9e4f25d532f59d85034cbef768bb941f748fb1f2.tar.zst gsoc2013-evolution-9e4f25d532f59d85034cbef768bb941f748fb1f2.zip |
Added to cvs. Currently contains no configurable stuff, but maybe it will
2002-11-13 Not Zed <NotZed@Ximian.com>
* GNOME_Evolution_Mail.server.in.in: Added to cvs. Currently
contains no configurable stuff, but maybe it will one day.
* Makefile.am (server_DATA): change oaf stuff to server stuff for
bonobo activation.
* mail-preferences.c (mail_preferences_apply): handle const entry text.
* mail-composer-prefs.c (url_requested): Fixed typo.
(mail_composer_prefs_construct): gnomepixmap->gtkimage.
* mail-callbacks.c (configure_mail): destroy dialogue before dealing
with response.
(mail_generate_reply): Fix a typo.
(popup_listener_cb): fix prototype.
(tag_editor_response): Handle gtk dialog response.
(flag_for_followup): Change gnome dialog to gtk dialog stuff.
(tag_editor_destroy_cb):
(tag_editor_cancel):
(tag_editor_ok): Removed, handled in _response().
(filter_editor_response): renamed from _clicked, handle gtk
dialogue signal.
(filter_editor_destroy): Removed.
(footer_info_new): gnome font api changes.
(do_mail_print): port to gnome print 2.
* mail-autofilter.c (mail_filter_delete_uri): message_dialog uses
a specific button enum, not the stock ones.
* mail-accounts.c (mail_accounts_tab_get_type): gobjectify.
(account_delete_clicked): gdkdialogise.
* mail-account-gui.c (mail_account_gui_setup): Hack around font
metric determination code.
* mail-account-editor.c (mail_account_editor_get_type):
gobjectise.
(mail_account_editor_new): ""
* folder-info.c (evolution_folder_info_notify_ready): use pbclient
interface.
* folder-browser-factory.c (control_destroy_cb): fix a typo.
(folder_browser_factory_new_control): More typos.
* folder-browser.c (on_right_click): cast around const warning.
(context_menu_position_func): fix for api change.
* e-searching-tokenizer.c (e_searching_tokenizer_finalise):
Changed from destroy since it only frees memory.
(e_searching_tokenizer_get_type): glibify.
* component-factory.c (request_quit): gtkdialogise.
(send_receive_cb): "
(create_component): gdk_pixbuf api.
(component_factory_init): bonobo activation stuff.
(warning_response): renamed from warning_clicked.
(owner_set_cb): gtkdialogise.
svn path=/trunk/; revision=18731
Diffstat (limited to 'mail/mail-accounts.c')
-rw-r--r-- | mail/mail-accounts.c | 115 |
1 files changed, 63 insertions, 52 deletions
diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c index 5074469e3e..784805481c 100644 --- a/mail/mail-accounts.c +++ b/mail/mail-accounts.c @@ -27,12 +27,9 @@ #include "mail-accounts.h" -#include <libgnomeui/gnome-stock.h> -#include <libgnomeui/gnome-messagebox.h> #include <gal/e-table/e-table-memory-store.h> #include <gal/e-table/e-table-scrolled.h> #include <gal/e-table/e-cell-toggle.h> -#include <gal/util/e-unicode-i18n.h> #include <gal/widgets/e-unicode.h> #include <camel/camel-url.h> @@ -50,7 +47,7 @@ static void mail_accounts_tab_class_init (MailAccountsTabClass *class); static void mail_accounts_tab_init (MailAccountsTab *prefs); -static void mail_accounts_tab_finalise (GtkObject *obj); +static void mail_accounts_tab_finalise (GObject *obj); static void mail_accounts_load (MailAccountsTab *tab); @@ -63,23 +60,23 @@ static GtkVBoxClass *parent_class = NULL; #define PREFS_WINDOW(prefs) GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (prefs), GTK_TYPE_WINDOW)) -GtkType +GType mail_accounts_tab_get_type (void) { - static GtkType type = 0; + static GType type = 0; if (!type) { - GtkTypeInfo type_info = { - "MailAccountsTab", - sizeof (MailAccountsTab), + GTypeInfo type_info = { sizeof (MailAccountsTabClass), - (GtkClassInitFunc) mail_accounts_tab_class_init, - (GtkObjectInitFunc) mail_accounts_tab_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL + NULL, NULL, + (GClassInitFunc) mail_accounts_tab_class_init, + NULL, NULL, + sizeof (MailAccountsTab), + 0, + (GInstanceInitFunc) mail_accounts_tab_init, }; - type = gtk_type_unique (gtk_vbox_get_type (), &type_info); + type = g_type_register_static (gtk_vbox_get_type (), "MailAccountsTab", &type_info, 0); } return type; @@ -88,10 +85,10 @@ mail_accounts_tab_get_type (void) static void mail_accounts_tab_class_init (MailAccountsTabClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; - object_class = (GtkObjectClass *) klass; - parent_class = gtk_type_class (gtk_vbox_get_type ()); + object_class = (GObjectClass *) klass; + parent_class = g_type_class_ref(gtk_vbox_get_type ()); object_class->finalize = mail_accounts_tab_finalise; /* override methods */ @@ -112,15 +109,15 @@ mail_accounts_tab_init (MailAccountsTab *prefs) } static void -mail_accounts_tab_finalise (GtkObject *obj) +mail_accounts_tab_finalise (GObject *obj) { MailAccountsTab *prefs = (MailAccountsTab *) obj; - gtk_object_unref (GTK_OBJECT (prefs->gui)); + g_object_unref((prefs->gui)); gdk_pixmap_unref (prefs->mark_pixmap); - gdk_bitmap_unref (prefs->mark_bitmap); + g_object_unref (prefs->mark_bitmap); - ((GtkObjectClass *)(parent_class))->finalize (obj); + ((GObjectClass *)(parent_class))->finalize (obj); } static void @@ -130,11 +127,14 @@ account_add_finished (GtkWidget *widget, gpointer user_data) MailAccountsTab *prefs = user_data; prefs->druid = NULL; - + +#warning "GTK_OBJECT_DESTROYED" +#if 0 if (!GTK_OBJECT_DESTROYED (prefs)) +#endif mail_accounts_load (prefs); - gtk_object_unref ((GtkObject *) prefs); + g_object_unref ((GtkObject *) prefs); } static void @@ -144,11 +144,11 @@ account_add_clicked (GtkButton *button, gpointer user_data) if (prefs->druid == NULL) { prefs->druid = (GtkWidget *) mail_config_druid_new (prefs->shell); - gtk_signal_connect (GTK_OBJECT (prefs->druid), "destroy", - GTK_SIGNAL_FUNC (account_add_finished), prefs); + g_signal_connect((prefs->druid), "destroy", + G_CALLBACK (account_add_finished), prefs); gtk_widget_show (prefs->druid); - gtk_object_ref ((GtkObject *) prefs); + g_object_ref ((GtkObject *) prefs); } else { gdk_window_raise (prefs->druid->window); } @@ -161,10 +161,12 @@ account_edit_finished (GtkWidget *widget, gpointer user_data) prefs->editor = NULL; +#if 0 if (!GTK_OBJECT_DESTROYED (prefs)) +#endif mail_accounts_load (prefs); - gtk_object_unref ((GtkObject *) prefs); + g_object_unref(prefs); } static void @@ -191,11 +193,11 @@ account_edit_clicked (GtkButton *button, gpointer user_data) account = gtk_clist_get_row_data (prefs->table, row); #endif prefs->editor = (GtkWidget *) mail_account_editor_new (account, GTK_WINDOW (window), prefs); - gtk_signal_connect (GTK_OBJECT (prefs->editor), "destroy", - GTK_SIGNAL_FUNC (account_edit_finished), + g_signal_connect((prefs->editor), "destroy", + G_CALLBACK (account_edit_finished), prefs); gtk_widget_show (prefs->editor); - gtk_object_ref ((GtkObject *) prefs); + g_object_ref ((GtkObject *) prefs); } } else { gdk_window_raise (prefs->editor->window); @@ -207,7 +209,8 @@ account_delete_clicked (GtkButton *button, gpointer user_data) { MailAccountsTab *prefs = user_data; const MailConfigAccount *account; - GnomeDialog *confirm; + GtkDialog *confirm; + GtkButton *tmp; const GSList *list; int row, ans; @@ -220,7 +223,21 @@ account_delete_clicked (GtkButton *button, gpointer user_data) /* make sure we have a valid account selected and that we aren't editing anything... */ if (row < 0 || prefs->editor != NULL) return; - + + confirm = (GtkDialog *)gtk_message_dialog_new(PREFS_WINDOW (prefs), + GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, + _("Are you sure you want to delete this account?")); + tmp = (GtkButton *)gtk_button_new_from_stock(GTK_STOCK_YES); + gtk_button_set_label(tmp, _("Delete")); + gtk_dialog_add_action_widget(confirm, (GtkWidget *)tmp, GTK_RESPONSE_YES); + tmp = (GtkButton *)gtk_button_new_from_stock(GTK_STOCK_NO); + gtk_button_set_label(tmp, _("Don't delete")); + gtk_dialog_add_action_widget(confirm, (GtkWidget *)tmp, GTK_RESPONSE_NO); + ans = gtk_dialog_run(confirm); + gtk_widget_destroy((GtkWidget *)confirm); + g_object_unref(confirm); +#if 0 confirm = GNOME_DIALOG (gnome_message_box_new (_("Are you sure you want to delete this account?"), GNOME_MESSAGE_BOX_QUESTION, NULL)); @@ -231,8 +248,8 @@ account_delete_clicked (GtkButton *button, gpointer user_data) gtk_window_set_title (GTK_WINDOW (confirm), _("Really delete account?")); gnome_dialog_set_parent (confirm, PREFS_WINDOW (prefs)); ans = gnome_dialog_run_and_close (confirm); - - if (ans == 0) { +#endif + if (ans == GTK_RESPONSE_YES) { int select, len; #if USE_ETABLE @@ -537,7 +554,7 @@ mail_accounts_etable_new (char *widget_name, char *string1, char *string2, int i gtk_container_add (GTK_CONTAINER (scrolled), table); - gtk_object_set_data (GTK_OBJECT (scrolled), "table", table); + g_object_set_data(G_OBJECT(scrolled), "table", table); gtk_widget_show (scrolled); gtk_widget_show (table); @@ -552,7 +569,7 @@ mail_accounts_tab_construct (MailAccountsTab *prefs) GtkWidget *toplevel, *widget; GladeXML *gui; - gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "accounts_tab"); + gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "accounts_tab", NULL); prefs->gui = gui; /* get our toplevel widget */ @@ -570,19 +587,18 @@ mail_accounts_tab_construct (MailAccountsTab *prefs) prefs->table = e_table_scrolled_get_table (E_TABLE_SCROLLED (widget)); prefs->model = prefs->table->model; - gtk_signal_connect (GTK_OBJECT (prefs->table), "cursor_change", + g_signal_connect((prefs->table), "cursor_change", account_cursor_change, prefs); - gtk_signal_connect (GTK_OBJECT (prefs->table), "double_click", + g_signal_connect((prefs->table), "double_click", account_double_click, prefs); mail_accounts_load (prefs); #else - prefs->table = GTK_CLIST (gtk_object_get_data (GTK_OBJECT (widget), "table")); + prefs->table = GTK_CLIST (g_object_get_data(G_OBJECT(widget), "table")); gtk_clist_set_column_justification (prefs->table, 0, GTK_JUSTIFY_RIGHT); - gtk_signal_connect (GTK_OBJECT (prefs->table), "select-row", - account_cursor_change, prefs); + g_signal_connect(prefs->table, "select-row", G_CALLBACK(account_cursor_change), prefs); mail_accounts_load (prefs); @@ -596,24 +612,19 @@ mail_accounts_tab_construct (MailAccountsTab *prefs) #endif prefs->mail_add = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountAdd")); - gtk_signal_connect (GTK_OBJECT (prefs->mail_add), "clicked", - account_add_clicked, prefs); - + g_signal_connect(prefs->mail_add, "clicked", G_CALLBACK(account_add_clicked), prefs); + prefs->mail_edit = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountEdit")); - gtk_signal_connect (GTK_OBJECT (prefs->mail_edit), "clicked", - account_edit_clicked, prefs); + g_signal_connect(prefs->mail_edit, "clicked", G_CALLBACK(account_edit_clicked), prefs); prefs->mail_delete = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountDelete")); - gtk_signal_connect (GTK_OBJECT (prefs->mail_delete), "clicked", - account_delete_clicked, prefs); + g_signal_connect(prefs->mail_delete, "clicked", G_CALLBACK(account_delete_clicked), prefs); prefs->mail_default = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountDefault")); - gtk_signal_connect (GTK_OBJECT (prefs->mail_default), "clicked", - account_default_clicked, prefs); + g_signal_connect(prefs->mail_default, "clicked", G_CALLBACK(account_default_clicked), prefs); prefs->mail_able = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountAble")); - gtk_signal_connect (GTK_OBJECT (prefs->mail_able), "clicked", - account_able_clicked, prefs); + g_signal_connect(prefs->mail_able, "clicked", G_CALLBACK(account_able_clicked), prefs); } |