( /* the toolbar groups */
- ( /* first group */
- { link = "getMail";
- cssClass = "tbicon_getmail"; label = "Get Mail"; },
- {
- link = "#"; // "compose"; // target = "_blank";
- isSafe = NO;
- onclick = "clickedCompose(this);return false;";
- cssClass = "tbicon_compose"; label = "Write";
- },
- ),
- ( // second group
- { link = "reply";
- isSafe = NO;
- cssClass = "tbicon_reply"; label = "Reply"; },
- { link = "replyall";
- isSafe = NO;
- cssClass = "tbicon_replyall"; label = "Reply All"; },
- { link = "forward";
- isSafe = NO;
- cssClass = "tbicon_forward"; label = "Forward"; },
- ),
- ( // third group
- { link = "delete"; isSafe = NO;
- enabled = showMarkDeletedButton;
- cssClass = "tbicon_delete"; label = "Delete"; },
- { link = "trash"; isSafe = NO;
- enabled = showTrashButton;
- cssClass = "tbicon_delete"; label = "Delete"; },
-/* TODO: enable when we know how to mark junk (#971)
+
+ ( /* first group */
+ { link = "getMail";
+ cssClass = "tbicon_getmail"; label = "Get Mail"; },
+
+ { link = "#"; // "compose"; // target = "_blank";
+ isSafe = NO;
+ onclick = "clickedCompose(this);return false;";
+ cssClass = "tbicon_compose"; label = "Write"; },
+ ),
+
+ ( // second group
+ { link = "reply";
+ isSafe = NO;
+ cssClass = "tbicon_reply"; label = "Reply"; },
+
+ { link = "replyall";
+ isSafe = NO;
+ cssClass = "tbicon_replyall"; label = "Reply All"; },
+
+ { link = "forward";
+ isSafe = NO;
+ cssClass = "tbicon_forward"; label = "Forward"; },
+ ),
+
+ ( // third group
+ { link = "delete"; isSafe = NO;
+ enabled = showMarkDeletedButton;
+ cssClass = "tbicon_delete"; label = "Delete"; },
+
+ { link = "trash"; isSafe = NO;
+ enabled = showTrashButton;
+ cssClass = "tbicon_delete"; label = "Delete"; },
+
+ /* TODO: enable when we know how to mark junk (#971)
+ => we could move the mail to the Junk folder?!
{ link = "#";
isSafe = NO;
cssClass = "tbicon_junk"; label = "Junk"; },
-*/
- ),
- ( /* fourth group */
-/* TODO: enable when we can print (#1207)
+ */
+ ),
+
+ ( /* fourth group */
+ /* TODO: enable when we can print (#1207)
{ link = "#"; cssClass = "tbicon_print"; label = "Print"; },
-*/
- { link = "#"; cssClass = "tbicon_stop"; label = "Stop"; },
- ),
+ */
+ { link = "#"; cssClass = "tbicon_stop"; label = "Stop"; },
+ ),
)
\ No newline at end of file
#include <UI/MailPartViewers/UIxMailRenderingContext.h> // cyclic
#include "WOContext+UIxMailer.h"
#include <SoObjects/Mailer/SOGoMailObject.h>
+#include <SoObjects/Mailer/SOGoMailAccount.h>
+#include <SoObjects/Mailer/SOGoMailFolder.h>
#include <NGImap4/NGImap4Envelope.h>
#include <NGImap4/NGImap4EnvelopeAddress.h>
#include "common.h"
/* expunge / delete setup and permissions */
+- (BOOL)isTrashingAllowed {
+ id trash;
+
+ trash = [[[self clientObject] mailAccountFolder]
+ trashFolderInContext:[self context]];
+ if ([trash isKindOfClass:[NSException class]])
+ return NO;
+
+ return [trash isWriteAllowed];
+}
+
- (BOOL)showMarkDeletedButton {
+ // TODO: we might also want to add a default to always show delete
if (![[self clientObject] isDeletionAllowed])
return NO;
- return NO; // TODO: make configurable in profile
+ return [self isTrashingAllowed] ? NO : YES;
}
- (BOOL)showTrashButton {
if (![[self clientObject] isDeletionAllowed])
return NO;
- // TODO: should also check for Trash write access (or add -isTrashingAllowed)
- return YES; // TODO: make configurable in profile
+ return [self isTrashingAllowed];
}
/* links (DUP to UIxMailPartViewer!) */