aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2004-04-17 07:57:01 +0800
committerHans Petter <hansp@src.gnome.org>2004-04-17 07:57:01 +0800
commit1e5ff7ff0271d5953d833ebc3ce9c41cdf3eb3a5 (patch)
tree7d7b3c276b4916ea706c8cac629a0cf7e189f9d3
parentdf20fdbeaa7781faea1e4608a9ad06625ec3c709 (diff)
downloadgsoc2013-evolution-1e5ff7ff0271d5953d833ebc3ce9c41cdf3eb3a5.tar.gz
gsoc2013-evolution-1e5ff7ff0271d5953d833ebc3ce9c41cdf3eb3a5.tar.zst
gsoc2013-evolution-1e5ff7ff0271d5953d833ebc3ce9c41cdf3eb3a5.zip
Add "wants HTML" checkbox.
2004-04-16 Hans Petter Jansson <hpj@ximian.com> * 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
-rw-r--r--addressbook/ChangeLog25
-rw-r--r--addressbook/gui/contact-editor/contact-editor.glade23
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c290
3 files changed, 47 insertions, 291 deletions
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 <hpj@ximian.com>
+
+ * 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 <toshok@ximian.com>
* 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 @@
<widget class="GtkTable" id="table85">
<property name="border_width">12</property>
<property name="visible">True</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">4</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
@@ -603,6 +603,27 @@
<property name="y_options"></property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkCheckButton" id="checkbutton-htmlmail">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Wants to receive HTML mail</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">4</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
</widget>
</child>
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 <libgnome/gnome-util.h>
#include <libgnome/gnome-i18n.h>
-#if 0
-#include <bonobo/bonobo-ui-container.h>
-#include <bonobo/bonobo-ui-util.h>
-#include <bonobo/bonobo-window.h>
-#endif
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gal/widgets/e-categories.h>
#include <gal/widgets/e-gui-utils.h>
@@ -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);
@@ -847,16 +822,6 @@ phone_entry_changed (GtkWidget *widget, EContactEditor *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)
{
editor->load_source_id = 0;
@@ -1142,15 +1107,6 @@ set_entry_changed_signal_phone(EContactEditor *editor, char *id)
}
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)
{
if (!editor->target_editable) {
@@ -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