]> err.no Git - scalable-opengroupware.org/commitdiff
some progress in the mailer
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 22 Oct 2004 15:46:56 +0000 (15:46 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 22 Oct 2004 15:46:56 +0000 (15:46 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@419 d1b88da0-ebda-0310-925b-ed51d893ca5b

15 files changed:
SOGo/UI/Mailer/ChangeLog
SOGo/UI/Mailer/Images/title_attachment_14x14.png
SOGo/UI/Mailer/Images/title_config.png
SOGo/UI/Mailer/Images/title_junk.png
SOGo/UI/Mailer/Images/title_read_14x14.png
SOGo/UI/Mailer/Images/title_sortdown_12x12.png
SOGo/UI/Mailer/Images/title_sortup_12x12.png [new file with mode: 0644]
SOGo/UI/Mailer/Images/title_thread.png
SOGo/UI/Mailer/UIxMailListView.m
SOGo/UI/Mailer/UIxMailListView.wox
SOGo/UI/Mailer/Version
SOGo/UI/Mailer/product.plist
SOGo/UI/SOGoUI/ChangeLog
SOGo/UI/SOGoUI/UIxComponent.m
SOGo/UI/SOGoUI/Version

index 90a66e606059086ffb363fc08b0c2e3c3aa06e87..dc17567c4da52f9ea6f63afcde5c43cf608f415e 100644 (file)
@@ -1,3 +1,15 @@
+2004-10-22  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+        * v0.9.42
+
+        * UIxMailListView.wox: sorting, proper handling of sort keys.
+          NOTE: there's still an unidentified bug of sort keys failing to be
+          retained on successive paging.
+
+        * UIxMailListView.m: sorting
+
+        * Images/title_*: corrected alpha values
+
 2004-10-20  Marcus Mueller  <znek@mulle-kybernetik.com>
 
         * v0.9.41
index d8af1b02f8111f6cbe5780644c8eb0c1c89b8729..b9e4667537a4e897fc88add57fc16b75abba4451 100644 (file)
Binary files a/SOGo/UI/Mailer/Images/title_attachment_14x14.png and b/SOGo/UI/Mailer/Images/title_attachment_14x14.png differ
index 34e76e068f64a293a5d06925d31b881fa1ef23fd..eb5d46fdd4d5566bcaf313198b564dda63ba77f1 100644 (file)
Binary files a/SOGo/UI/Mailer/Images/title_config.png and b/SOGo/UI/Mailer/Images/title_config.png differ
index b62fec9ab62b4f67f4b0c5a8695b1a8d8dc94f51..4fdeb5d273a6ce2da358ba066a77bc47f3633c1d 100644 (file)
Binary files a/SOGo/UI/Mailer/Images/title_junk.png and b/SOGo/UI/Mailer/Images/title_junk.png differ
index 31fc9c3e8895eabd7f1641b94057c873447d53ee..1c3e45cf732804f34247c8912221c017924768d3 100644 (file)
Binary files a/SOGo/UI/Mailer/Images/title_read_14x14.png and b/SOGo/UI/Mailer/Images/title_read_14x14.png differ
index 1a77d1eefa08729e071e549c55a2d46822200edb..30ff16f852e40761ea49fd52b2ab3911c0473974 100644 (file)
Binary files a/SOGo/UI/Mailer/Images/title_sortdown_12x12.png and b/SOGo/UI/Mailer/Images/title_sortdown_12x12.png differ
diff --git a/SOGo/UI/Mailer/Images/title_sortup_12x12.png b/SOGo/UI/Mailer/Images/title_sortup_12x12.png
new file mode 100644 (file)
index 0000000..404d527
Binary files /dev/null and b/SOGo/UI/Mailer/Images/title_sortup_12x12.png differ
index 8762589ecb16f51ce4097b025fb8716bec544282..aed73319d23bdd040e60e2126961b2966c56087e 100644 (file)
Binary files a/SOGo/UI/Mailer/Images/title_thread.png and b/SOGo/UI/Mailer/Images/title_thread.png differ
index c1014889031525f67c8a231c38f2bdc67a7ec3b5..cc5c9230d21e11326b1006b84e1dbc3978daf73e 100644 (file)
   id       message;
 }
 
+- (NSString *)defaultSortKey;
+- (NSString *)imap4SortKey;
+- (NSString *)imap4SortOrdering;
+
+- (BOOL)isSortedDescending;
+
 @end
 
 #include "common.h"
@@ -115,13 +121,24 @@ static int attachmentFlagSize = 8096;
   
   sort = [[[self context] request] formValueForKey:@"sort"];
   
-  // TODO: reversed sorts
-  
   if ([sort length] == 0)
     sort = [self defaultSortKey];
   return [sort uppercaseString];
 }
 
