Skip to content
This repository has been archived by the owner on Nov 12, 2021. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavo-IM committed Jan 15, 2019
2 parents 5b87674 + af256e1 commit a1a84d7
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 47 deletions.
33 changes: 17 additions & 16 deletions AGPMInjector/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -710,20 +710,6 @@
<rect key="frame" x="0.0" y="0.0" width="480" height="311"/>
<autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
<subviews>
<comboBox verticalHuggingPriority="750" id="epE-0h-z0T">
<rect key="frame" x="148" y="267" width="188" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="5" id="ATg-IS-GmI">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<objectValues>
<string>Item 1</string>
<string>Item 2</string>
<string>Item 3</string>
</objectValues>
</comboBoxCell>
</comboBox>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="K75-gj-yNU">
<rect key="frame" x="180" y="203" width="120" height="17"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down Expand Up @@ -771,17 +757,32 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" id="bEH-oe-swK">
<rect key="frame" x="168" y="268" width="145" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="cBc-8F-1df" id="v33-Z2-19j">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="djL-ty-7io">
<items>
<menuItem title="Item 1" state="on" id="cBc-8F-1df"/>
<menuItem title="Item 2" id="hO1-Re-yaL"/>
<menuItem title="Item 3" id="5PX-UM-KEZ"/>
</items>
</menu>
</popUpButtonCell>
</popUpButton>
</subviews>
</view>
<connections>
<outlet property="iGPULabel" destination="CgF-28-oYz" id="Wps-rE-i8O"/>
<outlet property="myComboBox" destination="epE-0h-z0T" id="VbG-FH-EvM"/>
<outlet property="popButton" destination="bEH-oe-swK" id="60h-t4-J7p"/>
<outlet property="yesChecked" destination="FRP-b5-Lma" id="jnh-ZI-3zB"/>
</connections>
</viewController>
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="809"/>
<point key="canvasLocation" x="75" y="808.5"/>
</scene>
</scenes>
</document>
2 changes: 1 addition & 1 deletion AGPMInjector/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0</string>
<string>2.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
Expand Down
60 changes: 30 additions & 30 deletions AGPMInjector/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class ViewController: NSViewController {
let setInfoPlistName = "Info.plist"
let tDocumentDirectory = FileManager.default.urls(for: .desktopDirectory, in: .userDomainMask).first!

@IBOutlet weak var popButton: NSPopUpButton!
@IBOutlet weak var iGPULabel: NSTextField!
@IBOutlet weak var yesChecked: NSButton!
@IBOutlet weak var myComboBox: NSComboBox!
override func viewDidLoad() {
self.preferredContentSize = NSMakeSize(self.view.frame.size.width, self.view.frame.size.height);
super.viewDidLoad()
Expand Down Expand Up @@ -137,10 +137,10 @@ class ViewController: NSViewController {
renameItemInArray(olditem: "Mac-FFE5EF870D7BA81A", newitem: "iMac16,2")

let sortedArray = comboboxArray.sorted()

myComboBox.removeAllItems()
myComboBox.addItems(withObjectValues: sortedArray)
myComboBox.selectItem(at: sortedArray.count-1)
popButton.removeAllItems()
popButton.addItems(withTitles: sortedArray)
popButton.selectItem(at: 0)
yesChecked.state = NSControlStateValueOff

}
Expand All @@ -157,7 +157,7 @@ class ViewController: NSViewController {
let plistData = try! plistDecoder.decode(PlistGet.self, from: data)
let filePath = tDocumentDirectory.appendingPathComponent("\(setAGPMInjectorDirectory)")
// Create a object to represent the plist data to get encoded
if myComboBox.stringValue == "iMacPro1,1" {
if popButton.titleOfSelectedItem == "iMacPro1,1" {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
let cfBundleInfoDictionaryVersion, cfBundleName, cfBundlePackageType, cfBundleShortVersionString: String
Expand Down Expand Up @@ -232,7 +232,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "MacPro5,1" {
if popButton.titleOfSelectedItem == "MacPro5,1" {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
let cfBundleInfoDictionaryVersion, cfBundleName, cfBundlePackageType, cfBundleShortVersionString: String
Expand Down Expand Up @@ -305,7 +305,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "MacPro4,1" {
if popButton.titleOfSelectedItem == "MacPro4,1" {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
let cfBundleInfoDictionaryVersion, cfBundleName, cfBundlePackageType, cfBundleShortVersionString: String
Expand Down Expand Up @@ -379,7 +379,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "MacPro6,1" {
if popButton.titleOfSelectedItem == "MacPro6,1" {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
let cfBundleInfoDictionaryVersion, cfBundleName, cfBundlePackageType, cfBundleShortVersionString: String
Expand Down Expand Up @@ -453,7 +453,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac14,2" {
if popButton.titleOfSelectedItem == "iMac14,2" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -646,7 +646,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac13,1" {
if popButton.titleOfSelectedItem == "iMac13,1" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -820,7 +820,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac14,1" {
if popButton.titleOfSelectedItem == "iMac14,1" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -1013,7 +1013,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac15,1" {
if popButton.titleOfSelectedItem == "iMac15,1" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -1206,7 +1206,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac18,1" {
if popButton.titleOfSelectedItem == "iMac18,1" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -1439,7 +1439,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac17,1" {
if popButton.titleOfSelectedItem == "iMac17,1" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -1612,7 +1612,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac14,3" {
if popButton.titleOfSelectedItem == "iMac14,3" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -1805,7 +1805,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac18,2" {
if popButton.titleOfSelectedItem == "iMac18,2" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -2038,7 +2038,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac13,3" {
if popButton.titleOfSelectedItem == "iMac13,3" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -2212,7 +2212,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac14,4" {
if popButton.titleOfSelectedItem == "iMac14,4" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -2405,7 +2405,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac16,1" {
if popButton.titleOfSelectedItem == "iMac16,1" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -2613,7 +2613,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac18,3" {
if popButton.titleOfSelectedItem == "iMac18,3" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -2846,7 +2846,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac15,2" {
if popButton.titleOfSelectedItem == "iMac15,2" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -3039,7 +3039,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac13,2" {
if popButton.titleOfSelectedItem == "iMac13,2" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -3213,7 +3213,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac16,2" {
if popButton.titleOfSelectedItem == "iMac16,2" {
if yesChecked.state == NSControlStateValueOff {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -3421,7 +3421,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac12,2" {
if popButton.titleOfSelectedItem == "iMac12,2" {
yesChecked.state = NSControlStateValueOff
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -3496,7 +3496,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac12,1" {
if popButton.titleOfSelectedItem == "iMac12,1" {
yesChecked.state = NSControlStateValueOff
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -3571,7 +3571,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac11,3" {
if popButton.titleOfSelectedItem == "iMac11,3" {
yesChecked.state = NSControlStateValueOff
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -3646,7 +3646,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac11,2" {
if popButton.titleOfSelectedItem == "iMac11,2" {
yesChecked.state = NSControlStateValueOff
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down Expand Up @@ -3721,7 +3721,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac11,1" {
if popButton.titleOfSelectedItem == "iMac11,1" {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
let cfBundleInfoDictionaryVersion, cfBundleName, cfBundlePackageType, cfBundleShortVersionString: String
Expand Down Expand Up @@ -3795,7 +3795,7 @@ class ViewController: NSViewController {
}
}

if myComboBox.stringValue == "iMac10,1" {
if popButton.titleOfSelectedItem == "iMac10,1" {
if yesChecked.state == NSControlStateValueOn {
struct PlistSet: Codable {
let buildMachineOSBuild, cfBundleDevelopmentRegion, cfBundleGetInfoString, cfBundleIdentifier: String
Expand Down

0 comments on commit a1a84d7

Please sign in to comment.