Skip to content

Commit

Permalink
cleanup preference
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowone committed Sep 27, 2018
1 parent f81a459 commit 7529d9c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 23 deletions.
32 changes: 15 additions & 17 deletions Preferences/Base.lproj/Preferences.xib
Expand Up @@ -13,7 +13,7 @@
<outlet property="inputModeExchangeShortcutView" destination="XiY-Tt-T3F" id="P94-Zj-7ft"/>
<outlet property="inputModeHanjaShortcutView" destination="H7u-hL-ncz" id="exc-2d-l3Z"/>
<outlet property="inputModeKoreanShortcutView" destination="ZkS-XC-ybl" id="B8V-7t-gJe"/>
<outlet property="windowDelegate" destination="DMm-2g-KCR" id="Z9P-92-IcS"/>
<outlet property="viewController" destination="DMm-2g-KCR" id="EWN-2K-pcr"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
Expand All @@ -22,22 +22,22 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="176" y="715" width="400" height="548"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="900"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
<view key="contentView" misplaced="YES" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="400" height="548"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" findBarPosition="belowContent" translatesAutoresizingMaskIntoConstraints="NO" id="6I9-vn-Dbb">
<rect key="frame" x="0.0" y="0.0" width="400" height="300"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="Psn-Uh-zb1">
<rect key="frame" x="0.0" y="0.0" width="400" height="300"/>
<rect key="frame" x="0.0" y="0.0" width="385" height="285"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view translatesAutoresizingMaskIntoConstraints="NO" id="Mwx-RP-qRv">
<rect key="frame" x="0.0" y="-200" width="400" height="500"/>
<rect key="frame" x="0.0" y="-215" width="385" height="500"/>
<subviews>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tMq-UC-GBP">
<rect key="frame" x="247" y="459" width="134" height="32"/>
<rect key="frame" x="232" y="459" width="134" height="32"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="00c-IC-7IF"/>
<constraint firstAttribute="width" constant="122" id="tGn-n0-cSc"/>
Expand Down Expand Up @@ -89,7 +89,7 @@
</connections>
</comboBox>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YGK-Vi-f1X">
<rect key="frame" x="23" y="336" width="110" height="17"/>
<rect key="frame" x="23" y="336" width="109" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="⌥(option) 키 동작:" id="jWu-1H-vJQ">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
Expand Down Expand Up @@ -190,7 +190,7 @@
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="QYr-aQ-b5O">
<rect key="frame" x="326" y="149" width="39" height="38"/>
<rect key="frame" x="326" y="151" width="38" height="37"/>
<constraints>
<constraint firstAttribute="width" constant="26" id="028-3e-SEc"/>
<constraint firstAttribute="height" constant="26" id="E0J-oy-6I2"/>
Expand All @@ -204,7 +204,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Th5-A5-nW2">
<rect key="frame" x="326" y="87" width="39" height="38"/>
<rect key="frame" x="326" y="89" width="38" height="37"/>
<constraints>
<constraint firstAttribute="width" constant="26" id="psx-Nr-h58"/>
<constraint firstAttribute="height" constant="26" id="v8L-TK-1TL"/>
Expand All @@ -218,7 +218,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="K9Y-NE-xf1">
<rect key="frame" x="326" y="54" width="39" height="38"/>
<rect key="frame" x="326" y="56" width="38" height="37"/>
<constraints>
<constraint firstAttribute="width" constant="26" id="6ek-RW-ajt"/>
<constraint firstAttribute="height" constant="26" id="ind-ay-rP8"/>
Expand All @@ -232,7 +232,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xGW-W9-NIo">
<rect key="frame" x="326" y="119" width="39" height="38"/>
<rect key="frame" x="326" y="121" width="38" height="37"/>
<constraints>
<constraint firstAttribute="width" constant="26" id="500-Ty-FU4"/>
<constraint firstAttribute="height" constant="26" id="NV0-an-WUg"/>
Expand Down Expand Up @@ -363,11 +363,11 @@
<constraint firstAttribute="height" constant="300" id="Jso-1l-2z0"/>
</constraints>
<scroller key="horizontalScroller" verticalHuggingPriority="750" horizontal="YES" id="Kcx-Qf-mei">
<rect key="frame" x="0.0" y="284" width="400" height="16"/>
<rect key="frame" x="0.0" y="285" width="385" height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="E1U-9N-bFJ">
<rect key="frame" x="384" y="0.0" width="16" height="300"/>
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="0.93023255813953487" horizontal="NO" id="E1U-9N-bFJ">
<rect key="frame" x="385" y="0.0" width="15" height="285"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
Expand All @@ -379,15 +379,13 @@
<constraint firstAttribute="trailing" secondItem="6I9-vn-Dbb" secondAttribute="trailing" id="pzZ-Tm-ISk"/>
</constraints>
</view>
<connections>
<outlet property="delegate" destination="DMm-2g-KCR" id="TZR-F2-JAi"/>
</connections>
<point key="canvasLocation" x="-214" y="33"/>
</window>
<customObject id="DMm-2g-KCR" customClass="PreferenceWindowDelegate" customModule="GureumPreferences" customModuleProvider="target">
<customObject id="DMm-2g-KCR" customClass="PreferenceViewController" customModule="GureumPreferences" customModuleProvider="target">
<connections>
<outlet property="defaultInputHangulComboBox" destination="X51-4X-EIq" id="LhT-HU-Jm4"/>
<outlet property="hangulWonCurrencySymbolForBackQuoteButton" destination="JYx-Sc-lao" id="5Kn-cE-sMA"/>
<outlet property="view" destination="se5-gp-TjO" id="x0B-I2-MHL"/>
</connections>
</customObject>
</objects>
Expand Down
2 changes: 1 addition & 1 deletion Preferences/Info.plist
Expand Up @@ -29,6 +29,6 @@
<key>NSPrefPaneIconLabel</key>
<string>Gureum Input Method</string>
<key>NSPrincipalClass</key>
<string>GureumPreferencePane</string>
<string>NSPreferencePane</string>
</dict>
</plist>
8 changes: 4 additions & 4 deletions Preferences/Preferences.swift
Expand Up @@ -12,15 +12,15 @@ import Cocoa
import MASShortcut

