diff options
author | mltownsend <mltownsend@gmail.com> | 2008-11-21 01:12:59 +0000 |
---|---|---|
committer | mltownsend <mltownsend@gmail.com> | 2008-11-21 01:12:59 +0000 |
commit | 1f3824ec2bc2465d9fe20c30f93db9ec5281151b (patch) | |
tree | 13f771c9e9b0f026097d8038e794c16db8d97cbf | |
parent | a1fe720cf5d7b6a04e7fa2b096721bad8a9e4532 (diff) | |
download | sequelpro-1f3824ec2bc2465d9fe20c30f93db9ec5281151b.tar.gz sequelpro-1f3824ec2bc2465d9fe20c30f93db9ec5281151b.tar.bz2 sequelpro-1f3824ec2bc2465d9fe20c30f93db9ec5281151b.zip |
Issue 34 Fix. Plus fixes for some warnings.
-rw-r--r-- | English.lproj/DBView.xib | 17 | ||||
-rw-r--r-- | TableContent.m | 3 | ||||
-rw-r--r-- | TableDump.m | 19 | ||||
-rw-r--r-- | TableSource.m | 8 | ||||
-rw-r--r-- | TablesList.h | 4 | ||||
-rw-r--r-- | TablesList.m | 27 |
6 files changed, 57 insertions, 21 deletions
diff --git a/English.lproj/DBView.xib b/English.lproj/DBView.xib index 829b680d..a2280417 100644 --- a/English.lproj/DBView.xib +++ b/English.lproj/DBView.xib @@ -8,6 +8,7 @@ <string key="IBDocument.HIToolboxVersion">352.00</string> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> + <integer value="4015"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -35,7 +36,7 @@ <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> <string key="NSWindowContentMinSize">{780, 480}</string> <object class="NSView" key="NSWindowView" id="579726586"> - <nil key="NSNextResponder"/> + <reference key="NSNextResponder"/> <int key="NSvFlags">256</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -963,6 +964,7 @@ </object> <string key="NSFrame">{{1, 1}, {194, 396}}</string> <reference key="NSSuperview" ref="233472824"/> + <reference key="NSNextKeyView" ref="251040077"/> <reference key="NSDocView" ref="251040077"/> <reference key="NSBGColor" ref="1024678221"/> <int key="NScvFlags">4</int> @@ -989,6 +991,7 @@ </object> <string key="NSFrameSize">{196, 398}</string> <reference key="NSSuperview" ref="355288374"/> + <reference key="NSNextKeyView" ref="73685676"/> <int key="NSsFlags">530</int> <reference key="NSVScroller" ref="693168867"/> <reference key="NSHScroller" ref="656188692"/> @@ -1073,6 +1076,7 @@ </object> <string key="NSFrame">{{1, 1}, {194, 123}}</string> <reference key="NSSuperview" ref="298226231"/> + <reference key="NSNextKeyView" ref="347093764"/> <reference key="NSDocView" ref="347093764"/> <reference key="NSBGColor" ref="1024678221"/> <int key="NScvFlags">4</int> @@ -1099,6 +1103,7 @@ </object> <string key="NSFrame">{{0, 407}, {196, 125}}</string> <reference key="NSSuperview" ref="355288374"/> + <reference key="NSNextKeyView" ref="685057119"/> <int key="NSsFlags">530</int> <reference key="NSVScroller" ref="245346414"/> <reference key="NSHScroller" ref="353686052"/> @@ -1851,6 +1856,7 @@ </object> <string key="NSFrame">{{1, 17}, {626, 282}}</string> <reference key="NSSuperview" ref="22340145"/> + <reference key="NSNextKeyView" ref="715508012"/> <reference key="NSDocView" ref="715508012"/> <reference key="NSBGColor" ref="1024678221"/> <int key="NScvFlags">4</int> @@ -1883,6 +1889,7 @@ </object> <string key="NSFrame">{{1, 0}, {626, 17}}</string> <reference key="NSSuperview" ref="22340145"/> + <reference key="NSNextKeyView" ref="926883367"/> <reference key="NSDocView" ref="926883367"/> <reference key="NSBGColor" ref="1024678221"/> <int key="NScvFlags">4</int> @@ -1891,6 +1898,7 @@ </object> <string key="NSFrame">{{-1, 24}, {628, 300}}</string> <reference key="NSSuperview" ref="220777809"/> + <reference key="NSNextKeyView" ref="16936123"/> <int key="NSsFlags">562</int> <reference key="NSVScroller" ref="943144555"/> <reference key="NSHScroller" ref="456666876"/> @@ -2321,6 +2329,7 @@ </object> <string key="NSFrame">{{1, 17}, {626, 138}}</string> <reference key="NSSuperview" ref="376224367"/> + <reference key="NSNextKeyView" ref="584834515"/> <reference key="NSDocView" ref="584834515"/> <reference key="NSBGColor" ref="1024678221"/> <int key="NScvFlags">4</int> @@ -2353,6 +2362,7 @@ </object> <string key="NSFrame">{{1, 0}, {626, 17}}</string> <reference key="NSSuperview" ref="376224367"/> + <reference key="NSNextKeyView" ref="459548655"/> <reference key="NSDocView" ref="459548655"/> <reference key="NSBGColor" ref="1024678221"/> <int key="NScvFlags">4</int> @@ -2361,6 +2371,7 @@ </object> <string key="NSFrame">{{-1, 22}, {628, 156}}</string> <reference key="NSSuperview" ref="1063281455"/> + <reference key="NSNextKeyView" ref="794929378"/> <int key="NSsFlags">562</int> <reference key="NSVScroller" ref="1019209947"/> <reference key="NSHScroller" ref="328951385"/> @@ -3953,6 +3964,7 @@ </object> </object> <string key="NSFrameSize">{863, 550}</string> + <reference key="NSSuperview"/> </object> <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string> <string key="NSMinSize">{780, 502}</string> @@ -5923,6 +5935,7 @@ </object> <string key="NSFrame">{{1, 17}, {423, 141}}</string> <reference key="NSSuperview" ref="1041893843"/> + <reference key="NSNextKeyView" ref="134631251"/> <reference key="NSDocView" ref="134631251"/> <reference key="NSBGColor" ref="1024678221"/> <int key="NScvFlags">6</int> @@ -5956,6 +5969,7 @@ </object> <string key="NSFrame">{{1, 0}, {423, 17}}</string> <reference key="NSSuperview" ref="1041893843"/> + <reference key="NSNextKeyView" ref="568493807"/> <reference key="NSDocView" ref="568493807"/> <reference key="NSBGColor" ref="1024678221"/> <int key="NScvFlags">4</int> @@ -5964,6 +5978,7 @@ </object> <string key="NSFrame">{{20, 45}, {425, 159}}</string> <reference key="NSSuperview" ref="1024486775"/> + <reference key="NSNextKeyView" ref="68425806"/> <int key="NSsFlags">530</int> <reference key="NSVScroller" ref="99652168"/> <reference key="NSHScroller" ref="1053700221"/> diff --git a/TableContent.m b/TableContent.m index 0a98414c..6610ceb1 100644 --- a/TableContent.m +++ b/TableContent.m @@ -180,6 +180,7 @@ dataCell = [[[NSTextFieldCell alloc] initTextCell:@""] autorelease]; } [dataCell setEditable:YES]; + if ( [dataCell respondsToSelector:@selector(setLineBreakMode:)] ) { // Mac OS X 10.4+ [dataCell setLineBreakMode:NSLineBreakByTruncatingTail]; @@ -906,6 +907,8 @@ [editTextView setFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]]; } else { [editTextView setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; + [limitRowsField setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; + [argumentField setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; } [hexTextView setFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]]; [limitRowsStepper setEnabled:NO]; diff --git a/TableDump.m b/TableDump.m index ea1a2914..185becec 100644 --- a/TableDump.m +++ b/TableDump.m @@ -44,7 +44,7 @@ get the tables in db //get tables [tables removeAllObjects]; - queryResult = [mySQLConnection listTables]; + queryResult = (CMMCPResult *)[mySQLConnection listTables]; for ( i = 0 ; i < [queryResult numOfRows] ; i++ ) { [queryResult dataSeek:i]; @@ -460,14 +460,14 @@ reads mysql-dumpfile //show fieldMapping sheet CMMCPResult *theResult; int i; - theResult = [mySQLConnection listTables]; + theResult = (CMMCPResult *) [mySQLConnection listTables]; for ( i = 0 ; i < [theResult numOfRows] ; i++ ) { [theResult dataSeek:i]; [fieldMappingPopup addItemWithTitle:[[theResult fetchRowAsArray] objectAtIndex:0]]; } if ([tableDocumentInstance table] != nil && ![(NSString *)[tableDocumentInstance table] isEqualToString:@""]) { - [fieldMappingPopup selectItemWithTitle:[tableDocumentInstance table]]; + [fieldMappingPopup selectItemWithTitle:[(TableDocument *)tableDocumentInstance table]]; } else { [fieldMappingPopup selectItemAtIndex:0]; } @@ -1475,6 +1475,19 @@ sets the connection (received from TableDocument) and makes things that have to } } +- (void)tableView:(NSTableView *)aTableView + willDisplayCell:(id)aCell + forTableColumn:(NSTableColumn *)aTableColumn + row:(int)rowIndex +{ + if ( [[NSUserDefaults standardUserDefaults] boolForKey:@"useMonospacedFonts"] ) { + [aCell setFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]]; + } + else + { + [aCell setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; + } +} - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex diff --git a/TableSource.m b/TableSource.m index 0d9e2bf4..caeb91fc 100644 --- a/TableSource.m +++ b/TableSource.m @@ -495,11 +495,19 @@ sets the connection (received from TableDocument) and makes things that have to if ( [prefs boolForKey:@"useMonospacedFonts"] ) { [[indexColumn dataCell] setFont:[NSFont fontWithName:@"Monaco" size:10]]; } + else + { + [[indexColumn dataCell] setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; + } } while ( (fieldColumn = [fieldColumnsEnumerator nextObject]) ) { if ( [prefs boolForKey:@"useMonospacedFonts"] ) { [[fieldColumn dataCell] setFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]]; } + else + { + [[fieldColumn dataCell] setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; + } } } diff --git a/TablesList.h b/TablesList.h index 7693f94c..84bb5e4e 100644 --- a/TablesList.h +++ b/TablesList.h @@ -24,9 +24,9 @@ #import <Cocoa/Cocoa.h> #import <MCPKit_bundled/MCPKit_bundled.h> -#import "CMMCPConnection.h" -#import "CMMCPResult.h" +@class CMMCResult; +@class CMMCPConnection; @interface TablesList : NSObject { diff --git a/TablesList.m b/TablesList.m index 83a36a06..a5ab02e5 100644 --- a/TablesList.m +++ b/TablesList.m @@ -28,6 +28,8 @@ #import "TableContent.h" #import "TableDump.h" #import "ImageAndTextCell.h" +#import "CMMCPConnection.h" +#import "CMMCPResult.h" @implementation TablesList @@ -47,9 +49,10 @@ loads all table names in array tables and reload the tableView [tablesListView deselectAll:self]; [tables removeAllObjects]; - [tables addObject:@"TABLES"]; + [tables addObject:NSLocalizedString(@"TABLES",@"header for table list")]; - theResult = [mySQLConnection listTables]; + theResult = (CMMCPResult *)[mySQLConnection listTables]; + for ( i = 0 ; i < [theResult numOfRows] ; i++ ) { [theResult dataSeek:i]; [tables addObject:[[theResult fetchRowAsArray] objectAtIndex:0]]; @@ -275,19 +278,6 @@ sets the connection (received from TableDocument) and makes things that have to - (void)setConnection:(CMMCPConnection *)theConnection { mySQLConnection = theConnection; - - //prefs = [[NSUserDefaults standardUserDefaults] retain]; - - //set smallSystemFonts - //[[[tablesListView tableColumnWithIdentifier:@"tables"] dataCell] setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; - //[copyTableNameField setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; - //if ( [prefs boolForKey:@"useMonospacedFonts"] ) { - - if ( [[NSUserDefaults standardUserDefaults] boolForKey:@"useMonospacedFonts"] ) { - [[[tablesListView tableColumnWithIdentifier:@"tables"] dataCell] - setFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]]; - } - [self updateTables:self]; } @@ -652,6 +642,13 @@ loads structure or source if tab selected the first time if (rowIndex > 0 && [[aTableColumn identifier] isEqualToString:@"tables"]) { [(ImageAndTextCell*)aCell setImage:[NSImage imageNamed:@"table-small"]]; [(ImageAndTextCell*)aCell setIndentationLevel:1]; + if ( [[NSUserDefaults standardUserDefaults] boolForKey:@"useMonospacedFonts"] ) { + [(ImageAndTextCell*)aCell setFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]]; + } + else + { + [(ImageAndTextCell*)aCell setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; + } } else { [(ImageAndTextCell*)aCell setImage:nil]; |