aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-06-21 14:55:04 +0000
committerstuconnolly <stuart02@gmail.com>2009-06-21 14:55:04 +0000
commit873774069986e899c61e10319336b8ac67ba7ebf (patch)
treec39bcbaefd546d3971a7d6c9f53fcde02d924853
parentcdf316bb4000fc904a0fac500e506c74db07bebe (diff)
downloadsequelpro-873774069986e899c61e10319336b8ac67ba7ebf.tar.gz
sequelpro-873774069986e899c61e10319336b8ac67ba7ebf.tar.bz2
sequelpro-873774069986e899c61e10319336b8ac67ba7ebf.zip
Fix for issue #305. Close all sheets attached to all open windows just before Sparkle relaunches the app.
-rw-r--r--Interfaces/English.lproj/MainMenu.xib15
-rw-r--r--Source/MainController.m22
2 files changed, 35 insertions, 2 deletions
diff --git a/Interfaces/English.lproj/MainMenu.xib b/Interfaces/English.lproj/MainMenu.xib
index f0982d2d..9b3239ec 100644
--- a/Interfaces/English.lproj/MainMenu.xib
+++ b/Interfaces/English.lproj/MainMenu.xib
@@ -8,7 +8,6 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="628"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2442,6 +2441,14 @@
</object>
<int key="connectionID">936</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="138191718"/>
+ <reference key="destination" ref="432083121"/>
+ </object>
+ <int key="connectionID">937</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -4371,7 +4378,7 @@ w6gg4oaSIGZhY2FkZV0</string>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">936</int>
+ <int key="maxID">937</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -4771,6 +4778,8 @@ w6gg4oaSIGZhY2FkZV0</string>
<string>tableTabView</string>
<string>tableWindow</string>
<string>tablesListInstance</string>
+ <string>titleAccessoryView</string>
+ <string>titleImageView</string>
<string>userField</string>
<string>variablesSheet</string>
<string>variablesTableView</string>
@@ -4825,6 +4834,8 @@ w6gg4oaSIGZhY2FkZV0</string>
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
+ <string>id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
diff --git a/Source/MainController.m b/Source/MainController.m
index d446444a..a0b69ffd 100644
--- a/Source/MainController.m
+++ b/Source/MainController.m
@@ -28,6 +28,8 @@
#import "TableDocument.h"
#import "SPPreferenceController.h"
+#import <Sparkle/Sparkle.h>
+
#define SEQUEL_PRO_HOME_PAGE_URL @"http://www.sequelpro.com/"
#define SEQUEL_PRO_DONATIONS_URL @"http://www.sequelpro.com/donate.html"
#define SEQUEL_PRO_FAQ_URL @"http://www.sequelpro.com/frequently-asked-questions.html"
@@ -177,6 +179,26 @@
}
/**
+ * Sparkle updater delegate method. Called just before the updater relaunches Sequel Pro and we need to make
+ * sure that no sheets are currently open, which will prevent the app from being quit.
+ */
+- (void)updaterWillRelaunchApplication:(SUUpdater *)updater
+{
+ // Get all the currently open windows and their attached sheets if any
+ NSArray *windows = [NSApp windows];
+
+ for (NSWindow *window in windows)
+ {
+ NSWindow *attachedSheet = [window attachedSheet];
+
+ if (attachedSheet) {
+ [NSApp endSheet:window returnCode:0];
+ [window orderOut:nil];
+ }
+ }
+}
+
+/**
* Deallocate prefs controller
*/
- (void)dealloc