+- (BOOL)isSortedDescending {
+  return [[[self context] request] formValueForKey:@"desc"] ? YES : NO;
+}
+
+- (NSString *)imap4SortOrdering {
+  NSString *sort;
+  
+  sort = [self imap4SortKey];
+  if(![self isSortedDescending])
+    return sort;
+  return [@"REVERSE " stringByAppendingString:sort];
+}
+
 - (NSRange)fetchRange {
   if (self->firstMessageNumber == 0)
     return NSMakeRange(0, 50);
@@ -134,7 +151,7 @@ static int attachmentFlagSize = 8096;
   
   self->sortedUIDs 
     = [[[self clientObject] fetchUIDsMatchingQualifier:[self qualifier]
-                           sortOrdering:[self imap4SortKey]] retain];
+                           sortOrdering:[self imap4SortOrdering]] retain];
   return self->sortedUIDs;
 }
 - (unsigned int)totalMessageCount {
index d33fa4769fe61a55e71465fcca540bec4ffda969..21456504cffba6420cf3b1a712dc2359a2aa2df1 100644 (file)
@@ -10,7 +10,8 @@
   title="name"
 >
   <div class="titlediv">
-    <a rsrc:href="tbird_073_mailwelcome.png"><var:string label:value="View" />:</a>, <!-- TODO ;-) -->
+    <a rsrc:href="tbird_073_mailwelcome.png"
+    ><var:string label:value="View" />:</a>, <!-- TODO ;-) -->
     <select name="viewfilter">    <!-- var:popup? -->
       <option value="all"   ><var:string label:value="All" /></option>
       <option value="unread"><var:string label:value="Unread" /></option>
             <var:entity const:name="nbsp" />
           </td>
           <td class="tbtv_headercell" width="50%">
-           <a href="view" _sort="subject">
+               <a href="view" _sort="subject">
               <var:string label:value="Subject" />
-              <var:if condition="imap4SortKey" const:value="SUBJECT">
-                <img rsrc:src="title_sortdown_12x12.png" 
-                     class="tbtv_sortcell" />
-              </var:if>
             </a>
+            <var:if condition="imap4SortKey" const:value="SUBJECT">
+              <var:if condition="isSortedDescending" >
+                <a href="view" _sort="subject">
+                  <img rsrc:src="title_sortup_12x12.png"
+                       class="tbtv_sortcell"
+                  />
+                </a>
+              </var:if>
+              <var:if condition="isSortedDescending" const:negate="YES" >
+                <a href="view" _sort="subject" _desc="1">
+                  <img rsrc:src="title_sortdown_12x12.png"
+                       class="tbtv_sortcell"
+                  />
+                </a>
+              </var:if>
+            </var:if>
           </td>
           <td class="tbtv_headercell">
             <var:if condition="showToAddress" const:negate="YES">
-              <a href="view" _sort="from">
+              <a href="view"
+                 _sort="from"
+                 var:queryDictionary="queryParameters"
+              >
                 <var:string label:value="From" />
-                <var:if condition="imap4SortKey" const:value="FROM">
-                  <img rsrc:src="title_sortdown_12x12.png" 
-                       class="tbtv_sortcell" />
-                </var:if>
               </a>
