Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #63 from jariz/v0.3
Browse files Browse the repository at this point in the history
V0.3
  • Loading branch information
jariz authored Dec 20, 2017
2 parents fa58462 + 28bb518 commit 1b3c5fd
Show file tree
Hide file tree
Showing 27 changed files with 334 additions and 162 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
osx_image: xcode8.2
osx_image: xcode9.1
language: objective-c
xcode_workspace: Noti.xcworkspace
xcode_scheme: Noti
script: xcodebuild -workspace Noti.xcworkspace -scheme Noti
before_install: pod update
script: xcodebuild -workspace Noti.xcworkspace -scheme Noti
55 changes: 50 additions & 5 deletions Noti.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
162B919FE4321ED9BC86AD09 /* Pods_Noti.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2C7615AF577BAEAF32B8516 /* Pods_Noti.framework */; };
4901D3CF1D1C121D005F1641 /* StatusMenuController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4901D3CE1D1C121D005F1641 /* StatusMenuController.swift */; };
4901D3D31D23E6AB005F1641 /* IntroViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4901D3D21D23E6AB005F1641 /* IntroViewController.swift */; };
491E887B1FC588F70048215F /* PreferencesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 491E887A1FC588F70048215F /* PreferencesViewController.swift */; };
498275F21D35101A00AB7029 /* Crypt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 498275F11D35101A00AB7029 /* Crypt.swift */; };
498499FE1D1BE46F007FC963 /* PushManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 498499FD1D1BE46F007FC963 /* PushManager.swift */; };
499DD0F61D2ACA0B00BB759D /* .gitignore in Resources */ = {isa = PBXBuildFile; fileRef = 499DD0F51D2ACA0B00BB759D /* .gitignore */; };
Expand All @@ -26,6 +27,7 @@
0F7FEC6A353CB04118DDEBF6 /* Pods-Noti.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Noti.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Noti/Pods-Noti.debug.xcconfig"; sourceTree = "<group>"; };
4901D3CE1D1C121D005F1641 /* StatusMenuController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatusMenuController.swift; sourceTree = "<group>"; };
4901D3D21D23E6AB005F1641 /* IntroViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntroViewController.swift; sourceTree = "<group>"; };
491E887A1FC588F70048215F /* PreferencesViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreferencesViewController.swift; sourceTree = "<group>"; };
498275F11D35101A00AB7029 /* Crypt.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Crypt.swift; sourceTree = "<group>"; };
498499FD1D1BE46F007FC963 /* PushManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PushManager.swift; sourceTree = "<group>"; };
499DD0F51D2ACA0B00BB759D /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = "<group>"; };
Expand Down Expand Up @@ -84,6 +86,7 @@
49B43B0F1D1ADFB200A24585 /* Assets.xcassets */,
49B43B111D1ADFB200A24585 /* Main.storyboard */,
4901D3D21D23E6AB005F1641 /* IntroViewController.swift */,
491E887A1FC588F70048215F /* PreferencesViewController.swift */,
49B43B141D1ADFB200A24585 /* Info.plist */,
498499FD1D1BE46F007FC963 /* PushManager.swift */,
4901D3CE1D1C121D005F1641 /* StatusMenuController.swift */,
Expand Down Expand Up @@ -143,12 +146,12 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0730;
LastUpgradeCheck = 0910;
ORGANIZATIONNAME = Oberon;
TargetAttributes = {
49B43B071D1ADFB200A24585 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0800;
LastSwiftMigration = 0910;
ProvisioningStyle = Manual;
};
};
Expand Down Expand Up @@ -192,9 +195,28 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Noti/Pods-Noti-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/CryptoSwift/CryptoSwift.framework",
"${BUILT_PRODUCTS_DIR}/EMCLoginItem/EMCLoginItem.framework",
"${PODS_ROOT}/Sparkle/Sparkle.framework",
"${PODS_ROOT}/Sparkle/Sparkle.framework.dSYM",
"${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework",
"${BUILT_PRODUCTS_DIR}/SwCrypt/SwCrypt.framework",
"${BUILT_PRODUCTS_DIR}/SwiftyBeaver/SwiftyBeaver.framework",
"${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CryptoSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EMCLoginItem.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sparkle.framework",
"${DWARF_DSYM_FOLDER_PATH}/Sparkle.framework.dSYM",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Starscream.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwCrypt.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyBeaver.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyJSON.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -222,13 +244,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Noti-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand All @@ -240,6 +265,7 @@
files = (
4901D3D31D23E6AB005F1641 /* IntroViewController.swift in Sources */,
499DD0FC1D2D8FAC00BB759D /* RoundedImage.swift in Sources */,
491E887B1FC588F70048215F /* PreferencesViewController.swift in Sources */,
498499FE1D1BE46F007FC963 /* PushManager.swift in Sources */,
49B43B0E1D1ADFB200A24585 /* AuthViewController.swift in Sources */,
4901D3CF1D1C121D005F1641 /* StatusMenuController.swift in Sources */,
Expand Down Expand Up @@ -272,13 +298,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
Expand Down Expand Up @@ -317,13 +351,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
Expand All @@ -342,6 +384,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
};
name = Release;
};
Expand All @@ -366,7 +409,8 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = io.jari.Noti;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -391,7 +435,8 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = io.jari.Noti;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
Binary file not shown.
4 changes: 3 additions & 1 deletion Noti.xcodeproj/xcshareddata/xcschemes/Noti.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -45,6 +46,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Binary file not shown.
26 changes: 20 additions & 6 deletions Noti/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import Cocoa
import Starscream
import SwiftyBeaver
let log = SwiftyBeaver.self

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
Expand All @@ -33,9 +35,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
pushManager!.disconnect()
}

