From 3d6ee35bc6b8fa082e31761caef5276506e17707 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sat, 4 Apr 2009 16:14:37 +0000 Subject: - Change the method of creating a new table to be the same as that when creating a new database by presenting a sheet, allowing the user to specify the table name and encoding. - Allowing the user to specify the table encoding partially addresses issue #161. - Implementing interface validation in the form of not allowing table creation without a name also removes the need for lots of error checking and presenting these errors to the user. - In addition to the above the ability to specify the initial field name, type and length (if applicable) of a new table can now be done on the same sheet, but is yet to be implemented. - Also did a general tidy up of TablesList.[hm]. --- Source/TablesList.h | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) (limited to 'Source/TablesList.h') diff --git a/Source/TablesList.h b/Source/TablesList.h index b4875dd9..76b49609 100644 --- a/Source/TablesList.h +++ b/Source/TablesList.h @@ -31,8 +31,7 @@ enum sp_table_types SP_TABLETYPE_VIEW = 1 }; -@class CMMCResult; -@class CMMCPConnection; +@class CMMCResult, CMMCPConnection; @interface TablesList : NSObject { @@ -50,32 +49,35 @@ enum sp_table_types IBOutlet id copyTableNameField; IBOutlet id copyTableContentSwitch; IBOutlet id tabView; + IBOutlet id tableSheet; + IBOutlet id tableNameField; + IBOutlet id tableEncodingButton; + IBOutlet id addTableButton; CMMCPConnection *mySQLConnection; + NSMutableArray *tables; NSMutableArray *tableTypes; -// NSUserDefaults *prefs; + BOOL structureLoaded, contentLoaded, statusLoaded, alertSheetOpened; } -//IBAction methods +// IBAction methods - (IBAction)updateTables:(id)sender; - (IBAction)addTable:(id)sender; +- (IBAction)closeTableSheet:(id)sender; - (IBAction)removeTable:(id)sender; - (IBAction)copyTable:(id)sender; -//alert sheet methods -- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(NSString *)contextInfo; - -//copyTableSheet methods +// copyTableSheet methods - (IBAction)closeCopyTableSheet:(id)sender; -//additional methods +// Additional methods - (void)removeTable; - (void)setConnection:(CMMCPConnection *)theConnection; - (void)doPerformQueryService:(NSString *)query; -//getter methods +// Getters - (NSString *)tableName; - (int)tableType; - (NSArray *)tables; @@ -84,22 +86,7 @@ enum sp_table_types - (BOOL)contentLoaded; - (BOOL)statusLoaded; -// Setter methods +// Setters - (void)setContentRequiresReload:(BOOL)reload; -//tableView datasource methods -- (int)numberOfRowsInTableView:(NSTableView *)aTableView; -- (id)tableView:(NSTableView *)aTableView - objectValueForTableColumn:(NSTableColumn *)aTableColumn - row:(int)rowIndex; -- (void)tableView:(NSTableView *)aTableView - setObjectValue:(id)anObject - forTableColumn:(NSTableColumn *)aTableColumn - row:(int)rowIndex; - -//tableView delegate methods -- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command; -- (BOOL)selectionShouldChangeInTableView:(NSTableView *)aTableView; -- (void)tableViewSelectionDidChange:(NSNotification *)aNotification; - @end -- cgit v1.2.3