diff options
author | 1 <NotZed@Ximian.com> | 2001-10-12 06:09:43 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2001-10-12 06:09:43 +0800 |
commit | f35bfdac73e1e48378dfb7afa7928a100a51e707 (patch) | |
tree | 8ed041f4a810cdde54f888148807425243e8183d | |
parent | a5fa3f992dd32fdf99bfcf550a8ce62df2b74d13 (diff) | |
download | gsoc2013-evolution-f35bfdac73e1e48378dfb7afa7928a100a51e707.tar.gz gsoc2013-evolution-f35bfdac73e1e48378dfb7afa7928a100a51e707.tar.zst gsoc2013-evolution-f35bfdac73e1e48378dfb7afa7928a100a51e707.zip |
Added a checkbox for body indexing.
2001-10-11 <NotZed@Ximian.com>
* local-config.glade: Added a checkbox for body indexing.
* mail-local.c (mail_local_reconfigure_folder): Get index_body
widget.
(mail_local_folder_reconfigure): Add an 'index_body' argument &
implement. Dont do anything if nothing changed.
* openpgp-utils.c (openpgp_verify): Use e_iconv_open.
svn path=/trunk/; revision=13603
-rw-r--r-- | mail/ChangeLog | 11 | ||||
-rw-r--r-- | mail/local-config.glade | 51 | ||||
-rw-r--r-- | mail/mail-format.c | 3 | ||||
-rw-r--r-- | mail/mail-local.c | 24 |
4 files changed, 85 insertions, 4 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 99858f0531..cc564dc7f9 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,14 @@ +2001-10-11 <NotZed@Ximian.com> + + * local-config.glade: Added a checkbox for body indexing. + + * mail-local.c (mail_local_reconfigure_folder): Get index_body + widget. + (mail_local_folder_reconfigure): Add an 'index_body' argument & + implement. Dont do anything if nothing changed. + + * openpgp-utils.c (openpgp_verify): Use e_iconv_open. + 2001-10-11 Jeffrey Stedfast <fejj@ximian.com> * mail-callbacks.c (do_forward_non_attached): Attach the message diff --git a/mail/local-config.glade b/mail/local-config.glade index 7a2dbc2862..291c25c1cc 100644 --- a/mail/local-config.glade +++ b/mail/local-config.glade @@ -86,7 +86,7 @@ <class>GtkTable</class> <name>table1</name> <border_width>2</border_width> - <rows>2</rows> + <rows>3</rows> <columns>2</columns> <homogeneous>False</homogeneous> <row_spacing>0</row_spacing> @@ -194,6 +194,55 @@ mh <yfill>False</yfill> </child> </widget> + + <widget> + <class>GtkLabel</class> + <name>label5</name> + <label>Indexing:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>1</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkCheckButton</class> + <name>check_index_body</name> + <can_focus>True</can_focus> + <label>Body contents</label> + <active>False</active> + <draw_indicator>True</draw_indicator> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> </widget> </widget> diff --git a/mail/mail-format.c b/mail/mail-format.c index c86a603253..0e92ddebd1 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -35,6 +35,7 @@ #include <libgnomevfs/gnome-vfs-mime-info.h> #include <libgnomevfs/gnome-vfs-mime-handlers.h> #include <gal/widgets/e-unicode.h> +#include <gal/util/e-iconv.h> #include <camel/camel-mime-utils.h> #include <camel/camel-pgp-mime.h> @@ -995,7 +996,7 @@ write_headers (CamelMimeMessage *message, MailDisplay *md) ct = camel_mime_part_get_content_type(CAMEL_MIME_PART(message)); charset = header_content_type_param(ct, "charset"); - charset = camel_charset_to_iconv(charset); + charset = e_iconv_charset_name(charset); header = CAMEL_MIME_PART(message)->headers; while (header) { diff --git a/mail/mail-local.c b/mail/mail-local.c index 85bedf43cc..7661d74c24 100644 --- a/mail/mail-local.c +++ b/mail/mail-local.c @@ -569,7 +569,7 @@ mail_local_folder_construct(MailLocalFolder *mlf, MailLocalStore *parent_store, } static gboolean -mail_local_folder_reconfigure (MailLocalFolder *mlf, const char *new_format, CamelException *ex) +mail_local_folder_reconfigure (MailLocalFolder *mlf, const char *new_format, int index_body, CamelException *ex) { CamelStore *fromstore = NULL; CamelFolder *fromfolder = NULL; @@ -578,6 +578,13 @@ mail_local_folder_reconfigure (MailLocalFolder *mlf, const char *new_format, Cam char *store_uri; GPtrArray *uids; int real_folder_frozen = FALSE; + int format_change, index_changed; + + format_change = strcmp(mlf->meta->format, new_format) != 0; + index_changed = mlf->meta->indexed != index_body; + + if (format_change == FALSE && index_changed == FALSE) + return TRUE; camel_operation_start(NULL, _("Reconfiguring folder")); @@ -593,6 +600,14 @@ mail_local_folder_reconfigure (MailLocalFolder *mlf, const char *new_format, Cam mlf_unset_folder(mlf); } + /* only indexed change, just re-open with new flags */ + if (!format_change) { + mlf->meta->indexed = index_body; + mlf_set_folder(mlf, CAMEL_STORE_FOLDER_CREATE, ex); + save_metainfo(mlf->meta); + goto cleanup; + } + store_uri = g_strdup_printf("%s:%s%s", mlf->meta->format, ((CamelService *)((CamelFolder *)mlf)->parent_store)->url->path, mlf->real_path); fromstore = camel_session_get_store(session, store_uri, ex); @@ -1101,9 +1116,11 @@ struct _reconfigure_msg { FolderBrowser *fb; char *newtype; + unsigned int index_body:1; GtkWidget *frame; GtkWidget *apply; GtkWidget *cancel; + GtkWidget *check_index_body; GtkOptionMenu *optionlist; CamelFolder *folder_out; }; @@ -1142,7 +1159,7 @@ reconfigure_folder_reconfigure (struct _mail_msg *mm) return; } - mail_local_folder_reconfigure (MAIL_LOCAL_FOLDER (local_folder), m->newtype, &mm->ex); + mail_local_folder_reconfigure (MAIL_LOCAL_FOLDER (local_folder), m->newtype, m->index_body, &mm->ex); m->folder_out = local_folder; } @@ -1200,6 +1217,7 @@ reconfigure_clicked (GnomeDialog *dialog, int button, struct _reconfigure_msg *m menu = gtk_option_menu_get_menu(m->optionlist); item = gtk_menu_get_active(GTK_MENU(menu)); m->newtype = g_strdup(gtk_object_get_data((GtkObject *)item, "type")); + m->index_body = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m->check_index_body)); gtk_widget_set_sensitive (m->frame, FALSE); gtk_widget_set_sensitive (m->apply, FALSE); @@ -1259,6 +1277,7 @@ mail_local_reconfigure_folder (FolderBrowser *fb) m->apply = glade_xml_get_widget (gui, "apply_format"); m->cancel = glade_xml_get_widget (gui, "cancel_format"); m->optionlist = (GtkOptionMenu *)glade_xml_get_widget (gui, "option_format"); + m->check_index_body = glade_xml_get_widget (gui, "check_index_body"); m->newtype = NULL; m->fb = fb; m->folder_out = NULL; @@ -1293,6 +1312,7 @@ mail_local_reconfigure_folder (FolderBrowser *fb) gtk_option_menu_remove_menu (GTK_OPTION_MENU(m->optionlist)); gtk_option_menu_set_menu (GTK_OPTION_MENU(m->optionlist), menu); gtk_option_menu_set_history(GTK_OPTION_MENU(m->optionlist), history); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m->check_index_body), MAIL_LOCAL_FOLDER (fb->folder)->meta->indexed); gtk_label_set_text ((GtkLabel *)glade_xml_get_widget (gui, "label_format"), MAIL_LOCAL_FOLDER (fb->folder)->meta->format); |