From 1e5ff7ff0271d5953d833ebc3ce9c41cdf3eb3a5 Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Fri, 16 Apr 2004 23:57:01 +0000 Subject: Add "wants HTML" checkbox. 2004-04-16 Hans Petter Jansson * gui/contact-editor/contact-editor.glade: Add "wants HTML" checkbox. * gui/contact-editor/contact-editor.c (email_location_to_index) (email_entry_changed) (set_entry_changed_signal_email) (file_save_cb) (file_close_cb) (file_save_as_cb) (file_send_as_cb) (file_send_to_cb) (contact_deleted_cb) (delete_cb) (print_cb) (print_envelope_cb) (tb_save_and_close_cb) (verbs) (pixmaps) (create_ui): Remove unused funcs. (command_state_changed): Remove bonobo calls. (e_contact_editor_init): Remove bonobo stuff. (fill_in_email) (fill_in_im): Remove unused vars. svn path=/trunk/; revision=25498 --- addressbook/ChangeLog | 25 ++ .../gui/contact-editor/contact-editor.glade | 23 +- addressbook/gui/contact-editor/e-contact-editor.c | 290 --------------------- 3 files changed, 47 insertions(+), 291 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 830b748a8a..21d28f873d 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,28 @@ +2004-04-16 Hans Petter Jansson + + * gui/contact-editor/contact-editor.glade: Add "wants HTML" checkbox. + + * gui/contact-editor/contact-editor.c (email_location_to_index) + (email_entry_changed) + (set_entry_changed_signal_email) + (file_save_cb) + (file_close_cb) + (file_save_as_cb) + (file_send_as_cb) + (file_send_to_cb) + (contact_deleted_cb) + (delete_cb) + (print_cb) + (print_envelope_cb) + (tb_save_and_close_cb) + (verbs) + (pixmaps) + (create_ui): Remove unused funcs. + (command_state_changed): Remove bonobo calls. + (e_contact_editor_init): Remove bonobo stuff. + (fill_in_email) + (fill_in_im): Remove unused vars. + 2004-04-16 Chris Toshok * gui/component/addressbook-component.c (book_loaded_cb): new diff --git a/addressbook/gui/contact-editor/contact-editor.glade b/addressbook/gui/contact-editor/contact-editor.glade index 256645f1a6..cefd73f07a 100644 --- a/addressbook/gui/contact-editor/contact-editor.glade +++ b/addressbook/gui/contact-editor/contact-editor.glade @@ -358,7 +358,7 @@ 12 True - 2 + 3 4 False 6 @@ -603,6 +603,27 @@ + + + + True + True + Wants to receive HTML mail + True + GTK_RELIEF_NORMAL + False + False + True + + + 0 + 4 + 2 + 3 + fill + + + diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 4cf2adff27..e1e0980dcd 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -39,11 +39,6 @@ #include #include -#if 0 -#include -#include -#include -#endif #include #include #include @@ -288,11 +283,6 @@ e_contact_editor_class_init (EContactEditorClass *klass) G_PARAM_READWRITE)); } - - - - - static void init_email_record_location (EContactEditor *editor, gint record) { @@ -374,19 +364,6 @@ extract_email_record (EContactEditor *editor, gint record, gchar **address, gint *location = gtk_option_menu_get_history (GTK_OPTION_MENU (location_option_menu)); } -static gint -email_location_to_index (const gchar *location) -{ - gint i; - - for (i = 0; i < G_N_ELEMENTS (im_location); i++) { - if (!strcasecmp (location, im_location [i].name)) - return i; - } - - return -1; -} - static const gchar * email_index_to_location (gint index) { @@ -439,7 +416,6 @@ fill_in_email (EContactEditor *editor) for (l = email_attr_list; l && record_n <= 4; l = g_list_next (l)) { EVCardAttribute *attr = l->data; gchar *email_address; - gchar *email_location; email_address = e_vcard_attribute_get_value (attr); @@ -599,7 +575,6 @@ fill_in_im (EContactEditor *editor) for (l = im_attr_list; l && record_n <= 3; l = g_list_next (l)) { EVCardAttribute *attr = l->data; gchar *im_name; - gchar *im_location; im_name = e_vcard_attribute_get_value (attr); @@ -846,16 +821,6 @@ phone_entry_changed (GtkWidget *widget, EContactEditor *editor) widget_changed (widget, editor); } -static void -email_entry_changed (GtkWidget *widget, EContactEditor *editor) -{ - GtkEntry *entry = GTK_ENTRY(widget); - - e_contact_set (editor->contact, emails[editor->email_choice], (char*)gtk_entry_get_text(entry)); - - widget_changed (widget, editor); -} - static void new_target_cb (EBook *new_book, EBookStatus status, EContactEditor *editor) { @@ -1141,15 +1106,6 @@ set_entry_changed_signal_phone(EContactEditor *editor, char *id) G_CALLBACK (phone_entry_changed), editor); } -static void -set_entry_changed_signal_email(EContactEditor *editor, char *id) -{ - GtkWidget *widget = glade_xml_get_widget(editor->gui, id); - if (widget && GTK_IS_ENTRY(widget)) - g_signal_connect(widget, "changed", - G_CALLBACK (email_entry_changed), editor); -} - static void widget_changed (GtkWidget *widget, EContactEditor *editor) { @@ -1502,18 +1458,6 @@ e_contact_editor_get_window (EABEditor *editor) } -/* Menu callbacks */ - -/* File/Save callback */ -static void -file_save_cb (GtkWidget *widget, gpointer data) -{ - EContactEditor *ce; - - ce = E_CONTACT_EDITOR (data); - save_contact (ce, FALSE); -} - static void file_save_and_close_cb (GtkWidget *widget, gpointer data) { @@ -1531,183 +1475,6 @@ file_cancel_cb (GtkWidget *widget, gpointer data) eab_editor_close (EAB_EDITOR (ce)); } -/* File/Close callback */ -static void -file_close_cb (GtkWidget *widget, gpointer data) -{ - EContactEditor *ce; - - ce = E_CONTACT_EDITOR (data); - if (!eab_editor_prompt_to_save_changes (EAB_EDITOR (ce), GTK_WINDOW (ce->app))) - return; - - eab_editor_close (EAB_EDITOR (ce)); -} - -static void -file_save_as_cb (GtkWidget *widget, gpointer data) -{ - EContactEditor *ce; - EContact *contact; - - ce = E_CONTACT_EDITOR (data); - - extract_info (ce); - - contact = ce->contact; - eab_contact_save(_("Save Contact as VCard"), contact, GTK_WINDOW (ce->app)); -} - -static void -file_send_as_cb (GtkWidget *widget, gpointer data) -{ - EContactEditor *ce; - - ce = E_CONTACT_EDITOR (data); - - extract_info (ce); - - eab_send_contact(ce->contact, EAB_DISPOSITION_AS_ATTACHMENT); -} - -static void -file_send_to_cb (GtkWidget *widget, gpointer data) -{ - EContactEditor *ce; - - ce = E_CONTACT_EDITOR (data); - - extract_info (ce); - - eab_send_contact(ce->contact, EAB_DISPOSITION_AS_TO); -} - -static void -contact_deleted_cb (EBook *book, EBookStatus status, EContactEditor *ce) -{ - gtk_widget_set_sensitive (ce->app, TRUE); - ce->in_async_call = FALSE; - - eab_editor_contact_deleted (EAB_EDITOR (ce), status, ce->contact); - - /* always close the dialog after we successfully delete a card */ - if (status == E_BOOK_ERROR_OK) - eab_editor_close (EAB_EDITOR (ce)); -} - -static void -delete_cb (GtkWidget *widget, gpointer data) -{ - EContactEditor *ce = E_CONTACT_EDITOR (data); - EContact *contact = ce->contact; - - g_object_ref(contact); - - if (eab_editor_confirm_delete(GTK_WINDOW(ce->app))) { - - extract_info (ce); - - if (!ce->is_new_contact && ce->source_book) { - gtk_widget_set_sensitive (ce->app, FALSE); - ce->in_async_call = TRUE; - - e_book_async_remove_contact (ce->source_book, contact, (EBookCallback)contact_deleted_cb, ce); - } - } - - g_object_unref(contact); -} - -#if 0 -/* Emits the signal to request printing a card */ -static void -print_cb (BonoboUIComponent *uih, void *data, const char *path) -{ - EContactEditor *ce; - - ce = E_CONTACT_EDITOR (data); - - extract_info (ce); - - gtk_widget_show(e_contact_print_contact_dialog_new(ce->contact)); -} -#endif - -#if 0 /* Envelope printing is disabled for Evolution 1.0. */ -/* Emits the signal to request printing a card */ -static void -print_envelope_cb (BonoboUIComponent *uih, void *data, const char *path) -{ - EContactEditor *ce; - - ce = E_CONTACT_EDITOR (data); - - extract_info (ce); - e_card_simple_sync_card (ce->simple); - - gtk_widget_show(e_contact_print_envelope_dialog_new(ce->card)); -} -#endif - -#if 0 -/* Toolbar/Save and Close callback */ -static void -tb_save_and_close_cb (BonoboUIComponent *uih, void *data, const char *path) -{ - EContactEditor *ce; - - ce = E_CONTACT_EDITOR (data); - save_contact (ce, TRUE); -} - -static -BonoboUIVerb verbs [] = { - BONOBO_UI_UNSAFE_VERB ("ContactEditorSave", file_save_cb), - BONOBO_UI_UNSAFE_VERB ("ContactEditorSaveAs", file_save_as_cb), - BONOBO_UI_UNSAFE_VERB ("ContactEditorSaveClose", tb_save_and_close_cb), - BONOBO_UI_UNSAFE_VERB ("ContactEditorSendAs", file_send_as_cb), - BONOBO_UI_UNSAFE_VERB ("ContactEditorSendTo", file_send_to_cb), - BONOBO_UI_UNSAFE_VERB ("ContactEditorDelete", delete_cb), - BONOBO_UI_UNSAFE_VERB ("ContactEditorPrint", print_cb), -#if 0 /* Envelope printing is disabled for Evolution 1.0. */ - BONOBO_UI_UNSAFE_VERB ("ContactEditorPrintEnvelope", print_envelope_cb), -#endif - /* BONOBO_UI_UNSAFE_VERB ("ContactEditorPageSetup", file_page_setup_menu), */ - BONOBO_UI_UNSAFE_VERB ("ContactEditorClose", file_close_cb), - - BONOBO_UI_VERB_END -}; - -EPixmap pixmaps[] = { - E_PIXMAP ("/commands/ContactEditorSave", "save-16.png"), - E_PIXMAP ("/commands/ContactEditorSaveClose", "save-16.png"), - E_PIXMAP ("/commands/ContactEditorSaveAs", "save-as-16.png"), - E_PIXMAP ("/commands/ContactEditorDelete", "evolution-trash-mini.png"), - E_PIXMAP ("/commands/ContactEditorPrint", "print.xpm"), -#if 0 /* Envelope printing is disabled for Evolution 1.0. */ - E_PIXMAP ("/commands/ContactEditorPrintEnvelope", "print.xpm"), -#endif - E_PIXMAP ("/Toolbar/ContactEditorSaveClose", "buttons/save-24.png"), - E_PIXMAP ("/Toolbar/ContactEditorDelete", "buttons/delete-message.png"), - E_PIXMAP ("/Toolbar/ContactEditorPrint", "buttons/print.png"), - - E_PIXMAP_END -}; - -static void -create_ui (EContactEditor *ce) -{ - bonobo_ui_component_add_verb_list_with_data (ce->uic, verbs, ce); - - bonobo_ui_util_set_ui (ce->uic, PREFIX, - EVOLUTION_UIDIR "/evolution-contact-editor.xml", - "evolution-contact-editor", NULL); - - e_pixmaps_update (ce->uic, pixmaps); -} - -#endif - /* Callback used when the dialog box is destroyed */ static gint app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) @@ -1769,13 +1536,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) { GladeXML *gui; GtkWidget *widget; -#if 0 - GtkWidget *bonobo_win; -#endif GtkWidget *wants_html; -#if 0 - BonoboUIContainer *container; -#endif char *icon_path; e_contact_editor->email_info = NULL; @@ -1847,42 +1608,6 @@ e_contact_editor_init (EContactEditor *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); -#if 0 - /* Construct the app */ - bonobo_win = bonobo_window_new ("contact-editor-dialog", _("Contact Editor")); - - /* FIXME: The sucking bit */ - { - GtkWidget *contents; - - contents = bonobo_dock_get_client_area (gnome_app_get_dock (GNOME_APP(e_contact_editor->app))); - - if (!contents) { - g_message ("contact_editor_construct(): Could not get contents"); - return; - } - g_object_ref (contents); - gtk_container_remove (GTK_CONTAINER (contents->parent), contents); - bonobo_window_set_contents (BONOBO_WINDOW (bonobo_win), contents); - gtk_widget_destroy (e_contact_editor->app); - e_contact_editor->app = bonobo_win; - } - - /* Build the menu and toolbar */ - container = bonobo_window_get_ui_container (BONOBO_WINDOW (e_contact_editor->app)); - - e_contact_editor->uic = bonobo_ui_component_new_default (); - if (!e_contact_editor->uic) { - g_message ("e_contact_editor_init(): eeeeek, could not create the UI handler!"); - return; - } - bonobo_ui_component_set_container (e_contact_editor->uic, - bonobo_object_corba_objref (BONOBO_OBJECT (container)), - NULL); - - create_ui (e_contact_editor); -#endif - widget = glade_xml_get_widget(e_contact_editor->gui, "entry-fullname"); if (widget) gtk_widget_grab_focus (widget); @@ -1995,21 +1720,6 @@ command_state_changed (EContactEditor *ce) widget = glade_xml_get_widget (ce->gui, "button-ok"); gtk_widget_set_sensitive (widget, allow_save); - -#if 0 - bonobo_ui_component_set_prop (ce->uic, - "/commands/ContactEditorSaveClose", - "sensitive", - (ce->target_editable && ce->changed) ? "1" : "0", NULL); - bonobo_ui_component_set_prop (ce->uic, - "/commands/ContactEditorSave", - "sensitive", - (ce->target_editable && ce->changed) ? "1" : "0", NULL); - bonobo_ui_component_set_prop (ce->uic, - "/commands/ContactEditorDelete", - "sensitive", - (ce->source_editable && !ce->is_new_contact) ? "1" : "0", NULL); -#endif } static void -- cgit v1.2.3