From b0699390ce20fa73ddbb704b4532a10716ae9cab Mon Sep 17 00:00:00 2001 From: avenjamin Date: Fri, 5 Dec 2008 16:22:43 +0000 Subject: TableDump --- Field mapping when importing CSV file now makes more sense. You can import data into multiple columns in the table. Known Issue: changing table while field mapping doesn't work. Select the table first before importing TableContent --- Partially solves issue where label at bottom "x of y rows selected" wasn't being updated TablesList --- Moved table delegate methods under correct pragma mark --- TableContent.m | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'TableContent.m') diff --git a/TableContent.m b/TableContent.m index 60045a75..7fda874c 100644 --- a/TableContent.m +++ b/TableContent.m @@ -1538,7 +1538,9 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn } } -//tableView delegate methods +#pragma mark - +#pragma mark tableView delegate methods + - (void)tableView:(NSTableView*)tableView didClickTableColumn:(NSTableColumn *)tableColumn /* sorts the tableView by the clicked column @@ -1633,6 +1635,33 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn return [self addRowToDB]; } +- (void)tableViewSelectionDidChange:(NSNotification *)aNotification +{ + // Check our notification object is our table content view + if ([aNotification object] != tableContentView) + return; + + if ( [tableContentView numberOfSelectedRows] > 0 ) { + [countText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"%d of %d rows selected", @"Text showing how many rows are selected"), [tableContentView numberOfSelectedRows], [tableContentView numberOfRows]]]; + } else { + [countText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"%d rows", @"Text showing how many rows are in the result"), [tableContentView numberOfRows]]]; + } +} + +- (void)tableViewSelectionIsChanging:(NSNotification *)aNotification +{ + // Check our notification object is our table content view + if ([aNotification object] != tableContentView) + return; + + if ( [tableContentView numberOfSelectedRows] > 0 ) { + [countText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"%d of %d rows selected", @"Text showing how many rows are selected"), [tableContentView numberOfSelectedRows], [tableContentView numberOfRows]]]; + } else { + [countText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"%d rows", @"Text showing how many rows are in the result"), [tableContentView numberOfRows]]]; + } +} + + - (void)tableViewColumnDidResize:(NSNotification *)aNotification /* saves the new column size in the preferences @@ -1815,6 +1844,8 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn return NO; } +#pragma mark - + - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command /* traps enter and esc an make/cancel editing without entering next row -- cgit v1.2.3