| 7 |
#import "PreferenceController.h" |
#import "PreferenceController.h" |
| 8 |
#import "DUMMailBoxManager.h" |
#import "DUMMailBoxManager.h" |
| 9 |
#import "MailBoxTableDataSource.h" |
#import "MailBoxTableDataSource.h" |
| 10 |
|
#import "DUMMail.h" |
| 11 |
|
#import "DUMMailBox.h" |
| 12 |
@implementation MainController |
@implementation MainController |
| 13 |
-(void)awakeFromNib{ |
-(void)setupToolbar{ |
|
MailBoxOutlineDataSource *ds; |
|
| 14 |
NSToolbar *toolbar; |
NSToolbar *toolbar; |
| 15 |
MainToolbarSource *mainToolbarSource; |
MainToolbarSource *mainToolbarSource; |
| 16 |
ComposeToolbarSource *composeToolbarSource; |
ComposeToolbarSource *composeToolbarSource; |
|
NSButtonCell *mailCheckButtonCell; |
|
|
NSButtonCell *mailDeleteButtonCell; |
|
|
|
|
|
[window center]; |
|
|
|
|
|
mailBoxManager = [[DUMMailBoxManager alloc] init]; |
|
|
ds = [[MailBoxOutlineDataSource alloc] |
|
|
initWithMailBoxManager:mailBoxManager]; |
|
|
[folderTree setDataSource:ds]; |
|
|
|
|
| 17 |
toolbar = [[NSToolbar alloc] initWithIdentifier:@"MainToolBar"]; |
toolbar = [[NSToolbar alloc] initWithIdentifier:@"MainToolBar"]; |
| 18 |
mainToolbarSource = [[MainToolbarSource alloc] initWithController:self]; |
mainToolbarSource = [[MainToolbarSource alloc] initWithController:self]; |
| 19 |
[toolbar setDelegate:mainToolbarSource]; |
[toolbar setDelegate:mainToolbarSource]; |
| 25 |
[toolbar setDelegate:composeToolbarSource]; |
[toolbar setDelegate:composeToolbarSource]; |
| 26 |
[composeWindow setToolbar:toolbar]; |
[composeWindow setToolbar:toolbar]; |
| 27 |
[toolbar release]; |
[toolbar release]; |
| 28 |
|
} |
| 29 |
|
|
| 30 |
|
|
| 31 |
|
-(void)awakeFromNib{ |
| 32 |
|
MailBoxOutlineDataSource *ds; |
| 33 |
|
NSButtonCell *mailCheckButtonCell; |
| 34 |
|
NSButtonCell *mailDeleteButtonCell; |
| 35 |
|
|
| 36 |
|
[window center]; |
| 37 |
|
|
| 38 |
|
mailBoxManager = [[DUMMailBoxManager alloc] init]; |
| 39 |
|
ds = [[MailBoxOutlineDataSource alloc] |
| 40 |
|
initWithMailBoxManager:mailBoxManager]; |
| 41 |
|
[folderTree setDataSource:ds]; |
| 42 |
|
|
| 43 |
|
[self setupToolbar]; |
| 44 |
|
|
| 45 |
|
|
| 46 |
mailCheckButtonCell = [[NSButtonCell alloc] init]; |
mailCheckButtonCell = [[NSButtonCell alloc] init]; |
| 47 |
mailDeleteButtonCell = [[NSButtonCell alloc] init]; |
mailDeleteButtonCell = [[NSButtonCell alloc] init]; |
| 89 |
[mailList reloadData]; |
[mailList reloadData]; |
| 90 |
return YES; |
return YES; |
| 91 |
} |
} |
| 92 |
|
- (BOOL)tableView:(NSTableView *)aTableView shouldSelectRow:(int)rowIndex{ |
| 93 |
|
MailBoxTableDataSource *ds; |
| 94 |
|
DUMMailBox *selectedMailBox; |
| 95 |
|
DUMMail *mail; |
| 96 |
|
NSString *text; |
| 97 |
|
|
| 98 |
|
ds = [aTableView dataSource]; |
| 99 |
|
selectedMailBox = [ds mailBox]; |
| 100 |
|
mail = [selectedMailBox mailAtIndex:rowIndex]; |
| 101 |
|
text = [mailContents string]; |
| 102 |
|
[mailContents replaceCharactersInRange:NSMakeRange(0, [text length]) |
| 103 |
|
withString:[mail content]]; |
| 104 |
|
return YES; |
| 105 |
|
} |
| 106 |
@end |
@end |