+              <var:if condition="imap4SortKey" const:value="FROM">
+                <var:if condition="isSortedDescending" >
+                  <a href="view"
+                     _sort="from"
+                     var:queryDictionary="queryParameters"
+                  >
+                    <img rsrc:src="title_sortup_12x12.png"
+                         class="tbtv_sortcell"
+                    />
+                  </a>
+                </var:if>
+                <var:if condition="isSortedDescending" const:negate="YES" >
+                  <a href="view"
+                     _sort="from"
+                     _desc="1"
+                     var:queryDictionary="queryParameters"
+                  >
+                    <img rsrc:src="title_sortdown_12x12.png"
+                         class="tbtv_sortcell"
+                    />
+                  </a>
+                </var:if>
+              </var:if>
             </var:if>
             <var:if condition="showToAddress">
-              <a href="view" _sort="to">
+              <a href="view"
+                 _sort="to"
+                 var:queryDictionary="queryParameters"
+              >
                 <var:string label:value="To" />
-                <var:if condition="imap4SortKey" const:value="TO">
-                  <img rsrc:src="title_sortdown_12x12.png"
-                       class="tbtv_sortcell" />
-               </var:if>
               </a>
+              <var:if condition="imap4SortKey" const:value="TO">
+                <var:if condition="isSortedDescending" >
+                  <a href="view"
+                     _sort="to"
+                     var:queryDictionary="queryParameters"
+                  >
+                    <img rsrc:src="title_sortup_12x12.png"
+                         class="tbtv_sortcell"
+                    />
+                  </a>
+                </var:if>
+                <var:if condition="isSortedDescending" const:negate="YES" >
+                  <a href="view"
+                     _sort="to"
+                     _desc="1"
+                     var:queryDictionary="queryParameters"
+                  >
+                    <img rsrc:src="title_sortdown_12x12.png"
+                         class="tbtv_sortcell"
+                    />
+                  </a>
+                </var:if>
+              </var:if>
             </var:if>
           </td>
           <td class="tbtv_headercell" width="17">
             <img rsrc:src="title_attachment_14x14.png" width="14" height="14" />
           </td>
           <td class="tbtv_headercell">
-            <a href="view" _sort="date">
+            <a href="view"
+               _sort="date"
+               var:queryDictionary="queryParameters"
+            >
               <var:string label:value="Date" />
-              <var:if condition="imap4SortKey" const:value="DATE">
-                <img rsrc:src="title_sortdown_12x12.png"
-                     class="tbtv_sortcell"/>
-              </var:if>
             </a>
+            <var:if condition="imap4SortKey" const:value="DATE">
+              <var:if condition="isSortedDescending" >
+                <a href="view"
+                   _sort="date"
+                   var:queryDictionary="queryParameters"
+                >
+                  <img rsrc:src="title_sortup_12x12.png"
+                       class="tbtv_sortcell"
+                  />
+                </a>
+              </var:if>
+              <var:if condition="isSortedDescending" const:negate="YES" >
+                <a href="view"
+                   _sort="date"
+                   _desc="1"
+                   var:queryDictionary="queryParameters"
+                >
+                  <img rsrc:src="title_sortdown_12x12.png"
+                       class="tbtv_sortcell"
+                  />
+                </a>
+              </var:if>
+            </var:if>
           </td>
         </tr>
         <tr class="tableview">
               <var:if condition="hasPrevious">
                 <a href="view"
                    _idx="1"
+                   var:queryDictionary="queryParameters"
                 ><var:string label:value="first"/></a> |
                 <a href="view"
                    var:_idx="prevFirstMessageNumber"
+                   var:queryDictionary="queryParameters"
                 ><var:string label:value="previous"/></a> |
               </var:if>
   
               <var:if condition="hasNext">
                 | <a href="view"
                      var:_idx="nextFirstMessageNumber"
+                     var:queryDictionary="queryParameters"
                   ><var:string label:value="next" /></a>
               </var:if>
             </var:if>
index b64cd5801f8619965d88b347e58edfa46efd36d2..57c3c0df019ed1842344a43cbb856600289ab749 100644 (file)
@@ -1,3 +1,5 @@
 # $Id$
 
