From e188d1d53a1b1f8cf96d8ce82221f2013e63c23b Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Fri, 4 May 2012 14:42:34 +0000 Subject: Rename database action class. --- Source/SPDBActionCommons.h | 51 ------------------------------------ Source/SPDBActionCommons.m | 33 ----------------------- Source/SPDatabaseAction.h | 51 ++++++++++++++++++++++++++++++++++++ Source/SPDatabaseAction.m | 33 +++++++++++++++++++++++ Source/SPDatabaseCopy.h | 4 +-- Source/SPDatabaseCopy.m | 1 - Source/SPDatabaseRename.h | 4 +-- Source/SPDatabaseRename.m | 1 - Source/SPTableCopy.h | 4 +-- Source/SPTableCopy.m | 1 - Source/SPViewCopy.h | 4 ++- Source/SPViewCopy.m | 1 - sequel-pro.xcodeproj/project.pbxproj | 12 ++++----- 13 files changed, 99 insertions(+), 101 deletions(-) delete mode 100644 Source/SPDBActionCommons.h delete mode 100644 Source/SPDBActionCommons.m create mode 100644 Source/SPDatabaseAction.h create mode 100644 Source/SPDatabaseAction.m diff --git a/Source/SPDBActionCommons.h b/Source/SPDBActionCommons.h deleted file mode 100644 index 5b467e1d..00000000 --- a/Source/SPDBActionCommons.h +++ /dev/null @@ -1,51 +0,0 @@ -// -// $Id$ -// -// SPDBActionCommons.h -// sequel-pro -// -// Created by David Rekowski on Apr 29, 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 - -#import - -@class SPTablesList; - -@interface SPDBActionCommons : NSObject -{ - NSWindow *messageWindow; - SPTablesList *tablesList; - SPMySQLConnection *connection; -} - -/** - * @property connection References the SPMySQL.framework MySQL connection; it has to be set. - */ -@property (readwrite, assign) SPMySQLConnection *connection; - -/** - * @property messageWindow The NSWindow instance to send message sheets to. - */ -@property (readwrite, assign) NSWindow *messageWindow; - -/** - * @property tablesList - */ -@property (readwrite, assign) SPTablesList *tablesList; - -@end diff --git a/Source/SPDBActionCommons.m b/Source/SPDBActionCommons.m deleted file mode 100644 index c12751cf..00000000 --- a/Source/SPDBActionCommons.m +++ /dev/null @@ -1,33 +0,0 @@ -// -// $Id$ -// -// SPDBActionCommons.m -// sequel-pro -// -// Created by David Rekowski on Apr 29, 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 - -#import "SPDBActionCommons.h" - -@implementation SPDBActionCommons - -@synthesize connection; -@synthesize messageWindow; -@synthesize tablesList; - -@end diff --git a/Source/SPDatabaseAction.h b/Source/SPDatabaseAction.h new file mode 100644 index 00000000..a5d27218 --- /dev/null +++ b/Source/SPDatabaseAction.h @@ -0,0 +1,51 @@ +// +// $Id$ +// +// SPDBActionCommons.h +// sequel-pro +// +// Created by David Rekowski on Apr 29, 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 + +#import + +@class SPTablesList; + +@interface SPDatabaseAction : NSObject +{ + NSWindow *messageWindow; + SPTablesList *tablesList; + SPMySQLConnection *connection; +} + +/** + * @property connection References the SPMySQL.framework MySQL connection; it has to be set. + */ +@property (readwrite, assign) SPMySQLConnection *connection; + +/** + * @property messageWindow The NSWindow instance to send message sheets to. + */ +@property (readwrite, assign) NSWindow *messageWindow; + +/** + * @property tablesList + */ +@property (readwrite, assign) SPTablesList *tablesList; + +@end diff --git a/Source/SPDatabaseAction.m b/Source/SPDatabaseAction.m new file mode 100644 index 00000000..83509360 --- /dev/null +++ b/Source/SPDatabaseAction.m @@ -0,0 +1,33 @@ +// +// $Id$ +// +// SPDBActionCommons.m +// sequel-pro +// +// Created by David Rekowski on Apr 29, 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 + +#import "SPDatabaseAction.h" + +@implementation SPDatabaseAction + +@synthesize connection; +@synthesize messageWindow; +@synthesize tablesList; + +@end diff --git a/Source/SPDatabaseCopy.h b/Source/SPDatabaseCopy.h index 41a22ff0..392c6081 100644 --- a/Source/SPDatabaseCopy.h +++ b/Source/SPDatabaseCopy.h @@ -22,12 +22,12 @@ // // More info at -#import "SPDBActionCommons.h" +#import "SPDatabaseAction.h" /** * The SPDatabaseCopy class povides functionality to create a copy of a database. */ -@interface SPDatabaseCopy : SPDBActionCommons +@interface SPDatabaseCopy : SPDatabaseAction /** * This method clones an existing database. diff --git a/Source/SPDatabaseCopy.m b/Source/SPDatabaseCopy.m index 130f5d99..1425a4ee 100644 --- a/Source/SPDatabaseCopy.m +++ b/Source/SPDatabaseCopy.m @@ -22,7 +22,6 @@ // // More info at -#import "SPDBActionCommons.h" #import "SPDatabaseCopy.h" #import "SPTableCopy.h" diff --git a/Source/SPDatabaseRename.h b/Source/SPDatabaseRename.h index e097c741..d81f9618 100644 --- a/Source/SPDatabaseRename.h +++ b/Source/SPDatabaseRename.h @@ -22,12 +22,12 @@ // // More info at -#import "SPDBActionCommons.h" +#import "SPDatabaseAction.h" /** * The SPDatabaseRename class povides functionality to rename a database. */ -@interface SPDatabaseRename : SPDBActionCommons +@interface SPDatabaseRename : SPDatabaseAction /** * This method renames an existing database. diff --git a/Source/SPDatabaseRename.m b/Source/SPDatabaseRename.m index 85763c7f..83fa7d07 100644 --- a/Source/SPDatabaseRename.m +++ b/Source/SPDatabaseRename.m @@ -22,7 +22,6 @@ // // More info at -#import "SPDBActionCommons.h" #import "SPDatabaseRename.h" #import "SPTableCopy.h" #import "SPViewCopy.h" diff --git a/Source/SPTableCopy.h b/Source/SPTableCopy.h index e32560aa..df6aaaa7 100644 --- a/Source/SPTableCopy.h +++ b/Source/SPTableCopy.h @@ -22,12 +22,12 @@ // // More info at -#import "SPDBActionCommons.h" +#import "SPDatabaseAction.h" /** * The SPTableCopy class povides functionality to copy tables between databases. */ -@interface SPTableCopy : SPDBActionCommons +@interface SPTableCopy : SPDatabaseAction /** * This method copies a table structure from one db to another. diff --git a/Source/SPTableCopy.m b/Source/SPTableCopy.m index e629e481..60869b9b 100644 --- a/Source/SPTableCopy.m +++ b/Source/SPTableCopy.m @@ -22,7 +22,6 @@ // // More info at -#import "SPDBActionCommons.h" #import "SPTableCopy.h" #import diff --git a/Source/SPViewCopy.h b/Source/SPViewCopy.h index 6f1be956..add4af77 100644 --- a/Source/SPViewCopy.h +++ b/Source/SPViewCopy.h @@ -30,7 +30,9 @@ // // More info at -@interface SPViewCopy : SPDBActionCommons +#import "SPDatabaseAction.h" + +@interface SPViewCopy : SPDatabaseAction - (BOOL)moveView:(NSString *)view from:(NSString *)sourceDatabase to:(NSString *)targetDatabase; diff --git a/Source/SPViewCopy.m b/Source/SPViewCopy.m index b7fde195..b32a08e4 100644 --- a/Source/SPViewCopy.m +++ b/Source/SPViewCopy.m @@ -30,7 +30,6 @@ // // More info at -#import "SPDBActionCommons.h" #import "SPViewCopy.h" #import diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index d06e20dc..ff8abd97 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -27,7 +27,7 @@ 1141A38A117BBFF200126A28 /* SPTableCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1141A388117BBFF200126A28 /* SPTableCopy.m */; }; 1198F5B31174EDD500670590 /* SPDatabaseCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1198F5B21174EDD500670590 /* SPDatabaseCopy.m */; }; 1198F7541174FFCF00670590 /* SPDatabaseCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1198F5B21174EDD500670590 /* SPDatabaseCopy.m */; }; - 11B55BFE1189E3B2009EF465 /* SPDBActionCommons.m in Sources */ = {isa = PBXBuildFile; fileRef = 11B55BFD1189E3B2009EF465 /* SPDBActionCommons.m */; }; + 11B55BFE1189E3B2009EF465 /* SPDatabaseAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 11B55BFD1189E3B2009EF465 /* SPDatabaseAction.m */; }; 11C211271180EC0400758039 /* SPDatabaseRename.m in Sources */ = {isa = PBXBuildFile; fileRef = 11C2109D1180E70800758039 /* SPDatabaseRename.m */; }; 11C211301180EC9A00758039 /* SPDatabaseRename.m in Sources */ = {isa = PBXBuildFile; fileRef = 11C2109D1180E70800758039 /* SPDatabaseRename.m */; }; 11D44DF0118F5887002AA43C /* OCMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 11D44DEF118F5887002AA43C /* OCMock.framework */; }; @@ -597,8 +597,8 @@ 1198F5B21174EDD500670590 /* SPDatabaseCopy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseCopy.m; sourceTree = ""; }; 1198F5C21174EF3F00670590 /* SPDatabaseCopyTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseCopyTest.h; sourceTree = ""; }; 1198F5C31174EF3F00670590 /* SPDatabaseCopyTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseCopyTest.m; sourceTree = ""; }; - 11B55BFC1189E3B2009EF465 /* SPDBActionCommons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDBActionCommons.h; sourceTree = ""; }; - 11B55BFD1189E3B2009EF465 /* SPDBActionCommons.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDBActionCommons.m; sourceTree = ""; }; + 11B55BFC1189E3B2009EF465 /* SPDatabaseAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseAction.h; sourceTree = ""; }; + 11B55BFD1189E3B2009EF465 /* SPDatabaseAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseAction.m; sourceTree = ""; }; 11C2109C1180E70800758039 /* SPDatabaseRename.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseRename.h; sourceTree = ""; }; 11C2109D1180E70800758039 /* SPDatabaseRename.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseRename.m; sourceTree = ""; }; 11C210DD1180E9B800758039 /* SPDatabaseRenameTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseRenameTest.h; sourceTree = ""; }; @@ -1400,8 +1400,8 @@ 1198F5B21174EDD500670590 /* SPDatabaseCopy.m */, 11C2109C1180E70800758039 /* SPDatabaseRename.h */, 11C2109D1180E70800758039 /* SPDatabaseRename.m */, - 11B55BFC1189E3B2009EF465 /* SPDBActionCommons.h */, - 11B55BFD1189E3B2009EF465 /* SPDBActionCommons.m */, + 11B55BFC1189E3B2009EF465 /* SPDatabaseAction.h */, + 11B55BFD1189E3B2009EF465 /* SPDatabaseAction.m */, ); name = "Database Actions"; sourceTree = ""; @@ -3232,7 +3232,7 @@ 5885CF4A116A63B200A85ACB /* SPFileHandle.m in Sources */, 1198F5B31174EDD500670590 /* SPDatabaseCopy.m in Sources */, 1141A389117BBFF200126A28 /* SPTableCopy.m in Sources */, - 11B55BFE1189E3B2009EF465 /* SPDBActionCommons.m in Sources */, + 11B55BFE1189E3B2009EF465 /* SPDatabaseAction.m in Sources */, 58A8A79111A036C000B95749 /* SPWindowController.m in Sources */, 5806B76411A991EC00813A88 /* SPDocumentController.m in Sources */, 173C837111AAD26E00B8B084 /* SPExportInitializer.m in Sources */, -- cgit v1.2.3