aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-05-17 21:49:21 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-05-17 21:49:21 +0800
commitea1a5fca456b891f8bb9ab248ad65651b66b54b2 (patch)
tree9619f2f9631aac471da3f8b24dd30908335627c9 /mail
parentc20b1701e81473504f1d67f6e7387a6f1e5fb856 (diff)
parent99ebc23e0860ef5baf1f169803d751db70e2aa32 (diff)
downloadgsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.tar.gz
gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.tar.zst
gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.zip
Merge branch 'gnome-2-30' into express2
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-reader.c6
-rw-r--r--mail/e-mail-reader.h3
-rw-r--r--mail/em-folder-tree.c26
-rw-r--r--mail/em-folder-utils.c6
4 files changed, 37 insertions, 4 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index b5bcd15b37..6b1fa7df09 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -2300,7 +2300,7 @@ mail_reader_update_actions (EMailReader *reader)
action_name = "mail-mark-junk";
sensitive = selection_has_not_junk_messages;
action = e_mail_reader_get_action (reader, action_name);
- gtk_action_set_sensitive (action, sensitive);
+ gtk_action_set_sensitive (action, sensitive && !(state & E_MAIL_READER_FOLDER_IS_JUNK));
action_name = "mail-mark-not-junk";
sensitive = selection_has_junk_messages;
@@ -2718,6 +2718,7 @@ e_mail_reader_check_state (EMailReader *reader)
gboolean drafts_or_outbox;
gboolean store_supports_vjunk = FALSE;
gboolean is_mailing_list;
+ gboolean is_junk_folder = FALSE;
guint32 state = 0;
guint ii;
@@ -2730,6 +2731,7 @@ e_mail_reader_check_state (EMailReader *reader)
if (folder != NULL) {
store = CAMEL_STORE (folder->parent_store);
store_supports_vjunk = (store->flags & CAMEL_STORE_VJUNK);
+ is_junk_folder = (folder->folder_flags & CAMEL_FOLDER_IS_JUNK) != 0;
}
drafts_or_outbox =
@@ -2845,6 +2847,8 @@ e_mail_reader_check_state (EMailReader *reader)
state |= E_MAIL_READER_SELECTION_HAS_UNREAD;
if (is_mailing_list)
state |= E_MAIL_READER_SELECTION_IS_MAILING_LIST;
+ if (is_junk_folder)
+ state |= E_MAIL_READER_FOLDER_IS_JUNK;
em_utils_uids_free (uids);
diff --git a/mail/e-mail-reader.h b/mail/e-mail-reader.h
index a79d7f5274..b724d6e19b 100644
--- a/mail/e-mail-reader.h
+++ b/mail/e-mail-reader.h
@@ -75,7 +75,8 @@ enum {
E_MAIL_READER_SELECTION_HAS_UNDELETED = 1 << 12,
E_MAIL_READER_SELECTION_HAS_UNIMPORTANT = 1 << 13,
E_MAIL_READER_SELECTION_HAS_UNREAD = 1 << 14,
- E_MAIL_READER_SELECTION_IS_MAILING_LIST = 1 << 15
+ E_MAIL_READER_SELECTION_IS_MAILING_LIST = 1 << 15,
+ E_MAIL_READER_FOLDER_IS_JUNK = 1 << 16
};
struct _EMailReaderIface {
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index b1f204df4b..fdd1b88ee0 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -1786,11 +1786,14 @@ folder_tree_drop_target(EMFolderTree *folder_tree, GdkDragContext *context, GtkT
GtkTreePath *src_path = gtk_tree_row_reference_get_path(p->drag_row);
if (src_path) {
+ guint32 src_flags = 0;
+
if (gtk_tree_model_get_iter (model, &iter, src_path))
gtk_tree_model_get (
model, &iter,
COL_POINTER_CAMEL_STORE, &sstore,
- COL_STRING_URI, &src_uri, -1);
+ COL_STRING_URI, &src_uri,
+ COL_UINT_FLAGS, &src_flags, -1);
/* can't dnd onto itself or below itself - bad things happen,
no point dragging to where we were either */
@@ -1803,6 +1806,26 @@ folder_tree_drop_target(EMFolderTree *folder_tree, GdkDragContext *context, GtkT
}
gtk_tree_path_free(src_path);
+
+ if ((src_flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_INBOX || (src_flags & CAMEL_FOLDER_SYSTEM) != 0) {
+ /* allow only copy of the Inbox and other system folders */
+ GdkAtom xfolder;
+
+ /* TODO: not sure if this is legal, but it works, force copy for special local folders */
+ context->suggested_action = GDK_ACTION_COPY;
+ context->actions = GDK_ACTION_COPY;
+ xfolder = drop_atoms[DND_DROP_TYPE_FOLDER];
+ while (targets != NULL) {
+ if (targets->data == (gpointer) xfolder) {
+ atom = xfolder;
+ goto done;
+ }
+
+ targets = targets->next;
+ }
+
+ goto done;
+ }
}
}
@@ -1824,6 +1847,7 @@ folder_tree_drop_target(EMFolderTree *folder_tree, GdkDragContext *context, GtkT
/* TODO: not sure if this is legal, but it works, force copy for special local folders */
context->suggested_action = GDK_ACTION_COPY;
+ context->actions = GDK_ACTION_COPY;
xfolder = drop_atoms[DND_DROP_TYPE_FOLDER];
while (targets != NULL) {
if (targets->data == (gpointer) xfolder) {
diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c
index 98168866ae..aee37d7d16 100644
--- a/mail/em-folder-utils.c
+++ b/mail/em-folder-utils.c
@@ -672,7 +672,11 @@ em_folder_utils_create_folder (CamelFolderInfo *folderinfo, EMFolderTree *emft,
if (folderinfo != NULL)
em_folder_selector_set_selected ((EMFolderSelector *) dialog, folderinfo->uri);
g_signal_connect (dialog, "response", G_CALLBACK (emfu_popup_new_folder_response), emft);
- gtk_widget_show (dialog);
+
+ if (!parent || !GTK_IS_DIALOG (parent))
+ gtk_widget_show (dialog);
+ else
+ gtk_dialog_run (GTK_DIALOG (dialog));
}
struct _folder_unsub_t {