@objcMembers class GureumPreferencePane: NSPreferencePane {
@IBOutlet var windowDelegate: PreferenceWindowDelegate! = nil
@IBOutlet var viewController: NSViewController! = nil

override func mainViewDidLoad() {
super.mainViewDidLoad()
windowDelegate.viewDidLoad()
// self.viewController.viewDidLoad()
}
}

@objcMembers class PreferenceWindowDelegate: NSObject, NSWindowDelegate, NSComboBoxDataSource {
@objcMembers class PreferenceViewController: NSViewController, NSComboBoxDataSource {
@IBOutlet weak var defaultInputHangulComboBox: NSComboBox!
@IBOutlet weak var inputModeExchangeShortcutView: MASShortcutView!
@IBOutlet weak var inputModeHanjaShortcutView: MASShortcutView!
Expand All @@ -34,7 +34,7 @@ import MASShortcut

// @IBOutlet var _window: NSWindow!

func viewDidLoad() {
override func viewDidLoad() {

}

Expand Down
2 changes: 2 additions & 0 deletions PreferencesApp/PreferencesApp-Bridging-Header.h
Expand Up @@ -10,4 +10,6 @@
- (BOOL)instantiatePrefPaneObject;
- (NSPreferencePane *)prefPaneObject;

@property(readonly) NSBundle *bundle;

@end
4 changes: 3 additions & 1 deletion PreferencesApp/TestWindowController.swift
Expand Up @@ -16,10 +16,12 @@ class TestWindowController: NSWindowController {
override func windowDidLoad() {
let path = Bundle.main.path(forResource: "Preferences", ofType: "prefPane")
let bundle = NSPrefPaneBundle(path: path)!
assert(bundle.bundle != nil)
assert(bundle.bundle.principalClass != nil)
let loaded = bundle.instantiatePrefPaneObject()
assert(loaded)
let pane = bundle.prefPaneObject()!
pane.loadMainView()
// pane.loadMainView()
self.window!.contentView = pane.mainView
}
}

0 comments on commit 7529d9c

Please sign in to comment.