]> err.no Git - scalable-opengroupware.org/commitdiff
added localization of special folder names
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 7 Feb 2005 01:10:41 +0000 (01:10 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 7 Feb 2005 01:10:41 +0000 (01:10 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@522 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/UI/Mailer/ChangeLog
SOGo/UI/Mailer/English.lproj/default.strings
SOGo/UI/Mailer/UIxMailListView.wox
SOGo/UI/Mailer/UIxMailMainFrame.wox
SOGo/UI/Mailer/UIxMailTree.m
SOGo/UI/Mailer/UIxMailTree.wox
SOGo/UI/Mailer/Version
SOGo/UI/Mailer/product.plist

index be1020b7af5f57dc2eec6348ea796d911a5576b0..e6862df772d980562140cac1bdaab3d804c73cd2 100644 (file)
@@ -1,3 +1,22 @@
+2005-02-07  Helge Hess  <helge.hess@opengroupware.org>
+
+       * v0.9.89
+
+       * UIxMailTree.m: made special folder names localizable
+
+       * English.lproj/default.strings: added some folder translations
+
+2005-02-06  Helge Hess  <helge.hess@opengroupware.org>
+
+       * v0.9.88
+
+       * UIxMailTree.m: some code cleanups, does not use -fetchSubfolders of
+         SOGoObject anymore (to be useful for any object)
+
+       * UIxMailMainFrame.wox: made "Folders" title localizable
+
+       * UIxMailListView.wox: removed some superflous section
+
 2005-01-31  Helge Hess  <helge.hess@opengroupware.org>
 
        * UIxMailView.m: implemented 'expunge' action (delete button in the
index 49d96fda88617445745e300c0b94bbc08fb88cff..6137407a0b5b3bd1122cd77eed423958198a78bf 100644 (file)
 "msgnumber_to"  = "to";
 "msgnumber_of"  = "of";
 
+/* Tree */
+
+"SentFolderName"   = "Sent";
+"TrashFolderName"  = "Trash";
+"InboxFolderName"  = "Inbox";
+"DraftsFolderName" = "Drafts";
+"SieveFolderName"  = "Filters";
+"Folders"          = "Folders"; /* title line */
+
 /* MailMoveToPopUp */
 
 "MoveTo"        = "Move &hellip;";
index 6e4bbf129a37898c1f7a101105468a8ec060fc5c..134fe1726fc289e883861200c8a41c970ffeb6fd 100644 (file)
       </span>
     </div>
   </div>
-  <!--
-  <div>
-    <pre>
-    tnn: <var:string value="clientObject.treeNavigationNodes" />
-    </pre>
-  </div>
-  -->
 </var:component>
index 36265f3ec6e15fd4faa95c1503848b1500bea513..652848a276e7451884b4f06a87c0c38a654fbad0 100644 (file)
@@ -58,7 +58,8 @@
             <table width="100%">
               <tr>
                 <td width="25%" valign="top" class="foldercell">
-                  <div class="titlediv">Folders</div>
+                  <div class="titlediv"
+                       ><var:string label:value="Folders" /></div>
                   <div style="height: 95%">
                     <div class="embedwhite_out">
                       <div class="embedwhite_in">
index 5870cfb7dc326e81efe3ed1b07abbb91ff00e5ca..30a5fe9f31bf6495eb3888452c5d2b35f1596062 100644 (file)
@@ -18,7 +18,6 @@
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id: UIxMailTree.m 278 2004-08-26 23:29:09Z helge $
 
 #include <SOGoUI/UIxComponent.h>
 
 
 #include "UIxMailTreeBlock.h"
 #include <SOGo/SoObjects/Mailer/SOGoMailBaseObject.h>
+#include <SOGo/SoObjects/Mailer/SOGoMailAccount.h>
 #include "common.h"
 #include <NGObjWeb/SoComponent.h>
 #include <NGObjWeb/SoObject+SoDAV.h>
 
+/*
+  Support special icons:
+    tbtv_leaf_corner_17x17.gif
+    tbtv_inbox_17x17.gif
+    tbtv_drafts_17x17.gif
+    tbtv_sent_17x17.gif
+    tbtv_trash_17x17.gif
+*/
 
 @implementation UIxMailTree
 
   [super dealloc];
 }
 
+/* icons */
+
+- (NSString *)defaultIconName {
+  return @"tbtv_leaf_corner_17x17.gif";
+}
+
+- (NSString *)iconNameForType:(NSString *)_type {
+  if (![_type isNotNull])
+    return [self defaultIconName];
+  
+  //return @"tbtv_drafts_17x17.gif";
+  
+  return [self defaultIconName];
+}
+
 /* accessors */
 
 - (void)setItem:(id)_item {
   return self->item;
 }
 
+- (NSString *)itemIconName {
+  // TODO: only called once!
+  NSString *ftype;
+  
+  ftype = [[self item] valueForKey:@"outlookFolderClass"];
+  return [self iconNameForType:ftype];
+}
+
+/* fetching subfolders */
+
+- (NSArray *)fetchSubfoldersOfObject:(id)_object {
+  /* Walk over toManyRelationshipKeys and lookup the controllers for them. */
+  NSMutableArray *ma;
+  NSArray  *names;
+  unsigned i, count;
+  
+  if ((names = [_object toManyRelationshipKeys]) == nil)
+    return nil;
+  
+  count = [names count];
+  ma    = [NSMutableArray arrayWithCapacity:(count + 1)];
+  for (i = 0; i < count; i++) {
+    id folder;
+    
+    folder = [_object lookupName:[names objectAtIndex:i] inContext:nil 
+                     acquire:NO];
+    if (folder == nil)
+      continue;
+    if ([folder isKindOfClass:[NSException class]])
+      continue;
+    
+    [ma addObject:folder];
+  }
+  return ma;
+}
+
 /* navigation nodes */
 
 - (BOOL)isRootObject:(id)_object {
     return YES;
   }
   
+  // TODO: make this a parameter to make UIxMailTree reusable
   return [_object isKindOfClass:NSClassFromString(@"SOGoMailAccounts")];
 }
 
   return link;
 }
 