let storyboard = NSStoryboard(name: "Main", bundle: nil)
iwc = storyboard.instantiateController(withIdentifier: "IntroWindowController") as? NSWindowController
NSApplication.shared().activate(ignoringOtherApps: true)
let storyboard = NSStoryboard(name: NSStoryboard.Name(rawValue: "Main"), bundle: nil)
iwc = storyboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "IntroWindowController")) as? NSWindowController
NSApplication.shared.activate(ignoringOtherApps: true)
iwc!.showWindow(self)
iwc!.window?.makeKeyAndOrderFront(self)
}
Expand All @@ -49,19 +51,31 @@ class AppDelegate: NSObject, NSApplicationDelegate {
return;
}

let storyboard = NSStoryboard(name: "Main", bundle: nil)
pwc = storyboard.instantiateController(withIdentifier: "PreferencesWindowController") as? NSWindowController
NSApplication.shared().activate(ignoringOtherApps: true)
let storyboard = NSStoryboard(name: NSStoryboard.Name(rawValue: "Main"), bundle: nil)
pwc = storyboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "PreferencesWindowController")) as? NSWindowController
NSApplication.shared.activate(ignoringOtherApps: true)
pwc!.showWindow(self)
pwc!.window?.makeKeyAndOrderFront(self)
}

func applicationDidFinishLaunching(_ aNotification: Notification) {
let file = FileDestination() // Adding file destination of log output
let console = ConsoleDestination() // log to Xcode Console
console.format = "$DHH:mm:ss$d $L $M" // clean console log
var url = try? FileManager.default.url(for: .libraryDirectory, // getting ~/Library/
in: .userDomainMask,
appropriateFor: nil,
create: true)
url = url?.appendingPathComponent("Logs/Noti.log")
file.logFileURL = url
log.addDestination(file)
log.addDestination(console)
loadPushManager()
}

func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
log.info("Going to terminate Noti.")
}


Expand Down
4 changes: 2 additions & 2 deletions Noti/Assets.xcassets/IntroLogo.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"images" : [
{
"idiom" : "mac",
"filename" : "IntroLogo.png",
"filename" : "IntroLogo-1.png",
"scale" : "1x"
},
{
"idiom" : "mac",
"filename" : "[email protected]",
"filename" : "IntroLogo@2x-1.png",
"scale" : "2x"
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
21 changes: 21 additions & 0 deletions Noti/Assets.xcassets/NotiEncryption.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "mac",
"filename" : "NotiEncryption.png",
"scale" : "1x"
},
{
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Noti/Assets.xcassets/NotiGeneral.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "mac",
"filename" : "StatusBarImageFail.png",
"scale" : "1x"
},
{
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Noti/AuthViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AuthViewController: NSViewController, WebFrameLoadDelegate {

override func viewDidAppear() {
if (self.view.window != nil) {
self.view.window!.appearance = NSAppearance(named: NSAppearanceNameVibrantDark)
self.view.window!.appearance = NSAppearance(named: NSAppearance.Name.vibrantDark)
self.view.window!.invalidateShadow()
}
}
Expand All @@ -37,7 +37,7 @@ class AuthViewController: NSViewController, WebFrameLoadDelegate {
if let url = ds.response.url {
if url.absoluteString.hasPrefix("about:blank") {
let token = (url.absoluteString as NSString).substring(from: 27)
let appDelegate = NSApplication.shared().delegate as! AppDelegate
let appDelegate = NSApplication.shared.delegate as! AppDelegate

print("Got token!", token, "saving and restarting PushManager")

Expand Down
10 changes: 5 additions & 5 deletions Noti/IntroViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class IntroViewController: NSViewController {

override func viewDidAppear() {
if (self.view.window != nil) {
self.view.window!.appearance = NSAppearance(named: NSAppearanceNameVibrantDark)
self.view.window!.appearance = NSAppearance(named: NSAppearance.Name.vibrantDark)
self.view.window!.titlebarAppearsTransparent = true;
self.view.window!.isMovableByWindowBackground = true
self.view.window!.invalidateShadow()
Expand All @@ -26,11 +26,11 @@ class IntroViewController: NSViewController {
@IBOutlet weak var authTxt:NSTextField!;
@IBOutlet weak var authImg:NSImageView!;

func authSuccess(_ notification: Notification) {
@objc func authSuccess(_ notification: Notification) {
authBtn.isEnabled = false
self.authTxt.alphaValue = 1
self.authTxt.alphaValue = self.authBtn.alphaValue
self.view.window!.styleMask.subtract(NSClosableWindowMask)
//self.view.window!.styleMask.subtract(NSClosableWindowMask)

NSAnimationContext.runAnimationGroup({ (context) -> Void in
context.duration = 0.50
Expand All @@ -55,9 +55,9 @@ class IntroViewController: NSViewController {
}

@IBAction func startAuth(_ sender: AnyObject) {
let storyboard = NSStoryboard(name: "Main", bundle: nil)
let storyboard = NSStoryboard(name: NSStoryboard.Name(rawValue: "Main"), bundle: nil)

awc = storyboard.instantiateController(withIdentifier: "AuthWindowController") as? NSWindowController
awc = storyboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "AuthWindowController")) as? NSWindowController
print("showWindow")
awc!.showWindow(self)
}
Expand Down
Loading

0 comments on commit 1b3c5fd

Please sign in to comment.