]> err.no Git - scalable-opengroupware.org/commitdiff
show delete button if trashing is disallowed
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 20 Jul 2005 09:26:45 +0000 (09:26 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 20 Jul 2005 09:26:45 +0000 (09:26 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@835 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/UI/MailerUI/ChangeLog
SOGo/UI/MailerUI/Toolbars/SOGoMailObject.toolbar
SOGo/UI/MailerUI/UIxMailView.m
SOGo/UI/MailerUI/Version

index 08c2a89dde72fc1b75ac6a3c1f71d2faa8eec89a..08719091e96e72a3f94efed239d55512febaee49 100644 (file)
@@ -1,5 +1,8 @@
 2005-07-20  Helge Hess  <helge.hess@opengroupware.org>
 
+       * 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
index c700c41afa27d4bf571bbd59557f107f82bbf2ee..822c0c218e722b6cc5081a868149d450a32739db 100644 (file)
@@ -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
index 59b40bfe3ed93280efa6544b24150b26b34342cc..01475783dcf3aa2b613ae4a6c67585f967aa9d9a 100644 (file)
@@ -33,6 +33,8 @@
 #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!) */
index 92d97d05935fd21f17a4a14da2a2b3320fc8deae..5bc038bbf14a934a864c649288a14bfb981b39a7 100644 (file)
@@ -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