diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-08-19 20:28:39 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-08-19 20:28:39 +0000 |
commit | fdf2f07d8dfd4260c2dd5dd3326ad7206c1e30f1 (patch) | |
tree | f3029d320bf887a3bf360cb7ae8163f447fb26e8 /Source/SPWindowController.m | |
parent | 692e6e7330d9a6fd0227f74c1665ddc0b19cc4c6 (diff) | |
download | sequelpro-fdf2f07d8dfd4260c2dd5dd3326ad7206c1e30f1.tar.gz sequelpro-fdf2f07d8dfd4260c2dd5dd3326ad7206c1e30f1.tar.bz2 sequelpro-fdf2f07d8dfd4260c2dd5dd3326ad7206c1e30f1.zip |
• made usage of SPBeginWaitingAlertSheet while closing a spf file for readability of that spf file
• suppress if a window with one tab will be closed that [... parentTabShouldClose] method will be called twice via closeTab:
- this issue could be the reason for recent crashes/exception esp. of the NSNavigator (should be investigated further)
Diffstat (limited to 'Source/SPWindowController.m')
-rw-r--r-- | Source/SPWindowController.m | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/SPWindowController.m b/Source/SPWindowController.m index 65c1c330..33a5ae74 100644 --- a/Source/SPWindowController.m +++ b/Source/SPWindowController.m @@ -596,10 +596,14 @@ */ - (BOOL)windowShouldClose:(id)sender { - for (NSTabViewItem *eachItem in [tabView tabViewItems]) { - SPDatabaseDocument *eachDocument = [eachItem identifier]; - if (![eachDocument parentTabShouldClose]) return NO; - } + + // Iterate through all tabs if more than one tab is opened only otherwise + // [... parentTabShouldClose] will be called twice [see self closeTab:(id)sender] + if([[tabView tabViewItems] count] > 1) + for (NSTabViewItem *eachItem in [tabView tabViewItems]) { + SPDatabaseDocument *eachDocument = [eachItem identifier]; + if (![eachDocument parentTabShouldClose]) return NO; + } // Remove global session data if the last window of a session will be closed if([[NSApp delegate] sessionURL] && [[[NSApp delegate] orderedDatabaseConnectionWindows] count] == 1) { |