From 8b5496d4cf8014fc8d5e4f38fdce26e53503f22c Mon Sep 17 00:00:00 2001 From: helge Date: Mon, 14 Feb 2005 16:21:40 +0000 Subject: [PATCH] minor code cleanups git-svn-id: http://svn.opengroupware.org/SOGo/trunk@558 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/UI/Contacts/ChangeLog | 4 +++ SOGo/UI/Contacts/UIxContactsListView.h | 11 ++++-- SOGo/UI/Contacts/UIxContactsListView.m | 3 +- SOGo/UI/Contacts/Version | 4 +-- SOGo/UI/Mailer/ChangeLog | 12 ++++++- SOGo/UI/Mailer/GNUmakefile | 1 - SOGo/UI/Mailer/UIxMailMainFrame.wox | 4 ++- SOGo/UI/Mailer/UIxMailTree.m | 47 +++++++++++++++++++++++--- SOGo/UI/Mailer/Version | 2 +- SOGo/UI/Mailer/common.h | 1 - SOGo/UI/Mailer/product.plist | 34 +++++++++++++++---- 11 files changed, 100 insertions(+), 23 deletions(-) diff --git a/SOGo/UI/Contacts/ChangeLog b/SOGo/UI/Contacts/ChangeLog index 25470784..69ad2178 100644 --- a/SOGo/UI/Contacts/ChangeLog +++ b/SOGo/UI/Contacts/ChangeLog @@ -1,3 +1,7 @@ +2005-02-14 Helge Hess + + * UIxContactsListView.h: properly protected header file (v0.9.19) + 2004-12-08 Marcus Mueller * UIxContactEditor.m: changed to use NGLogging (v0.9.18) diff --git a/SOGo/UI/Contacts/UIxContactsListView.h b/SOGo/UI/Contacts/UIxContactsListView.h index e848363b..31d68c27 100644 --- a/SOGo/UI/Contacts/UIxContactsListView.h +++ b/SOGo/UI/Contacts/UIxContactsListView.h @@ -17,18 +17,23 @@ 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$ +*/ +#ifndef __UIxContactsListView_H__ +#define __UIxContactsListView_H__ #include +@class NSString, NSArray; + @interface UIxContactsListView : UIxComponent { NSArray *allRecords; NSArray *filteredRecords; NSString *searchText; - id contact; + id contact; } @end + +#endif /* __UIxContactsListView_H__ */ diff --git a/SOGo/UI/Contacts/UIxContactsListView.m b/SOGo/UI/Contacts/UIxContactsListView.m index 1fdccbf2..55ab51c0 100644 --- a/SOGo/UI/Contacts/UIxContactsListView.m +++ b/SOGo/UI/Contacts/UIxContactsListView.m @@ -18,8 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ - #include "UIxContactsListView.h" #include @@ -50,6 +48,7 @@ - (id)searchText { return self->searchText; } + - (EOQualifier *)qualifier { NSString *qs, *s; diff --git a/SOGo/UI/Contacts/Version b/SOGo/UI/Contacts/Version index e66b6e90..145749f9 100644 --- a/SOGo/UI/Contacts/Version +++ b/SOGo/UI/Contacts/Version @@ -1,6 +1,6 @@ -# $Id$ +# GNUstep makefile -SUBMINOR_VERSION:=18 +SUBMINOR_VERSION:=19 # v0.9.18 requires NGExtensions v4.5.136 # v0.9.16 requires libSOGoUI v0.9.16 diff --git a/SOGo/UI/Mailer/ChangeLog b/SOGo/UI/Mailer/ChangeLog index b4071acd..8acfa77a 100644 --- a/SOGo/UI/Mailer/ChangeLog +++ b/SOGo/UI/Mailer/ChangeLog @@ -1,5 +1,15 @@ 2005-02-14 Helge Hess - + + * v0.9.107 + + * product.plist: mapped 'namespaced' "tb.view" SOPE method to the same + methods like "view". This allows us to use "tb.view" inside the + mailer without clashing with other UIs on top of the same SoObjects + + * UIxMailTree.m: use Inbox icon for SOGoMailAccount and + SOGoMailAccounts folders, added ability to specify a + 'treeFolderAction' (relative URL to be triggered by clicks) + * v0.9.106 * UIxMailFilterPanel.wox: improved CSS styling of the search field diff --git a/SOGo/UI/Mailer/GNUmakefile b/SOGo/UI/Mailer/GNUmakefile index b9caf48d..f18d8530 100644 --- a/SOGo/UI/Mailer/GNUmakefile +++ b/SOGo/UI/Mailer/GNUmakefile @@ -91,7 +91,6 @@ MailerUI_RESOURCE_FILES += \ mailer.js \ MailerUI_RESOURCE_FILES += \ - screenshots/*.png \ Images/tbtv_*.gif \ Images/icon_*.gif \ Images/tbtb_*.png \ diff --git a/SOGo/UI/Mailer/UIxMailMainFrame.wox b/SOGo/UI/Mailer/UIxMailMainFrame.wox index 1e6679a6..a419b307 100644 --- a/SOGo/UI/Mailer/UIxMailMainFrame.wox +++ b/SOGo/UI/Mailer/UIxMailMainFrame.wox @@ -64,7 +64,9 @@
+ rootClassName="treeRootClassName" + const:treeFolderAction="tb.view" + />
diff --git a/SOGo/UI/Mailer/UIxMailTree.m b/SOGo/UI/Mailer/UIxMailTree.m index 832308fc..9f062a65 100644 --- a/SOGo/UI/Mailer/UIxMailTree.m +++ b/SOGo/UI/Mailer/UIxMailTree.m @@ -24,6 +24,7 @@ @interface UIxMailTree : UIxComponent { NSString *rootClassName; + NSString *treeFolderAction; id rootNodes; id item; } @@ -54,7 +55,8 @@ static BOOL debugBlocks = NO; } - (void)dealloc { - [self->rootClassName release]; + [self->treeFolderAction release]; + [self->rootClassName release]; [self->rootNodes release]; [self->item release]; [super dealloc]; @@ -91,6 +93,13 @@ static BOOL debugBlocks = NO; return self->item; } +- (void)setTreeFolderAction:(NSString *)_action { + ASSIGNCOPY(self->treeFolderAction, _action); +} +- (NSString *)treeFolderAction { + return self->treeFolderAction; +} + - (NSString *)itemIconName { // TODO: only called once! NSString *ftype; @@ -108,7 +117,7 @@ static BOOL debugBlocks = NO; unsigned i, count; if ((names = [_object toManyRelationshipKeys]) == nil) { - [self logWithFormat:@"no to-many: %@", _object]; + if (debugBlocks) [self logWithFormat:@"no to-many: %@", _object]; return nil; } @@ -149,8 +158,17 @@ static BOOL debugBlocks = NO; - (NSString *)treeNavigationLinkForObject:(id)_object atDepth:(int)_depth { NSString *link; unsigned i; - + link = [[_object nameInContainer] stringByAppendingString:@"/"]; + link = [link stringByAppendingString:[self treeFolderAction]]; + + switch (_depth) { + case 0: return link; + case 1: return [@"../" stringByAppendingString:link]; + case 2: return [@"../../" stringByAppendingString:link]; + case 3: return [@"../../../" stringByAppendingString:link]; + } + for (i = 0; i < _depth; i++) link = [@"../" stringByAppendingString:link]; return link; @@ -202,6 +220,20 @@ static BOOL debugBlocks = NO; *_t = [_object davDisplayName]; *_icon = nil; + + if ([_object isKindOfClass:NSClassFromString(@"SOGoMailFolder")]) + *_icon = nil; + else if ([_object isKindOfClass:NSClassFromString(@"SOGoMailAccount")]) + *_icon = @"tbtv_inbox_17x17.gif"; + else if ([_object isKindOfClass:NSClassFromString(@"SOGoMailAccounts")]) + *_icon = @"tbtv_inbox_17x17.gif"; + else if ([_object isKindOfClass:NSClassFromString(@"SOGoUserFolder")]) + *_icon = @"tbtv_inbox_17x17.gif"; + else { + // TODO: use drafts icon for other SOGo folders + *_icon = @"tbtv_drafts_17x17.gif"; + } + return; } @@ -340,7 +372,7 @@ static BOOL debugBlocks = NO; folders = [self fetchSubfoldersOfObject:_object]; count = [folders count]; - blocks = [NSMutableArray arrayWithCapacity:count]; + blocks = [NSMutableArray arrayWithCapacity:count == 0 ? 1 : count]; for (i = 0; i < count; i++) { UIxMailTreeBlock *block; id folder; @@ -352,7 +384,12 @@ static BOOL debugBlocks = NO; if ([block isNotNull]) [blocks addObject:block]; } - if ([blocks count] == 0) blocks = nil; + if ([blocks count] == 0) { + if (_activeChildBlock != nil) // if the parent has no proper fetchmethod! + [blocks addObject:_activeChildBlock]; + else + blocks = nil; + } /* build block */ diff --git a/SOGo/UI/Mailer/Version b/SOGo/UI/Mailer/Version index 177d1750..d973f317 100644 --- a/SOGo/UI/Mailer/Version +++ b/SOGo/UI/Mailer/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=106 +SUBMINOR_VERSION:=107 # v0.9.100 requires libNGMime v4.5.213 # v0.9.99 requires libNGMime v4.5.212 diff --git a/SOGo/UI/Mailer/common.h b/SOGo/UI/Mailer/common.h index bb109a4a..9e98639c 100644 --- a/SOGo/UI/Mailer/common.h +++ b/SOGo/UI/Mailer/common.h @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ #import diff --git a/SOGo/UI/Mailer/product.plist b/SOGo/UI/Mailer/product.plist index f95ac7a4..f21701b9 100644 --- a/SOGo/UI/Mailer/product.plist +++ b/SOGo/UI/Mailer/product.plist @@ -66,12 +66,6 @@ "title_thread.png", "title_sortdown_12x12.png", "title_sortup_12x12.png", - - "tbird_073_accountview.png", - "tbird_073_compose.png", - "tbird_073_mailwelcome.png", - "tbird_073_settings.png", - "tbird_073_viewer.png", ); factories = { @@ -131,6 +125,10 @@ protectedBy = "View"; pageName = "UIxMailListView"; }; + "tb.view" = { /* primary entry for mailer actions */ + protectedBy = "View"; + pageName = "UIxMailListView"; + }; index = { protectedBy = "View"; pageName = "UIxMailListView"; @@ -210,6 +208,10 @@ protectedBy = "View"; pageName = "UIxMailView"; }; + "tb.view" = { /* primary entry for mailer actions */ + protectedBy = "View"; + pageName = "UIxMailView"; + }; getMail = { protectedBy = "View"; @@ -271,6 +273,10 @@ protectedBy = "View"; pageName = "UIxMailAccountsView"; }; + "tb.view" = { /* primary entry for mailer actions */ + protectedBy = "View"; + pageName = "UIxMailAccountsView"; + }; }; }; @@ -296,6 +302,10 @@ protectedBy = "View"; pageName = "UIxMailAccountView"; }; + "tb.view" = { /* primary entry for mailer actions */ + protectedBy = "View"; + pageName = "UIxMailAccountView"; + }; addressbook = { protectedBy = "View"; pageName = "UIxMailAddressbook"; @@ -334,6 +344,10 @@ protectedBy = "View"; pageName = "UIxMailListView"; }; + "tb.view" = { /* primary entry for mailer actions */ + protectedBy = "View"; + pageName = "UIxMailListView"; + }; getMail = { protectedBy = "View"; pageName = "UIxMailListView"; @@ -378,6 +392,10 @@ protectedBy = "View"; pageName = "UIxMailEditor"; }; + "tb.view" = { /* primary entry for mailer actions */ + protectedBy = "View"; + pageName = "UIxMailEditor"; + }; edit = { protectedBy = "View"; pageName = "UIxMailEditor"; @@ -457,6 +475,10 @@ protectedBy = "View"; pageName = "UIxFilterList"; }; + "tb.view" = { /* primary entry for mailer actions */ + protectedBy = "View"; + pageName = "UIxFilterList"; + }; create = { protectedBy = "View"; pageName = "UIxFilterList"; -- 2.39.5