From 669d18b218982f43c1a879109ab11c633b3aaa55 Mon Sep 17 00:00:00 2001 From: Klaas Pieter Annema Date: Wed, 10 Feb 2010 11:46:40 +0100 Subject: [PATCH 1/5] added missing exception when a viewcontroller has no view after loadView --- AppKit/CPViewController.j | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/AppKit/CPViewController.j b/AppKit/CPViewController.j index c66f021f8..748e2140e 100644 --- a/AppKit/CPViewController.j +++ b/AppKit/CPViewController.j @@ -138,8 +138,6 @@ var CPViewControllerCachedCibs; Returns the view that the controller manages. If this property is nil, the controller sends loadView to itself to create the view that it manages. Subclasses should override the loadView method to create any custom views. The default value is nil. - - Note: An error will not be thrown if after -loadView, the view property is still nil. -view will simply return nil, but will continue to call -loadView on subsequent calls. */ - (CPView)view { @@ -155,6 +153,14 @@ var CPViewControllerCachedCibs; if (_view === nil && [cibOwner isKindOfClass:[CPDocument class]]) [self setView:[cibOwner valueForKey:@"view"]]; + if (!_view) + { + var reason = [CPString stringWithFormat:@"View for %@ could not be loaded from Cib or no view specified. \ + Override loadView to load the view manually.", self]; + + [CPException raise:CPInternalInconsistencyException reason:reason]; + } + if ([cibOwner respondsToSelector:@selector(viewControllerDidLoadCib:)]) [cibOwner viewControllerDidLoadCib:self]; } From 90cd519916bda0f38dcdfb39542d8b6101365f5e Mon Sep 17 00:00:00 2001 From: Klaas Pieter Annema Date: Wed, 10 Feb 2010 12:13:17 +0100 Subject: [PATCH 2/5] added viewDidLoad to CPViewController --- AppKit/CPViewController.j | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/AppKit/CPViewController.j b/AppKit/CPViewController.j index 748e2140e..3fffe261d 100644 --- a/AppKit/CPViewController.j +++ b/AppKit/CPViewController.j @@ -155,20 +155,32 @@ var CPViewControllerCachedCibs; if (!_view) { - var reason = [CPString stringWithFormat:@"View for %@ could not be loaded from Cib or no view specified. \ - Override loadView to load the view manually.", self]; + var reason = [CPString stringWithFormat:@"View for %@ could not be loaded from Cib or no view specified. Override loadView to load the view manually.", self]; [CPException raise:CPInternalInconsistencyException reason:reason]; } if ([cibOwner respondsToSelector:@selector(viewControllerDidLoadCib:)]) [cibOwner viewControllerDidLoadCib:self]; + + [self viewDidLoad]; } return _view; } +/*! + This method is called after the view controller has loaded its associated views into memory. + This method is called regardless of whether the views were stored in a nib file or created programmatically in the loadView method. + This method is most commonly used to perform additional initialization steps on views that are loaded from nib files. +*/ +- (void)viewDidLoad +{ + +} + + /*! Manually sets the view that the controller manages. Setting to nil will cause -loadView to be called on all subsequent calls of -view. From ea47baa1fc0fcfc0e65f616c1fab17188d1652d7 Mon Sep 17 00:00:00 2001 From: Klaas Pieter Annema Date: Wed, 10 Feb 2010 16:19:51 +0100 Subject: [PATCH 3/5] implemented imageDimsWhenDisabled on CPButton --- AppKit/CPButton.j | 1 + AppKit/_CPImageAndTextView.j | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/AppKit/CPButton.j b/AppKit/CPButton.j index 57b15195b..2cbcbf519 100644 --- a/AppKit/CPButton.j +++ b/AppKit/CPButton.j @@ -554,6 +554,7 @@ CPButtonStateMixed = CPThemeState("mixed"); [contentView setTextShadowOffset:[self currentValueForThemeAttribute:@"text-shadow-offset"]]; [contentView setImagePosition:[self currentValueForThemeAttribute:@"image-position"]]; [contentView setImageScaling:[self currentValueForThemeAttribute:@"image-scaling"]]; + [contentView setDimsImage:[self hasThemeState:CPThemeStateDisabled] && _imageDimsWhenDisabled]; } } diff --git a/AppKit/_CPImageAndTextView.j b/AppKit/_CPImageAndTextView.j index d5755c60d..85ba77333 100644 --- a/AppKit/_CPImageAndTextView.j +++ b/AppKit/_CPImageAndTextView.j @@ -68,6 +68,7 @@ var HORIZONTAL_MARGIN = 3.0, CPCellImagePosition _imagePosition; CPImageScaling _imageScaling; + BOOL _shouldDimImage; CPImage _image; CPString _text; @@ -216,6 +217,16 @@ var HORIZONTAL_MARGIN = 3.0, return _imageScaling; } +- (void)setDimsImage:(BOOL)shouldDimImage +{ + var shouldDimImage = !!shouldDimImage; + if (_shouldDimImage !== shouldDimImage) + { + _shouldDimImage = shouldDimImage; + [self setNeedsLayout]; + } +} + - (void)setTextColor:(CPColor)aTextColor { if (_textColor === aTextColor) @@ -577,6 +588,13 @@ var HORIZONTAL_MARGIN = 3.0, imageHeight *= scale; } +#if PLATFORM(DOM) + if (CPFeatureIsCompatible(CPOpacityRequiresFilterFeature)) + _DOMElement.style.filter = @"alpha(opacity=" + _shouldDimImage ? 50 : 100 + ")"; + else + _DOMElement.style.opacity = _shouldDimImage ? 0.5 : 1.0; +#endif + #if PLATFORM(DOM) _DOMImageElement.width = imageWidth; _DOMImageElement.height = imageHeight; From bf691fa552649091dcebd54c940e93321dce3086 Mon Sep 17 00:00:00 2001 From: Klaas Pieter Annema Date: Thu, 11 Feb 2010 12:47:27 +0100 Subject: [PATCH 4/5] removed incorrect implementation of imageDimsWhenDisabled --- AppKit/CPButton.j | 1 - AppKit/_CPImageAndTextView.j | 18 ------------------ 2 files changed, 19 deletions(-) diff --git a/AppKit/CPButton.j b/AppKit/CPButton.j index 2cbcbf519..57b15195b 100644 --- a/AppKit/CPButton.j +++ b/AppKit/CPButton.j @@ -554,7 +554,6 @@ CPButtonStateMixed = CPThemeState("mixed"); [contentView setTextShadowOffset:[self currentValueForThemeAttribute:@"text-shadow-offset"]]; [contentView setImagePosition:[self currentValueForThemeAttribute:@"image-position"]]; [contentView setImageScaling:[self currentValueForThemeAttribute:@"image-scaling"]]; - [contentView setDimsImage:[self hasThemeState:CPThemeStateDisabled] && _imageDimsWhenDisabled]; } } diff --git a/AppKit/_CPImageAndTextView.j b/AppKit/_CPImageAndTextView.j index 85ba77333..d5755c60d 100644 --- a/AppKit/_CPImageAndTextView.j +++ b/AppKit/_CPImageAndTextView.j @@ -68,7 +68,6 @@ var HORIZONTAL_MARGIN = 3.0, CPCellImagePosition _imagePosition; CPImageScaling _imageScaling; - BOOL _shouldDimImage; CPImage _image; CPString _text; @@ -217,16 +216,6 @@ var HORIZONTAL_MARGIN = 3.0, return _imageScaling; } -- (void)setDimsImage:(BOOL)shouldDimImage -{ - var shouldDimImage = !!shouldDimImage; - if (_shouldDimImage !== shouldDimImage) - { - _shouldDimImage = shouldDimImage; - [self setNeedsLayout]; - } -} - - (void)setTextColor:(CPColor)aTextColor { if (_textColor === aTextColor) @@ -588,13 +577,6 @@ var HORIZONTAL_MARGIN = 3.0, imageHeight *= scale; } -#if PLATFORM(DOM) - if (CPFeatureIsCompatible(CPOpacityRequiresFilterFeature)) - _DOMElement.style.filter = @"alpha(opacity=" + _shouldDimImage ? 50 : 100 + ")"; - else - _DOMElement.style.opacity = _shouldDimImage ? 0.5 : 1.0; -#endif - #if PLATFORM(DOM) _DOMImageElement.width = imageWidth; _DOMImageElement.height = imageHeight; From 7d9bd252709932f362a17dab3a854da8a47a887d Mon Sep 17 00:00:00 2001 From: Tom Robinson Date: Mon, 15 Feb 2010 21:20:33 -0800 Subject: [PATCH 5/5] Disable bootstrap installing prebuilt packages --- bootstrap.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 8d03401f5..8f3a5a1ff 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -166,13 +166,13 @@ if ! prompt; then exit 1 fi -echo "================================================================================" -echo "Would you like to install the pre-built Objective-J and Cappuccino packages?" -echo "If you intend to build Cappuccino yourself this is not neccessary." -extra_packages="" -if prompt; then - extra_packages="objective-j cappuccino" -fi +# echo "================================================================================" +# echo "Would you like to install the pre-built Objective-J and Cappuccino packages?" +# echo "If you intend to build Cappuccino yourself this is not neccessary." +# extra_packages="" +# if prompt; then +# extra_packages="objective-j cappuccino" +# fi echo "Installing necessary packages..."