Develop and Download Open Source Software

Browse CVS Repository

Diff of /undmail/guiproto/MainController.m

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

revision 1.12 by footashida, Sat Jan 25 13:20:46 2003 UTC revision 1.13 by footashida, Sun Jan 26 14:50:49 2003 UTC
# Line 7  Line 7 
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];
# Line 34  Line 25 
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];
# Line 81  Line 89 
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

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

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