diff --git a/OTRS-Watch.xcodeproj/project.pbxproj b/OTRS-Watch.xcodeproj/project.pbxproj index 7e4df79..5dcd8a5 100644 --- a/OTRS-Watch.xcodeproj/project.pbxproj +++ b/OTRS-Watch.xcodeproj/project.pbxproj @@ -18,6 +18,7 @@ 854A87DD1DF6DC7500904B3E /* OTRS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854A87DC1DF6DC7500904B3E /* OTRS.swift */; }; 857EB22C1DF974F500CCA941 /* Ticket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 857EB22B1DF974F500CCA941 /* Ticket.swift */; }; 857EB22F1DF9845200CCA941 /* TicketExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 857EB22E1DF9845200CCA941 /* TicketExtension.swift */; }; + 85DB9C401E03F73E0073EDE4 /* WindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85DB9C3F1E03F73E0073EDE4 /* WindowController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -55,6 +56,7 @@ 854A87DC1DF6DC7500904B3E /* OTRS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OTRS.swift; sourceTree = ""; }; 857EB22B1DF974F500CCA941 /* Ticket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Ticket.swift; path = Model/Ticket.swift; sourceTree = ""; }; 857EB22E1DF9845200CCA941 /* TicketExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TicketExtension.swift; path = Model/Extension/TicketExtension.swift; sourceTree = ""; }; + 85DB9C3F1E03F73E0073EDE4 /* WindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WindowController.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -113,15 +115,16 @@ 854A87AE1DF6BD9A00904B3E /* OTRS-Watch */ = { isa = PBXGroup; children = ( + 854A87DA1DF6C22C00904B3E /* Constants.swift */, + 85DB9C411E03F9080073EDE4 /* Net */, 8505EAD01E014486002A0BFB /* Extension */, 857EB22A1DF9748B00CCA941 /* Model */, 854A87AF1DF6BD9A00904B3E /* AppDelegate.swift */, + 85DB9C3F1E03F73E0073EDE4 /* WindowController.swift */, 854A87B11DF6BD9A00904B3E /* ViewController.swift */, 854A87B31DF6BD9A00904B3E /* Assets.xcassets */, 854A87B51DF6BD9A00904B3E /* Main.storyboard */, 854A87B81DF6BD9A00904B3E /* Info.plist */, - 854A87DA1DF6C22C00904B3E /* Constants.swift */, - 854A87DC1DF6DC7500904B3E /* OTRS.swift */, ); path = "OTRS-Watch"; sourceTree = ""; @@ -161,6 +164,14 @@ name = Extension; sourceTree = ""; }; + 85DB9C411E03F9080073EDE4 /* Net */ = { + isa = PBXGroup; + children = ( + 854A87DC1DF6DC7500904B3E /* OTRS.swift */, + ); + name = Net; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -299,6 +310,7 @@ 8505EACF1E01441F002A0BFB /* ViewControllerExtension.swift in Sources */, 854A87DD1DF6DC7500904B3E /* OTRS.swift in Sources */, 857EB22C1DF974F500CCA941 /* Ticket.swift in Sources */, + 85DB9C401E03F73E0073EDE4 /* WindowController.swift in Sources */, 854A87B01DF6BD9A00904B3E /* AppDelegate.swift in Sources */, 854A87DB1DF6C22C00904B3E /* Constants.swift in Sources */, ); 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 b1c7222..36804fd 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/AppDelegate.swift b/OTRS-Watch/AppDelegate.swift index 95f634f..a1aea68 100644 --- a/OTRS-Watch/AppDelegate.swift +++ b/OTRS-Watch/AppDelegate.swift @@ -14,6 +14,14 @@ class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { // Insert code here to initialize your application + + // Here we just opt-in for allowing our instance of the NSTouchBar class to be customized throughout the app. + if #available(OSX 10.12.2, *) { + if ((NSClassFromString("NSTouchBar")) != nil) { + NSApplication.shared().isAutomaticCustomizeTouchBarMenuItemEnabled = true + } + } + if let baseURL = UserDefaults.standard.string(forKey: Constants.USER_SETTINGS.OTRS.BASE_URL) { OTRS.sharedInstance.configure(baseURL_: baseURL, username_: UserDefaults.standard.string(forKey: Constants.USER_SETTINGS.CREDENTIALS.USER)!, password_: UserDefaults.standard.string(forKey: Constants.USER_SETTINGS.CREDENTIALS.PASSWORD)!) diff --git a/OTRS-Watch/Base.lproj/Main.storyboard b/OTRS-Watch/Base.lproj/Main.storyboard index 169fd2b..9027f86 100644 --- a/OTRS-Watch/Base.lproj/Main.storyboard +++ b/OTRS-Watch/Base.lproj/Main.storyboard @@ -664,8 +664,8 @@ - - + + @@ -675,7 +675,11 @@ - + + + + + diff --git a/OTRS-Watch/WindowController.swift b/OTRS-Watch/WindowController.swift new file mode 100644 index 0000000..36bc7df --- /dev/null +++ b/OTRS-Watch/WindowController.swift @@ -0,0 +1,31 @@ +// +// WindowController.swift +// OTRS-Watch +// +// Created by Gerrit Linnemann on 16.12.16. +// Copyright © 2016 Adawim UG (haftungsbeschränkt). All rights reserved. +// + +import Cocoa + +class WindowController: NSWindowController { + + /*var viewController: ViewController { + get { + return self.window!.contentViewController! as! ViewController + } + }*/ + + override func windowDidLoad() { + super.windowDidLoad() + + // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. + } + + @IBAction func toolbarActionReload(_ sender: NSToolbarItem) { + if let que:Int = Int(UserDefaults.standard.string(forKey: Constants.USER_SETTINGS.OTRS.QUEUE)!) { + OTRS.sharedInstance.reload(que: que) + } + } +} +