diff --git a/OTRS-Watch.xcodeproj/project.xcworkspace/xcuserdata/linnemann.xcuserdatad/UserInterfaceState.xcuserstate b/OTRS-Watch.xcodeproj/project.xcworkspace/xcuserdata/linnemann.xcuserdatad/UserInterfaceState.xcuserstate index ac0bbae..b12ebde 100644 Binary files a/OTRS-Watch.xcodeproj/project.xcworkspace/xcuserdata/linnemann.xcuserdatad/UserInterfaceState.xcuserstate and b/OTRS-Watch.xcodeproj/project.xcworkspace/xcuserdata/linnemann.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/OTRS-Watch/Assets.xcassets/icon-transparent.imageset/Contents.json b/OTRS-Watch/Assets.xcassets/icon-transparent.imageset/Contents.json new file mode 100644 index 0000000..0f4ab26 --- /dev/null +++ b/OTRS-Watch/Assets.xcassets/icon-transparent.imageset/Contents.json @@ -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" + } +} \ No newline at end of file diff --git a/OTRS-Watch/Assets.xcassets/icon-transparent.imageset/icon-transparent.png b/OTRS-Watch/Assets.xcassets/icon-transparent.imageset/icon-transparent.png new file mode 100644 index 0000000..d41aaab Binary files /dev/null and b/OTRS-Watch/Assets.xcassets/icon-transparent.imageset/icon-transparent.png differ diff --git a/OTRS-Watch/Base.lproj/Main.storyboard b/OTRS-Watch/Base.lproj/Main.storyboard index 1042293..0467ac9 100644 --- a/OTRS-Watch/Base.lproj/Main.storyboard +++ b/OTRS-Watch/Base.lproj/Main.storyboard @@ -675,14 +675,20 @@ - + + + + + + + @@ -710,7 +716,7 @@ - + @@ -832,7 +838,7 @@ - + @@ -966,6 +972,7 @@ + @@ -979,6 +986,7 @@ - + + diff --git a/OTRS-Watch/Constants.swift b/OTRS-Watch/Constants.swift index 00d8ebf..527bff9 100644 --- a/OTRS-Watch/Constants.swift +++ b/OTRS-Watch/Constants.swift @@ -38,4 +38,11 @@ struct Constants { static let IN = "nf::ticket::in" } } + + struct TABS { + struct TAB { + static let OTRS = 0 + static let SETTINGS = 1 + } + } } diff --git a/OTRS-Watch/ViewController.swift b/OTRS-Watch/ViewController.swift index 23c5fbf..6fcf058 100644 --- a/OTRS-Watch/ViewController.swift +++ b/OTRS-Watch/ViewController.swift @@ -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) } diff --git a/OTRS-Watch/WindowController.swift b/OTRS-Watch/WindowController.swift index 36bc7df..253902a 100644 --- a/OTRS-Watch/WindowController.swift +++ b/OTRS-Watch/WindowController.swift @@ -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) } }