autostart

This commit is contained in:
j 2016-04-14 12:57:58 +02:00
parent 016c55d6f9
commit e8c8356dc9
2 changed files with 6 additions and 3 deletions

View File

@ -15,8 +15,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var statusMenu: NSMenu!
let autostart = Process.arguments.count >= 2 ? Process.arguments[1] == "--autostart" : false
let statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(-1)
let basePath = NSString(string:"~/Library/Application Support/Open Media Library").stringByExpandingTildeInPath
func applicationDidFinishLaunching(aNotification: NSNotification) {
let icon = NSImage(named: "statusIcon")
@ -31,8 +33,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
server.launchPath = basePath.stringByAppendingString("/ctl")
server.arguments = ["start"]
server.launch()
load()
if (!autostart) {
load()
}
} else {
let resourcePath = NSBundle.mainBundle().resourcePath
let install_py = resourcePath?.stringByAppendingString("/install.py")

View File

@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.7</string>
<string>0.8</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>