boB Rudis
5 years ago
commit
2d9ee8dc90
13 changed files with 944 additions and 0 deletions
@ -0,0 +1,361 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14865.1" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES"> |
||||
|
<dependencies> |
||||
|
<deployment version="101500" identifier="macosx"/> |
||||
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14865.1"/> |
||||
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
||||
|
</dependencies> |
||||
|
<objects> |
||||
|
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication"/> |
||||
|
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> |
||||
|
<customObject id="-3" userLabel="Application" customClass="NSObject"/> |
||||
|
<window title="R Switch" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" frameAutosaveName="r.switch.main" animationBehavior="default" id="21" userLabel="Window"> |
||||
|
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/> |
||||
|
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> |
||||
|
<rect key="contentRect" x="484" y="618" width="416" height="215"/> |
||||
|
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1440"/> |
||||
|
<view key="contentView" autoresizesSubviews="NO" id="2"> |
||||
|
<rect key="frame" x="0.0" y="0.0" width="416" height="215"/> |
||||
|
<autoresizingMask key="autoresizingMask"/> |
||||
|
<subviews> |
||||
|
<box autoresizesSubviews="NO" fixedFrame="YES" title="Current R Version" translatesAutoresizingMaskIntoConstraints="NO" id="206"> |
||||
|
<rect key="frame" x="17" y="16" width="382" height="179"/> |
||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
||||
|
<view key="contentView" id="zOt-Yb-lpq"> |
||||
|
<rect key="frame" x="3" y="3" width="376" height="161"/> |
||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
||||
|
<subviews> |
||||
|
<scrollView appearanceType="aqua" fixedFrame="YES" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="208"> |
||||
|
<rect key="frame" x="16" y="32" width="346" height="119"/> |
||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
||||
|
<clipView key="contentView" ambiguous="YES" copiesOnScroll="NO" id="Yhc-99-Y1I"> |
||||
|
<rect key="frame" x="1" y="1" width="344" height="117"/> |
||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
||||
|
<subviews> |
||||
|
<tableView verticalHuggingPriority="750" ambiguous="YES" allowsExpansionToolTips="YES" columnAutoresizingStyle="none" columnReordering="NO" columnResizing="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" id="209"> |
||||
|
<rect key="frame" x="0.0" y="0.0" width="466" height="117"/> |
||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
||||
|
<size key="intercellSpacing" width="3" height="2"/> |
||||
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> |
||||
|
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/> |
||||
|
<tableColumns> |
||||
|
<tableColumn identifier="version" editable="NO" width="60" minWidth="40" maxWidth="1000" id="210"> |
||||
|
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Version"> |
||||
|
<font key="font" metaFont="message" size="11"/> |
||||
|
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/> |
||||
|
<color key="backgroundColor" white="0.33333299" alpha="1" colorSpace="calibratedWhite"/> |
||||
|
</tableHeaderCell> |
||||
|
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" id="228"> |
||||
|
<font key="font" metaFont="system"/> |
||||
|
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> |
||||
|
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> |
||||
|
</textFieldCell> |
||||
|
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> |
||||
|
</tableColumn> |
||||
|
<tableColumn identifier="desc" width="400" minWidth="4" maxWidth="1000" id="221"> |
||||
|
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Description"> |
||||
|
<font key="font" metaFont="message" size="11"/> |
||||
|
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/> |
||||
|
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/> |
||||
|
</tableHeaderCell> |
||||
|
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" id="227"> |
||||
|
<font key="font" metaFont="system"/> |
||||
|
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> |
||||
|
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> |
||||
|
</textFieldCell> |
||||
|
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> |
||||
|
</tableColumn> |
||||
|
</tableColumns> |
||||
|
<connections> |
||||
|
<outlet property="dataSource" destination="213" id="220"/> |
||||
|
<outlet property="delegate" destination="213" id="219"/> |
||||
|
</connections> |
||||
|
</tableView> |
||||
|
</subviews> |
||||
|
</clipView> |
||||
|
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="229"> |
||||
|
<rect key="frame" x="-100" y="-100" width="128" height="15"/> |
||||
|
<autoresizingMask key="autoresizingMask"/> |
||||
|
</scroller> |
||||
|
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="230"> |
||||
|
<rect key="frame" x="-30" y="1" width="15" height="117"/> |
||||
|
<autoresizingMask key="autoresizingMask"/> |
||||
|
</scroller> |
||||
|
</scrollView> |
||||
|
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="212"> |
||||
|
<rect key="frame" x="16" y="11" width="220" height="13"/> |
||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> |
||||
|
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Change is effective immediately." id="225"> |
||||
|
<font key="font" metaFont="system" size="10"/> |
||||
|
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> |
||||
|
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> |
||||
|
</textFieldCell> |
||||
|
</textField> |
||||
|
<button verticalHuggingPriority="750" fixedFrame="YES" imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="222"> |
||||
|
<rect key="frame" x="282" y="8" width="81" height="16"/> |
||||
|
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> |
||||
|
<buttonCell key="cell" type="push" title="Rediscover" bezelStyle="rounded" alignment="center" controlSize="mini" borderStyle="border" inset="2" id="226"> |
||||
|
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> |
||||
|
<font key="font" metaFont="miniSystem"/> |
||||
|
</buttonCell> |
||||
|
<connections> |
||||
|
<action selector="rediscover:" target="213" id="223"/> |
||||
|
</connections> |
||||
|
</button> |
||||
|
</subviews> |
||||
|
</view> |
||||
|
</box> |
||||
|
</subviews> |
||||
|
</view> |
||||
|
<connections> |
||||
|
<outlet property="delegate" destination="213" id="217"/> |
||||
|
<outlet property="initialFirstResponder" destination="209" id="218"/> |
||||
|
</connections> |
||||
|
<point key="canvasLocation" x="139" y="148"/> |
||||
|
</window> |
||||
|
<menu title="MainMenu" systemMenu="main" id="29" userLabel="MainMenu"> |
||||
|
<items> |
||||
|
<menuItem title="RSwitch" id="56"> |
||||
|
<menu key="submenu" title="RSwitch" systemMenu="apple" id="57"> |
||||
|
<items> |
||||
|
<menuItem title="About RSwitch" id="58"> |
||||
|
<modifierMask key="keyEquivalentModifierMask"/> |
||||
|
<connections> |
||||
|
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem isSeparatorItem="YES" id="196"> |
||||
|
<modifierMask key="keyEquivalentModifierMask" command="YES"/> |
||||
|
</menuItem> |
||||
|
<menuItem title="Preferences…" keyEquivalent="," id="129"/> |
||||
|
<menuItem isSeparatorItem="YES" id="143"> |
||||
|
<modifierMask key="keyEquivalentModifierMask" command="YES"/> |
||||
|
</menuItem> |
||||
|
<menuItem title="Services" id="131"> |
||||
|
<menu key="submenu" title="Services" systemMenu="services" id="130"/> |
||||
|
</menuItem> |
||||
|
<menuItem isSeparatorItem="YES" id="144"> |
||||
|
<modifierMask key="keyEquivalentModifierMask" command="YES"/> |
||||
|
</menuItem> |
||||
|
<menuItem title="Hide RSwitch" keyEquivalent="h" id="134"> |
||||
|
<connections> |
||||
|
<action selector="hide:" target="-2" id="152"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Hide Others" keyEquivalent="h" id="145"> |
||||
|
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> |
||||
|
<connections> |
||||
|
<action selector="hideOtherApplications:" target="-2" id="146"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Show All" id="150"> |
||||
|
<connections> |
||||
|
<action selector="unhideAllApplications:" target="-2" id="153"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem isSeparatorItem="YES" id="149"> |
||||
|
<modifierMask key="keyEquivalentModifierMask" command="YES"/> |
||||
|
</menuItem> |
||||
|
<menuItem title="Quit RSwitch" keyEquivalent="q" id="136"> |
||||
|
<connections> |
||||
|
<action selector="terminate:" target="-2" id="139"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
</items> |
||||
|
</menu> |
||||
|
</menuItem> |
||||
|
<menuItem title="File" id="83"> |
||||
|
<menu key="submenu" title="File" id="81"> |
||||
|
<items> |
||||
|
<menuItem title="New" keyEquivalent="n" id="82"/> |
||||
|
<menuItem title="Open..." keyEquivalent="o" id="72"/> |
||||
|
<menuItem title="Open Recent" id="124"> |
||||
|
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="125"> |
||||
|
<items> |
||||
|
<menuItem title="Clear Menu" id="126"> |
||||
|
<connections> |
||||
|
<action selector="clearRecentDocuments:" target="-1" id="127"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
</items> |
||||
|
</menu> |
||||
|
</menuItem> |
||||
|
<menuItem isSeparatorItem="YES" id="79"> |
||||
|
<modifierMask key="keyEquivalentModifierMask" command="YES"/> |
||||
|
</menuItem> |
||||
|
<menuItem title="Close" keyEquivalent="w" id="73"> |
||||
|
<connections> |
||||
|
<action selector="performClose:" target="-1" id="193"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Save" keyEquivalent="s" id="75"/> |
||||
|
<menuItem title="Save As…" keyEquivalent="S" id="80"/> |
||||
|
<menuItem title="Revert" id="112"> |
||||
|
<modifierMask key="keyEquivalentModifierMask"/> |
||||
|
</menuItem> |
||||
|
<menuItem isSeparatorItem="YES" id="74"> |
||||
|
<modifierMask key="keyEquivalentModifierMask" command="YES"/> |
||||
|
</menuItem> |
||||
|
<menuItem title="Page Setup…" keyEquivalent="P" id="77"> |
||||
|
<connections> |
||||
|
<action selector="runPageLayout:" target="-1" id="87"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Print…" keyEquivalent="p" id="78"> |
||||
|
<connections> |
||||
|
<action selector="print:" target="-1" id="86"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
</items> |
||||
|
</menu> |
||||
|
</menuItem> |
||||
|
<menuItem title="Edit" id="163"> |
||||
|
<menu key="submenu" title="Edit" id="169"> |
||||
|
<items> |
||||
|
<menuItem title="Undo" keyEquivalent="z" id="158"> |
||||
|
<connections> |
||||
|
<action selector="undo:" target="-1" id="180"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Redo" keyEquivalent="Z" id="173"> |
||||
|
<connections> |
||||
|
<action selector="redo:" target="-1" id="178"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem isSeparatorItem="YES" id="156"> |
||||
|
<modifierMask key="keyEquivalentModifierMask" command="YES"/> |
||||
|
</menuItem> |
||||
|
<menuItem title="Cut" keyEquivalent="x" id="160"> |
||||
|
<connections> |
||||
|
<action selector="cut:" target="-1" id="175"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Copy" keyEquivalent="c" id="157"> |
||||
|
<connections> |
||||
|
<action selector="copy:" target="-1" id="181"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Paste" keyEquivalent="v" id="171"> |
||||
|
<connections> |
||||
|
<action selector="paste:" target="-1" id="176"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Paste and Match Style" keyEquivalent="V" id="204"> |
||||
|
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> |
||||
|
<connections> |
||||
|
<action selector="pasteAsPlainText:" target="-1" id="205"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Delete" id="164"> |
||||
|
<connections> |
||||
|
<action selector="delete:" target="-1" id="195"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Select All" keyEquivalent="a" id="172"> |
||||
|
<connections> |
||||
|
<action selector="selectAll:" target="-1" id="179"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem isSeparatorItem="YES" id="174"> |
||||
|
<modifierMask key="keyEquivalentModifierMask" command="YES"/> |
||||
|
</menuItem> |
||||
|
<menuItem title="Find" id="168"> |
||||
|
<menu key="submenu" title="Find" id="159"> |
||||
|
<items> |
||||
|
<menuItem title="Find…" tag="1" keyEquivalent="f" id="154"> |
||||
|
<connections> |
||||
|
<action selector="performFindPanelAction:" target="-1" id="199"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="167"> |
||||
|
<connections> |
||||
|
<action selector="performFindPanelAction:" target="-1" id="200"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="162"> |
||||
|
<connections> |
||||
|
<action selector="performFindPanelAction:" target="-1" id="201"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="161"> |
||||
|
<connections> |
||||
|
<action selector="performFindPanelAction:" target="-1" id="202"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Jump to Selection" keyEquivalent="j" id="155"> |
||||
|
<connections> |
||||
|
<action selector="centerSelectionInVisibleArea:" target="-1" id="203"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
</items> |
||||
|
</menu> |
||||
|
</menuItem> |
||||
|
<menuItem title="Spelling" id="184"> |
||||
|
<menu key="submenu" title="Spelling" id="185"> |
||||
|
<items> |
||||
|
<menuItem title="Spelling…" keyEquivalent=":" id="187"> |
||||
|
<connections> |
||||
|
<action selector="showGuessPanel:" target="-1" id="188"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Check Spelling" keyEquivalent=";" id="189"> |
||||
|
<connections> |
||||
|
<action selector="checkSpelling:" target="-1" id="190"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Check Spelling as You Type" id="191"> |
||||
|
<connections> |
||||
|
<action selector="toggleContinuousSpellChecking:" target="-1" id="192"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
</items> |
||||
|
</menu> |
||||
|
</menuItem> |
||||
|
</items> |
||||
|
</menu> |
||||
|
</menuItem> |
||||
|
<menuItem title="Window" id="19"> |
||||
|
<menu key="submenu" title="Window" systemMenu="window" id="24"> |
||||
|
<items> |
||||
|
<menuItem title="Minimize" keyEquivalent="m" id="23"> |
||||
|
<connections> |
||||
|
<action selector="performMiniaturize:" target="-1" id="37"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem title="Zoom" id="197"> |
||||
|
<connections> |
||||
|
<action selector="performZoom:" target="-1" id="198"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
<menuItem isSeparatorItem="YES" id="92"> |
||||
|
<modifierMask key="keyEquivalentModifierMask" command="YES"/> |
||||
|
</menuItem> |
||||
|
<menuItem title="Bring All to Front" id="5"> |
||||
|
<connections> |
||||
|
<action selector="arrangeInFront:" target="-1" id="39"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
</items> |
||||
|
</menu> |
||||
|
</menuItem> |
||||
|
<menuItem title="Help" id="103"> |
||||
|
<menu key="submenu" title="Help" id="106"> |
||||
|
<items> |
||||
|
<menuItem title="RSwitch Help" keyEquivalent="?" id="111"> |
||||
|
<connections> |
||||
|
<action selector="showHelp:" target="-1" id="122"/> |
||||
|
</connections> |
||||
|
</menuItem> |
||||
|
</items> |
||||
|
</menu> |
||||
|
</menuItem> |
||||
|
</items> |
||||
|
</menu> |
||||
|
<customObject id="213" userLabel="SwitchCtrl" customClass="SwitchCtrl"> |
||||
|
<connections> |
||||
|
<outlet property="list" destination="209" id="214"/> |
||||
|
<outlet property="window" destination="21" id="215"/> |
||||
|
</connections> |
||||
|
</customObject> |
||||
|
</objects> |
||||
|
</document> |
@ -0,0 +1,28 @@ |
|||||
|
<?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>RSwitch</string> |
||||
|
<key>CFBundleIdentifier</key> |
||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> |
||||
|
<key>CFBundleInfoDictionaryVersion</key> |
||||
|
<string>6.0</string> |
||||
|
<key>CFBundleName</key> |
||||
|
<string>${PRODUCT_NAME}</string> |
||||
|
<key>CFBundlePackageType</key> |
||||
|
<string>APPL</string> |
||||
|
<key>CFBundleSignature</key> |
||||
|
<string>????</string> |
||||
|
<key>CFBundleVersion</key> |
||||
|
<string>$(CURRENT_PROJECT_VERSION)</string> |
||||
|
<key>NSMainNibFile</key> |
||||
|
<string>MainMenu</string> |
||||
|
<key>NSPrincipalClass</key> |
||||
|
<string>NSApplication</string> |
||||
|
</dict> |
||||
|
</plist> |
Binary file not shown.
@ -0,0 +1,340 @@ |
|||||
|
// !$*UTF8*$! |
||||
|
{ |
||||
|
archiveVersion = 1; |
||||
|
classes = { |
||||
|
}; |
||||
|
objectVersion = 45; |
||||
|
objects = { |
||||
|
|
||||
|
/* Begin PBXBuildFile section */ |
||||
|
01E00C68231C30F700FCDEFE /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 01E00C66231C30F700FCDEFE /* MainMenu.xib */; }; |
||||
|
681F0F480AB1AB400089A9D9 /* SwitchCtrl.m in Sources */ = {isa = PBXBuildFile; fileRef = 681F0F470AB1AB400089A9D9 /* SwitchCtrl.m */; }; |
||||
|
681F11D10AB1BA7D0089A9D9 /* RSwitch.icns in Resources */ = {isa = PBXBuildFile; fileRef = 681F11D00AB1BA7D0089A9D9 /* RSwitch.icns */; }; |
||||
|
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 */; }; |
||||
|
/* End PBXBuildFile section */ |
||||
|
|
||||
|
/* Begin PBXFileReference section */ |
||||
|
01E00C65231C2B7800FCDEFE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; |
||||
|
01E00C67231C30F700FCDEFE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; 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 /* RSwitch_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RSwitch_Prefix.pch; sourceTree = "<group>"; }; |
||||
|
681F0F460AB1AB400089A9D9 /* SwitchCtrl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SwitchCtrl.h; sourceTree = "<group>"; }; |
||||
|
681F0F470AB1AB400089A9D9 /* SwitchCtrl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SwitchCtrl.m; sourceTree = "<group>"; }; |
||||
|
681F11D00AB1BA7D0089A9D9 /* RSwitch.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = RSwitch.icns; sourceTree = "<group>"; }; |
||||
|
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; |
||||
|
8D1107320486CEB800E47090 /* RSwitch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RSwitch.app; sourceTree = BUILT_PRODUCTS_DIR; }; |
||||
|
/* End PBXFileReference section */ |
||||
|
|
||||
|
/* Begin PBXFrameworksBuildPhase section */ |
||||
|
8D11072E0486CEB800E47090 /* Frameworks */ = { |
||||
|
isa = PBXFrameworksBuildPhase; |
||||
|
buildActionMask = 2147483647; |
||||
|
files = ( |
||||
|
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, |
||||
|
); |
||||
|
runOnlyForDeploymentPostprocessing = 0; |
||||
|
}; |
||||
|
/* End PBXFrameworksBuildPhase section */ |
||||
|
|
||||
|
/* Begin PBXGroup section */ |
||||
|
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { |
||||
|
isa = PBXGroup; |
||||
|
children = ( |
||||
|
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 /* RSwitch.app */, |
||||
|
); |
||||
|
name = Products; |
||||
|
sourceTree = "<group>"; |
||||
|
}; |
||||
|
29B97314FDCFA39411CA2CEA /* RSwitch */ = { |
||||
|
isa = PBXGroup; |
||||
|
children = ( |
||||
|
29B97315FDCFA39411CA2CEA /* Other Sources */, |
||||
|
29B97317FDCFA39411CA2CEA /* Resources */, |
||||
|
29B97323FDCFA39411CA2CEA /* Frameworks */, |
||||
|
19C28FACFE9D520D11CA2CBB /* Products */, |
||||
|
); |
||||
|
name = RSwitch; |
||||
|
sourceTree = "<group>"; |
||||
|
}; |
||||
|
29B97315FDCFA39411CA2CEA /* Other Sources */ = { |
||||
|
isa = PBXGroup; |
||||
|
children = ( |
||||
|
32CA4F630368D1EE00C91783 /* RSwitch_Prefix.pch */, |
||||
|
29B97316FDCFA39411CA2CEA /* main.m */, |
||||
|
681F0F460AB1AB400089A9D9 /* SwitchCtrl.h */, |
||||
|
681F0F470AB1AB400089A9D9 /* SwitchCtrl.m */, |
||||
|
); |
||||
|
name = "Other Sources"; |
||||
|
sourceTree = "<group>"; |
||||
|
}; |
||||
|
29B97317FDCFA39411CA2CEA /* Resources */ = { |
||||
|
isa = PBXGroup; |
||||
|
children = ( |
||||
|
01E00C66231C30F700FCDEFE /* MainMenu.xib */, |
||||
|
681F11D00AB1BA7D0089A9D9 /* RSwitch.icns */, |
||||
|
8D1107310486CEB800E47090 /* Info.plist */, |
||||
|
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 /* RSwitch */ = { |
||||
|
isa = PBXNativeTarget; |
||||
|
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "RSwitch" */; |
||||
|
buildPhases = ( |
||||
|
8D1107290486CEB800E47090 /* Resources */, |
||||
|
8D11072C0486CEB800E47090 /* Sources */, |
||||
|
8D11072E0486CEB800E47090 /* Frameworks */, |
||||
|
); |
||||
|
buildRules = ( |
||||
|
); |
||||
|
dependencies = ( |
||||
|
); |
||||
|
name = RSwitch; |
||||
|
productInstallPath = "$(HOME)/Applications"; |
||||
|
productName = RSwitch; |
||||
|
productReference = 8D1107320486CEB800E47090 /* RSwitch.app */; |
||||
|
productType = "com.apple.product-type.application"; |
||||
|
}; |
||||
|
/* End PBXNativeTarget section */ |
||||
|
|
||||
|
/* Begin PBXProject section */ |
||||
|
29B97313FDCFA39411CA2CEA /* Project object */ = { |
||||
|
isa = PBXProject; |
||||
|
attributes = { |
||||
|
LastUpgradeCheck = 1100; |
||||
|
}; |
||||
|
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "RSwitch" */; |
||||
|
compatibilityVersion = "Xcode 2.4"; |
||||
|
developmentRegion = en; |
||||
|
hasScannedForEncodings = 1; |
||||
|
knownRegions = ( |
||||
|
ja, |
||||
|
Base, |
||||
|
en, |
||||
|
fr, |
||||
|
de, |
||||
|
); |
||||
|
mainGroup = 29B97314FDCFA39411CA2CEA /* RSwitch */; |
||||
|
projectDirPath = ""; |
||||
|
projectRoot = ""; |
||||
|
targets = ( |
||||
|
8D1107260486CEB800E47090 /* RSwitch */, |
||||
|
); |
||||
|
}; |
||||
|
/* End PBXProject section */ |
||||
|
|
||||
|
/* Begin PBXResourcesBuildPhase section */ |
||||
|
8D1107290486CEB800E47090 /* Resources */ = { |
||||
|
isa = PBXResourcesBuildPhase; |
||||
|
buildActionMask = 2147483647; |
||||
|
files = ( |
||||
|
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, |
||||
|
681F11D10AB1BA7D0089A9D9 /* RSwitch.icns in Resources */, |
||||
|
01E00C68231C30F700FCDEFE /* MainMenu.xib in Resources */, |
||||
|
); |
||||
|
runOnlyForDeploymentPostprocessing = 0; |
||||
|
}; |
||||
|
/* End PBXResourcesBuildPhase section */ |
||||
|
|
||||
|
/* Begin PBXSourcesBuildPhase section */ |
||||
|
8D11072C0486CEB800E47090 /* Sources */ = { |
||||
|
isa = PBXSourcesBuildPhase; |
||||
|
buildActionMask = 2147483647; |
||||
|
files = ( |
||||
|
8D11072D0486CEB800E47090 /* main.m in Sources */, |
||||
|
681F0F480AB1AB400089A9D9 /* SwitchCtrl.m in Sources */, |
||||
|
); |
||||
|
runOnlyForDeploymentPostprocessing = 0; |
||||
|
}; |
||||
|
/* End PBXSourcesBuildPhase section */ |
||||
|
|
||||
|
/* Begin PBXVariantGroup section */ |
||||
|
01E00C66231C30F700FCDEFE /* MainMenu.xib */ = { |
||||
|
isa = PBXVariantGroup; |
||||
|
children = ( |
||||
|
01E00C67231C30F700FCDEFE /* Base */, |
||||
|
); |
||||
|
name = MainMenu.xib; |
||||
|
sourceTree = "<group>"; |
||||
|
}; |
||||
|
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { |
||||
|
isa = PBXVariantGroup; |
||||
|
children = ( |
||||
|
01E00C65231C2B7800FCDEFE /* en */, |
||||
|
); |
||||
|
name = InfoPlist.strings; |
||||
|
sourceTree = "<group>"; |
||||
|
}; |
||||
|
/* End PBXVariantGroup section */ |
||||
|
|
||||
|
/* Begin XCBuildConfiguration section */ |
||||
|
C01FCF4B08A954540054247B /* Debug */ = { |
||||
|
isa = XCBuildConfiguration; |
||||
|
buildSettings = { |
||||
|
CLANG_ENABLE_OBJC_WEAK = YES; |
||||
|
CODE_SIGN_IDENTITY = "-"; |
||||
|
COPY_PHASE_STRIP = NO; |
||||
|
CURRENT_PROJECT_VERSION = 1.3; |
||||
|
GCC_DYNAMIC_NO_PIC = NO; |
||||
|
GCC_MODEL_TUNING = G5; |
||||
|
GCC_OPTIMIZATION_LEVEL = 0; |
||||
|
INFOPLIST_FILE = Info.plist; |
||||
|
INSTALL_PATH = "$(HOME)/Applications"; |
||||
|
MACOSX_DEPLOYMENT_TARGET = 10.12; |
||||
|
PRODUCT_BUNDLE_IDENTIFIER = info.urbanek.RSwitch; |
||||
|
PRODUCT_NAME = RSwitch; |
||||
|
SDKROOT = macosx; |
||||
|
WRAPPER_EXTENSION = app; |
||||
|
ZERO_LINK = YES; |
||||
|
}; |
||||
|
name = Debug; |
||||
|
}; |
||||
|
C01FCF4C08A954540054247B /* Release */ = { |
||||
|
isa = XCBuildConfiguration; |
||||
|
buildSettings = { |
||||
|
CLANG_ENABLE_OBJC_WEAK = YES; |
||||
|
CODE_SIGN_IDENTITY = "-"; |
||||
|
CURRENT_PROJECT_VERSION = 1.3; |
||||
|
GCC_GENERATE_DEBUGGING_SYMBOLS = NO; |
||||
|
GCC_MODEL_TUNING = G5; |
||||
|
GCC_VERSION = ""; |
||||
|
INFOPLIST_FILE = Info.plist; |
||||
|
INSTALL_PATH = "$(HOME)/Applications"; |
||||
|
MACOSX_DEPLOYMENT_TARGET = 10.12; |
||||
|
PRODUCT_BUNDLE_IDENTIFIER = info.urbanek.RSwitch; |
||||
|
PRODUCT_NAME = RSwitch; |
||||
|
SDKROOT = macosx; |
||||
|
WRAPPER_EXTENSION = app; |
||||
|
}; |
||||
|
name = Release; |
||||
|
}; |
||||
|
C01FCF4F08A954540054247B /* Debug */ = { |
||||
|
isa = XCBuildConfiguration; |
||||
|
buildSettings = { |
||||
|
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; |
||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; |
||||
|
CLANG_WARN_BOOL_CONVERSION = YES; |
||||
|
CLANG_WARN_COMMA = YES; |
||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES; |
||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; |
||||
|
CLANG_WARN_EMPTY_BODY = YES; |
||||
|
CLANG_WARN_ENUM_CONVERSION = YES; |
||||
|
CLANG_WARN_INFINITE_RECURSION = YES; |
||||
|
CLANG_WARN_INT_CONVERSION = YES; |
||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; |
||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; |
||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; |
||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; |
||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES; |
||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES; |
||||
|
CLANG_WARN_UNREACHABLE_CODE = YES; |
||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; |
||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES; |
||||
|
ENABLE_TESTABILITY = YES; |
||||
|
GCC_NO_COMMON_BLOCKS = YES; |
||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; |
||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES; |
||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES; |
||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES; |
||||
|
GCC_WARN_UNUSED_FUNCTION = YES; |
||||
|
GCC_WARN_UNUSED_VARIABLE = YES; |
||||
|
ONLY_ACTIVE_ARCH = YES; |
||||
|
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; |
||||
|
}; |
||||
|
name = Debug; |
||||
|
}; |
||||
|
C01FCF5008A954540054247B /* Release */ = { |
||||
|
isa = XCBuildConfiguration; |
||||
|
buildSettings = { |
||||
|
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; |
||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; |
||||
|
CLANG_WARN_BOOL_CONVERSION = YES; |
||||
|
CLANG_WARN_COMMA = YES; |
||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES; |
||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; |
||||
|
CLANG_WARN_EMPTY_BODY = YES; |
||||
|
CLANG_WARN_ENUM_CONVERSION = YES; |
||||
|
CLANG_WARN_INFINITE_RECURSION = YES; |
||||
|
CLANG_WARN_INT_CONVERSION = YES; |
||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; |
||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; |
||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; |
||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; |
||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES; |
||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES; |
||||
|
CLANG_WARN_UNREACHABLE_CODE = YES; |
||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; |
||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES; |
||||
|
GCC_NO_COMMON_BLOCKS = YES; |
||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; |
||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES; |
||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES; |
||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES; |
||||
|
GCC_WARN_UNUSED_FUNCTION = YES; |
||||
|
GCC_WARN_UNUSED_VARIABLE = YES; |
||||
|
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; |
||||
|
}; |
||||
|
name = Release; |
||||
|
}; |
||||
|
/* End XCBuildConfiguration section */ |
||||
|
|
||||
|
/* Begin XCConfigurationList section */ |
||||
|
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "RSwitch" */ = { |
||||
|
isa = XCConfigurationList; |
||||
|
buildConfigurations = ( |
||||
|
C01FCF4B08A954540054247B /* Debug */, |
||||
|
C01FCF4C08A954540054247B /* Release */, |
||||
|
); |
||||
|
defaultConfigurationIsVisible = 0; |
||||
|
defaultConfigurationName = Release; |
||||
|
}; |
||||
|
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "RSwitch" */ = { |
||||
|
isa = XCConfigurationList; |
||||
|
buildConfigurations = ( |
||||
|
C01FCF4F08A954540054247B /* Debug */, |
||||
|
C01FCF5008A954540054247B /* Release */, |
||||
|
); |
||||
|
defaultConfigurationIsVisible = 0; |
||||
|
defaultConfigurationName = Release; |
||||
|
}; |
||||
|
/* End XCConfigurationList section */ |
||||
|
}; |
||||
|
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; |
||||
|
} |
@ -0,0 +1,7 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<Workspace |
||||
|
version = "1.0"> |
||||
|
<FileRef |
||||
|
location = "self:"> |
||||
|
</FileRef> |
||||
|
</Workspace> |
@ -0,0 +1,8 @@ |
|||||
|
<?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>IDEDidComputeMac32BitWarning</key> |
||||
|
<true/> |
||||
|
</dict> |
||||
|
</plist> |
Binary file not shown.
@ -0,0 +1,14 @@ |
|||||
|
<?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>SchemeUserState</key> |
||||
|
<dict> |
||||
|
<key>RSwitch.xcscheme_^#shared#^_</key> |
||||
|
<dict> |
||||
|
<key>orderHint</key> |
||||
|
<integer>0</integer> |
||||
|
</dict> |
||||
|
</dict> |
||||
|
</dict> |
||||
|
</plist> |
@ -0,0 +1,7 @@ |
|||||
|
// |
||||
|
// Prefix header for all source files of the 'RSwitch' target in the 'RSwitch' project |
||||
|
// |
||||
|
|
||||
|
#ifdef __OBJC__ |
||||
|
#import <Cocoa/Cocoa.h> |
||||
|
#endif |
@ -0,0 +1,10 @@ |
|||||
|
/* SwitchCtrl */ |
||||
|
|
||||
|
#import <Cocoa/Cocoa.h> |
||||
|
|
||||
|
@interface SwitchCtrl : NSObject |
||||
|
{ |
||||
|
IBOutlet NSTableView *list; |
||||
|
IBOutlet NSWindow *window; |
||||
|
} |
||||
|
@end |
@ -0,0 +1,152 @@ |
|||||
|
#import "SwitchCtrl.h" |
||||
|
|
||||
|
NSArray *versions = nil; |
||||
|
NSArray *desc = nil; |
||||
|
BOOL finishedLoading = NO; |
||||
|
|
||||
|
@interface SwitchCtrl (Private) |
||||
|
|
||||
|
- (void) reloadVersions; |
||||
|
@end |
||||
|
|
||||
|
@implementation SwitchCtrl |
||||
|
|
||||
|
NSString *where = @"/Library/Frameworks/R.framework/Versions"; |
||||
|
|
||||
|
- (IBAction)rediscover:(id)sender |
||||
|
{ |
||||
|
[self reloadVersions]; |
||||
|
} |
||||
|
|
||||
|
/* awake */ |
||||
|
|
||||
|
- (void) awakeFromNib { |
||||
|
[self reloadVersions]; |
||||
|
finishedLoading = YES; |
||||
|
} |
||||
|
|
||||
|
// fn is now a path to R_HOME. Uses bin/R (for older R) or Rversion.h header |
||||
|
static NSString *getVersionString(NSString *fn) { |
||||
|
char buf[512]; |
||||
|
FILE *f = fopen([[fn stringByAppendingString:@"/bin/R"] UTF8String],"r"); |
||||
|
if (!f) return @"<incomplete installation>"; |
||||
|
buf[511]=0; |
||||
|
while (!feof(f) && fgets(buf,511,f)) { |
||||
|
char *c = strstr(buf,"version=\""); |
||||
|
if (c) { |
||||
|
char *d = c; |
||||
|
while (*d) d++; |
||||
|
d--; while (d > c+10 && (*d=='.' || *d=='\n' || *d=='\r' || *d==' ')) { *d=0; d--; }; |
||||
|
fclose(f); |
||||
|
return [NSString stringWithUTF8String:c+9]; |
||||
|
} |
||||
|
} |
||||
|
fclose(f); |
||||
|
// bin/R doesn't contain version="" - try headers - it's messy, though |
||||
|
f = fopen([[fn stringByAppendingString:@"/include/i386/Rversion.h"] UTF8String], "r"); |
||||
|
if (!f) // possibly not multi-arch -- note that this won't work for multi-arch as it's jsut a stub |
||||
|
f = fopen([[fn stringByAppendingString:@"/include/Rversion.h"] UTF8String], "r"); |
||||
|
if (f) { |
||||
|
NSString *ver = @""; |
||||
|
while (!feof(f) && fgets(buf, 511, f)) { |
||||
|
int maj = 1; |
||||
|
char *c = strstr(buf, "R_MAJOR"); |
||||
|
if (!c) { |
||||
|
c = strstr(buf, "R_MINOR"); |
||||
|
maj = 0; |
||||
|
} |
||||
|
if (c) { |
||||
|
char *anchor; |
||||
|
while (*c && *c != '\"') c++; |
||||
|
if (*c) c++; |
||||
|
anchor = c; |
||||
|
while (*c && *c != '\"') c++; |
||||
|
*c = 0; |
||||
|
ver = [ver stringByAppendingFormat:@"%s%s", maj ? "" : ".", anchor]; |
||||
|
} |
||||
|
} |
||||
|
fclose(f); |
||||
|
if ([ver length] > 0) |
||||
|
return ver; |
||||
|
} |
||||
|
return @"<unknown>"; |
||||
|
} |
||||
|
|
||||
|
- (void) reloadVersions { |
||||
|
NSArray *cont = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:where error:nil]; |
||||
|
|
||||
|
if (cont) { |
||||
|
NSMutableArray *ma = [[NSMutableArray alloc] initWithCapacity:[cont count]]; |
||||
|
if (desc) [desc release]; |
||||
|
desc = [[NSMutableArray alloc] initWithCapacity:[cont count]]; |
||||
|
NSEnumerator *enumerator = [cont objectEnumerator]; |
||||
|
|
||||
|
NSString *cur = [[NSFileManager defaultManager] destinationOfSymbolicLinkAtPath:[NSString stringWithFormat:@"%@/Current", where] error: nil]; |
||||
|
|
||||
|
NSString *ver; |
||||
|
while (ver = (NSString*) [enumerator nextObject]) { |
||||
|
NSString *rsh = [NSString stringWithFormat:@"%@/%@/Resources", where, ver]; |
||||
|
if (![ver isEqualToString:@"Current"] && [[NSFileManager defaultManager] fileExistsAtPath:rsh]) { |
||||
|
[ma addObject:ver]; |
||||
|
[(NSMutableArray*)desc addObject: getVersionString(rsh)]; |
||||
|
} |
||||
|
} |
||||
|
if (versions) [versions release]; |
||||
|
versions = ma; |
||||
|
|
||||
|
[list reloadData]; |
||||
|
|
||||
|
if (cur) { |
||||
|
NSUInteger cp = [versions indexOfObject:cur]; |
||||
|
if (cp != NSNotFound) [list selectRowIndexes:[NSIndexSet indexSetWithIndex:cp] byExtendingSelection:NO]; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/* selection */ |
||||
|
|
||||
|
- (void) tableViewSelectionDidChange:(NSNotification *)aNotification |
||||
|
{ |
||||
|
NSUInteger nr = [list numberOfRows]; |
||||
|
NSInteger sel = -1; |
||||
|
if (nr>0) { |
||||
|
sel = [list selectedRow]; |
||||
|
if (finishedLoading && sel>=0 && sel<nr) { |
||||
|
NSString *curl = [NSString stringWithFormat:@"%@/Current", where]; |
||||
|
NSString *new = [versions objectAtIndex:sel]; |
||||
|
[[NSFileManager defaultManager] removeItemAtURL:[NSURL URLWithString:curl] error: nil]; |
||||
|
[[NSFileManager defaultManager] createSymbolicLinkAtURL:[NSURL URLWithString:curl] withDestinationURL:[NSURL URLWithString:new] error: nil]; |
||||
|
NSLog(@"Requested change of link %@ to %@", curl, new); |
||||
|
} |
||||
|
} |
||||
|
NSLog(@"Did change, nr=%ld, sel=%ld, finished=%d", nr, sel, finishedLoading); |
||||
|
} |
||||
|
|
||||
|
/* dataSource callbacks */ |
||||
|
|
||||
|
- (id)tableView:(NSTableView *)aTableView |
||||
|
objectValueForTableColumn:(NSTableColumn *)aTableColumn |
||||
|
row:(int)rowIndex |
||||
|
{ |
||||
|
NSArray *ac = nil; |
||||
|
if ([[aTableColumn identifier] isEqual:@"desc"]) ac = desc; |
||||
|
if ([[aTableColumn identifier] isEqual:@"version"]) ac = versions; |
||||
|
if (!ac) return nil; |
||||
|
NSParameterAssert(rowIndex >= 0 && rowIndex < [ac count]); |
||||
|
return [ac objectAtIndex:rowIndex]; |
||||
|
} |
||||
|
|
||||
|
- (NSUInteger)numberOfRowsInTableView:(NSTableView *)aTableView |
||||
|
{ |
||||
|
return desc?[desc count]:0; |
||||
|
} |
||||
|
|
||||
|
/* window callbacks */ |
||||
|
|
||||
|
- (BOOL)windowShouldClose:(id)sender { |
||||
|
[NSApp terminate:0]; |
||||
|
return YES; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@end |
@ -0,0 +1,3 @@ |
|||||
|
/* Localized versions of Info.plist keys */ |
||||
|
|
||||
|
NSHumanReadableCopyright = "© Simon Urbanek, 2006,2011"; |
@ -0,0 +1,14 @@ |
|||||
|
// |
||||
|
// main.m |
||||
|
// RSwitch |
||||
|
// |
||||
|
// Created by Simon Urbanek on 9/8/06. |
||||
|
// Copyright Simon Urbanek 2006,2011. All rights reserved. |
||||
|
// |
||||
|
|
||||
|
#import <Cocoa/Cocoa.h> |
||||
|
|
||||
|
int main(int argc, char *argv[]) |
||||
|
{ |
||||
|
return NSApplicationMain(argc, (const char **) argv); |
||||
|
} |
Loading…
Reference in new issue