| 1 |
footashida |
1.1 |
#import "MainController.h" |
| 2 |
footashida |
1.12 |
#import "MailBoxOutlineDataSource.h" |
| 3 |
footashida |
1.2 |
#import "MainToolbarSource.h" |
| 4 |
footashida |
1.1 |
#import "IconedCell.h" |
| 5 |
footashida |
1.2 |
#import "ComposeToolbarSource.h" |
| 6 |
footashida |
1.3 |
#import "PreferenceToolbarSource.h" |
| 7 |
footashida |
1.12 |
#import "PreferenceController.h" |
| 8 |
|
|
#import "DUMMailBoxManager.h" |
| 9 |
|
|
#import "MailBoxTableDataSource.h" |
| 10 |
footashida |
1.1 |
@implementation MainController |
| 11 |
|
|
-(void)awakeFromNib{ |
| 12 |
footashida |
1.12 |
MailBoxOutlineDataSource *ds; |
| 13 |
footashida |
1.1 |
NSToolbar *toolbar; |
| 14 |
footashida |
1.2 |
MainToolbarSource *mainToolbarSource; |
| 15 |
|
|
ComposeToolbarSource *composeToolbarSource; |
| 16 |
footashida |
1.5 |
NSButtonCell *mailCheckButtonCell; |
| 17 |
|
|
NSButtonCell *mailDeleteButtonCell; |
| 18 |
footashida |
1.3 |
|
| 19 |
footashida |
1.11 |
[window center]; |
| 20 |
|
|
|
| 21 |
footashida |
1.12 |
mailBoxManager = [[DUMMailBoxManager alloc] init]; |
| 22 |
|
|
ds = [[MailBoxOutlineDataSource alloc] |
| 23 |
|
|
initWithMailBoxManager:mailBoxManager]; |
| 24 |
footashida |
1.1 |
[folderTree setDataSource:ds]; |
| 25 |
|
|
|
| 26 |
footashida |
1.5 |
toolbar = [[NSToolbar alloc] initWithIdentifier:@"MainToolBar"]; |
| 27 |
footashida |
1.2 |
mainToolbarSource = [[MainToolbarSource alloc] initWithController:self]; |
| 28 |
|
|
[toolbar setDelegate:mainToolbarSource]; |
| 29 |
footashida |
1.1 |
[window setToolbar:toolbar]; |
| 30 |
|
|
[toolbar release]; |
| 31 |
|
|
|
| 32 |
footashida |
1.5 |
toolbar = [[NSToolbar alloc] initWithIdentifier:@"ComposeToolBar"]; |
| 33 |
footashida |
1.2 |
composeToolbarSource = [[ComposeToolbarSource alloc] initWithController:self]; |
| 34 |
|
|
[toolbar setDelegate:composeToolbarSource]; |
| 35 |
footashida |
1.1 |
[composeWindow setToolbar:toolbar]; |
| 36 |
|
|
[toolbar release]; |
| 37 |
|
|
|
| 38 |
footashida |
1.5 |
mailCheckButtonCell = [[NSButtonCell alloc] init]; |
| 39 |
|
|
mailDeleteButtonCell = [[NSButtonCell alloc] init]; |
| 40 |
|
|
[mailCheckButtonCell setButtonType:NSSwitchButton]; |
| 41 |
|
|
[mailDeleteButtonCell setButtonType:NSSwitchButton]; |
| 42 |
|
|
|
| 43 |
|
|
[mailCheckButtonCell setTitle:@""]; |
| 44 |
|
|
[mailDeleteButtonCell setTitle:@""]; |
| 45 |
|
|
|
| 46 |
|
|
[[mailCheckTable tableColumnWithIdentifier:@"MailCheckFlag"] setDataCell:mailCheckButtonCell]; |
| 47 |
|
|
[[mailCheckTable tableColumnWithIdentifier:@"MailDeleteFlag"] setDataCell:mailDeleteButtonCell]; |
| 48 |
footashida |
1.1 |
} |
| 49 |
|
|
- (void)applicationDidFinishLaunching:(NSNotification*)notif |
| 50 |
|
|
{ |
| 51 |
|
|
NSTableColumn* tableColumn; |
| 52 |
|
|
IconedCell* iconedCell; |
| 53 |
|
|
// �t�H���_�c���[���A�A�C�R��+�������\���������������ACell�����X���s���B |
| 54 |
|
|
tableColumn = [folderTree tableColumnWithIdentifier:@"folderview"]; |
| 55 |
|
|
iconedCell = [[[IconedCell alloc] init] autorelease]; |
| 56 |
|
|
[tableColumn setDataCell:iconedCell]; |
| 57 |
|
|
} |
| 58 |
|
|
-(IBAction)createNewMessage:(id)sender{ |
| 59 |
|
|
[composeWindow makeKeyAndOrderFront:nil]; |
| 60 |
|
|
} |
| 61 |
footashida |
1.2 |
-(IBAction)showPreference:(id)sender{ |
| 62 |
footashida |
1.12 |
if(prefController == nil){ |
| 63 |
|
|
prefController = [[PreferenceController alloc] init]; |
| 64 |
footashida |
1.3 |
} |
| 65 |
footashida |
1.12 |
[prefController showWindow:self]; |
| 66 |
footashida |
1.1 |
} |
| 67 |
footashida |
1.9 |
-(IBAction)createRule:(id)sender{ |
| 68 |
|
|
[self showPreference:self]; |
| 69 |
footashida |
1.12 |
[prefController selectPreferenceTabWithName:@"rule_tab"]; |
| 70 |
|
|
} |
| 71 |
|
|
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item{ |
| 72 |
|
|
MailBoxTableDataSource *ds; |
| 73 |
|
|
|
| 74 |
|
|
if([mailList dataSource] == nil){ |
| 75 |
|
|
ds = [[MailBoxTableDataSource alloc] initWithMailBox:item]; |
| 76 |
|
|
[mailList setDataSource:ds]; |
| 77 |
|
|
}else{ |
| 78 |
|
|
ds = [mailList dataSource]; |
| 79 |
|
|
[ds changeMailBox:item]; |
| 80 |
|
|
} |
| 81 |
|
|
[mailList reloadData]; |
| 82 |
|
|
return YES; |
| 83 |
footashida |
1.9 |
} |
| 84 |
footashida |
1.1 |
@end |