From 976cdd5eb9d8ad0800761ce883efe9289edf9c54 Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Thu, 22 Apr 2004 23:51:43 +0000 Subject: Override the save_contact function. (e_contact_editor_save_contact): 2004-04-22 Hans Petter Jansson * gui/contact-editor/e-contact-editor.c (e_contact_editor_class_init): Override the save_contact function. (e_contact_editor_save_contact): Implement. (e_contact_editor_init): Remove some unnecessary checks - if something's the matter with the UI files, that needs to be warned about and fixed, not silently worked around. svn path=/trunk/; revision=25589 --- addressbook/gui/contact-editor/e-contact-editor.c | 28 ++++++++++------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'addressbook/gui/contact-editor') diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 0ce3f02d9d..b5aead2397 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -95,6 +95,7 @@ static void e_contact_editor_dispose (GObject *object); static void e_contact_editor_raise (EABEditor *editor); static void e_contact_editor_show (EABEditor *editor); +static void e_contact_editor_save_contact (EABEditor *editor, gboolean should_close); static void e_contact_editor_close (EABEditor *editor); static gboolean e_contact_editor_is_valid (EABEditor *editor); static gboolean e_contact_editor_is_changed (EABEditor *editor); @@ -234,6 +235,7 @@ e_contact_editor_class_init (EContactEditorClass *klass) editor_class->show = e_contact_editor_show; editor_class->close = e_contact_editor_close; editor_class->is_valid = e_contact_editor_is_valid; + editor_class->save_contact = e_contact_editor_save_contact; editor_class->is_changed = e_contact_editor_is_changed; editor_class->get_window = e_contact_editor_get_window; @@ -1788,6 +1790,12 @@ save_contact (EContactEditor *ce, gboolean should_close) } } +static void +e_contact_editor_save_contact (EABEditor *editor, gboolean should_close) +{ + save_contact (E_CONTACT_EDITOR (editor), should_close); +} + /* Closes the dialog box and emits the appropriate signals */ static void e_contact_editor_close (EABEditor *editor) @@ -1930,27 +1938,15 @@ e_contact_editor_init (EContactEditor *e_contact_editor) init_address (e_contact_editor); wants_html = glade_xml_get_widget(e_contact_editor->gui, "checkbutton-htmlmail"); - if (wants_html && GTK_IS_TOGGLE_BUTTON(wants_html)) - g_signal_connect (wants_html, "toggled", - G_CALLBACK (wants_html_changed), e_contact_editor); - + g_signal_connect (wants_html, "toggled", G_CALLBACK (wants_html_changed), e_contact_editor); widget = glade_xml_get_widget(e_contact_editor->gui, "button-fullname"); - if (widget && GTK_IS_BUTTON(widget)) - g_signal_connect (widget, "clicked", - G_CALLBACK (full_name_clicked), e_contact_editor); - + g_signal_connect (widget, "clicked", G_CALLBACK (full_name_clicked), e_contact_editor); widget = glade_xml_get_widget(e_contact_editor->gui, "button-categories"); - if (widget && GTK_IS_BUTTON(widget)) - g_signal_connect (widget, "clicked", - G_CALLBACK (categories_clicked), e_contact_editor); + g_signal_connect (widget, "clicked", G_CALLBACK (categories_clicked), e_contact_editor); widget = glade_xml_get_widget (e_contact_editor->gui, "source-option-menu-source"); - if (widget && E_IS_SOURCE_OPTION_MENU (widget)) - g_signal_connect (widget, "source_selected", - G_CALLBACK (source_selected), e_contact_editor); - + g_signal_connect (widget, "source_selected", G_CALLBACK (source_selected), e_contact_editor); widget = glade_xml_get_widget (e_contact_editor->gui, "button-ok"); g_signal_connect (widget, "clicked", G_CALLBACK (file_save_and_close_cb), e_contact_editor); - widget = glade_xml_get_widget (e_contact_editor->gui, "button-cancel"); g_signal_connect (widget, "clicked", G_CALLBACK (file_cancel_cb), e_contact_editor); -- cgit v1.2.3