diff options
author | rowanbeentje <rowan@beent.je> | 2009-08-01 19:48:30 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-08-01 19:48:30 +0000 |
commit | 8b672753ae94f76308557375ea13f373143d78cd (patch) | |
tree | d5b59470f6570fbfd907a9ff214a0e0367578681 /Source/TableContent.h | |
parent | 61c1ffe21ce73752bc195e0312a6a851808601e6 (diff) | |
download | sequelpro-8b672753ae94f76308557375ea13f373143d78cd.tar.gz sequelpro-8b672753ae94f76308557375ea13f373143d78cd.tar.bz2 sequelpro-8b672753ae94f76308557375ea13f373143d78cd.zip |
- Fix an errant NSLog in TableSource
- Improve and make consistent state saving in TableContent; now saves filters and scroll position mor reliably on refresh/edit, and supports remembering and restoring which rows were selected
- Significantly improve table history - only create entries for tables switches or filters, only remember 50 items, and save view/filters/scroll position/selections in table content view
Diffstat (limited to 'Source/TableContent.h')
-rw-r--r-- | Source/TableContent.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/Source/TableContent.h b/Source/TableContent.h index 254fe9c9..ba9d9b51 100644 --- a/Source/TableContent.h +++ b/Source/TableContent.h @@ -28,13 +28,14 @@ #import <Cocoa/Cocoa.h> #import <MCPKit/MCPKit.h> -@class CMCopyTable, SPTextAndLinkCell; +@class CMCopyTable, SPTextAndLinkCell, SPHistoryController; @interface TableContent : NSObject { IBOutlet id tableDocumentInstance; IBOutlet id tablesListInstance; IBOutlet id tableDataInstance; + IBOutlet SPHistoryController *spHistoryControllerInstance; IBOutlet id tableWindow; IBOutlet CMCopyTable *tableContentView; @@ -56,14 +57,19 @@ NSString *selectedTable, *usedQuery; NSMutableArray *fullResult, *filteredResult, *dataColumns, *keys, *oldRow; - NSString *compareType, *lastField; - NSString *targetFilterColumn, *targetFilterValue; + NSString *compareType; NSNumber *sortCol; BOOL isEditingRow, isEditingNewRow, isSavingRow, isDesc, setLimit; NSUserDefaults *prefs; int numRows, currentlyEditingRow, maxNumRowsOfCurrentTable; bool areShowingAllRows; - + + BOOL sortColumnToRestoreIsAsc; + NSString *sortColumnToRestore; + unsigned int limitStartPositionToRestore; + NSIndexSet *selectionIndexToRestore; + NSRect selectionViewportToRestore; + NSString *filterFieldToRestore, *filterComparisonToRestore, *filterValueToRestore; } //table methods @@ -101,6 +107,21 @@ - (int)fetchNumberOfRows; - (BOOL)saveRowOnDeselect; +// Retrieving and setting table state +- (NSString *) sortColumnName; +- (BOOL) sortColumnIsAscending; +- (unsigned int) limitStart; +- (NSIndexSet *) selectedRowIndexes; +- (NSRect) viewport; +- (NSDictionary *) filterSettings; +- (void) setSortColumnNameToRestore:(NSString *)theSortColumnName isAscending:(BOOL)isAscending; +- (void) setLimitStartToRestore:(unsigned int)theLimitStart; +- (void) setSelectedRowIndexesToRestore:(NSIndexSet *)theIndexSet; +- (void) setViewportToRestore:(NSRect)theViewport; +- (void) setFiltersToRestore:(NSDictionary *)filterSettings; +- (void) storeCurrentDetailsForRestoration; +- (void) clearDetailsToRestore; + //tableView datasource methods - (int)numberOfRowsInTableView:(NSTableView *)aTableView; - (id)tableView:(CMCopyTable *)aTableView |