From 7dfafb60062fc150f71bba694810cd8d328efd00 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Fri, 17 Sep 2010 20:06:37 +0000 Subject: New add index sheet, which includes: - The ability to easily index multiple columns - The ability to specify the storage type (HASH or BTREE) that should be used when available and permitted - The ability to specify a length prefix when indexing a specific column (required on TEXT columns) Requires lots of testing. --- Source/SPIndexesController.h | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) (limited to 'Source/SPIndexesController.h') diff --git a/Source/SPIndexesController.h b/Source/SPIndexesController.h index 8fe7c88d..cd049e57 100644 --- a/Source/SPIndexesController.h +++ b/Source/SPIndexesController.h @@ -23,7 +23,13 @@ // // More info at -@class SPDatabaseDocument, SPTablesList, SPTableData, SPTableStructure, MCPConnection; +@class SPDatabaseDocument, SPTablesList, SPTableData, SPTableStructure, MCPConnection, BWAnchoredButtonBar; + +// Constants +extern NSString *SPNewIndexIndexName; +extern NSString *SPNewIndexIndexType; +extern NSString *SPNewIndexIndexedColumns; +extern NSString *SPNewIndexStorageType; @interface SPIndexesController : NSWindowController { @@ -41,18 +47,45 @@ // New index sheet IBOutlet NSPopUpButton *indexTypePopUpButton; IBOutlet NSTextField *indexNameTextField; - IBOutlet NSComboBox *indexedColumnsComboBox; + IBOutlet NSTableView *indexedColumnsTableView; + IBOutlet NSScrollView *indexedColumnsScrollView; + IBOutlet NSTextField *indexTypeLabel; + IBOutlet NSTextField *indexNameLabel; + IBOutlet NSTableColumn *indexSizeTableColumn; + IBOutlet NSButton *addIndexedColumnButton; + IBOutlet NSButton *removeIndexedColumnButton; + IBOutlet NSButton *confirmAddIndexButton; + IBOutlet BWAnchoredButtonBar *anchoredButtonBar; + // Advanced options view + IBOutlet NSButton *indexAdvancedOptionsViewButton; + IBOutlet NSView *indexAdvancedOptionsView; + IBOutlet NSButton *indexAdvancedOptionsViewLabelButton; + IBOutlet NSPopUpButton *indexStorageTypePopUpButton; + NSString *table; - NSMutableArray *fields, *indexes; + NSMutableArray *fields, *indexes, *indexedFields, *supportsLength, *requiresLength; NSUserDefaults *prefs; MCPConnection *connection; + + BOOL showAdvancedView; + + NSInteger heightOffset; + NSUInteger windowMinWidth; + NSUInteger windowMinHeigth; } +/** + * @property table The table currently being viewed + */ @property (readwrite, retain) NSString *table; + +/** + * @property connection The MySQL connection to use + */ @property (readwrite, assign) MCPConnection *connection; - (IBAction)addIndex:(id)sender; @@ -60,6 +93,10 @@ - (IBAction)chooseIndexType:(id)sender; - (IBAction)closeSheet:(id)sender; +- (IBAction)addIndexedField:(id)sender; +- (IBAction)removeIndexedField:(id)sender; +- (IBAction)toggleAdvancedIndexOptionsView:(id)sender; + - (void)setFields:(NSArray *)tableFields; - (void)setIndexes:(NSArray *)tableIndexes; -- cgit v1.2.3