~ubuntu-branches/ubuntu/precise/vice/precise

« back to all changes in this revision

Viewing changes to src/arch/unix/macosx/cocoa/dialog/viceresourcewindowcontroller.m

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2010-02-11 18:30:16 UTC
  • mfrom: (1.1.8 upstream) (9.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100211183016-f6n8usn3tzp0u6dp
Tags: 2.2.dfsg-1
* New upstream release, C64 DTV is included so update package description
  and add it to the menu.
* Drop patch fixing build failure with gcc-4.4 , applied upstream.
* Fix some lintian problems and clean up debian/rules .

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
@implementation VICEResourceWindowController
32
32
 
 
33
-(void)windowDidLoad
 
34
{
 
35
    [super windowDidLoad];
 
36
    
 
37
    // register for monitor state updates
 
38
    [[NSNotificationCenter defaultCenter] addObserver:self
 
39
                                             selector:@selector(monitorStateChanged:)
 
40
                                                 name:VICEMonitorStateNotification
 
41
                                               object:nil];
 
42
}
 
43
 
 
44
-(void)monitorStateChanged:(NSNotification *)notification
 
45
{
 
46
    NSWindow *window = [self window];
 
47
    int state = [[[notification userInfo] objectForKey:@"state"] intValue];
 
48
    switch (state) {
 
49
        case VICEMonitorStateOn:
 
50
            shownBeforeMonitor = [window isVisible];
 
51
            if (shownBeforeMonitor) {
 
52
                [window orderOut:self];
 
53
            }
 
54
            break;
 
55
        case VICEMonitorStateOff:
 
56
            if (shownBeforeMonitor) {
 
57
                [window orderFront:self];
 
58
            }
 
59
            break;
 
60
        default:
 
61
            break;
 
62
    }
 
63
}
 
64
 
33
65
-(void)registerForResourceUpdate:(SEL)selector
34
66
{
35
67
    // register resource updates
52
84
{
53
85
    NSNumber *number = [[VICEApplication theMachineController] 
54
86
                            getIntResource:name];
55
 
    if(number==nil)
 
87
    if (number == nil) {
56
88
        return -1;
 
89
    }
57
90
    int result = [number intValue];
58
91
    return result;
59
92
}
103
136
 
104
137
// ----- File Tools -----
105
138
 
106
 
- (NSString *)pickOpenFileWithTitle:(NSString *)title types:(NSArray *)types
107
 
{
108
 
    return [[VICEApplication theAppController] pickOpenFileWithTitle:title types:types];
109
 
}
110
 
 
111
 
- (NSString *)pickSaveFileWithTitle:(NSString *)title types:(NSArray *)types
112
 
{
113
 
    return [[VICEApplication theAppController] pickSaveFileWithTitle:title types:types];
114
 
}
115
 
 
116
 
- (NSString *)pickDirectoryWithTitle:(NSString *)title
117
 
{
118
 
    return [[VICEApplication theAppController] pickDirectoryWithTitle:title];
 
139
- (VICEFilePanel *)getFilePanel
 
140
{
 
141
    return [[VICEApplication theAppController] getFilePanel];
119
142
}
120
143
 
121
144
@end