]> err.no Git - scalable-opengroupware.org/commitdiff
improvements
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 22 Oct 2004 18:18:37 +0000 (18:18 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 22 Oct 2004 18:18:37 +0000 (18:18 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@421 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/SOGo.xcode/project.pbxproj
SOGo/UI/Mailer/ChangeLog
SOGo/UI/Mailer/GNUmakefile
SOGo/UI/Mailer/UIxMailListView.wox
SOGo/UI/Mailer/UIxMailSortableTableHeader.m [new file with mode: 0644]
SOGo/UI/Mailer/UIxMailSortableTableHeader.wox [new file with mode: 0644]
SOGo/UI/Mailer/Version

index e579c534d75008b4dc5f86f1a3d968c790f2e3d9..e42edc91c215f9430b5d54ad388bfba84aec4d94 100644 (file)
                        refType = 4;
                        sourceTree = "<group>";
                };
+               ADBE446607297BA9000FEA6A = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text.xml;
+                       path = UIxMailSortableTableHeader.wox;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               ADBE446707297BA9000FEA6A = {
+                       fileEncoding = 5;
+                       indentWidth = 2;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = UIxMailSortableTableHeader.m;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
                ADCDE53106ADA8AC00BFCE2B = {
                        fileEncoding = 5;
                        indentWidth = 8;
                                AD2C76D7071BF4EB0087E027,
                                ADDF4DCC06DE0E9A00C4E7F8,
                                ADDF4DCD06DE0E9A00C4E7F8,
+                               ADBE446707297BA9000FEA6A,
+                               ADBE446607297BA9000FEA6A,
                                ADDF4DCE06DE0E9A00C4E7F8,
                                ADDF4DCF06DE0E9A00C4E7F8,
                        );
index e5fca484ab81df6220e80383db6465e7b6f1aa2c..c9999d70855e3d1d76d73480417c229a9d8acd34 100644 (file)
@@ -1,5 +1,11 @@
 2004-10-22  Marcus Mueller  <znek@mulle-kybernetik.com>
 
+        * v0.9.44
+
+        * UIxMailSortableTableHeader.[wox|m]: new component for doing sorting
+
+        * UIxMailListView.wox: uses UIxMailSortableTableHeader for sorting
+
         * UIxMailListView.wox: bugfixes (v0.9.43)
 
         * v0.9.42
index e41a60daba934567d72dd8f0a58814bfc6cb09f8..fe9ba40ced78f618353a450416e80e055eeb2ebe 100644 (file)
@@ -21,15 +21,16 @@ MailerUI_OBJC_FILES += \
        UIxMailTree.m                   \
        UIxMailToolbar.m                \
        \
-       UIxMailAccountsView.m   \
-       UIxMailAccountView.m    \
-       UIxMailListView.m       \
-       UIxMailView.m           \
+       UIxMailAccountsView.m           \
+       UIxMailAccountView.m            \
+       UIxMailListView.m               \
+       UIxMailView.m                   \
+       UIxMailSortableTableHeader.m    \
        \
-       UIxMailEditor.m         \
-       UIxMailEditorAction.m   \
-       UIxMailToSelection.m    \
-       UIxMailAddressbook.m    \
+       UIxMailEditor.m                 \
+       UIxMailEditorAction.m           \
+       UIxMailToSelection.m            \
+       UIxMailAddressbook.m            \
        \
        UIxMailPartViewer.m             \
        UIxMailPartTextViewer.m         \
@@ -46,14 +47,15 @@ MailerUI_RESOURCE_FILES += \
        UIxMailTree.wox                 \
        UIxMailToolbar.wox              \
        \
-       UIxMailAccountsView.wox \
-       UIxMailAccountView.wox  \
-       UIxMailListView.wox     \
-       UIxMailView.wox         \
+       UIxMailAccountsView.wox         \
+       UIxMailAccountView.wox          \
+       UIxMailListView.wox             \
+       UIxMailView.wox                 \
+       UIxMailSortableTableHeader.wox  \
        \
-       UIxMailEditor.wox       \
-       UIxMailToSelection.wox  \
-       UIxMailAddressbook.wox  \
+       UIxMailEditor.wox               \
+       UIxMailToSelection.wox          \
+       UIxMailAddressbook.wox          \
        \
        UIxMailPartTextViewer.wox       \
        UIxMailPartMixedViewer.wox      \
index 7d800cf64fe457eb3d2536ad7c76eeef580f8e39..669958c142be67319011dbb062d86a328f3aa6be 100644 (file)
             <var:entity const:name="nbsp" />
           </td>
           <td class="tbtv_headercell" width="50%">
-            <a href="view"
-               _sort="subject"
-               _desc="0"
-               var:queryDictionary="queryParameters"
-            >
-              <var:string label:value="Subject" />
-            </a>
-            <var:if condition="imap4SortKey" const:value="SUBJECT">
-              <var:if condition="isSortedDescending" >
-                <a href="view"
-                   _sort="subject"
-                   _desc="0"
-                   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="subject"
-                   _desc="1"
-                   var:queryDictionary="queryParameters"
-                >
-                  <img rsrc:src="title_sortdown_12x12.png"
-                       class="tbtv_sortcell"
-                  />
-                </a>
-              </var:if>
-            </var:if>
+            <var:component className="UIxMailSortableTableHeader"
+                           label:label="Subject"
+                           const:sortKey="subject"
+                           const:href="view"
+                           var:queryDictionary="queryParameters"
+            />
           </td>
           <td class="tbtv_headercell">
             <var:if condition="showToAddress" const:negate="YES">
-              <a href="view"
-                 _sort="from"
-                 _desc="0"
-                 var:queryDictionary="queryParameters"
-              >
-                <var:string label:value="From" />
-              </a>
-              <var:if condition="imap4SortKey" const:value="FROM">
-                <var:if condition="isSortedDescending" >
-                  <a href="view"
-                     _sort="from"
-                     _desc="0"
-                     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:component className="UIxMailSortableTableHeader"
+                             label:label="From"
+                             const:sortKey="from"
+                             const:href="view"
+                             var:queryDictionary="queryParameters"
+              />
             </var:if>
             <var:if condition="showToAddress">
-              <a href="view"
-                 _sort="to"
-                 _desc="0"
-                 var:queryDictionary="queryParameters"
-              >
-                <var:string label:value="To" />
-              </a>
-              <var:if condition="imap4SortKey" const:value="TO">
-                <var:if condition="isSortedDescending" >
-                  <a href="view"
-                     _sort="to"
-                     _desc="0"
-                     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:component className="UIxMailSortableTableHeader"
+                             label:label="To"
+                             const:sortKey="to"
+                             const:href="view"
+                             var:queryDictionary="queryParameters"
+              />
             </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"
-               _desc="0"
-               var:queryDictionary="queryParameters"
-            >
-              <var:string label:value="Date" />
-            </a>
-            <var:if condition="imap4SortKey" const:value="DATE">
-              <var:if condition="isSortedDescending" >
-                <a href="view"
-                   _sort="date"
-                   _desc="0"
-                   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>
+            <var:component className="UIxMailSortableTableHeader"
+                           label:label="Date"
+                           const:sortKey="date"
+                           const:href="view"
+                           var:queryDictionary="queryParameters"
+                           const:isDefault="YES"
+            />
           </td>
         </tr>
         <tr class="tableview">
diff --git a/SOGo/UI/Mailer/UIxMailSortableTableHeader.m b/SOGo/UI/Mailer/UIxMailSortableTableHeader.m
new file mode 100644 (file)
index 0000000..00781f7
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ Copyright (C) 2000-2004 SKYRIX Software AG
+ This file is part of OGo
+ OGo is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+ OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ License for more details.
+ You should have received a copy of the GNU Lesser General Public
+ License along with OGo; see the file COPYING.  If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+ */
+// $Id$
+
+
+#include <NGObjWeb/NGObjWeb.h>
+
+@interface UIxMailSortableTableHeader : WOComponent
+{
+  NSString     *label;
+  NSString     *sortKey;
+  NSString     *href;
+  NSDictionary *queryDictionary;
+  BOOL         isDefault;
+}
+
+@end
+
+#include "common.h"
+
+@implementation UIxMailSortableTableHeader
+
+- (void)dealloc {
+  [self->label           release];
+  [self->sortKey         release];
+  [self->href            release];
+  [self->queryDictionary release];
+  [super dealloc];
+}
+
+/* Accessors */
+
+- (void)setLabel:(NSString *)_label {
+  ASSIGN(self->label, _label);
+}
+- (NSString *)label {
+  return self->label;
+}
+
+- (void)setSortKey:(NSString *)_sortKey {
+  ASSIGN(self->sortKey, _sortKey);
+}
+- (NSString *)sortKey {
+  return self->sortKey;
+}
+
+- (void)setHref:(NSString *)_href {
+  ASSIGN(self->href, _href);
+}
+- (NSString *)href {
+  return self->href;
+}
+
+- (void)setQueryDictionary:(NSDictionary *)_queryDictionary {
+  ASSIGN(self->queryDictionary, _queryDictionary);
+}
+- (NSDictionary *)queryDictionary {
+  return self->queryDictionary;
+}
+
+- (void)setIsDefault:(BOOL)_isDefault {
+  self->isDefault = _isDefault;
+}
+- (BOOL)isDefault {
+  return self->isDefault;
+}
+
+- (BOOL)isSelected {
+  NSString *so;
+  so = [self->queryDictionary objectForKey:@"sort"];
+  if(!so) {
+    return self->isDefault;
+  }
+  return [so isEqualToString:self->sortKey];
+}
+
+- (BOOL)isSortedDescending {
+  NSString *desc;
+  
+  desc = [self->queryDictionary objectForKey:@"desc"];
+  if(!desc)
+    return NO;
+  return [desc boolValue] ? YES : NO;
+}
+
+@end
diff --git a/SOGo/UI/Mailer/UIxMailSortableTableHeader.wox b/SOGo/UI/Mailer/UIxMailSortableTableHeader.wox
new file mode 100644 (file)
index 0000000..c983234
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version='1.0' standalone='yes'?>
+
+<span xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:var="http://www.skyrix.com/od/binding"
+      xmlns:const="http://www.skyrix.com/od/constant"
+      xmlns:rsrc="OGo:url"
+>
+  <var:if condition="isSelected" const:negate="YES">
+    <a var:href="href"
+       var:_sort="sortKey"
+       _desc="0"
+       var:queryDictionary="queryDictionary"
+    ><var:string var:value="label"
+     /></a>
+  </var:if>
+  <var:if condition="isSelected">
+    <var:if condition="isSortedDescending" >
+      <a var:href="href"
+         var:_sort="sortKey"
+         _desc="0"
+         var:queryDictionary="queryDictionary"
+      ><var:string var:value="label"
+       /><var:entity const:name="nbsp"
+         /><img rsrc:src="title_sortup_12x12.png"
+                class="tbtv_sortcell"
+           /></a>
+    </var:if>
+    <var:if condition="isSortedDescending" const:negate="YES" >
+      <a var:href="href"
+         var:_sort="sortKey"
+         _desc="1"
+         var:queryDictionary="queryDictionary"
+      ><var:string var:value="label"
+       /><var:entity const:name="nbsp"
+         /><img rsrc:src="title_sortdown_12x12.png"
+                class="tbtv_sortcell"
+           /></a>
+    </var:if>
+  </var:if>
+</span>
\ No newline at end of file
index af3bd22bb89e2770e820da0a27b42c7727318f45..5ddff4f0ac4430f6f42c0a60ebd8e8a04a39d156 100644 (file)
@@ -1,6 +1,6 @@
 # $Id$
 
-SUBMINOR_VERSION:=43
+SUBMINOR_VERSION:=44
 
 # v0.9.43 requires NGObjWeb v4.3.73
 # v0.9.42 requires NGObjWeb v4.3.72