// // Perforce_ServerPref.m // Perforce Server // // Created by Mike Ashmore on 3/3/10. // Copyright (c) 2010 Mike Ashmore. All rights reserved. // #import "Perforce_ServerPref.h" @implementation Perforce_ServerPref @synthesize buttonText, statusText, serverConfig, p4rootText, p4logText, p4portText; - (void) mainViewDidLoad { self.updatePanelStatus; self.p4rootText = [@"P4ROOT is presently " stringByAppendingString:[serverConfig p4rootPath]]; self.p4logText = [@"P4LOG is presently " stringByAppendingString:[serverConfig p4logPath]]; self.p4portText = [@"P4PORT is presently " stringByAppendingString:[[serverConfig p4port] stringValue]]; } - (IBAction) startOrStopButtonPressed:(id)sender { if ([serverConfig isRunning]) { [serverConfig stopServer]; } else { [serverConfig startServer]; } self.updatePanelStatus; } - (void) updatePanelStatus { BOOL running; running = [serverConfig isRunning]; if (running) { self.buttonText = @"Stop Perforce Server"; self.statusText = @"P4D is running"; } else { self.buttonText = @"Start Perforce Server"; self.statusText = @"P4D is stopped"; }; } @end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 7595 | Mike Ashmore |
Now displays the values we're setting for P4ROOT, P4LOG, and P4PORT. These values are not, as yet, configurable. If I worked for Perforce, I would have a substantial incentive to improve this state of affairs. |
||
#2 | 7594 | Mike Ashmore |
Now correctly reflect status of server: running vs. not running. Note: OS X's authorization services make it really really hard to handle the installation of launchd services in a genuinely secure manner. You have to create a helper app to run with elevated privileges, then send commands to it via IPC and ... well, it's all just a bit much for me to figure out for a tool that was intended to be a quick one-off. Perhaps if I were employed by Perforce I could be troubled to do it the "right" way. Supposedly the ServiceManagement framework makes this all less painful, but it's an API that's brand-new in OS X 10.6 and not terribly well documented yet. And in any case, 10.6 still has not seen widespread enough adoption to justify using a 10.6-only framework. |
||
#1 | 7588 | Mike Ashmore |
This preference pane will make installation of p4d on OS X much simpler. Perhaps after some refinement it'll be worthy of packaging and letting Perforce Inc. distribute directly. |