diff options
author | rowanbeentje <rowan@beent.je> | 2009-07-30 00:20:52 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-07-30 00:20:52 +0000 |
commit | 9e72b900075cb73e32254754faea71882f1b8299 (patch) | |
tree | a5515497616be0cd525b24d149300895b5d604ac /Source/TableDocument.m | |
parent | 24cdce10cbd4817682b0ecaf2b834f7dc18cb3b5 (diff) | |
download | sequelpro-9e72b900075cb73e32254754faea71882f1b8299.tar.gz sequelpro-9e72b900075cb73e32254754faea71882f1b8299.tar.bz2 sequelpro-9e72b900075cb73e32254754faea71882f1b8299.zip |
- Add an initial barebones version of the history controller, with a basic toolbar item to navigate backwards and forwards. TBC!
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 00c31a15..76e0337b 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -43,6 +43,7 @@ #import "MainController.h" #import "SPExtendedTableInfo.h" #import "SPConnectionController.h" +#import "SPHistoryController.h" #import "SPPreferenceController.h" #import "SPPrintAccessory.h" #import "QLPreviewPanel.h" @@ -168,6 +169,7 @@ if ([connectionController database] && ![[connectionController database] isEqualToString:@""]) { if (selectedDatabase) [selectedDatabase release], selectedDatabase = nil; selectedDatabase = [[NSString alloc] initWithString:[connectionController database]]; + [spHistoryControllerInstance updateHistoryEntries]; } // Update the database list @@ -416,6 +418,9 @@ [tablesListInstance setConnection:mySQLConnection]; [tableDumpInstance setConnection:mySQLConnection]; [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@/%@", mySQLVersion, [self name], [self database]]]; + + // Add a history entry + [spHistoryControllerInstance updateHistoryEntries]; } /** @@ -1550,6 +1555,7 @@ [tableTabView selectTabViewItemAtIndex:0]; [mainToolbar setSelectedItemIdentifier:@"SwitchToTableStructureToolbarItemIdentifier"]; + [spHistoryControllerInstance updateHistoryEntries]; } - (IBAction)viewContent:(id)sender @@ -1563,6 +1569,7 @@ [tableTabView selectTabViewItemAtIndex:1]; [mainToolbar setSelectedItemIdentifier:@"SwitchToTableContentToolbarItemIdentifier"]; + [spHistoryControllerInstance updateHistoryEntries]; } - (IBAction)viewQuery:(id)sender @@ -1583,6 +1590,7 @@ [tableTabView selectTabViewItemAtIndex:2]; [mainToolbar setSelectedItemIdentifier:@"SwitchToRunQueryToolbarItemIdentifier"]; + [spHistoryControllerInstance updateHistoryEntries]; // Set the focus on the text field if no query has been run if (![[customQueryTextView string] length]) [tableWindow makeFirstResponder:customQueryTextView]; @@ -1606,6 +1614,7 @@ [tableTabView selectTabViewItemAtIndex:3]; [mainToolbar setSelectedItemIdentifier:@"SwitchToTableInfoToolbarItemIdentifier"]; + [spHistoryControllerInstance updateHistoryEntries]; } - (IBAction)viewRelations:(id)sender @@ -1626,6 +1635,7 @@ [tableTabView selectTabViewItemAtIndex:4]; [mainToolbar setSelectedItemIdentifier:@"SwitchToTableRelationsToolbarItemIdentifier"]; + [spHistoryControllerInstance updateHistoryEntries]; } @@ -1751,7 +1761,12 @@ chooseDatabaseToolbarItem = toolbarItem; [self updateChooseDatabaseToolbarItemWidth]; } - + + } else if ([itemIdentifier isEqualToString:@"HistoryNavigationToolbarItemIdentifier"]) { + [toolbarItem setLabel:NSLocalizedString(@"History", @"toolbar item for navigation history")]; + [toolbarItem setPaletteLabel:[toolbarItem label]]; + [toolbarItem setView:historyControl]; + } else if ([itemIdentifier isEqualToString:@"ToggleConsoleIdentifier"]) { //set the text label to be displayed in the toolbar and customization palette [toolbarItem setPaletteLabel:NSLocalizedString(@"Show/Hide Console", @"toolbar item for show/hide console")]; @@ -1847,6 +1862,7 @@ { return [NSArray arrayWithObjects: @"DatabaseSelectToolbarItemIdentifier", + @"HistoryNavigationToolbarItemIdentifier", @"ToggleConsoleIdentifier", @"ClearConsoleIdentifier", @"FlushPrivilegesIdentifier", |