From 33acdfb5f2f7a0c48ef3093af74378f89cc32dbc Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 22 Dec 2006 17:05:13 +0000 Subject: [PATCH] Monotone-Parent: 8753dcb2e70b6f0507ea84bb100f503152e814e4 Monotone-Revision: d535d7ddfc7b2fe0512601074c136e964343f019 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-12-22T17:05:13 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 + UI/MailerUI/UIxMailAccountView.m | 172 ------------------------------- UI/MailerUI/UIxMailSplashView.m | 29 ++++++ 3 files changed, 33 insertions(+), 172 deletions(-) delete mode 100644 UI/MailerUI/UIxMailAccountView.m create mode 100644 UI/MailerUI/UIxMailSplashView.m diff --git a/ChangeLog b/ChangeLog index 6bb01b9df..0a8217d60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-12-22 Wolfgang Sourdeau + * UI/MailerUI/UIxMailAccountView.m: renamed to UIxMailSplashView, + since its the component that displays the same splash screen than + the one in Thunderbird/Icedove. + * UI/MailerUI/UIxMailAccountViewContainer.[hm], UI/MailerUI/UI/MailerUI/UIxMailAccountsView.m, UI/MailerUI/UIxMailListViewContainer.[hm], diff --git a/UI/MailerUI/UIxMailAccountView.m b/UI/MailerUI/UIxMailAccountView.m deleted file mode 100644 index dd13c0a1c..000000000 --- a/UI/MailerUI/UIxMailAccountView.m +++ /dev/null @@ -1,172 +0,0 @@ -/* - Copyright (C) 2004-2005 SKYRIX Software AG - - This file is part of OpenGroupware.org. - - 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. -*/ - -#include - -@interface UIxMailAccountView : UIxComponent -{ - id inbox; -} - -@end - -#include -#include -#include "common.h" - -@interface NSString(DotCutting) - -- (NSString *)titleForSOGoIMAP4String; - -@end - -@interface SOGoMailFolder(UsedPrivates) -- (BOOL)isCreateAllowedInACL; -@end - -@implementation UIxMailAccountView - -static BOOL useAltNamespace = NO; - -+ (void)initialize { - NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; - - useAltNamespace = [ud boolForKey:@"SOGoSpecialFoldersInRoot"]; -} - -- (void)dealloc { - [self->inbox release]; - [super dealloc]; -} - -/* notifications */ - -- (void)sleep { - [super sleep]; - [self->inbox release]; self->inbox = nil; -} - -/* title */ - -- (NSString *)objectTitle { - return [[[self clientObject] nameInContainer] titleForSOGoIMAP4String]; -} - -- (NSString *)panelTitle { - NSString *s; - - s = [self labelForKey:@"Mail Account"]; - s = [s stringByAppendingString:@": "]; - s = [s stringByAppendingString:[self objectTitle]]; - return s; -} - -- (BOOL)showFolderCreateButton { - if (!useAltNamespace) { - /* in a regular configuration everything must be created below INBOX */ - return NO; - } - - /* - A hack to manually check whether we have permission to create folders at - the root level. We do this by checking the permissions on the INBOX - folder (which is technically the root in Cyrus). - - See OGo bug #1472 for details. - */ - - if (self->inbox == nil) { - id tmp; - - tmp = [[self clientObject] lookupName:@"INBOX" - inContext:[self context] - acquire:NO]; - if ([tmp isKindOfClass:[NSException class]] || tmp == nil) - tmp = [NSNull null]; - - self->inbox = [tmp retain]; - } - - if (![self->inbox isNotNull]) { - [self warnWithFormat:@"Found no INBOX folder!"]; - return NO; - } - - return [self->inbox isCreateAllowedInACL]; -} - -- (NSString *) mailFolderName -{ - return [NSString stringWithFormat: @"/%@", - [[self clientObject] nameInContainer]]; -} - -/* error redirects */ - -- (id)redirectToViewWithError:(id)_error { - // TODO: DUP to UIxMailListView - // TODO: improve, localize - // TODO: there is a bug in the treeview which preserves the current URL for - // the active object (displaying the error again) - id url; - - if (![_error isNotNull]) - return [self redirectToLocation:@"view"]; - - if ([_error isKindOfClass:[NSException class]]) - _error = [_error reason]; - else if ([_error isKindOfClass:[NSString class]]) - _error = [_error stringValue]; - - url = [_error stringByEscapingURL]; - url = [@"view?error=" stringByAppendingString:url]; - return [self redirectToLocation:url]; -} - -/* actions */ - -- (id)createFolderAction { - NSException *error; - NSString *folderName; - id client; - - folderName = [[[self context] request] formValueForKey:@"name"]; - if ([folderName length] == 0) { - error = [NSException exceptionWithHTTPStatus:400 /* Bad Request */ - reason:@"missing 'name' query parameter!"]; - return [self redirectToViewWithError:error]; - } - - if ((client = [self clientObject]) == nil) { - error = [NSException exceptionWithHTTPStatus:404 /* Not Found */ - reason:@"did not find mail folder"]; - return [self redirectToViewWithError:error]; - } - - if ((error = [[self clientObject] davCreateCollection:folderName - inContext:[self context]]) != nil) { - return [self redirectToViewWithError:error]; - } - - return [self redirectToLocation:[folderName stringByAppendingString:@"/"]]; -} - -@end /* UIxMailAccountView */ diff --git a/UI/MailerUI/UIxMailSplashView.m b/UI/MailerUI/UIxMailSplashView.m new file mode 100644 index 000000000..628011889 --- /dev/null +++ b/UI/MailerUI/UIxMailSplashView.m @@ -0,0 +1,29 @@ +/* UIxMailSplashView - this file is part of SOGo + * + * Copyright (C) 2006 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import + +@interface UIxMailSplashView : UIxComponent +@end + +@implementation UIxMailSplashView +@end /* UIxMailSplashView */