mirror of
https://github.com/munki/munki.git
synced 2026-04-23 21:40:25 -05:00
Still trying to get all these changes uploaded...
git-svn-id: http://munki.googlecode.com/svn/trunk@227 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// BorderlessWindow.h
|
||||
// MunkiStatus
|
||||
//
|
||||
// Created by Greg Neagle on 5/16/09.
|
||||
// Copyright 2009 Greg Neagle.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
@interface BorderlessWindow : NSWindow
|
||||
|
||||
- (id) initWithContentRect: (NSRect) contentRect
|
||||
styleMask: (unsigned int) aStyle
|
||||
backing: (NSBackingStoreType) bufferingType
|
||||
defer: (BOOL) flag;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// BorderlessWindow.m
|
||||
// MunkiStatus
|
||||
//
|
||||
// Created by Greg Neagle on 5/16/09.
|
||||
// Copyright 2009 Greg Neagle.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import "BorderlessWindow.h"
|
||||
|
||||
|
||||
@implementation BorderlessWindow
|
||||
|
||||
- (id) initWithContentRect: (NSRect) contentRect
|
||||
styleMask: (unsigned int) aStyle
|
||||
backing: (NSBackingStoreType) bufferingType
|
||||
defer: (BOOL) flag
|
||||
{
|
||||
if (self = [super initWithContentRect: contentRect
|
||||
styleMask: NSBorderlessWindowMask
|
||||
backing: bufferingType
|
||||
defer: flag])
|
||||
|
||||
{
|
||||
// other initialization
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
Binary file not shown.
@@ -0,0 +1,655 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">9L31a</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">677</string>
|
||||
<string key="IBDocument.AppKitVersion">949.54</string>
|
||||
<string key="IBDocument.HIToolboxVersion">353.00</string>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="372"/>
|
||||
<integer value="394"/>
|
||||
<integer value="29"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilderKit</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSCustomObject" id="1021">
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1014">
|
||||
<string key="NSClassName">FirstResponder</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1050">
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSMenu" id="649796088">
|
||||
<string key="NSTitle">AMainMenu</string>
|
||||
<object class="NSMutableArray" key="NSMenuItems">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<string key="NSName">_NSMainMenu</string>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="972006081">
|
||||
<int key="NSWindowStyleMask">5</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{335, 627}, {532, 123}}</string>
|
||||
<int key="NSWTFlags">1946157056</int>
|
||||
<string key="NSWindowTitle">Window</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
|
||||
<object class="NSView" key="NSWindowView" id="439893737">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSButton" id="811837434">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">289</int>
|
||||
<string key="NSFrame">{{422, 12}, {96, 32}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="232900647">
|
||||
<int key="NSCellFlags">-2080244224</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Stop</string>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">1.300000e+01</double>
|
||||
<int key="NSfFlags">1044</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="811837434"/>
|
||||
<int key="NSButtonFlags">-2038284033</int>
|
||||
<int key="NSButtonFlags2">129</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSProgressIndicator" id="1034146942">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">1290</int>
|
||||
<object class="NSPSMatrix" key="NSDrawMatrix"/>
|
||||
<string key="NSFrame">{{99, 61}, {415, 20}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<int key="NSpiFlags">16394</int>
|
||||
<double key="NSMinValue">2.000000e+01</double>
|
||||
<double key="NSMaxValue">1.000000e+02</double>
|
||||
</object>
|
||||
<object class="NSTextField" id="616760596">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">266</int>
|
||||
<string key="NSFrame">{{98, 86}, {412, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="735196095">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents"/>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande-Bold</string>
|
||||
<double key="NSSize">1.300000e+01</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="616760596"/>
|
||||
<object class="NSColor" key="NSBackgroundColor" id="407029040">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC42NjY2NjY2OQA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor" id="471091633">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlTextColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="778599036">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">266</int>
|
||||
<string key="NSFrame">{{98, 43}, {417, 14}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="27000179">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags2">272761856</int>
|
||||
<string key="NSContents"/>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">1.100000e+01</double>
|
||||
<int key="NSfFlags">3100</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="778599036"/>
|
||||
<reference key="NSBackgroundColor" ref="407029040"/>
|
||||
<reference key="NSTextColor" ref="471091633"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSImageView" id="7529079">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<object class="NSMutableSet" key="NSDragTypes">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSMutableArray" key="set.sortedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>Apple PDF pasteboard type</string>
|
||||
<string>Apple PICT pasteboard type</string>
|
||||
<string>Apple PNG pasteboard type</string>
|
||||
<string>NSFilenamesPboardType</string>
|
||||
<string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
|
||||
<string>NeXT TIFF v4.0 pasteboard type</string>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{17, 42}, {64, 64}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSImageCell" key="NSCell" id="442116785">
|
||||
<int key="NSCellFlags">130560</int>
|
||||
<int key="NSCellFlags2">33554432</int>
|
||||
<int key="NSAlign">0</int>
|
||||
<int key="NSScale">0</int>
|
||||
<int key="NSStyle">0</int>
|
||||
<bool key="NSAnimates">NO</bool>
|
||||
</object>
|
||||
<bool key="NSEditable">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{532, 123}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
|
||||
<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="610635028">
|
||||
<string key="NSClassName">MunkiStatusAppDelegate</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="232835591">
|
||||
<string key="NSClassName">MSController</string>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="1035834437">
|
||||
<int key="NSWindowStyleMask">1</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{196, 240}, {480, 270}}</string>
|
||||
<int key="NSWTFlags">603984896</int>
|
||||
<string key="NSWindowTitle">BackdropWindow</string>
|
||||
<string key="NSWindowClass">BorderlessWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
|
||||
<object class="NSView" key="NSWindowView" id="395199118">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSImageView" id="935737279">
|
||||
<reference key="NSNextResponder" ref="395199118"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableSet" key="NSDragTypes">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSMutableArray" key="set.sortedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>Apple PDF pasteboard type</string>
|
||||
<string>Apple PICT pasteboard type</string>
|
||||
<string>Apple PNG pasteboard type</string>
|
||||
<string>NSFilenamesPboardType</string>
|
||||
<string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
|
||||
<string>NeXT TIFF v4.0 pasteboard type</string>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{480, 270}</string>
|
||||
<reference key="NSSuperview" ref="395199118"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSImageCell" key="NSCell" id="166426576">
|
||||
<int key="NSCellFlags">130560</int>
|
||||
<int key="NSCellFlags2">33554432</int>
|
||||
<int key="NSAlign">0</int>
|
||||
<int key="NSScale">0</int>
|
||||
<int key="NSStyle">0</int>
|
||||
<bool key="NSAnimates">NO</bool>
|
||||
</object>
|
||||
<bool key="NSEditable">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{480, 270}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
|
||||
<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="1050"/>
|
||||
<reference key="destination" ref="610635028"/>
|
||||
</object>
|
||||
<int key="connectionID">374</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">messageFld</string>
|
||||
<reference key="source" ref="232835591"/>
|
||||
<reference key="destination" ref="616760596"/>
|
||||
</object>
|
||||
<int key="connectionID">388</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">detailFld</string>
|
||||
<reference key="source" ref="232835591"/>
|
||||
<reference key="destination" ref="778599036"/>
|
||||
</object>
|
||||
<int key="connectionID">389</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">progressIndicator</string>
|
||||
<reference key="source" ref="232835591"/>
|
||||
<reference key="destination" ref="1034146942"/>
|
||||
</object>
|
||||
<int key="connectionID">391</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">stopBtn</string>
|
||||
<reference key="source" ref="232835591"/>
|
||||
<reference key="destination" ref="811837434"/>
|
||||
</object>
|
||||
<int key="connectionID">392</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">window</string>
|
||||
<reference key="source" ref="232835591"/>
|
||||
<reference key="destination" ref="972006081"/>
|
||||
</object>
|
||||
<int key="connectionID">393</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">imageFld</string>
|
||||
<reference key="source" ref="232835591"/>
|
||||
<reference key="destination" ref="7529079"/>
|
||||
</object>
|
||||
<int key="connectionID">401</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">backdropWindow</string>
|
||||
<reference key="source" ref="232835591"/>
|
||||
<reference key="destination" ref="1035834437"/>
|
||||
</object>
|
||||
<int key="connectionID">402</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">backdropImageFld</string>
|
||||
<reference key="source" ref="232835591"/>
|
||||
<reference key="destination" ref="935737279"/>
|
||||
</object>
|
||||
<int key="connectionID">405</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">stopBtnClicked:</string>
|
||||
<reference key="source" ref="232835591"/>
|
||||
<reference key="destination" ref="811837434"/>
|
||||
</object>
|
||||
<int key="connectionID">408</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<object class="NSArray" key="object" id="1049">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="children" ref="1048"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="1021"/>
|
||||
<reference key="parent" ref="1049"/>
|
||||
<string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="1014"/>
|
||||
<reference key="parent" ref="1049"/>
|
||||
<string key="objectName">First Responder</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-3</int>
|
||||
<reference key="object" ref="1050"/>
|
||||
<reference key="parent" ref="1049"/>
|
||||
<string key="objectName">Application</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">29</int>
|
||||
<reference key="object" ref="649796088"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="parent" ref="1049"/>
|
||||
<string key="objectName">MainMenu</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">371</int>
|
||||
<reference key="object" ref="972006081"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="439893737"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1049"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">372</int>
|
||||
<reference key="object" ref="439893737"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="811837434"/>
|
||||
<reference ref="1034146942"/>
|
||||
<reference ref="616760596"/>
|
||||
<reference ref="778599036"/>
|
||||
<reference ref="7529079"/>
|
||||
</object>
|
||||
<reference key="parent" ref="972006081"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">373</int>
|
||||
<reference key="object" ref="610635028"/>
|
||||
<reference key="parent" ref="1049"/>
|
||||
<string key="objectName">MunkiStatusAppDelegate</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">375</int>
|
||||
<reference key="object" ref="811837434"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="232900647"/>
|
||||
</object>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">376</int>
|
||||
<reference key="object" ref="232900647"/>
|
||||
<reference key="parent" ref="811837434"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">377</int>
|
||||
<reference key="object" ref="1034146942"/>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">378</int>
|
||||
<reference key="object" ref="616760596"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="735196095"/>
|
||||
</object>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">379</int>
|
||||
<reference key="object" ref="735196095"/>
|
||||
<reference key="parent" ref="616760596"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">380</int>
|
||||
<reference key="object" ref="778599036"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="27000179"/>
|
||||
</object>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">381</int>
|
||||
<reference key="object" ref="27000179"/>
|
||||
<reference key="parent" ref="778599036"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">387</int>
|
||||
<reference key="object" ref="232835591"/>
|
||||
<reference key="parent" ref="1049"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">394</int>
|
||||
<reference key="object" ref="1035834437"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="395199118"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1049"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">395</int>
|
||||
<reference key="object" ref="395199118"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="935737279"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1035834437"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">399</int>
|
||||
<reference key="object" ref="7529079"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="442116785"/>
|
||||
</object>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">400</int>
|
||||
<reference key="object" ref="442116785"/>
|
||||
<reference key="parent" ref="7529079"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">403</int>
|
||||
<reference key="object" ref="935737279"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="166426576"/>
|
||||
</object>
|
||||
<reference key="parent" ref="395199118"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">404</int>
|
||||
<reference key="object" ref="166426576"/>
|
||||
<reference key="parent" ref="935737279"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSMutableArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.IBPluginDependency</string>
|
||||
<string>-2.IBPluginDependency</string>
|
||||
<string>-3.IBPluginDependency</string>
|
||||
<string>29.IBEditorWindowLastContentRect</string>
|
||||
<string>29.IBPluginDependency</string>
|
||||
<string>29.ImportedFromIB2</string>
|
||||
<string>29.WindowOrigin</string>
|
||||
<string>29.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>371.IBEditorWindowLastContentRect</string>
|
||||
<string>371.IBWindowTemplateEditedContentRect</string>
|
||||
<string>371.NSWindowTemplate.visibleAtLaunch</string>
|
||||
<string>371.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>372.IBPluginDependency</string>
|
||||
<string>373.IBPluginDependency</string>
|
||||
<string>375.IBPluginDependency</string>
|
||||
<string>376.IBPluginDependency</string>
|
||||
<string>377.IBPluginDependency</string>
|
||||
<string>378.IBPluginDependency</string>
|
||||
<string>379.IBPluginDependency</string>
|
||||
<string>380.IBPluginDependency</string>
|
||||
<string>381.IBPluginDependency</string>
|
||||
<string>387.IBPluginDependency</string>
|
||||
<string>394.IBEditorWindowLastContentRect</string>
|
||||
<string>394.IBWindowTemplateEditedContentRect</string>
|
||||
<string>394.NSWindowTemplate.visibleAtLaunch</string>
|
||||
<string>395.IBPluginDependency</string>
|
||||
<string>399.IBPluginDependency</string>
|
||||
<string>400.IBPluginDependency</string>
|
||||
<string>403.CustomClassName</string>
|
||||
<string>403.IBPluginDependency</string>
|
||||
<string>404.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilderKit</string>
|
||||
<string>com.apple.InterfaceBuilderKit</string>
|
||||
<string>{{21, 791}, {24, 20}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{74, 862}</string>
|
||||
<string>{{11, 836}, {478, 20}}</string>
|
||||
<string>{{99, 598}, {532, 123}}</string>
|
||||
<string>{{99, 598}, {532, 123}}</string>
|
||||
<boolean value="NO" id="6"/>
|
||||
<string>{{238, 285}, {480, 360}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{0, 575}, {480, 270}}</string>
|
||||
<string>{{0, 575}, {480, 270}}</string>
|
||||
<reference ref="6"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>ScaledImageView</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">408</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">BorderlessWindow</string>
|
||||
<string key="superclassName">NSWindow</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">BorderlessWindow.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MSController</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<string key="NS.key.0">stopBtnClicked:</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSMutableArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>backdropImageFld</string>
|
||||
<string>backdropWindow</string>
|
||||
<string>detailFld</string>
|
||||
<string>imageFld</string>
|
||||
<string>messageFld</string>
|
||||
<string>progressIndicator</string>
|
||||
<string>stopBtn</string>
|
||||
<string>window</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">MSController.py</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MunkiStatusAppDelegate</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">MunkiStatusAppDelegate.py</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">ScaledImageView</string>
|
||||
<string key="superclassName">NSImageView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">ScaledImageView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.LastKnownRelativeProjectPath">../MunkiStatus.xcodeproj</string>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//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>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.googlecode.munki.munkistatus</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>MkSt</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.0</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>LSUIElement</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
@@ -0,0 +1,230 @@
|
||||
#
|
||||
# MSController.py
|
||||
# MunkiStatus
|
||||
#
|
||||
# Created by Greg Neagle on 9/21/09.
|
||||
# Copyright (c) 2009 Walt Disney Animation. All rights reserved.
|
||||
#
|
||||
|
||||
import os
|
||||
import socket
|
||||
import objc
|
||||
from Foundation import *
|
||||
from SystemConfiguration import SCDynamicStoreCopyConsoleUser
|
||||
from AppKit import *
|
||||
import PyObjCTools
|
||||
|
||||
debug = False
|
||||
|
||||
class NSPropertyListSerializationException(Exception):
|
||||
pass
|
||||
|
||||
def readPlist(filepath):
|
||||
"""
|
||||
Read a .plist file from filepath. Return the unpacked root object
|
||||
(which usually is a dictionary).
|
||||
"""
|
||||
plistData = NSData.dataWithContentsOfFile_(filepath)
|
||||
dataObject, plistFormat, error = NSPropertyListSerialization.propertyListFromData_mutabilityOption_format_errorDescription_(plistData, NSPropertyListMutableContainers, None, None)
|
||||
if error:
|
||||
raise NSPropertyListSerializationException(error)
|
||||
else:
|
||||
return dataObject
|
||||
|
||||
|
||||
def getLoginwindowPicture():
|
||||
desktopPicturePath = ''
|
||||
loginwindowPrefsPath = "/Library/Preferences/com.apple.loginwindow.plist"
|
||||
if os.path.exists(loginwindowPrefsPath):
|
||||
loginwindowPrefs = readPlist(loginwindowPrefsPath)
|
||||
if loginwindowPrefs:
|
||||
desktopPicturePath = loginwindowPrefs.get('DesktopPicture', '')
|
||||
if desktopPicturePath:
|
||||
if os.path.exists(desktopPicturePath):
|
||||
theImage = NSImage.alloc().initWithContentsOfFile_(desktopPicturePath)
|
||||
if theImage:
|
||||
return theImage
|
||||
return NSImage.imageNamed_("Solid Aqua Blue")
|
||||
return NSImage.alloc().initWithContentsFile_("/System/Library/CoreServices/DefaultDesktop.jpg")
|
||||
|
||||
|
||||
def getconsoleuser():
|
||||
cfuser = SCDynamicStoreCopyConsoleUser( None, None, None )
|
||||
return cfuser[0]
|
||||
|
||||
|
||||
class MSController(NSObject):
|
||||
window = objc.IBOutlet()
|
||||
messageFld = objc.IBOutlet()
|
||||
detailFld = objc.IBOutlet()
|
||||
progressIndicator = objc.IBOutlet()
|
||||
stopBtn = objc.IBOutlet()
|
||||
imageFld = objc.IBOutlet()
|
||||
|
||||
backdropWindow = objc.IBOutlet()
|
||||
backdropImageFld = objc.IBOutlet()
|
||||
|
||||
stopBtnState = 0
|
||||
restartAlertDismissed = 0
|
||||
|
||||
@objc.IBAction
|
||||
def stopBtnClicked_(self, sender):
|
||||
if debug:
|
||||
NSLog(u"Stop button was clicked.")
|
||||
sender.setState_(1)
|
||||
self.stopBtnState = 1
|
||||
sender.setEnabled_(False)
|
||||
|
||||
def awakeFromNib(self):
|
||||
NSLog(u"MunkiStatus.app PID: %s" % os.getpid())
|
||||
if getconsoleuser() == None:
|
||||
if self.backdropWindow:
|
||||
self.backdropWindow.setCanBecomeVisibleWithoutLogin_(True)
|
||||
self.backdropWindow.setLevel_(NSStatusWindowLevel)
|
||||
screenRect = NSScreen.mainScreen().frame()
|
||||
self.backdropWindow.setFrame_display_(screenRect, True)
|
||||
if self.backdropImageFld:
|
||||
bgImage = getLoginwindowPicture()
|
||||
self.backdropImageFld.setImage_(bgImage)
|
||||
self.backdropWindow.orderFrontRegardless()
|
||||
|
||||
if self.window:
|
||||
# needed so the window can show over the loginwindow
|
||||
self.window.setCanBecomeVisibleWithoutLogin_(True)
|
||||
if getconsoleuser() == None:
|
||||
self.window.setLevel_(NSScreenSaverWindowLevel - 1)
|
||||
self.window.center()
|
||||
self.window.setTitle_(u"Managed Software Update")
|
||||
self.window.orderFrontRegardless()
|
||||
if self.imageFld:
|
||||
theImage = NSImage.imageNamed_("Installer")
|
||||
self.imageFld.setImage_(theImage)
|
||||
if self.messageFld:
|
||||
self.messageFld.setStringValue_(u"Waiting...")
|
||||
if self.detailFld:
|
||||
self.detailFld.setStringValue_(u"")
|
||||
if self.progressIndicator:
|
||||
self.progressIndicator.setMinValue_(0.0)
|
||||
self.progressIndicator.setMaxValue_(100.0)
|
||||
self.progressIndicator.setIndeterminate_(True)
|
||||
self.progressIndicator.setUsesThreadedAnimation_(True)
|
||||
self.progressIndicator.startAnimation_(self)
|
||||
|
||||
NSThread.detachNewThreadSelector_toTarget_withObject_(self.handleSocket, self, None)
|
||||
NSApp.activateIgnoringOtherApps_(True)
|
||||
|
||||
def handleSocket(self):
|
||||
|
||||
# Autorelease pool for memory management
|
||||
pool = NSAutoreleasePool.alloc().init()
|
||||
|
||||
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
socketpath = "/tmp/com.googlecode.munki.munkistatus.%s" % os.getpid()
|
||||
try:
|
||||
os.remove(socketpath)
|
||||
except OSError:
|
||||
pass
|
||||
s.bind(socketpath)
|
||||
s.listen(1)
|
||||
conn, addr = s.accept()
|
||||
if debug:
|
||||
NSLog("Connection established.")
|
||||
buffer = ''
|
||||
keepLooping = True
|
||||
while keepLooping:
|
||||
data = conn.recv(1024)
|
||||
if not data:
|
||||
# socket connection was closed, we should terminate.
|
||||
NSLog("Connection closed without QUIT message.")
|
||||
break
|
||||
if debug:
|
||||
NSLog(repr(data))
|
||||
buffer = buffer + data
|
||||
# do we have at least one return character?
|
||||
if buffer.count('\n'):
|
||||
lines = buffer.splitlines(True)
|
||||
buffer = ''
|
||||
for line in lines:
|
||||
if line.endswith('\n'):
|
||||
command = line.rstrip('\n')
|
||||
if debug:
|
||||
NSLog(u"Received command: %s" % command)
|
||||
if command.startswith("QUIT: "):
|
||||
keepLooping = False
|
||||
break
|
||||
response = self.processSocketMsg(command)
|
||||
if response:
|
||||
conn.send(response)
|
||||
else:
|
||||
buffer = line
|
||||
break
|
||||
|
||||
conn.close()
|
||||
try:
|
||||
os.remove(socketpath)
|
||||
except OSError:
|
||||
pass
|
||||
NSApp.terminate_(self)
|
||||
|
||||
# Clean up autorelease pool
|
||||
del pool
|
||||
|
||||
def processSocketMsg(self, message):
|
||||
if message.startswith("ACTIVATE: "):
|
||||
NSApp.activateIgnoringOtherApps_(True)
|
||||
return ""
|
||||
if message.startswith("TITLE: "):
|
||||
self.window.setTitle_(message[7:])
|
||||
return ""
|
||||
if message.startswith("MESSAGE: "):
|
||||
self.messageFld.setStringValue_(message[9:])
|
||||
return ""
|
||||
if message.startswith("DETAIL: "):
|
||||
self.detailFld.setStringValue_(message[8:])
|
||||
return ""
|
||||
if message.startswith("PERCENT: "):
|
||||
self.setPercentageDone(message[9:])
|
||||
return ""
|
||||
if message.startswith("GETSTOPBUTTONSTATE: "):
|
||||
return "%s\n" % self.stopBtnState
|
||||
if message.startswith("HIDESTOPBUTTON: "):
|
||||
self.stopBtn.setHidden_(True)
|
||||
return ""
|
||||
if message.startswith("SHOWSTOPBUTTON: "):
|
||||
self.stopBtn.setHidden_(False)
|
||||
return ""
|
||||
if message.startswith("ENABLESTOPBUTTON: "):
|
||||
self.stopBtn.setEnabled_(True)
|
||||
return ""
|
||||
if message.startswith("DISABLESTOPBUTTON: "):
|
||||
self.stopBtn.setEnabled_(False)
|
||||
return ""
|
||||
if message.startswith("RESTARTALERT: "):
|
||||
self.doRestartAlert()
|
||||
while 1:
|
||||
if self.restartAlertDismissed:
|
||||
break
|
||||
return "1\n"
|
||||
|
||||
return ""
|
||||
|
||||
def setPercentageDone(self, percent):
|
||||
if float(percent) < 0:
|
||||
if not self.progressIndicator.isIndeterminate():
|
||||
self.progressIndicator.setIndeterminate_(True)
|
||||
self.progressIndicator.startAnimation_(self)
|
||||
else:
|
||||
if self.progressIndicator.isIndeterminate():
|
||||
self.progressIndicator.stopAnimation_(self)
|
||||
self.progressIndicator.setIndeterminate_(False)
|
||||
self.progressIndicator.setDoubleValue_(float(percent))
|
||||
|
||||
@PyObjCTools.AppHelper.endSheetMethod
|
||||
def alertDidEnd_returnCode_contextInfo_(self, alert, returncode, contextinfo):
|
||||
self.restartAlertDismissed = 1
|
||||
|
||||
def doRestartAlert(self):
|
||||
self.restartAlertDismissed = 0
|
||||
alert = NSAlert.alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat_("Restart Required", "Restart", objc.nil, objc.nil, "Software installed or removed requires a restart. You will have a chance to save open documents.")
|
||||
alert.beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_(self.window, self, self.alertDidEnd_returnCode_contextInfo_, objc.nil)
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,319 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 44;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
77631A270C06C501005415CB /* Python.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77631A260C06C501005415CB /* Python.framework */; };
|
||||
77631A3F0C0748CF005415CB /* main.py in Resources */ = {isa = PBXBuildFile; fileRef = 77631A3E0C0748CF005415CB /* main.py */; };
|
||||
7790198F0C07548A00326F66 /* MunkiStatusAppDelegate.py in Resources */ = {isa = PBXBuildFile; fileRef = 7790198E0C07548A00326F66 /* MunkiStatusAppDelegate.py */; };
|
||||
77C8C1F90C07829500965286 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 77C8C1F70C07829500965286 /* MainMenu.xib */; };
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
|
||||
C00C5343106847B000E16D63 /* MSController.py in Resources */ = {isa = PBXBuildFile; fileRef = C00C5342106847B000E16D63 /* MSController.py */; };
|
||||
C00C537010693D6B00E16D63 /* Solid Aqua Blue.png in Resources */ = {isa = PBXBuildFile; fileRef = C00C536910693D6B00E16D63 /* Solid Aqua Blue.png */; };
|
||||
C00C537110693D6B00E16D63 /* ScaledImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = C00C536A10693D6B00E16D63 /* ScaledImageView.m */; };
|
||||
C00C537210693D6B00E16D63 /* BorderlessWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = C00C536C10693D6B00E16D63 /* BorderlessWindow.m */; };
|
||||
C00C537310693D6B00E16D63 /* package.tiff in Resources */ = {isa = PBXBuildFile; fileRef = C00C536E10693D6B00E16D63 /* package.tiff */; };
|
||||
C00C537410693D6B00E16D63 /* Installer.tiff in Resources */ = {isa = PBXBuildFile; fileRef = C00C536F10693D6B00E16D63 /* Installer.tiff */; };
|
||||
C0640F44106AFC77006F43BE /* MunkiStatus.icns in Resources */ = {isa = PBXBuildFile; fileRef = C0640F43106AFC77006F43BE /* MunkiStatus.icns */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
|
||||
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
|
||||
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
32CA4F630368D1EE00C91783 /* MunkiStatus_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MunkiStatus_Prefix.pch; sourceTree = "<group>"; };
|
||||
77631A260C06C501005415CB /* Python.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Python.framework; path = /System/Library/Frameworks/Python.framework; sourceTree = "<absolute>"; };
|
||||
77631A3E0C0748CF005415CB /* main.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = main.py; sourceTree = "<group>"; };
|
||||
7790198E0C07548A00326F66 /* MunkiStatusAppDelegate.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = MunkiStatusAppDelegate.py; sourceTree = "<group>"; };
|
||||
77C8C1F80C07829500965286 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
8D1107320486CEB800E47090 /* MunkiStatus.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MunkiStatus.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C00C5342106847B000E16D63 /* MSController.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = MSController.py; sourceTree = "<group>"; };
|
||||
C00C536910693D6B00E16D63 /* Solid Aqua Blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Solid Aqua Blue.png"; sourceTree = "<group>"; };
|
||||
C00C536A10693D6B00E16D63 /* ScaledImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScaledImageView.m; sourceTree = "<group>"; };
|
||||
C00C536B10693D6B00E16D63 /* ScaledImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScaledImageView.h; sourceTree = "<group>"; };
|
||||
C00C536C10693D6B00E16D63 /* BorderlessWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BorderlessWindow.m; sourceTree = "<group>"; };
|
||||
C00C536D10693D6B00E16D63 /* BorderlessWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BorderlessWindow.h; sourceTree = "<group>"; };
|
||||
C00C536E10693D6B00E16D63 /* package.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = package.tiff; sourceTree = "<group>"; };
|
||||
C00C536F10693D6B00E16D63 /* Installer.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Installer.tiff; sourceTree = "<group>"; };
|
||||
C0640F43106AFC77006F43BE /* MunkiStatus.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = MunkiStatus.icns; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8D11072E0486CEB800E47090 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
|
||||
77631A270C06C501005415CB /* Python.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
080E96DDFE201D6D7F000001 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C00C5342106847B000E16D63 /* MSController.py */,
|
||||
7790198E0C07548A00326F66 /* MunkiStatusAppDelegate.py */,
|
||||
);
|
||||
name = Classes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
77631A260C06C501005415CB /* Python.framework */,
|
||||
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
|
||||
);
|
||||
name = "Linked Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
|
||||
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
19C28FACFE9D520D11CA2CBB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8D1107320486CEB800E47090 /* MunkiStatus.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97314FDCFA39411CA2CEA /* MunkiStatus */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8D1107310486CEB800E47090 /* Info.plist */,
|
||||
080E96DDFE201D6D7F000001 /* Classes */,
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */,
|
||||
29B97317FDCFA39411CA2CEA /* Resources */,
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */,
|
||||
19C28FACFE9D520D11CA2CBB /* Products */,
|
||||
);
|
||||
name = MunkiStatus;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C00C536B10693D6B00E16D63 /* ScaledImageView.h */,
|
||||
C00C536D10693D6B00E16D63 /* BorderlessWindow.h */,
|
||||
C00C536C10693D6B00E16D63 /* BorderlessWindow.m */,
|
||||
C00C536A10693D6B00E16D63 /* ScaledImageView.m */,
|
||||
32CA4F630368D1EE00C91783 /* MunkiStatus_Prefix.pch */,
|
||||
29B97316FDCFA39411CA2CEA /* main.m */,
|
||||
77631A3E0C0748CF005415CB /* main.py */,
|
||||
);
|
||||
name = "Other Sources";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C0640F43106AFC77006F43BE /* MunkiStatus.icns */,
|
||||
C00C536E10693D6B00E16D63 /* package.tiff */,
|
||||
C00C536F10693D6B00E16D63 /* Installer.tiff */,
|
||||
C00C536910693D6B00E16D63 /* Solid Aqua Blue.png */,
|
||||
77C8C1F70C07829500965286 /* MainMenu.xib */,
|
||||
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
|
||||
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
8D1107260486CEB800E47090 /* MunkiStatus */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "MunkiStatus" */;
|
||||
buildPhases = (
|
||||
8D1107290486CEB800E47090 /* Resources */,
|
||||
8D11072C0486CEB800E47090 /* Sources */,
|
||||
8D11072E0486CEB800E47090 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = MunkiStatus;
|
||||
productInstallPath = "$(HOME)/Applications";
|
||||
productName = MunkiStatus;
|
||||
productReference = 8D1107320486CEB800E47090 /* MunkiStatus.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
29B97313FDCFA39411CA2CEA /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MunkiStatus" */;
|
||||
compatibilityVersion = "Xcode 3.0";
|
||||
hasScannedForEncodings = 1;
|
||||
mainGroup = 29B97314FDCFA39411CA2CEA /* MunkiStatus */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
8D1107260486CEB800E47090 /* MunkiStatus */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8D1107290486CEB800E47090 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
|
||||
77631A3F0C0748CF005415CB /* main.py in Resources */,
|
||||
7790198F0C07548A00326F66 /* MunkiStatusAppDelegate.py in Resources */,
|
||||
77C8C1F90C07829500965286 /* MainMenu.xib in Resources */,
|
||||
C00C5343106847B000E16D63 /* MSController.py in Resources */,
|
||||
C00C537010693D6B00E16D63 /* Solid Aqua Blue.png in Resources */,
|
||||
C00C537310693D6B00E16D63 /* package.tiff in Resources */,
|
||||
C00C537410693D6B00E16D63 /* Installer.tiff in Resources */,
|
||||
C0640F44106AFC77006F43BE /* MunkiStatus.icns in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8D11072C0486CEB800E47090 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */,
|
||||
C00C537110693D6B00E16D63 /* ScaledImageView.m in Sources */,
|
||||
C00C537210693D6B00E16D63 /* BorderlessWindow.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
089C165DFE840E0CC02AAC07 /* English */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
77C8C1F70C07829500965286 /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
77C8C1F80C07829500965286 /* English */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
C01FCF4B08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = MunkiStatus_Prefix.pch;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
PRODUCT_NAME = MunkiStatus;
|
||||
WRAPPER_EXTENSION = app;
|
||||
ZERO_LINK = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C01FCF4C08A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = MunkiStatus_Prefix.pch;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
PRODUCT_NAME = MunkiStatus;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
C01FCF4F08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C01FCF5008A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "MunkiStatus" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C01FCF4B08A954540054247B /* Debug */,
|
||||
C01FCF4C08A954540054247B /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MunkiStatus" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C01FCF4F08A954540054247B /* Debug */,
|
||||
C01FCF5008A954540054247B /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#
|
||||
# MunkiStatusAppDelegate.py
|
||||
# MunkiStatus
|
||||
#
|
||||
# Created by Greg Neagle on 9/21/09.
|
||||
# Copyright Walt Disney Animation 2009. All rights reserved.
|
||||
#
|
||||
|
||||
from Foundation import *
|
||||
from AppKit import *
|
||||
|
||||
class MunkiStatusAppDelegate(NSObject):
|
||||
def applicationDidFinishLaunching_(self, sender):
|
||||
#NSLog("Application did finish launching.")
|
||||
pass
|
||||
|
||||
def applicationWillTerminate_(self,sender):
|
||||
NSLog("Application will terminate.")
|
||||
@@ -0,0 +1,7 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'MunkiStatus' target in the 'MunkiStatus' project
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// MyNSView.h
|
||||
// CustomNSViewTest
|
||||
//
|
||||
// Created by Greg Neagle on 5/27/09.
|
||||
//
|
||||
// Copyright 2009 Greg Neagle.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
@interface ScaledImageView : NSImageView
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// ScaledImageView.m
|
||||
//
|
||||
// Created by Greg Neagle on 5/27/09.
|
||||
//
|
||||
// Copyright 2009 Greg Neagle.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
|
||||
#import "ScaledImageView.h"
|
||||
|
||||
|
||||
@implementation ScaledImageView
|
||||
|
||||
-(void)drawRect:(NSRect *)rect {
|
||||
|
||||
NSRect dstRect = [self bounds];
|
||||
|
||||
float sourceWidth = [[self image] size].width;
|
||||
float sourceHeight = [[self image] size].height;
|
||||
float targetWidth = dstRect.size.width;
|
||||
float targetHeight = dstRect.size.height;
|
||||
|
||||
// Calculate aspect ratios
|
||||
float sourceRatio = sourceWidth / sourceHeight;
|
||||
float targetRatio = targetWidth / targetHeight;
|
||||
|
||||
// Determine what side of the source image to use for proportional scaling
|
||||
BOOL scaleWidth = (sourceRatio <= targetRatio);
|
||||
|
||||
// Proportionally scale source image
|
||||
float scalingFactor, scaledWidth, scaledHeight;
|
||||
if (scaleWidth) {
|
||||
scalingFactor = 1.0 / sourceRatio;
|
||||
scaledWidth = targetWidth;
|
||||
scaledHeight = round(targetWidth * scalingFactor);
|
||||
} else {
|
||||
scalingFactor = sourceRatio;
|
||||
scaledWidth = round(targetHeight * scalingFactor);
|
||||
scaledHeight = targetHeight;
|
||||
}
|
||||
float scaleFactor = scaledHeight / sourceHeight;
|
||||
|
||||
// Calculate compositing rectangles
|
||||
NSRect sourceRect;
|
||||
float destX, destY;
|
||||
|
||||
// Crop from center
|
||||
destX = round((scaledWidth - targetWidth) / 2.0);
|
||||
destY = round((scaledHeight - targetHeight) / 2.0);
|
||||
|
||||
sourceRect = NSMakeRect(destX / scaleFactor, destY / scaleFactor,
|
||||
targetWidth / scaleFactor, targetHeight / scaleFactor);
|
||||
|
||||
|
||||
[[self image] drawInRect:dstRect
|
||||
fromRect:sourceRect
|
||||
operation:NSCompositeSourceOver
|
||||
fraction:1.0];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 495 B |
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// main.m
|
||||
// MunkiStatus
|
||||
//
|
||||
// Created by Greg Neagle on 9/21/09.
|
||||
// Copyright Walt Disney Animation 2009. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Python/Python.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
NSBundle *mainBundle = [NSBundle mainBundle];
|
||||
NSString *resourcePath = [mainBundle resourcePath];
|
||||
NSArray *pythonPathArray = [NSArray arrayWithObjects: resourcePath, [resourcePath stringByAppendingPathComponent:@"PyObjC"], nil];
|
||||
|
||||
setenv("PYTHONPATH", [[pythonPathArray componentsJoinedByString:@":"] UTF8String], 1);
|
||||
|
||||
NSArray *possibleMainExtensions = [NSArray arrayWithObjects: @"py", @"pyc", @"pyo", nil];
|
||||
NSString *mainFilePath = nil;
|
||||
|
||||
for (NSString *possibleMainExtension in possibleMainExtensions) {
|
||||
mainFilePath = [mainBundle pathForResource: @"main" ofType: possibleMainExtension];
|
||||
if ( mainFilePath != nil ) break;
|
||||
}
|
||||
|
||||
if ( !mainFilePath ) {
|
||||
[NSException raise: NSInternalInconsistencyException format: @"%s:%d main() Failed to find the Main.{py,pyc,pyo} file in the application wrapper's Resources directory.", __FILE__, __LINE__];
|
||||
}
|
||||
|
||||
Py_SetProgramName("/usr/bin/python");
|
||||
Py_Initialize();
|
||||
PySys_SetArgv(argc, (char **)argv);
|
||||
|
||||
const char *mainFilePathPtr = [mainFilePath UTF8String];
|
||||
FILE *mainFile = fopen(mainFilePathPtr, "r");
|
||||
int result = PyRun_SimpleFile(mainFile, (char *)[[mainFilePath lastPathComponent] UTF8String]);
|
||||
|
||||
if ( result != 0 )
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"%s:%d main() PyRun_SimpleFile failed with file '%@'. See console for errors.", __FILE__, __LINE__, mainFilePath];
|
||||
|
||||
[pool drain];
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#
|
||||
# main.py
|
||||
# MunkiStatus
|
||||
#
|
||||
# Created by Greg Neagle on 9/21/09.
|
||||
# Copyright Walt Disney Animation 2009. All rights reserved.
|
||||
#
|
||||
|
||||
#import modules required by application
|
||||
import objc
|
||||
import Foundation
|
||||
import AppKit
|
||||
|
||||
from PyObjCTools import AppHelper
|
||||
|
||||
# import modules containing classes required to start application and load MainMenu.nib
|
||||
import MunkiStatusAppDelegate
|
||||
import MSController
|
||||
|
||||
# pass control to AppKit
|
||||
AppHelper.runEventLoop()
|
||||
Binary file not shown.
Reference in New Issue
Block a user