-SUBMINOR_VERSION:=41
+SUBMINOR_VERSION:=42
+
+# v0.9.42 requires NGObjWeb v4.3.72
index 65f9f893b2f4a29bd11a21a58f69853d0329bd95..78e4848520d1fbaaf0a86df60e677997c94a86ec 100644 (file)
@@ -65,7 +65,8 @@
     "title_read_14x14.png",
     "title_thread.png",
     "title_sortdown_12x12.png",
-    
+    "title_sortup_12x12.png",
+
     "tbird_073_accountview.png",
     "tbird_073_compose.png",
     "tbird_073_mailwelcome.png",
index db811fb7384f5f77b603c731c2e04bda4266f75c..4648fe3796eb87a1d608fa17793cb270c98fb291 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-22  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * UIxComponent.m: rewrote handling of queryParameters, these get
+         constructed lazily now (v0.9.17)
+
 2004-10-20  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * SOGoJSStringFormatter.[hm]: new formatter to properly escape certain
index a063446131418a79ca42f85d62680c0992b14192..51be44ee637ad5749d3544c8e6c9f6ecfebc9227 100644 (file)
@@ -26,6 +26,7 @@
 
 @interface UIxComponent (PrivateAPI)
 - (void)_parseQueryString:(NSString *)_s;
+- (NSMutableDictionary *)_queryParameters;
 @end
 
 @implementation UIxComponent
@@ -98,39 +99,11 @@ static BOOL uixDebugEnabled = NO;
   }
 }
 
-- (id)init {
-  if ((self = [super init])) {
-    self->queryParameters = [[NSMutableDictionary alloc] initWithCapacity:8];
-  }
-  return self;
-}
-
 - (void)dealloc {
   [self->queryParameters release];
   [super dealloc];
 }
 
-/* notifications */
-
-- (void)awake {
-  WORequest *req;
-  NSString  *uri;
-  NSRange   r;
-
-  [super awake];
-
-  req = [[self context] request];
-  uri = [req uri];
-  r   = [uri rangeOfString:@"?"];
-  if (r.length > 0) {
-    NSString *qs;
-    
-    qs = [uri substringFromIndex:(r.location + r.length)];
-    [self->queryParameters removeAllObjects];
-    [self _parseQueryString:qs];
-  }    
-}
-
 /* query parameters */
 
 - (void)_parseQueryString:(NSString *)_s {
@@ -158,7 +131,7 @@ static BOOL uixDebugEnabled = NO;
 }
 
 - (NSString *)queryParameterForKey:(NSString *)_key {
-  return [self->queryParameters objectForKey:_key];
+  return [[self _queryParameters] objectForKey:_key];
 }
 
 - (void)setQueryParameter:(NSString *)_param forKey:(NSString *)_key {
@@ -166,15 +139,36 @@ static BOOL uixDebugEnabled = NO;
     return;
 
   if(_param != nil)
-    [self->queryParameters setObject:_param forKey:_key];
+    [[self _queryParameters] setObject:_param forKey:_key];
   else
-    [self->queryParameters removeObjectForKey:_key];
+    [[self _queryParameters] removeObjectForKey:_key];
 }
 
-- (NSDictionary *)queryParameters {
+- (NSMutableDictionary *)_queryParameters {
+  if(!self->queryParameters) {
+    WORequest *req;
+    NSString  *uri;
+    NSRange   r;
+    
+    self->queryParameters = [[NSMutableDictionary alloc] initWithCapacity:8];
+    
+    req = [[self context] request];
+    uri = [req uri];
+    r   = [uri rangeOfString:@"?" options:NSBackwardsSearch];
+    if (r.length > 0) {
+      NSString *qs;
+      
+      qs = [uri substringFromIndex:NSMaxRange(r)];
+      [self _parseQueryString:qs];
+    }    
+  }
   return self->queryParameters;
 }
 
+- (NSDictionary *)queryParameters {
+  return [self _queryParameters];
+}
+
 - (NSDictionary *)queryParametersBySettingSelectedDate:(NSCalendarDate *)_date{
   NSMutableDictionary *qp;
     
index 27f42dca521c102631a68b11d5a0fab575d2dd28..33dfbe1b04726220aa5142e7e070a02c182f5657 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=16
+SUBMINOR_VERSION:=17