#include "modest-tny-msg.h"
#include "modest-tny-mime-part.h"
#include "modest-text-utils.h"
-#include <modest-address-book.h>
+#include "modest-address-book.h"
#include <widgets/modest-attachments-view.h>
#include <modest-runtime.h>
#include <tny-simple-list.h>
TnyHeader *header;
TnyHeaderFlags flags;
gboolean dimmed = FALSE;
-
+
g_return_val_if_fail (MODEST_IS_MSG_VIEW_WINDOW(win), FALSE);
g_return_val_if_fail (MODEST_IS_DIMMING_RULE (user_data), FALSE);
rule = MODEST_DIMMING_RULE (user_data);
-
+
header = modest_msg_view_window_get_header (MODEST_MSG_VIEW_WINDOW (win));
if (!header) {
dimmed = TRUE;
}
+ /* If the viewer is showing a message sent as attachment */
+ if (!dimmed)
+ dimmed = !modest_msg_view_window_has_headers_model (MODEST_MSG_VIEW_WINDOW (win));
+
if (!dimmed) {
flags = tny_header_get_flags (header);
if (flags & TNY_HEADER_FLAG_SEEN)
dimmed = TRUE;
}
+ /* If the viewer is showing a message sent as attachment */
+ if (!dimmed)
+ dimmed = !modest_msg_view_window_has_headers_model (MODEST_MSG_VIEW_WINDOW (win));
+
if (!dimmed) {
flags = tny_header_get_flags (header);
if (!(flags & TNY_HEADER_FLAG_SEEN))
{
ModestDimmingRule *rule = NULL;
gboolean dimmed = FALSE;
-
+
g_return_val_if_fail (MODEST_IS_DIMMING_RULE (user_data), FALSE);
rule = MODEST_DIMMING_RULE (user_data);
/* Check dimmed rule */
GSList *account_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr (), TRUE);
- if (g_slist_length (account_names) <= 1)
+ if (g_slist_length (account_names) < 1)
dimmed = TRUE;
if (dimmed)
modest_dimming_rule_set_notification (rule, _("mcen_nc_no_email_acnts_defined"));
TnyIterator *iter;
iter = tny_list_create_iterator (attachments);
while (!tny_iterator_is_done (iter) && !result) {
+#ifdef MODEST_TOOLKIT_HILDON2
+ gboolean not_selectable = FALSE;
+#endif
TnyMimePart *mime_part = TNY_MIME_PART (tny_iterator_get_current (iter));
TnyList *nested_list = tny_simple_list_new ();
+ tny_mime_part_get_parts (mime_part, nested_list);
if (!for_remove && modest_tny_mime_part_is_msg (mime_part)) {
TnyMsg *window_msg;
window_msg = modest_msg_view_window_get_message (MODEST_MSG_VIEW_WINDOW (win));
if ((TnyMimePart *) window_msg != mime_part) {
selected_messages = TRUE;
+#ifdef MODEST_TOOLKIT_HILDON2
+ not_selectable = TRUE;
+#else
result = TRUE;
+#endif
}
g_object_unref (window_msg);
}
- tny_mime_part_get_parts (mime_part, nested_list);
if (!for_remove && tny_list_get_length (nested_list) > 0) {
nested_attachments = TRUE;
+#ifdef MODEST_TOOLKIT_HILDON2
+ not_selectable = TRUE;
+#else
result = TRUE;
+#endif
}
+#ifdef MODEST_TOOLKIT_HILDON2
+ if (not_selectable)
+ n_selected --;
+#endif
g_object_unref (nested_list);
g_object_unref (mime_part);
tny_iterator_next (iter);
}
g_object_unref (iter);
}
+
+ /* No valid attachment available */
+ if (n_selected == 0)
+ result = TRUE;
/* Set notifications */
if (result && rule != NULL) {
cache_mgr = modest_runtime_get_cache_mgr ();
send_queue_cache = modest_cache_mgr_get_cache (cache_mgr,
MODEST_CACHE_MGR_CACHE_TYPE_SEND_QUEUE);
-
+
g_hash_table_foreach (send_queue_cache, (GHFunc) fill_list_of_caches, &send_queues);
-
+
for (node = send_queues; node != NULL && !found; node = g_slist_next (node)) {
send_queue = MODEST_TNY_SEND_QUEUE (node->data);
-
+
/* Check if msg uid is being processed inside send queue */
if (modest_tny_send_queue_sending_in_progress (send_queue)) {
found = TRUE;