From c58602f5f5d24126f0d4cacdfcfbfc10683b9559 Mon Sep 17 00:00:00 2001 From: gcasa Date: Sun, 26 Jul 2009 02:56:56 +0000 Subject: [PATCH] * Source/NSAlert.m: Offset color by less in -resetWindow. Remove redundant logic for calling the "didEnd" method in the NSBeginSheet... functions. * Source/NSApplication.m: Add code to reset parent window in beginSheet:... method. Also added check to make sure the modalDelegate is not nil. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28411 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 +++++++++ Source/NSAlert.m | 31 ++++++------------------------- Source/NSApplication.m | 5 ++++- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index a92bdbaab..8971dd2f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-07-25 22:54-EDT Gregory John Casamento + + * Source/NSAlert.m: Offset color by less in -resetWindow. Remove + redundant logic for calling the "didEnd" method in the NSBeginSheet... + functions. + * Source/NSApplication.m: Add code to reset parent window in + beginSheet:... method. Also added check to make sure the + modalDelegate is not nil. + 2009-07-25 20:54-EDT Gregory John Casamento * Source/NSAlert.m: Remove category for setAttachedSheet method. diff --git a/Source/NSAlert.m b/Source/NSAlert.m index 6caf87b20..b66d5f179 100644 --- a/Source/NSAlert.m +++ b/Source/NSAlert.m @@ -976,9 +976,9 @@ setControl(NSView* content, id control, NSString *title) colorUsingColorSpaceName: NSCalibratedRGBColorSpace] getRed: &r green: &g blue: &b alpha: &a]; - color = [NSColor colorWithCalibratedRed: r + 0.1 - green: g + 0.1 - blue: b + 0.1 + color = [NSColor colorWithCalibratedRed: r + 0.05 + green: g + 0.05 + blue: b + 0.05 alpha: a]; [self setBackgroundColor: color]; } @@ -1547,21 +1547,16 @@ void NSBeginAlertSheet(NSString *title, panel = getSomeSheet(&standardAlertPanel, defaultTitle, title, message, defaultButton, alternateButton, otherButton); + // FIXME: We should also change the button action to call endSheet: [NSApp beginSheet: panel modalForWindow: docWindow modalDelegate: modalDelegate didEndSelector: willEndSelector contextInfo: contextInfo]; - [panel close]; - if (modalDelegate && [modalDelegate respondsToSelector: didEndSelector]) - { - void (*didEnd)(id, SEL, id, int, void*); - didEnd = (void (*)(id, SEL, id, int, void*))[modalDelegate methodForSelector: - didEndSelector]; - didEnd(modalDelegate, didEndSelector, panel, [panel result], contextInfo); - } + [panel close]; + NSReleaseAlertPanel(panel); } @@ -1593,14 +1588,7 @@ void NSBeginCriticalAlertSheet(NSString *title, didEndSelector: willEndSelector contextInfo: contextInfo]; [panel close]; - if (modalDelegate && [modalDelegate respondsToSelector: didEndSelector]) - { - void (*didEnd)(id, SEL, id, int, void*); - didEnd = (void (*)(id, SEL, id, int, void*))[modalDelegate methodForSelector: - didEndSelector]; - didEnd(modalDelegate, didEndSelector, panel, [panel result], contextInfo); - } NSReleaseAlertPanel(panel); } @@ -1634,14 +1622,7 @@ void NSBeginInformationalAlertSheet(NSString *title, didEndSelector: willEndSelector contextInfo: contextInfo]; [panel close]; - if (modalDelegate && [modalDelegate respondsToSelector: didEndSelector]) - { - void (*didEnd)(id, SEL, id, int, void*); - didEnd = (void (*)(id, SEL, id, int, void*))[modalDelegate methodForSelector: - didEndSelector]; - didEnd(modalDelegate, didEndSelector, panel, [panel result], contextInfo); - } NSReleaseAlertPanel(panel); } diff --git a/Source/NSApplication.m b/Source/NSApplication.m index abf39f90f..8adcd338b 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -1893,10 +1893,11 @@ See -runModalForWindow: [sheet setParentWindow: docWindow]; [docWindow setAttachedSheet: sheet]; + ret = [self runModalForWindow: sheet relativeToWindow: docWindow]; - if ([modalDelegate respondsToSelector: didEndSelector]) + if (modalDelegate && [modalDelegate respondsToSelector: didEndSelector]) { void (*didEnd)(id, SEL, id, int, void*); @@ -1904,7 +1905,9 @@ See -runModalForWindow: didEndSelector]; didEnd(modalDelegate, didEndSelector, sheet, ret, contextInfo); } + [docWindow setAttachedSheet: nil]; + [sheet setParentWindow: nil]; } /**