Commit 287b3606 authored by David Smith's avatar David Smith Committed by david

Initial wildfire System Prefs pane

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6345 b35dd754-fafc-0310-a699-88a17e54d16e
parent 1faf86be
......@@ -1291,8 +1291,20 @@
<delete file="${mac.dmg.file}"/>
<delete dir="${mac.template}"/>
</target>
<target name="mac.prefpane">
<!-- install will put it in macpkg/Library/PreferencePanes/ as specified in the target settings -->
<exec executable="/usr/bin/xcodebuild" dir="${basedir}/build/osx/wildfirePrefPane/" failonerror="true">
<arg value="-configuration"/>
<arg value="Deployment"/>
<arg value="-target"/>
<arg value="Wildfire"/>
<arg value="clean"/>
<arg value="install"/>
</exec>
</target>
<target name="mac.prepare" depends="mac.delete,wildfire">
<target name="mac.prepare" depends="mac.delete,wildfire, mac.prefpane">
<copy todir="${mac.pkg.dir}/usr/local/wildfire">
<fileset dir="${target.dir}/wildfire">
<exclude name="**/wildfired"/>
......
B/* Localized versions of Info.plist keys */
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
CLASS = NSPreferencePane;
LANGUAGE = ObjC;
OUTLETS = {
"_firstKeyView" = id;
"_initialKeyView" = id;
"_lastKeyView" = id;
"_window" = id;
};
SUPERCLASS = NSObject;
},
{CLASS = WilfireStartStop; LANGUAGE = ObjC; SUPERCLASS = NSButton; },
{
ACTIONS = {
openAdminInterface = id;
openAdminInterfaceSSL = id;
toggleAutoStart = id;
toggleServer = id;
};
CLASS = wildfirePrefPane;
LANGUAGE = ObjC;
OUTLETS = {
autoStartCheckbox = NSButton;
startButton = NSButton;
statusDescription = NSTextField;
statusMessage = NSTextField;
statusProgress = NSProgressIndicator;
viewAdminButton = NSButton;
viewAdminButtonSSL = NSButton;
};
SUPERCLASS = NSPreferencePane;
}
);
IBVersion = 1;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>1155 145 481 349 0 0 1680 1028 </string>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>12</integer>
</array>
<key>IBSystem Version</key>
<string>8N1150</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Wildfire</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.apple.prefpanel</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>Jive Software</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>wildfirePrefPane</string>
<key>NSPrefPaneIconFile</key>
<string>wildfirePrefPaneLogo.tiff</string>
<key>NSPrefPaneIconLabel</key>
<string>Wildfire</string>
<key>NSPrincipalClass</key>
<string>wildfirePrefPane</string>
</dict>
</plist>
#!/bin/bash
CURRENT_FLAG=`sudo awk '/RunAtLoad/{getline; print}' /Library/LaunchDaemons/org.jivesoftware.wildfire.plist | tr -d '\n' | grep true`
echo "Current flag is $CURRENT_FLAG"
if [ -z "$CURRENT_FLAG" ] ; then
CURRENT_FLAG="false"
NEW_FLAG="true"
else
CURRENT_FLAG="true"
NEW_FLAG="false"
fi
sudo sed -i "" -e "/RunAtLoad/ {
n
s/$CURRENT_FLAG/$NEW_FLAG/
}" /Library/LaunchDaemons/org.jivesoftware.wildfire.plist
//
// wildfirePrefPane.h
// Preference panel for Wildfire
//
// Created by Daniel Henninger on 7/7/06.
// Copyright (c) 2006 Jive Software. All rights reserved.
//
// Concept taken from MySQL preference panel, as well as some borrowed code.
//
#import <PreferencePanes/PreferencePanes.h>
#import <Security/Authorization.h>
#import <Security/AuthorizationTags.h>
#include <unistd.h>
// 'ps' command to use to check for running wildfire daemon
char *pscmd = "/bin/ps auxww | fgrep -v 'fgrep' | fgrep wildfire/lib/startup.jar";
// The path to the plist file
NSString *plistPath = @"/Library/LaunchDaemons/org.jivesoftware.wildfire.plist";
@interface wildfirePrefPane : NSPreferencePane
{
IBOutlet NSButton *startButton;
IBOutlet NSButton *autoStartCheckbox;
IBOutlet NSButton *viewAdminButton;
IBOutlet NSButton *viewAdminButtonSSL;
IBOutlet NSTextField *statusMessage;
IBOutlet NSTextField *statusDescription;
IBOutlet NSProgressIndicator *statusProgress;
AuthorizationRef authorizationRef;
AuthorizationRights authRights;
AuthorizationRights *authorizedRights;
AuthorizationFlags authFlags;
OSStatus ourStatus;
NSTimer *statusTimer;
}
- (IBAction)toggleServer:(id)sender;
- (IBAction)toggleAutoStart:(id)sender;
- (IBAction)openAdminInterface:(id)sender;
- (IBAction)openAdminInterfaceSSL:(id)sender;
- (void)mainViewDidLoad;
- (void)updateStatus;
- (void)startServer;
- (void)stopServer;
- (void)checkStatus;
- (BOOL)isRunning;
@end
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment