aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableContent.h
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-08-11 00:42:06 +0000
committerrowanbeentje <rowan@beent.je>2009-08-11 00:42:06 +0000
commitb7c070b098a053175a62b60d27ac10fe10aed72e (patch)
tree2bdd10dda78249031a8c7ac2d6d7d283ba8d189f /Source/TableContent.h
parentc02b45604808b6ffb6c41e671f4a0595ad13741c (diff)
downloadsequelpro-b7c070b098a053175a62b60d27ac10fe10aed72e.tar.gz
sequelpro-b7c070b098a053175a62b60d27ac10fe10aed72e.tar.bz2
sequelpro-b7c070b098a053175a62b60d27ac10fe10aed72e.zip
Rework data loading in TableContent:
- Data loading now only occurs in one place in the code. This improves consistency and fixes a number of actions which used to trigger a full table reload followed instantly by a filter when the action was performed - If "Reload data after..." prefs are unticked, no longer load the data (ie the preference now works) - Make table count text more consistent and useful - Fix a number of small position-saving type problems with filters and limits active. This fixes Issue #200. - Clean up and standardise the code dealing with data storage - only one data storage array is now used.
Diffstat (limited to 'Source/TableContent.h')
-rw-r--r--Source/TableContent.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/Source/TableContent.h b/Source/TableContent.h
index ba9d9b51..ea09a325 100644
--- a/Source/TableContent.h
+++ b/Source/TableContent.h
@@ -51,18 +51,17 @@
IBOutlet id limitRowsField;
IBOutlet id limitRowsButton;
IBOutlet id limitRowsStepper;
- IBOutlet id limitRowsText;
MCPConnection *mySQLConnection;
NSString *selectedTable, *usedQuery;
- NSMutableArray *fullResult, *filteredResult, *dataColumns, *keys, *oldRow;
+ NSMutableArray *tableValues, *dataColumns, *keys, *oldRow;
NSString *compareType;
NSNumber *sortCol;
BOOL isEditingRow, isEditingNewRow, isSavingRow, isDesc, setLimit;
+ BOOL isFiltered, isLimited;
NSUserDefaults *prefs;
int numRows, currentlyEditingRow, maxNumRowsOfCurrentTable;
- bool areShowingAllRows;
BOOL sortColumnToRestoreIsAsc;
NSString *sortColumnToRestore;
@@ -72,15 +71,18 @@
NSString *filterFieldToRestore, *filterComparisonToRestore, *filterValueToRestore;
}
-//table methods
-- (void)loadTable:(NSString *)aTable;
-- (IBAction)reloadTable:(id)sender;
-- (IBAction)reloadTableValues:(id)sender;
-- (IBAction)filterTable:(id)sender;
-- (IBAction)showAll:(id)sender;
-- (IBAction)toggleFilterField:(id)sender;
-- (NSString *)usedQuery;
-- (void)setUsedQuery:(NSString *)query;
+// Table loading methods and information
+- (void) loadTable:(NSString *)aTable;
+- (void) loadTableValues;
+- (NSString *) tableFilterString;
+- (void) updateCountText;
+
+// Table interface actions
+- (IBAction) reloadTable:(id)sender;
+- (IBAction) filterTable:(id)sender;
+- (IBAction) toggleFilterField:(id)sender;
+- (NSString *) usedQuery;
+- (void) setUsedQuery:(NSString *)query;
//edit methods
- (IBAction)addRow:(id)sender;
@@ -135,7 +137,6 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn
//tableView delegate methods
- (void)tableView:(NSTableView*)tableView didClickTableColumn:(NSTableColumn *)tableColumn;
- (void)tableViewSelectionDidChange:(NSNotification *)aNotification;
-- (void)tableViewSelectionIsChanging:(NSNotification *)aNotification;
- (void)tableViewColumnDidResize:(NSNotification *)aNotification;
- (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex;
- (BOOL)tableView:(NSTableView *)tableView writeRows:(NSArray*)rows toPasteboard:(NSPasteboard*)pboard;