Toolbar-refresh

This commit is contained in:
Gerrit Linnemann 2016-12-16 11:28:42 +01:00
parent d89f34ea6b
commit 99c2d8cf27
5 changed files with 60 additions and 5 deletions

View File

@ -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 = "<group>"; };
857EB22B1DF974F500CCA941 /* Ticket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Ticket.swift; path = Model/Ticket.swift; sourceTree = "<group>"; };
857EB22E1DF9845200CCA941 /* TicketExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TicketExtension.swift; path = Model/Extension/TicketExtension.swift; sourceTree = "<group>"; };
85DB9C3F1E03F73E0073EDE4 /* WindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WindowController.swift; sourceTree = "<group>"; };
/* 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 = "<group>";
@ -161,6 +164,14 @@
name = Extension;
sourceTree = "<group>";
};
85DB9C411E03F9080073EDE4 /* Net */ = {
isa = PBXGroup;
children = (
854A87DC1DF6DC7500904B3E /* OTRS.swift */,
);
name = Net;
sourceTree = "<group>";
};
/* 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 */,
);

View File

@ -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)!)

View File

@ -664,8 +664,8 @@
<!--Window Controller-->
<scene sceneID="R2V-B0-nI4">
<objects>
<windowController showSeguePresentationStyle="single" id="B8D-0N-5wS" sceneMemberID="viewController">
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
<windowController showSeguePresentationStyle="single" id="B8D-0N-5wS" customClass="WindowController" customModule="OTRS_Watch" customModuleProvider="target" sceneMemberID="viewController">
<window key="window" title="OTRS-Watch" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
@ -675,7 +675,11 @@
<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="Neu laden" paletteLabel="Neu laden" tag="-1" image="NSRefreshTemplate" id="eMt-Dh-Yhp">
<connections>
<action selector="toolbarActionReload:" target="B8D-0N-5wS" id="mgg-0v-kkd"/>
</connections>
</toolbarItem>
</allowedToolbarItems>
<defaultToolbarItems>
<toolbarItem reference="eMt-Dh-Yhp"/>

View File

@ -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)
}
}
}