+- (NSString *)titleForObject:(id)_object {
+  // TODO: need to refactor for reuse!
+  NSString *ftype;
+  unsigned len;
+  
+  ftype = [_object valueForKey:@"outlookFolderClass"];
+  len   = [ftype length];
+
+  switch (len) {
+  case 8:
+    if ([ftype isEqualToString:@"IPF.Sent"])
+      return [self labelForKey:@"SentFolderName"];
+    break;
+  case 9:
+    if ([ftype isEqualToString:@"IPF.Inbox"])
+      return [self labelForKey:@"InboxFolderName"];
+    if ([ftype isEqualToString:@"IPF.Trash"])
+      return [self labelForKey:@"TrashFolderName"];
+    break;
+  case 10:
+    if ([ftype isEqualToString:@"IPF.Drafts"])
+      return [self labelForKey:@"DraftsFolderName"];
+    if ([ftype isEqualToString:@"IPF.Filter"])
+      return [self labelForKey:@"SieveFolderName"];
+  }
+  
+  return [_object davDisplayName];
+}
+
 - (UIxMailTreeBlock *)treeNavigationBlockForLeafNode:(id)_o atDepth:(int)_d {
   UIxMailTreeBlock *md;
   id blocks;
     : nil;
   
   md = [UIxMailTreeBlock blockWithName:nil
-                        title:[_o davDisplayName]
+                        title:[self titleForObject:_o]
                         link:[self treeNavigationLinkForObject:_o atDepth:_d]
                         isPathNode:NO isActiveNode:NO
                         childBlocks:blocks];
 }
 
 - (UIxMailTreeBlock *)treeNavigationBlockForRootNode:(id)_object {
-  /* this generates the block for the clientObject */
+  /*
+     This generates the block for the root object (root of the tree, we get
+     there by walking up the chain starting with the client object).
+  */
   UIxMailTreeBlock *md;
-  NSMutableArray      *blocks;
-  NSArray             *folders;
-  unsigned            i, count;
+  NSMutableArray   *blocks;
+  NSArray          *folders;
+  unsigned         i, count;
   
   /* process child folders */
   
-  folders = [_object fetchSubfolders];
+  folders = [self fetchSubfoldersOfObject:_object];
   count   = [folders count];
   blocks  = [NSMutableArray arrayWithCapacity:count];
   for (i = 0; i < count; i++) {
   /* build block */
   
   md = [UIxMailTreeBlock blockWithName:[_object nameInContainer]
-                        title:[_object davDisplayName]
+                        title:[self titleForObject:_object]
                         link:[@"../" stringByAppendingString:
                                  [_object nameInContainer]]
                         isPathNode:YES isActiveNode:YES
 
 - (UIxMailTreeBlock *)treeNavigationBlockForActiveNode:(id)_object {
   /* 
-     this generates the block for the clientObject (the object which has the 
+     This generates the block for the clientObject (the object which has the 
      focus)
   */
   UIxMailTreeBlock *md;
   
   /* process child folders */
   
-  folders = [_object fetchSubfolders];
+  folders = [self fetchSubfoldersOfObject:_object];
   count   = [folders count];
   blocks  = [NSMutableArray arrayWithCapacity:count];
   for (i = 0; i < count; i++) {
   /* build block */
   
   md = [UIxMailTreeBlock blockWithName:[_object nameInContainer]
-                        title:[_object davDisplayName]
+                        title:[self titleForObject:_object]
                         link:@"."
                         isPathNode:YES isActiveNode:YES
                         childBlocks:blocks];
   
   /* process child folders */
   
-  folders = [_object fetchSubfolders];
+  folders = [self fetchSubfoldersOfObject:_object];
   count   = [folders count];
   blocks  = [NSMutableArray arrayWithCapacity:count];
   for (i = 0; i < count; i++) {
   /* build block */
   
   md = [UIxMailTreeBlock blockWithName:[_object nameInContainer]
-                        title:[_object davDisplayName]
+                        title:[self titleForObject:_object]
                         link:[self treeNavigationLinkForObject:_object 
                                    atDepth:(_depth + 1)] 
                         isPathNode:YES isActiveNode:NO
index 35287698851623a69d6e722669f3059876544b9a..bd83fd44b64067a96e604a84d519f0c458981679 100644 (file)
@@ -5,6 +5,7 @@
       xmlns:rsrc="OGo:url"
       xmlns:label="OGo:label"
 >
+  <!-- TODO: extend treeview to use CSS -->
   <var:treeview
     list="rootNodes" item="item" sublist="item.children"
     zoom="item.isPathNode"
index 53efe52364db252385d921307b4f742d721b78d9..e229e7c90ea24487085f70dcb02c9dcde1a63991 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=87
+SUBMINOR_VERSION:=89
 
 # v0.9.87 requires SoObjects/Mailer v0.9.65
 # v0.9.86 requires SoObjects/Mailer v0.9.64
index fda2a6a7a83355abe45587434b46832b1f8f08d9..1fcfefe679d910e5e42b8662e5e519541d338133 100644 (file)
                 cssClass = "tbicon_compose"; label = "Write"; },
             ),
             ( // second group
-/* TODO: enable when implemented
+///* TODO: enable when implemented
               { link = "reply"; 
                 cssClass = "tbicon_reply";    label = "Reply";     },
               { link = "replyall"; 
                 cssClass = "tbicon_replyall"; label = "Reply All"; },
-*/
+//*/
               { link = "forward"; 
                 cssClass = "tbicon_forward";  label = "Forward";   },
             ),