/* EditorWindowController.m - Editor window controller for Localize.app Copyright (C) 2003 Rob Burns This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. */ #include "EditorWindowController.h" @implementation EditorWindowController - (void) dealloc { RELEASE(index); RELEASE(transImage); RELEASE(notTransImage); RELEASE(notTransUnMatchImage); RELEASE(unMatchImage); [super dealloc]; } - (id) initWithWindowNibName: (NSString *) name { if( (self = [super initWithWindowNibName: name]) ) { index = [[NSMutableArray alloc] init]; transImage = RETAIN([NSImage imageNamed: @"Translated"]); notTransImage = RETAIN([NSImage imageNamed: @"NotTranslated"]); notTransUnMatchImage = RETAIN([NSImage imageNamed: @"NotTransUnMatch"]); unMatchImage = RETAIN([NSImage imageNamed: @"unMatched"]); return self; } return nil; } - (void) awakeFromNib { [self setFilter: self]; [valueText setFieldEditor: YES]; [commentText setFieldEditor: YES]; [keyList setAutoresizesAllColumnsToFit: YES]; [keyList setDataSource: [self document]]; [keyList reloadData]; if( [[self document] m_sGenerated] ) { // [fileLabel setStringValue: _(@"File:")]; // [[filterList itemAtIndex: 0] setTitle: _(@"All Strings")]; // [[filterList itemAtIndex: 1] setTitle: _(@"Untranslated Strings")]; // [[filterList itemAtIndex: 2] setTitle: _(@"Unmatched Strings")]; } } // Action methods // *************** - (void) selectKey: (id)sender { } - (void) deleteString: (id)sender { // int x = [[index objectAtIndex: [keyList selectedRowInColumn: 0]] intValue]; // [[self document] deleteStringAtIndex: x]; // [self setFilter: self]; } - (void) setFilter: (id)sender { /* NSString *filter = [filterList titleOfSelectedItem]; int numberOfStrings = [[[self document] strings] count]; int i; if( [filter isEqualToString: _(@"All Strings")] ) { [index removeAllObjects]; for( i=0;i