diff options
author | rowanbeentje <rowan@beent.je> | 2010-11-27 22:51:47 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-11-27 22:51:47 +0000 |
commit | 10117475bae9659b41d41c8d408bee3a3c0d6cf2 (patch) | |
tree | 82f49c6b362c128faf9c58d80bb24fe0bbbd46c6 | |
parent | 9309908a0e5e425314f9e602ed79056134aa7750 (diff) | |
download | sequelpro-10117475bae9659b41d41c8d408bee3a3c0d6cf2.tar.gz sequelpro-10117475bae9659b41d41c8d408bee3a3c0d6cf2.tar.bz2 sequelpro-10117475bae9659b41d41c8d408bee3a3c0d6cf2.zip |
- Fix issues right-clicking in the empty table area ( http://spbug.com/l/1726 )
- Improve 10.5 compatibility when clearing menus ( http://spbug.com/l/1508 , http://spbug.com/l/1829 , http://spbug.com/l/1818 )
- Fix a possible crash when updating database lists
- Update localisable strings
-rw-r--r-- | Resources/English.lproj/BundleEditor.strings | bin | 15520 -> 15018 bytes | |||
-rw-r--r-- | Resources/English.lproj/Localizable.strings | bin | 191756 -> 195340 bytes | |||
-rw-r--r-- | Source/SPAppController.m | 2 | ||||
-rw-r--r-- | Source/SPBundleEditorController.m | 3 | ||||
-rw-r--r-- | Source/SPCategoryAdditions.h | 1 | ||||
-rw-r--r-- | Source/SPDatabaseDocument.m | 2 | ||||
-rw-r--r-- | Source/SPEditorPreferencePane.m | 3 | ||||
-rw-r--r-- | Source/SPFieldMapperController.m | 3 | ||||
-rw-r--r-- | Source/SPMenuAdditions.h | 33 | ||||
-rw-r--r-- | Source/SPMenuAdditions.m | 40 | ||||
-rw-r--r-- | Source/SPTablesList.m | 3 | ||||
-rw-r--r-- | sequel-pro.xcodeproj/project.pbxproj | 6 |
12 files changed, 91 insertions, 5 deletions
diff --git a/Resources/English.lproj/BundleEditor.strings b/Resources/English.lproj/BundleEditor.strings Binary files differindex 07aa2356..34048acb 100644 --- a/Resources/English.lproj/BundleEditor.strings +++ b/Resources/English.lproj/BundleEditor.strings diff --git a/Resources/English.lproj/Localizable.strings b/Resources/English.lproj/Localizable.strings Binary files differindex 9b8ab5cd..341a58be 100644 --- a/Resources/English.lproj/Localizable.strings +++ b/Resources/English.lproj/Localizable.strings diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 04bb07ab..55eb4e17 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -1145,7 +1145,7 @@ NSMenu *menu = [[[NSApp mainMenu] itemWithTag:SPMainMenuBundles] submenu]; // Clean menu - [menu removeAllItems]; + [menu compatibleRemoveAllItems]; NSString *bundlePath = [[NSFileManager defaultManager] applicationSupportDirectoryForSubDirectory:SPBundleSupportFolder createIfNotExists:NO error:nil]; diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index bddc7a22..71f036e4 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -24,6 +24,7 @@ #import "SPBundleEditorController.h" #import "SPArrayAdditions.h" +#import "SPMenuAdditions.h" #define kBundleNameKey @"bundleName" #define kChildrenKey @"_children_" @@ -223,7 +224,7 @@ [inputNonePopUpMenu addItem:anItem]; [anItem release]; - [inputGeneralScopePopUpMenu removeAllItems]; + [inputGeneralScopePopUpMenu compatibleRemoveAllItems]; anItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"General", @"general scope menu label") action:@selector(scopeButtonChanged:) keyEquivalent:@""]; [anItem setTag:kGeneralScopeArrayIndex]; [inputGeneralScopePopUpMenu addItem:anItem]; diff --git a/Source/SPCategoryAdditions.h b/Source/SPCategoryAdditions.h index f1d6b6a2..347dd957 100644 --- a/Source/SPCategoryAdditions.h +++ b/Source/SPCategoryAdditions.h @@ -34,6 +34,7 @@ #import "SPTextViewAdditions.h" #import "SPWindowAdditions.h" #import "SPDataAdditions.h" +#import "SPMenuAdditions.h" #import "SPNotLoaded.h" #import "SPMainThreadTrampoline.h" #import "SPColorAdditions.h" diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index be5f1155..4b52b39d 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -5220,7 +5220,7 @@ SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, parentWindow, self, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"Unable to connect to database %@.\nBe sure that you have the necessary privileges.", @"message of panel when connection to db failed after selecting from popupbutton"), targetDatabaseName]); // Update the database list - [self setDatabases:self]; + [[self onMainThread] setDatabases:self]; } [self endTask]; diff --git a/Source/SPEditorPreferencePane.m b/Source/SPEditorPreferencePane.m index a57980be..6176c742 100644 --- a/Source/SPEditorPreferencePane.m +++ b/Source/SPEditorPreferencePane.m @@ -27,6 +27,7 @@ #import "SPPreferenceController.h" #import "SPColorWellCell.h" #import "SPAlertSheets.h" +#import "SPCategoryAdditions.h" @interface SPEditorPreferencePane (PrivateAPI) @@ -334,7 +335,7 @@ [defaultItem setTarget:self]; // Build theme selection submenu - [themeSelectionMenu removeAllItems]; + [themeSelectionMenu compatibleRemoveAllItems]; [themeSelectionMenu addItem:defaultItem]; [themeSelectionMenu addItem:[NSMenuItem separatorItem]]; diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index 0be1c4d4..e70a7c25 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -28,6 +28,7 @@ #import "SPTablesList.h" #import "SPTextView.h" #import "SPTableView.h" +#import "SPCategoryAdditions.h" #define SP_NUMBER_OF_RECORDS_STRING NSLocalizedString(@"%ld of %@%lu records", @"Label showing the index of the selected CSV row") @@ -1883,7 +1884,7 @@ static const NSString *SPTableViewSqlColumnID = @"sql"; [prefs setObject:recents forKey:SPGlobalValueHistory]; // Re-init recent menu - [recentGlobalValueMenu removeAllItems]; + [recentGlobalValueMenu compatibleRemoveAllItems]; for(id item in recents) [recentGlobalValueMenu addItemWithTitle:item action:@selector(insertRecentGlobalValue:) keyEquivalent:@""]; diff --git a/Source/SPMenuAdditions.h b/Source/SPMenuAdditions.h new file mode 100644 index 00000000..88d0129b --- /dev/null +++ b/Source/SPMenuAdditions.h @@ -0,0 +1,33 @@ +// +// $Id$ +// +// SPMenuAdditions.h +// sequel-pro +// +// Created by Rowan Beentje on November 27, 2010 +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// More info at <http://code.google.com/p/sequel-pro/> + +#import <Cocoa/Cocoa.h> + + +@interface NSMenu (SPMenuAdditions) + +// Add a 10.5-compatible removeAllItems +- (void)compatibleRemoveAllItems; + +@end diff --git a/Source/SPMenuAdditions.m b/Source/SPMenuAdditions.m new file mode 100644 index 00000000..45bde232 --- /dev/null +++ b/Source/SPMenuAdditions.m @@ -0,0 +1,40 @@ +// +// $Id$ +// +// SPMenuAdditions.m +// sequel-pro +// +// Created by Rowan Beentje on November 27, 2010 +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// More info at <http://code.google.com/p/sequel-pro/> + +#import "SPMenuAdditions.h" + + +@implementation NSMenu (SPMenuAdditions) + +// Add a 10.5-compatible removeAllItems +- (void)compatibleRemoveAllItems +{ + if ([self respondsToSelector:@selector(removeAllItems)]) { + [self removeAllItems]; + } else { + while ([self numberOfItems]) [self removeItemAtIndex:0]; + } +} + +@end diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index 45999ea1..bbc40164 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -1443,6 +1443,9 @@ // Disallow selection while the document is working on a task if ([tableDocumentInstance isWorking]) return NO; + // Allow deselections + if (rowIndex == -1) return YES; + if(![[filteredTables objectAtIndex:rowIndex] isKindOfClass:[NSString class]]) return NO; diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 230530df..5283eb72 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -314,6 +314,7 @@ 58DA8863103E15B5000B98DF /* SPLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DA8862103E15B5000B98DF /* SPLogger.m */; }; 58DC0D5F1293293400B76DA5 /* ShortcutRecorder.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 58DC0D5E1293293400B76DA5 /* ShortcutRecorder.framework */; }; 58DC0D7C12932AB200B76DA5 /* ShortcutRecorder.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 58DC0D5E1293293400B76DA5 /* ShortcutRecorder.framework */; }; + 58DC10D312A1B8DF00B76DA5 /* SPMenuAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC10D212A1B8DF00B76DA5 /* SPMenuAdditions.m */; }; 58E205FC1234FE4F00A97059 /* KeyTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 58E205FB1234FE4F00A97059 /* KeyTemplate.pdf */; }; 58FEF16D0F23D66600518E8E /* SPSQLParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 58FEF16C0F23D66600518E8E /* SPSQLParser.m */; }; 58FEF57E0F3B4E9700518E8E /* SPTableData.m in Sources */ = {isa = PBXBuildFile; fileRef = 58FEF57D0F3B4E9700518E8E /* SPTableData.m */; }; @@ -1025,6 +1026,8 @@ 58DA8861103E15B5000B98DF /* SPLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPLogger.h; sourceTree = "<group>"; }; 58DA8862103E15B5000B98DF /* SPLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPLogger.m; sourceTree = "<group>"; }; 58DC0D5E1293293400B76DA5 /* ShortcutRecorder.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ShortcutRecorder.framework; path = Frameworks/ShortcutRecorder.framework; sourceTree = "<group>"; }; + 58DC10D112A1B8DF00B76DA5 /* SPMenuAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPMenuAdditions.h; sourceTree = "<group>"; }; + 58DC10D212A1B8DF00B76DA5 /* SPMenuAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPMenuAdditions.m; sourceTree = "<group>"; }; 58E205FB1234FE4F00A97059 /* KeyTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = KeyTemplate.pdf; sourceTree = "<group>"; }; 58FEF16B0F23D66600518E8E /* SPSQLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPSQLParser.h; sourceTree = "<group>"; }; 58FEF16C0F23D66600518E8E /* SPSQLParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPSQLParser.m; sourceTree = "<group>"; }; @@ -2430,6 +2433,8 @@ B52460D40F8EF92300171639 /* SPArrayAdditions.m */, 1789343A0F30C1DD0097539A /* SPStringAdditions.h */, 1789343B0F30C1DD0097539A /* SPStringAdditions.m */, + 58DC10D112A1B8DF00B76DA5 /* SPMenuAdditions.h */, + 58DC10D212A1B8DF00B76DA5 /* SPMenuAdditions.m */, B52460D50F8EF92300171639 /* SPTextViewAdditions.h */, B52460D60F8EF92300171639 /* SPTextViewAdditions.m */, B57747D70F7A8990003B34F9 /* SPWindowAdditions.h */, @@ -3117,6 +3122,7 @@ BC68BFC7128D4EAE004907D9 /* SPBundleEditorController.m in Sources */, BC1944D01297291800A236CD /* SPBundleCommandTextView.m in Sources */, BC77C5E4129AA69E009AD832 /* SPBundleHTMLOutputController.m in Sources */, + 58DC10D312A1B8DF00B76DA5 /* SPMenuAdditions.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; |