From e15b9632793b749184b6c7843602234f67049c44 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 19 Sep 2010 17:05:34 +0900 Subject: [PATCH] Correct alert panel handling. --- tools/Forge/Bundles/MapEdit/Project.m | 10 +++++++--- tools/Forge/Bundles/MapEdit/QuakeEd.m | 8 +++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/Forge/Bundles/MapEdit/Project.m b/tools/Forge/Bundles/MapEdit/Project.m index 8c765c56b..512809774 100644 --- a/tools/Forge/Bundles/MapEdit/Project.m +++ b/tools/Forge/Bundles/MapEdit/Project.m @@ -241,6 +241,7 @@ t in:(id) obj int row; char fname[1024]; id panel; + NSModalSession session; matrix =[sender matrixInColumn:0]; row =[matrix selectedRow]; @@ -248,12 +249,15 @@ t in:(id) obj panel = NSGetAlertPanel (@"Loading...", @"Loading map. Please wait.", NULL, NULL, NULL); - [panel orderFront:NULL]; + + session = [NSApp beginModalSessionForWindow: panel]; + [NSApp runModalSession: session]; [quakeed_i doOpen:fname]; - [panel performClose:NULL]; - // NSFreeAlertPanel(panel); + [NSApp endModalSession: session]; + [panel close]; + NSReleaseAlertPanel (panel); return self; } diff --git a/tools/Forge/Bundles/MapEdit/QuakeEd.m b/tools/Forge/Bundles/MapEdit/QuakeEd.m index 65be3b8c1..d5185f2eb 100644 --- a/tools/Forge/Bundles/MapEdit/QuakeEd.m +++ b/tools/Forge/Bundles/MapEdit/QuakeEd.m @@ -676,12 +676,14 @@ cmdline dialog:(BOOL) wt if (wt) { id panel; + NSModalSession session; panel = NSGetAlertPanel (@"BSP In Progress",[NSString stringWithCString:expandedcmd], NULL, NULL, NULL); - [panel makeKeyAndOrderFront:NULL]; + session = [NSApp beginModalSessionForWindow: panel]; system (expandedcmd); - [panel release]; - [self makeKeyAndOrderFront:NULL]; + [NSApp endModalSession: session]; + [panel close]; + NSReleaseAlertPanel (panel); DisplayCmdOutput (); } else { // cmdte = DPSAddTimedEntry(1, CheckCmdDone, self, NS_BASETHRESHOLD);