diff --git a/UI/Common/UIxPageFrame.h b/UI/Common/UIxPageFrame.h index 2dd1366fc..7647b169e 100644 --- a/UI/Common/UIxPageFrame.h +++ b/UI/Common/UIxPageFrame.h @@ -31,6 +31,7 @@ @interface UIxPageFrame : UIxComponent { NSString *title; + NSString *toolbar; id item; BOOL isPopup; } @@ -50,6 +51,9 @@ - (void) setPopup: (BOOL) popup; - (BOOL) isPopup; +- (void) setToolbar: (NSString *) newToolbar; +- (NSString *) toolbar; + @end #endif /* UIXPAGEFRAME_H */ diff --git a/UI/Common/UIxPageFrame.m b/UI/Common/UIxPageFrame.m index d29842ec1..a9bc62cb7 100644 --- a/UI/Common/UIxPageFrame.m +++ b/UI/Common/UIxPageFrame.m @@ -28,31 +28,43 @@ @implementation UIxPageFrame +- (id) init +{ + if ((self = [super init])) + { + toolbar = nil; + } + + return self; +} + - (void)dealloc { - [self->item release]; - [self->title release]; + [item release]; + [title release]; + if (toolbar) + [toolbar release]; [super dealloc]; } /* accessors */ - (void)setTitle:(NSString *)_value { - ASSIGNCOPY(self->title, _value); + ASSIGNCOPY(title, _value); } - (NSString *)title { if ([self isUIxDebugEnabled]) - return self->title; + return title; return [self labelForKey: @"SOGo"]; } - (void)setItem:(id)_item { - ASSIGN(self->item, _item); + ASSIGN(item, _item); } - (id)item { - return self->item; + return item; } - (NSString *)ownerInContext { @@ -71,18 +83,19 @@ - (NSString *)helpURL { - return [NSString stringWithFormat: @"help/%@.html", self->title]; + return [NSString stringWithFormat: @"help/%@.html", title]; } - (NSString *)helpWindowTarget { - return [NSString stringWithFormat: @"Help_%@", self->title]; + return [NSString stringWithFormat: @"Help_%@", title]; } /* notifications */ - (void)sleep { - [self->item release]; self->item = nil; + [item release]; + item = nil; [super sleep]; } @@ -214,4 +227,14 @@ return ([[self productCSSURL] length] > 0); } +- (void) setToolbar: (NSString *) newToolbar +{ + ASSIGN (toolbar, newToolbar); +} + +- (NSString *) toolbar +{ + return toolbar; +} + @end /* UIxPageFrame */ diff --git a/UI/Common/UIxToolbar.m b/UI/Common/UIxToolbar.m index 6b68661d1..c36eaece2 100644 --- a/UI/Common/UIxToolbar.m +++ b/UI/Common/UIxToolbar.m @@ -34,44 +34,61 @@ { NSArray *toolbarConfig; NSArray *toolbarGroup; + NSString *toolbar; NSDictionary *buttonInfo; } + +- (void) setToolbar: (NSString *) newToolbar; +- (NSString *) toolbar; + @end @implementation UIxToolbar +- (id) init +{ + if ((self = [super init])) + { + toolbar = nil; + } + + return self; +} + - (void)dealloc { - [self->toolbarGroup release]; - [self->toolbarConfig release]; - [self->buttonInfo release]; + [toolbarGroup release]; + [toolbarConfig release]; + [buttonInfo release]; + if (toolbar) + [toolbar release]; [super dealloc]; } /* notifications */ - (void)sleep { - [self->toolbarGroup release]; self->toolbarGroup = nil; - [self->toolbarConfig release]; self->toolbarConfig = nil; - [self->buttonInfo release]; self->buttonInfo = nil; + [toolbarGroup release]; toolbarGroup = nil; + [toolbarConfig release]; toolbarConfig = nil; + [buttonInfo release]; buttonInfo = nil; [super sleep]; } /* accessors */ - (void)setToolbarGroup:(id)_group { - ASSIGN(self->toolbarGroup, _group); + ASSIGN(toolbarGroup, _group); } - (id)toolbarGroup { - return self->toolbarGroup; + return toolbarGroup; } - (void)setButtonInfo:(id)_info { - ASSIGN(self->buttonInfo, _info); + ASSIGN(buttonInfo, _info); } - (id)buttonInfo { - return self->buttonInfo; + return buttonInfo; } /* toolbar */ @@ -144,24 +161,28 @@ - (id)toolbarConfig { id tb; - if (self->toolbarConfig != nil) - return [self->toolbarConfig isNotNull] ? self->toolbarConfig : nil; + if (toolbarConfig != nil) + return [toolbarConfig isNotNull] ? toolbarConfig : nil; - tb = [[self clientObject] lookupName:@"toolbar" inContext:[self context] - acquire:NO]; + if (toolbar) + tb = toolbar; + else + tb = [[self clientObject] lookupName:@"toolbar" inContext:[self context] + acquire:NO]; + if ([tb isKindOfClass:[NSException class]]) { [self errorWithFormat: @"not toolbar configuration found on SoObject: %@ (%@)", [self clientObject], [[self clientObject] soClass]]; - self->toolbarConfig = [[NSNull null] retain]; + toolbarConfig = [[NSNull null] retain]; return nil; } if ([tb isKindOfClass:[NSString class]]) tb = [self loadToolbarConfigFromResourceNamed:tb]; - self->toolbarConfig = [tb retain]; - return self->toolbarConfig; + toolbarConfig = [tb retain]; + return toolbarConfig; } /* labels */ @@ -219,4 +240,14 @@ return (amount > 0); } +- (void) setToolbar: (NSString *) newToolbar +{ + ASSIGN(toolbar, newToolbar); +} + +- (NSString *) toolbar +{ + return toolbar; +} + @end /* UIxToolbar */