From: helge Date: Wed, 20 Jul 2005 09:26:45 +0000 (+0000) Subject: show delete button if trashing is disallowed X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69d1c55a1a199b13e3a4305943f0e5a90c925fc1;p=scalable-opengroupware.org show delete button if trashing is disallowed git-svn-id: http://svn.opengroupware.org/SOGo/trunk@835 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/UI/MailerUI/ChangeLog b/SOGo/UI/MailerUI/ChangeLog index 08c2a89d..08719091 100644 --- a/SOGo/UI/MailerUI/ChangeLog +++ b/SOGo/UI/MailerUI/ChangeLog @@ -1,5 +1,8 @@ 2005-07-20 Helge Hess + * UIxMailView.m: show delete button if delete is allowed but trashing + isn't (#1444) (v0.9.157) + * v0.9.156 * product.plist: moved more complex toolbar configs to own resource diff --git a/SOGo/UI/MailerUI/Toolbars/SOGoMailObject.toolbar b/SOGo/UI/MailerUI/Toolbars/SOGoMailObject.toolbar index c700c41a..822c0c21 100644 --- a/SOGo/UI/MailerUI/Toolbars/SOGoMailObject.toolbar +++ b/SOGo/UI/MailerUI/Toolbars/SOGoMailObject.toolbar @@ -1,42 +1,50 @@ ( /* 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 diff --git a/SOGo/UI/MailerUI/UIxMailView.m b/SOGo/UI/MailerUI/UIxMailView.m index 59b40bfe..01475783 100644 --- a/SOGo/UI/MailerUI/UIxMailView.m +++ b/SOGo/UI/MailerUI/UIxMailView.m @@ -33,6 +33,8 @@ #include // cyclic #include "WOContext+UIxMailer.h" #include +#include +#include #include #include #include "common.h" @@ -74,19 +76,30 @@ /* 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!) */ diff --git a/SOGo/UI/MailerUI/Version b/SOGo/UI/MailerUI/Version index 92d97d05..5bc038bb 100644 --- a/SOGo/UI/MailerUI/Version +++ b/SOGo/UI/MailerUI/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=156 +SUBMINOR_VERSION:=157 # v0.9.140 requires SoObjects/Mailer v0.9.100 # v0.9.134 requires libSOGo v0.9.41