@property (readonly) BreakpointController* breakpoint;
@property (readonly) LoggingController* loggingController;
+// Returns the instance of this class that is acting as the application's
+// delegate.
++ (AppDelegate*)instance;
+
- (IBAction)showDebuggerWindow:(id)sender;
- (IBAction)showBreakpointWindow:(id)sender;
- (IBAction)showPreferences:(id)sender;
[pool release];
}
++ (AppDelegate*)instance
+{
+ return (AppDelegate*)[NSApp delegate];
+}
+
/**
* Shows the debugger window
*/
- (LogEntry*)recordSend:(NSString*)command
{
- LoggingController* logger = [(AppDelegate*)[NSApp delegate] loggingController];
+ LoggingController* logger = [[AppDelegate instance] loggingController];
LogEntry* entry = [LogEntry newSendEntry:command];
entry.lastReadTransactionID = lastReadTransaction_;
entry.lastWrittenTransactionID = lastWrittenTransaction_;
- (LogEntry*)recordReceive:(NSString*)command
{
- LoggingController* logger = [(AppDelegate*)[NSApp delegate] loggingController];
+ LoggingController* logger = [[AppDelegate instance] loggingController];
LogEntry* entry = [LogEntry newReceiveEntry:command];
entry.lastReadTransactionID = lastReadTransaction_;
entry.lastWrittenTransactionID = lastWrittenTransaction_;
// If this node has children but they haven't been loaded from the backend,
// request them asynchronously.
if (![self isLeaf] && [children count] < 1) {
- [[[(AppDelegate*)[NSApp delegate] debugger] connection] getProperty:[self fullname]];
+ [[AppDelegate instance].debugger.connection getProperty:[self fullname]];
}
return children;
}