Develop and Download Open Source Software

Browse CVS Repository

Contents of /undmail/guiproto/MainController.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.14 - (show annotations) (download)
Sun Jan 26 16:30:09 2003 UTC (21 years, 2 months ago) by footashida
Branch: MAIN
Changes since 1.13: +9 -0 lines
*** empty log message ***

1 #import "MainController.h"
2 #import "MailBoxOutlineDataSource.h"
3 #import "MainToolbarSource.h"
4 #import "IconedCell.h"
5 #import "ComposeToolbarSource.h"
6 #import "PreferenceToolbarSource.h"
7 #import "PreferenceController.h"
8 #import "DUMMailBoxManager.h"
9 #import "MailBoxTableDataSource.h"
10 #import "DUMMail.h"
11 #import "DUMMailBox.h"
12 #import "AddressBookController.h"
13 @implementation MainController
14 -(void)setupToolbar{
15 NSToolbar *toolbar;
16 MainToolbarSource *mainToolbarSource;
17 ComposeToolbarSource *composeToolbarSource;
18 toolbar = [[NSToolbar alloc] initWithIdentifier:@"MainToolBar"];
19 mainToolbarSource = [[MainToolbarSource alloc] initWithController:self];
20 [toolbar setDelegate:mainToolbarSource];
21 [window setToolbar:toolbar];
22 [toolbar release];
23
24 toolbar = [[NSToolbar alloc] initWithIdentifier:@"ComposeToolBar"];
25 composeToolbarSource = [[ComposeToolbarSource alloc] initWithController:self];
26 [toolbar setDelegate:composeToolbarSource];
27 [composeWindow setToolbar:toolbar];
28 [toolbar release];
29 }
30
31
32 -(void)awakeFromNib{
33 MailBoxOutlineDataSource *ds;
34 NSButtonCell *mailCheckButtonCell;
35 NSButtonCell *mailDeleteButtonCell;
36
37 [window center];
38
39 mailBoxManager = [[DUMMailBoxManager alloc] init];
40 ds = [[MailBoxOutlineDataSource alloc]
41 initWithMailBoxManager:mailBoxManager];
42 [folderTree setDataSource:ds];
43
44 [self setupToolbar];
45
46
47 mailCheckButtonCell = [[NSButtonCell alloc] init];
48 mailDeleteButtonCell = [[NSButtonCell alloc] init];
49 [mailCheckButtonCell setButtonType:NSSwitchButton];
50 [mailDeleteButtonCell setButtonType:NSSwitchButton];
51
52 [mailCheckButtonCell setTitle:@""];
53 [mailDeleteButtonCell setTitle:@""];
54
55 [[mailCheckTable tableColumnWithIdentifier:@"MailCheckFlag"] setDataCell:mailCheckButtonCell];
56 [[mailCheckTable tableColumnWithIdentifier:@"MailDeleteFlag"] setDataCell:mailDeleteButtonCell];
57 }
58 - (void)applicationDidFinishLaunching:(NSNotification*)notif
59 {
60 NSTableColumn* tableColumn;
61 IconedCell* iconedCell;
62 // �t�H���_�c���[���A�A�C�R��+�������\���������������ACell�����X���s���B
63 tableColumn = [folderTree tableColumnWithIdentifier:@"folderview"];
64 iconedCell = [[[IconedCell alloc] init] autorelease];
65 [tableColumn setDataCell:iconedCell];
66 }
67 -(IBAction)createNewMessage:(id)sender{
68 [composeWindow makeKeyAndOrderFront:nil];
69 }
70 -(IBAction)showPreference:(id)sender{
71 if(prefController == nil){
72 prefController = [[PreferenceController alloc] init];
73 }
74 [prefController showWindow:self];
75 }
76 -(IBAction)createRule:(id)sender{
77 [self showPreference:self];
78 [prefController selectPreferenceTabWithName:@"rule_tab"];
79 }
80 - (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item{
81 MailBoxTableDataSource *ds;
82
83 if([mailList dataSource] == nil){
84 ds = [[MailBoxTableDataSource alloc] initWithMailBox:item];
85 [mailList setDataSource:ds];
86 }else{
87 ds = [mailList dataSource];
88 [ds changeMailBox:item];
89 }
90 [mailList reloadData];
91 return YES;
92 }
93 - (BOOL)tableView:(NSTableView *)aTableView shouldSelectRow:(int)rowIndex{
94 MailBoxTableDataSource *ds;
95 DUMMailBox *selectedMailBox;
96 DUMMail *mail;
97 NSString *text;
98
99 ds = [aTableView dataSource];
100 selectedMailBox = [ds mailBox];
101 mail = [selectedMailBox mailAtIndex:rowIndex];
102 text = [mailContents string];
103 [mailContents replaceCharactersInRange:NSMakeRange(0, [text length])
104 withString:[mail content]];
105 return YES;
106 }
107 -(IBAction)showAddressBook{
108 NSLog(@"show addressbook");
109 if(addressbookController == nil){
110 addressbookController
111 = [[AddressBookController alloc] init];
112 }
113 [addressbookController showWindow:self];
114 }
115 @end

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26