aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog20
-rw-r--r--mail/em-folder-browser.c10
-rw-r--r--mail/em-folder-view.c13
-rw-r--r--mail/em-format-html-display.c6
-rw-r--r--mail/em-format-html-display.h2
-rw-r--r--mail/em-popup.c16
-rw-r--r--mail/em-popup.h4
-rw-r--r--mail/em-utils.c39
8 files changed, 102 insertions, 8 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index f77edd206e..8991e840a5 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,23 @@
+2005-10-18 Srinivasa Ragavan <sragavan@novell.com>
+
+ * em-folder-browser.c (emfb_focus_search) (emfb_tools_vfolders): Make '/' to
+ focus on search bar entry. Fixes bug #268027
+
+ * em-folder-view.c (emfv_enable_menus): Set the target widget.
+
+ * em-format-html-display.[ch] (em_format_html_display_get_bar): Added a
+ function to get the attachment bar.
+
+ * em-utils.c (em_utils_temp_save_attachments): Added function to save
+ parts of the attachments.
+
+2005-10-03 Srinivasa Ragavan <sragavan@novell.com>
+
+ * em-folder-view.c (emfv_ena) (emfv_popup_items): Mark visible with
+ junk flags as well.
+ * em-popup.[ch] (em_popup_target_new_select): Set the flags
+ for junk respectively.
+
2005-10-18 Sankar P <psankar@novell.com>
- Enhances Signature-Preferences.
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index a161f4d37e..a8f90bebcb 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -765,6 +765,14 @@ emfb_tools_subscriptions(BonoboUIComponent *uid, void *data, const char *path)
}
static void
+emfb_focus_search(BonoboUIComponent *uid, void *data, const char *path)
+{
+ EMFolderBrowser *emfb = data;
+
+ gtk_widget_grab_focus (((ESearchBar *)emfb->search)->entry);
+}
+
+static void
emfb_tools_vfolders(BonoboUIComponent *uid, void *data, const char *path)
{
/* FIXME: rename/refactor this */
@@ -799,6 +807,8 @@ static BonoboUIVerb emfb_verbs[] = {
BONOBO_UI_UNSAFE_VERB ("ToolsFilters", emfb_tools_filters),
BONOBO_UI_UNSAFE_VERB ("ToolsSubscriptions", emfb_tools_subscriptions),
BONOBO_UI_UNSAFE_VERB ("ToolsVFolders", emfb_tools_vfolders),
+ BONOBO_UI_UNSAFE_VERB ("FocusSearch", emfb_focus_search),
+
/* ViewPreview is a toggle */
BONOBO_UI_VERB_END
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index 27e4e9452d..5c9dfdf830 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -1056,8 +1056,8 @@ static EPopupItem emfv_popup_items[] = {
{ E_POPUP_ITEM, "50.emfv.01", N_("Mark as _Unread"), emfv_popup_mark_unread, NULL, "stock_mail-unread", EM_POPUP_SELECT_MARK_UNREAD|EM_FOLDER_VIEW_SELECT_LISTONLY },
{ E_POPUP_ITEM, "50.emfv.02", N_("Mark as _Important"), emfv_popup_mark_important, NULL, "stock_mail-priority-high", EM_POPUP_SELECT_MARK_IMPORTANT|EM_FOLDER_VIEW_SELECT_LISTONLY },
{ E_POPUP_ITEM, "50.emfv.03", N_("_Mark as Unimportant"), emfv_popup_mark_unimportant, NULL, NULL, EM_POPUP_SELECT_MARK_UNIMPORTANT|EM_FOLDER_VIEW_SELECT_LISTONLY },
- { E_POPUP_ITEM, "50.emfv.04", N_("Mark as _Junk"), emfv_popup_mark_junk, NULL, "stock_spam", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY },
- { E_POPUP_ITEM, "50.emfv.05", N_("Mark as _Not Junk"), emfv_popup_mark_nojunk, NULL, "stock_not-spam", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY },
+ { E_POPUP_ITEM, "50.emfv.04", N_("Mark as _Junk"), emfv_popup_mark_junk, NULL, "stock_spam", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY|EM_POPUP_SELECT_JUNK },
+ { E_POPUP_ITEM, "50.emfv.05", N_("Mark as _Not Junk"), emfv_popup_mark_nojunk, NULL, "stock_not-spam", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY|EM_POPUP_SELECT_NOT_JUNK },
{ E_POPUP_ITEM, "50.emfv.06", N_("Mark for Follo_w Up..."), emfv_popup_flag_followup, NULL, "stock_mail-flag-for-followup", EM_POPUP_SELECT_FLAG_FOLLOWUP|EM_FOLDER_VIEW_SELECT_LISTONLY },
{ E_POPUP_SUBMENU, "60.label.00", N_("Label"), NULL, NULL, NULL, EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY },
@@ -1770,8 +1770,8 @@ static const EMFolderViewEnable emfv_enable_map[] = {
{ "MessageMarkAsUnRead", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_UNREAD },
{ "MessageMarkAsImportant", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_IMPORTANT },
{ "MessageMarkAsUnimportant", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_UNIMPORTANT },
- { "MessageMarkAsJunk", EM_POPUP_SELECT_MANY },
- { "MessageMarkAsNotJunk", EM_POPUP_SELECT_MANY },
+ { "MessageMarkAsJunk", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_JUNK },
+ { "MessageMarkAsNotJunk", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_NOT_JUNK },
{ "MessageFollowUpFlag", EM_POPUP_SELECT_MANY },
{ "MessageMove", EM_POPUP_SELECT_MANY },
{ "MessageOpen", EM_POPUP_SELECT_MANY },
@@ -1790,11 +1790,11 @@ static const EMFolderViewEnable emfv_enable_map[] = {
{ "TextZoomOut", EM_POPUP_SELECT_ONE },
{ "TextZoomReset", EM_POPUP_SELECT_ONE },
- { "ToolsFilterMailingList", EM_POPUP_SELECT_ONE },
+ { "ToolsFilterMailingList", EM_POPUP_SELECT_ONE|EM_POPUP_SELECT_MAILING_LIST},
{ "ToolsFilterRecipient", EM_POPUP_SELECT_ONE },
{ "ToolsFilterSender", EM_POPUP_SELECT_ONE },
{ "ToolsFilterSubject", EM_POPUP_SELECT_ONE },
- { "ToolsVFolderMailingList", EM_POPUP_SELECT_ONE },
+ { "ToolsVFolderMailingList", EM_POPUP_SELECT_ONE|EM_POPUP_SELECT_MAILING_LIST},
{ "ToolsVFolderRecipient", EM_POPUP_SELECT_ONE },
{ "ToolsVFolderSender", EM_POPUP_SELECT_ONE },
{ "ToolsVFolderSubject", EM_POPUP_SELECT_ONE },
@@ -1830,6 +1830,7 @@ emfv_enable_menus(EMFolderView *emfv)
EMMenuTargetSelect *t;
t = em_menu_target_new_select(emfv->menu, emfv->folder, emfv->folder_uri, message_list_get_selected(emfv->list));
+ t->target.widget = emfv;
e_menu_update_target((EMenu *)emfv->menu, t);
}
}
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index d6719d361a..ec26935242 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -419,6 +419,12 @@ void em_format_html_display_set_caret_mode(EMFormatHTMLDisplay *efhd, gboolean s
gtk_html_set_caret_mode(((EMFormatHTML *)efhd)->html, state);
}
+EAttachmentBar *
+em_format_html_display_get_bar (EMFormatHTMLDisplay *efhd)
+{
+ return efhd->priv->attachment_bar;
+}
+
void
em_format_html_display_set_search(EMFormatHTMLDisplay *efhd, int type, GSList *strings)
{
diff --git a/mail/em-format-html-display.h b/mail/em-format-html-display.h
index df5ebff9d4..ffb1786687 100644
--- a/mail/em-format-html-display.h
+++ b/mail/em-format-html-display.h
@@ -7,6 +7,7 @@
#define _EM_FORMAT_HTML_DISPLAY_H
#include "mail/em-format-html.h"
+#include "e-attachment-bar.h"
typedef struct _EMFormatHTMLDisplay EMFormatHTMLDisplay;
typedef struct _EMFormatHTMLDisplayClass EMFormatHTMLDisplayClass;
@@ -58,6 +59,7 @@ void em_format_html_display_paste (EMFormatHTMLDisplay *efhd);
void em_format_html_display_zoom_in (EMFormatHTMLDisplay *efhd);
void em_format_html_display_zoom_out (EMFormatHTMLDisplay *efhd);
void em_format_html_display_zoom_reset (EMFormatHTMLDisplay *efhd);
+EAttachmentBar * em_format_html_display_get_bar (EMFormatHTMLDisplay *efhd);
gboolean em_format_html_display_popup_menu (EMFormatHTMLDisplay *efhd);
diff --git a/mail/em-popup.c b/mail/em-popup.c
index 965365957e..a31ca6866d 100644
--- a/mail/em-popup.c
+++ b/mail/em-popup.c
@@ -175,6 +175,7 @@ EMPopupTargetSelect *
em_popup_target_new_select(EMPopup *emp, struct _CamelFolder *folder, const char *folder_uri, GPtrArray *uids)
{
EMPopupTargetSelect *t = e_popup_target_new(&emp->popup, EM_POPUP_TARGET_SELECT, sizeof(*t));
+ CamelStore *store = CAMEL_STORE (folder->parent_store);
guint32 mask = ~0;
int i;
const char *tmp;
@@ -218,7 +219,18 @@ em_popup_target_new_select(EMPopup *emp, struct _CamelFolder *folder, const char
mask &= ~EM_POPUP_SELECT_MARK_UNREAD;
else
mask &= ~EM_POPUP_SELECT_MARK_READ;
-
+
+ if (store->flags & CAMEL_STORE_VJUNK) {
+ if ((flags & CAMEL_MESSAGE_JUNK))
+ mask &= ~EM_POPUP_SELECT_NOT_JUNK;
+ else
+ mask &= ~EM_POPUP_SELECT_JUNK;
+ } else {
+ /* Show both options */
+ mask &= ~EM_POPUP_SELECT_NOT_JUNK;
+ mask &= ~EM_POPUP_SELECT_JUNK;
+ }
+
if (flags & CAMEL_MESSAGE_DELETED)
mask &= ~EM_POPUP_SELECT_UNDELETE;
else
@@ -830,6 +842,8 @@ static const EPopupHookTargetMask emph_select_masks[] = {
{ "flag_clear", EM_POPUP_SELECT_FLAG_CLEAR },
{ "add_sender", EM_POPUP_SELECT_ADD_SENDER },
{ "folder", EM_POPUP_SELECT_FOLDER },
+ { "junk", EM_POPUP_SELECT_JUNK },
+ { "not_junk", EM_POPUP_SELECT_NOT_JUNK },
{ 0 }
};
diff --git a/mail/em-popup.h b/mail/em-popup.h
index 6ae0623099..42752bc3ec 100644
--- a/mail/em-popup.h
+++ b/mail/em-popup.h
@@ -103,7 +103,9 @@ enum _em_popup_target_select_t {
EM_POPUP_SELECT_FLAG_CLEAR = 1<<13,
EM_POPUP_SELECT_ADD_SENDER = 1<<14,
EM_POPUP_SELECT_FOLDER = 1<<15, /* do we have any folder at all? */
- EM_POPUP_SELECT_LAST = 1<<17, /* reserve 2 slots */
+ EM_POPUP_SELECT_JUNK = 1<<16,
+ EM_POPUP_SELECT_NOT_JUNK = 1<<17,
+ EM_POPUP_SELECT_LAST = 1<<18,
};
/**
diff --git a/mail/em-utils.c b/mail/em-utils.c
index f43f63f689..434b0205d9 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -64,6 +64,7 @@
#include "em-composer-utils.h"
#include "em-format-quote.h"
#include "em-account-editor.h"
+#include "e-attachment.h"
static void emu_save_part_done (CamelMimePart *part, char *name, int done, void *data);
@@ -117,6 +118,44 @@ em_utils_prompt_user(GtkWindow *parent, const char *promptkey, const char *tag,
return button == GTK_RESPONSE_YES;
}
+
+char *
+em_utils_temp_save_attachments (GSList *attachments)
+{
+ char *path = NULL;
+ GSList *selected;
+
+ path = e_mkdtemp("evolution-attachments-XXXXXX");
+
+ for ( selected = attachments; selected != NULL; selected = selected->next) {
+ const char *file_name;
+ char *safe_name = NULL;
+ char *file_path;
+ CamelMimePart *part = (CamelMimePart *)((EAttachment *)selected->data)->body;
+
+ file_name = camel_mime_part_get_filename(part);
+ if (file_name == NULL) {
+ file_name = _("attachment");
+ } else {
+ safe_name = g_strdup(file_name);
+ e_filename_make_safe(safe_name);
+ file_name = safe_name;
+ }
+
+ file_path = g_build_filename (path, file_name, NULL);
+
+ if (!g_file_test(file_path, (G_FILE_TEST_EXISTS)))
+ mail_save_part(part, file_path, NULL, NULL);
+ else
+ g_warning ("Could not save %s. File already exists", file_path);
+
+ g_free (file_path);
+ g_free (safe_name);
+ }
+
+ return path;
+}
+
/**
* em_utils_uids_copy:
* @uids: array of uids