diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-02-25 22:46:54 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-02-25 22:46:54 +0000 |
commit | 947cb3e7725ee0e67cd0b2a22c34c5c1122d6cc3 (patch) | |
tree | a651086f83f8c98d96c72b3b624d56bd0608e4db /Source/TablesList.m | |
parent | 429879a5060d5fe0a27794a1e53b131ab04dba91 (diff) | |
download | sequelpro-947cb3e7725ee0e67cd0b2a22c34c5c1122d6cc3.tar.gz sequelpro-947cb3e7725ee0e67cd0b2a22c34c5c1122d6cc3.tar.bz2 sequelpro-947cb3e7725ee0e67cd0b2a22c34c5c1122d6cc3.zip |
• Query Favorites:
- added snippet variable $SP_SELECTED_TABLES which inserts `table1`,`table2`, etc. (ONLY tables)
• improved "Check Table"
- now one can select more than one table to execute "CHECK TABLE table1,table2,… ; if all tables passed successfully alert OK, if not show the result as accessory table in the sheet
note: OPTIMIZE, REPAIR, FLUSH, CHECKSUM, ANALYZE follow
Diffstat (limited to 'Source/TablesList.m')
-rw-r--r-- | Source/TablesList.m | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Source/TablesList.m b/Source/TablesList.m index af7f6fdc..3ca55f43 100644 --- a/Source/TablesList.m +++ b/Source/TablesList.m @@ -822,6 +822,10 @@ [separatorTableMenuItem setHidden:YES]; [separatorTableContextMenuItem setHidden:YES]; + NSMenu *tableSubMenu = [[[NSApp mainMenu] itemWithTitle:@"Table"] submenu]; + [[tableSubMenu itemAtIndex:3] setTitle:NSLocalizedString(@"Check Selected Items", @"check selected items menu item")]; + + // set window title [tableWindow setTitle:[tableDocumentInstance displaySPName]]; @@ -980,6 +984,36 @@ #pragma mark - #pragma mark Getter methods + +- (NSArray *)selectedTableNames +{ + NSIndexSet *indexes = [tablesListView selectedRowIndexes]; + + NSUInteger currentIndex = [indexes firstIndex]; + NSMutableArray *selTables = [NSMutableArray array]; + + while (currentIndex != NSNotFound) { + if([[filteredTableTypes objectAtIndex:currentIndex] integerValue] == SP_TABLETYPE_TABLE) + [selTables addObject:[filteredTables objectAtIndex:currentIndex]]; + currentIndex = [indexes indexGreaterThanIndex:currentIndex]; + } + return selTables; +} + +- (NSArray *)selectedTableItems +{ + NSIndexSet *indexes = [tablesListView selectedRowIndexes]; + + NSUInteger currentIndex = [indexes firstIndex]; + NSMutableArray *selTables = [NSMutableArray array]; + + while (currentIndex != NSNotFound) { + [selTables addObject:[filteredTables objectAtIndex:currentIndex]]; + currentIndex = [indexes indexGreaterThanIndex:currentIndex]; + } + return selTables; +} + /** * Returns the currently selected table or nil if no table or mulitple tables are selected */ |