mirror of
https://github.com/HackPlan/quark-shell-mac.git
synced 2026-01-12 15:04:57 +08:00
[Close #1] Add quark.setLaunchAtLogin
This commit is contained in:
3
Podfile
3
Podfile
@@ -2,7 +2,8 @@ platform :osx, '10.9'
|
||||
|
||||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
|
||||
pod 'MASShortcut', :git => 'https://github.com/xhacker/MASShortcut.git', :branch => 'menubar-webkit'
|
||||
pod 'MASShortcut', :git => 'https://github.com/xhacker/MASShortcut.git', :branch => 'menubar-webkit'
|
||||
pod 'RHPreferences', :head
|
||||
pod 'Sparkle', '~> 1.8.0'
|
||||
pod 'ISO8601DateFormatter', '~> 0.7'
|
||||
pod 'LaunchAtLoginController', :podspec => 'https://raw.githubusercontent.com/jashephe/LaunchAtLoginController/master/LaunchAtLoginController.podspec'
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
PODS:
|
||||
- ISO8601DateFormatter (0.7)
|
||||
- LaunchAtLoginController (1.0.0)
|
||||
- MASShortcut (1.2.3)
|
||||
- RHPreferences (HEAD based on 1.0.0)
|
||||
- Sparkle (1.8.0)
|
||||
|
||||
DEPENDENCIES:
|
||||
- ISO8601DateFormatter (~> 0.7)
|
||||
- LaunchAtLoginController (from `https://raw.githubusercontent.com/jashephe/LaunchAtLoginController/master/LaunchAtLoginController.podspec`)
|
||||
- MASShortcut (from `https://github.com/xhacker/MASShortcut.git`, branch `menubar-webkit`)
|
||||
- RHPreferences (HEAD)
|
||||
- Sparkle (~> 1.8.0)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
LaunchAtLoginController:
|
||||
:podspec: https://raw.githubusercontent.com/jashephe/LaunchAtLoginController/master/LaunchAtLoginController.podspec
|
||||
MASShortcut:
|
||||
:branch: menubar-webkit
|
||||
:git: https://github.com/xhacker/MASShortcut.git
|
||||
@@ -22,6 +26,7 @@ CHECKOUT OPTIONS:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
ISO8601DateFormatter: 59731cd880cf87e71b4fa95f0d6b713dcbc4cbce
|
||||
LaunchAtLoginController: ebe8f91297f8bb68c1085b431308871d7b05128c
|
||||
MASShortcut: a1e29fd34567fcd249d00648548924c8e7639474
|
||||
RHPreferences: d0215102b7b8cd9f501655e5e7db2551ef4dc0e5
|
||||
Sparkle: 5eb20bb37ca21e471dab8417dee880198d905327
|
||||
|
||||
@@ -48,8 +48,8 @@ quark.setMenubarIcon("data:image/png;base64,iVBORw...SuQmCC")
|
||||
quark.setMenubarHighlightedIcon("data:image/png;base64,iVBORw...SuQmCC")
|
||||
quark.resetMenubarIcon()
|
||||
|
||||
// Auto start with system
|
||||
quark.setAutoStart(true) // not implemented yet
|
||||
// Auto launch at login
|
||||
quark.setLaunchAtLogin(true)
|
||||
|
||||
// Send system notification
|
||||
quark.notify({
|
||||
@@ -182,6 +182,7 @@ Used third-party libraries:
|
||||
* [MASShortcut](https://github.com/shpakovski/MASShortcut) by [@shpakovski](https://github.com/shpakovski)
|
||||
* [RHPreferences](https://github.com/heardrwt/RHPreferences) by [@heardrwt](https://github.com/heardrwt)
|
||||
* [Sparkle](https://github.com/sparkle-project/Sparkle) by [contributors](https://github.com/sparkle-project/Sparkle/graphs/contributors)
|
||||
* [LaunchAtLoginController](https://github.com/jashephe/LaunchAtLoginController) by [@Mozketo](https://github.com/Mozketo), modified by [@tgunr](https://github.com/tgunr) and [@jashephe](https://github.com/jashephe).
|
||||
|
||||
## Contribution
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#import <RHPreferences.h>
|
||||
#import <Sparkle/Sparkle.h>
|
||||
#import <ISO8601DateFormatter.h>
|
||||
#import <LaunchAtLoginController.h>
|
||||
|
||||
static NSString * const kWebScriptNamespace = @"quark";
|
||||
static const NSInteger kPreferencesDefaultHeight = 192;
|
||||
@@ -70,6 +71,7 @@ static const NSInteger kPreferencesDefaultHeight = 192;
|
||||
selector == @selector(changeIcon:) ||
|
||||
selector == @selector(changeHighlightedIcon:) ||
|
||||
selector == @selector(resetMenubarIcon) ||
|
||||
selector == @selector(setLaunchAtLogin:) ||
|
||||
selector == @selector(notify:) ||
|
||||
selector == @selector(removeAllScheduledNotifications) ||
|
||||
selector == @selector(removeAllDeliveredNotifications) ||
|
||||
@@ -133,6 +135,9 @@ static const NSInteger kPreferencesDefaultHeight = 192;
|
||||
else if (selector == @selector(showMenu:)) {
|
||||
result = @"showMenu";
|
||||
}
|
||||
else if (selector == @selector(setLaunchAtLogin:)) {
|
||||
result = @"setLaunchAtLogin";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -205,6 +210,12 @@ static const NSInteger kPreferencesDefaultHeight = 192;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setLaunchAtLogin:(BOOL)launchAtLogin
|
||||
{
|
||||
LaunchAtLoginController *launchController = [[LaunchAtLoginController alloc] init];
|
||||
launchController.launchAtLogin = launchAtLogin;
|
||||
}
|
||||
|
||||
- (void)notify:(WebScriptObject *)obj
|
||||
{
|
||||
QSHWebScriptObjectConverter *converter = [[QSHWebScriptObjectConverter alloc] initWithWebView:self.webView];
|
||||
|
||||
Reference in New Issue
Block a user