From: helge Date: Tue, 5 Oct 2004 13:32:31 +0000 (+0000) Subject: simple navigation X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f7468b8d043e351f44a6d29643344c78bdca811;p=scalable-opengroupware.org simple navigation git-svn-id: http://svn.opengroupware.org/SOGo/trunk@358 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/UI/Mailer/ChangeLog b/SOGo/UI/Mailer/ChangeLog index 12789f63..6504db88 100644 --- a/SOGo/UI/Mailer/ChangeLog +++ b/SOGo/UI/Mailer/ChangeLog @@ -1,5 +1,7 @@ 2004-10-05 Helge Hess + * UIxMailListView: added simple navigation (v0.9.20) + * v0.9.19 * UIxMailPartViewer.m: added content decoding for QP, base64 and 7bit, diff --git a/SOGo/UI/Mailer/UIxMailListView.m b/SOGo/UI/Mailer/UIxMailListView.m index 9e48347b..c597fbd0 100644 --- a/SOGo/UI/Mailer/UIxMailListView.m +++ b/SOGo/UI/Mailer/UIxMailListView.m @@ -25,9 +25,10 @@ @interface UIxMailListView : UIxComponent { - NSArray *sortedUIDs; /* we always need to retrieve all anyway! */ - NSArray *messages; - id message; + NSArray *sortedUIDs; /* we always need to retrieve all anyway! */ + NSArray *messages; + unsigned firstMessageNumber; + id message; } @end @@ -101,7 +102,9 @@ } - (NSRange)fetchRange { - return NSMakeRange(0, 50); + if (self->firstMessageNumber == 0) + return NSMakeRange(0, 50); + return NSMakeRange(self->firstMessageNumber - 1, 50); } - (NSArray *)sortedUIDs { @@ -127,7 +130,7 @@ r = [self fetchRange]; uids = [self sortedUIDs]; - + /* only need to restrict if we have a lot */ if ((len = [uids count]) <= r.length) { r.location = 0; @@ -163,6 +166,20 @@ return r.location + r.length >= [[self sortedUIDs] count] ? NO : YES; } +- (unsigned int)nextFirstMessageNumber { + return [self firstMessageNumber] + [self fetchRange].length; +} +- (unsigned int)prevFirstMessageNumber { + NSRange r; + unsigned idx; + + idx = [self firstMessageNumber]; + r = [self fetchRange]; + if (idx > r.length) + return (idx - r.length); + return 1; +} + - (NSArray *)messages { NSArray *uids; NSArray *msgs; @@ -236,6 +253,8 @@ - (id)defaultAction { [self logWithFormat:@"default action ..."]; + self->firstMessageNumber = + [[[[self context] request] formValueForKey:@"idx"] intValue]; return self; } diff --git a/SOGo/UI/Mailer/UIxMailListView.wox b/SOGo/UI/Mailer/UIxMailListView.wox index b0043154..adee279d 100644 --- a/SOGo/UI/Mailer/UIxMailListView.wox +++ b/SOGo/UI/Mailer/UIxMailListView.wox @@ -55,7 +55,8 @@ - prev | + first | + prev | @@ -65,7 +66,7 @@ - | next + | next diff --git a/SOGo/UI/Mailer/Version b/SOGo/UI/Mailer/Version index 93c8cd1d..7cb001ac 100644 --- a/SOGo/UI/Mailer/Version +++ b/SOGo/UI/Mailer/Version @@ -1,3 +1,3 @@ # $Id$ -SUBMINOR_VERSION:=19 +SUBMINOR_VERSION:=20