New tab item for settings

This commit is contained in:
Gerrit Linnemann 2016-12-19 09:33:33 +01:00
parent 877a7a7ea2
commit 3ceae82d36
7 changed files with 52 additions and 7 deletions

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "icon-transparent.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@ -675,14 +675,20 @@
<toolbarItem implicitItemIdentifier="NSToolbarPrintItem" id="GwS-Vr-90W"/>
<toolbarItem implicitItemIdentifier="NSToolbarSpaceItem" id="46s-4Y-0D4"/>
<toolbarItem implicitItemIdentifier="NSToolbarFlexibleSpaceItem" id="rDU-kC-B36"/>
<toolbarItem implicitItemIdentifier="A42EF47E-64EE-472A-B852-11FA2922A300" label="Neu laden" paletteLabel="Neu laden" tag="-1" image="NSRefreshTemplate" id="eMt-Dh-Yhp">
<toolbarItem implicitItemIdentifier="A42EF47E-64EE-472A-B852-11FA2922A300" label="Tickets" paletteLabel="Tickets" tag="-1" image="icon-transparent" id="eMt-Dh-Yhp">
<connections>
<action selector="toolbarActionReload:" target="B8D-0N-5wS" id="mgg-0v-kkd"/>
</connections>
</toolbarItem>
<toolbarItem implicitItemIdentifier="CC0BF630-F7BB-4131-B276-10BB3A0ACF88" label="Einstellungen" paletteLabel="Einstellungen" tag="-1" image="NSPreferencesGeneral" id="31c-eE-1XB">
<connections>
<action selector="toolbarActionSettings:" target="B8D-0N-5wS" id="3Qw-ua-kEb"/>
</connections>
</toolbarItem>
</allowedToolbarItems>
<defaultToolbarItems>
<toolbarItem reference="eMt-Dh-Yhp"/>
<toolbarItem reference="31c-eE-1XB"/>
<toolbarItem reference="rDU-kC-B36"/>
<toolbarItem reference="GwS-Vr-90W"/>
</defaultToolbarItems>
@ -710,7 +716,7 @@
<font key="font" metaFont="system"/>
<tabViewItems>
<tabViewItem label="Übersicht" identifier="1" id="MIJ-kl-tQe">
<view key="view" ambiguous="YES" id="3eX-zs-jOD">
<view key="view" id="3eX-zs-jOD">
<rect key="frame" x="10" y="33" width="692" height="417"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
@ -832,7 +838,7 @@
</subviews>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="yAG-0l-MrF">
<rect key="frame" x="1" y="400" width="696" height="16"/>
<rect key="frame" x="1" y="-16" width="0.0" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="0Mc-1B-cqp">
@ -848,7 +854,7 @@
</view>
</tabViewItem>
<tabViewItem label="Einstellungen" identifier="2" id="yzk-gj-wT8">
<view key="view" id="lU4-zL-hyv">
<view key="view" ambiguous="YES" id="lU4-zL-hyv">
<rect key="frame" x="10" y="33" width="692" height="417"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
@ -966,6 +972,7 @@
</subviews>
</view>
<connections>
<outlet property="tabView" destination="Zi9-hf-1KA" id="WBf-Lj-rLk"/>
<outlet property="ticketTableView" destination="uqq-D2-JrZ" id="Csb-WI-8ex"/>
<outlet property="txtBaseURL" destination="J3Z-8V-Igs" id="MNC-l0-bgU"/>
<outlet property="txtPassword" destination="dBq-YZ-1Lb" id="zcP-17-bRV"/>
@ -979,6 +986,7 @@
</scene>
</scenes>
<resources>
<image name="NSRefreshTemplate" width="11" height="15"/>
<image name="NSPreferencesGeneral" width="32" height="32"/>
<image name="icon-transparent" width="990" height="990"/>
</resources>
</document>

View File

@ -38,4 +38,11 @@ struct Constants {
static let IN = "nf::ticket::in"
}
}
struct TABS {
struct TAB {
static let OTRS = 0
static let SETTINGS = 1
}
}
}

View File

@ -15,6 +15,7 @@ class ViewController: NSViewController {
@IBOutlet weak var txtQueue: NSTextField!
@IBOutlet weak var txtBaseURL: NSTextField!
@IBOutlet weak var ticketTableView: NSTableView!
@IBOutlet weak var tabView: NSTabView!
override func viewDidLoad() {
super.viewDidLoad()
@ -67,6 +68,8 @@ class ViewController: NSViewController {
UserDefaults.standard.setValue(txtQueue.stringValue, forKey: Constants.USER_SETTINGS.OTRS.QUEUE)
UserDefaults.standard.setValue(txtBaseURL.stringValue, forKey: Constants.USER_SETTINGS.OTRS.BASE_URL)
self.tabView.selectTabViewItem(at: Constants.TABS.TAB.OTRS)
}

View File

@ -10,11 +10,11 @@ import Cocoa
class WindowController: NSWindowController {
/*var viewController: ViewController {
var viewController: ViewController {
get {
return self.window!.contentViewController! as! ViewController
}
}*/
}
override func windowDidLoad() {
super.windowDidLoad()
@ -26,6 +26,12 @@ class WindowController: NSWindowController {
if let que:Int = Int(UserDefaults.standard.string(forKey: Constants.USER_SETTINGS.OTRS.QUEUE)!) {
OTRS.sharedInstance.reload(que: que)
}
self.viewController.tabView.selectTabViewItem(at: Constants.TABS.TAB.OTRS)
}
@IBAction func toolbarActionSettings(_ sender: NSToolbarItem) {
self.viewController.tabView.selectTabViewItem(at: Constants.TABS.TAB.SETTINGS)
}
}