autostart
This commit is contained in:
parent
016c55d6f9
commit
e8c8356dc9
2 changed files with 6 additions and 3 deletions
|
@ -15,8 +15,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||||
|
|
||||||
@IBOutlet weak var statusMenu: NSMenu!
|
@IBOutlet weak var statusMenu: NSMenu!
|
||||||
|
|
||||||
|
let autostart = Process.arguments.count >= 2 ? Process.arguments[1] == "--autostart" : false
|
||||||
let statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(-1)
|
let statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(-1)
|
||||||
let basePath = NSString(string:"~/Library/Application Support/Open Media Library").stringByExpandingTildeInPath
|
let basePath = NSString(string:"~/Library/Application Support/Open Media Library").stringByExpandingTildeInPath
|
||||||
|
|
||||||
|
|
||||||
func applicationDidFinishLaunching(aNotification: NSNotification) {
|
func applicationDidFinishLaunching(aNotification: NSNotification) {
|
||||||
let icon = NSImage(named: "statusIcon")
|
let icon = NSImage(named: "statusIcon")
|
||||||
|
@ -31,8 +33,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||||
server.launchPath = basePath.stringByAppendingString("/ctl")
|
server.launchPath = basePath.stringByAppendingString("/ctl")
|
||||||
server.arguments = ["start"]
|
server.arguments = ["start"]
|
||||||
server.launch()
|
server.launch()
|
||||||
load()
|
if (!autostart) {
|
||||||
|
load()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
let resourcePath = NSBundle.mainBundle().resourcePath
|
let resourcePath = NSBundle.mainBundle().resourcePath
|
||||||
let install_py = resourcePath?.stringByAppendingString("/install.py")
|
let install_py = resourcePath?.stringByAppendingString("/install.py")
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.7</string>
|
<string>0.8</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleSupportedPlatforms</key>
|
<key>CFBundleSupportedPlatforms</key>
|
||||||
|
|
Loading…
Reference in a new issue