Skip to content

Commit 9241360

Browse files
committed
[Close #1] Add quark.setLaunchAtLogin
1 parent 935cd60 commit 9241360

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

Podfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ platform :osx, '10.9'
22

33
source 'https://github.com/CocoaPods/Specs.git'
44

5-
pod 'MASShortcut', :git => 'https://github.com/xhacker/MASShortcut.git', :branch => 'menubar-webkit'
5+
pod 'MASShortcut', :git => 'https://github.com/xhacker/MASShortcut.git', :branch => 'menubar-webkit'
66
pod 'RHPreferences', :head
77
pod 'Sparkle', '~> 1.8.0'
88
pod 'ISO8601DateFormatter', '~> 0.7'
9+
pod 'LaunchAtLoginController', :podspec => 'https://raw.githubusercontent.com/jashephe/LaunchAtLoginController/master/LaunchAtLoginController.podspec'

Podfile.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
PODS:
22
- ISO8601DateFormatter (0.7)
3+
- LaunchAtLoginController (1.0.0)
34
- MASShortcut (1.2.3)
45
- RHPreferences (HEAD based on 1.0.0)
56
- Sparkle (1.8.0)
67

78
DEPENDENCIES:
89
- ISO8601DateFormatter (~> 0.7)
10+
- LaunchAtLoginController (from `https://raw.githubusercontent.com/jashephe/LaunchAtLoginController/master/LaunchAtLoginController.podspec`)
911
- MASShortcut (from `https://github.com/xhacker/MASShortcut.git`, branch `menubar-webkit`)
1012
- RHPreferences (HEAD)
1113
- Sparkle (~> 1.8.0)
1214

1315
EXTERNAL SOURCES:
16+
LaunchAtLoginController:
17+
:podspec: https://raw.githubusercontent.com/jashephe/LaunchAtLoginController/master/LaunchAtLoginController.podspec
1418
MASShortcut:
1519
:branch: menubar-webkit
1620
:git: https://github.com/xhacker/MASShortcut.git
@@ -22,6 +26,7 @@ CHECKOUT OPTIONS:
2226

2327
SPEC CHECKSUMS:
2428
ISO8601DateFormatter: 59731cd880cf87e71b4fa95f0d6b713dcbc4cbce
29+
LaunchAtLoginController: ebe8f91297f8bb68c1085b431308871d7b05128c
2530
MASShortcut: a1e29fd34567fcd249d00648548924c8e7639474
2631
RHPreferences: d0215102b7b8cd9f501655e5e7db2551ef4dc0e5
2732
Sparkle: 5eb20bb37ca21e471dab8417dee880198d905327

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ quark.setMenubarIcon("data:image/png;base64,iVBORw...SuQmCC")
4848
quark.setMenubarHighlightedIcon("data:image/png;base64,iVBORw...SuQmCC")
4949
quark.resetMenubarIcon()
5050

51-
// Auto start with system
52-
quark.setAutoStart(true) // not implemented yet
51+
// Auto launch at login
52+
quark.setLaunchAtLogin(true)
5353

5454
// Send system notification
5555
quark.notify({
@@ -182,6 +182,7 @@ Used third-party libraries:
182182
* [MASShortcut](https://github.com/shpakovski/MASShortcut) by [@shpakovski](https://github.com/shpakovski)
183183
* [RHPreferences](https://github.com/heardrwt/RHPreferences) by [@heardrwt](https://github.com/heardrwt)
184184
* [Sparkle](https://github.com/sparkle-project/Sparkle) by [contributors](https://github.com/sparkle-project/Sparkle/graphs/contributors)
185+
* [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).
185186
186187
## Contribution
187188

quark-shell/QSHWebViewDelegate.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#import <RHPreferences.h>
1515
#import <Sparkle/Sparkle.h>
1616
#import <ISO8601DateFormatter.h>
17+
#import <LaunchAtLoginController.h>
1718

1819
static NSString * const kWebScriptNamespace = @"quark";
1920
static const NSInteger kPreferencesDefaultHeight = 192;
@@ -70,6 +71,7 @@ + (BOOL)isSelectorExcludedFromWebScript:(SEL)selector
7071
selector == @selector(changeIcon:) ||
7172
selector == @selector(changeHighlightedIcon:) ||
7273
selector == @selector(resetMenubarIcon) ||
74+
selector == @selector(setLaunchAtLogin:) ||
7375
selector == @selector(notify:) ||
7476
selector == @selector(removeAllScheduledNotifications) ||
7577
selector == @selector(removeAllDeliveredNotifications) ||
@@ -133,6 +135,9 @@ + (NSString *)webScriptNameForSelector:(SEL)selector
133135
else if (selector == @selector(showMenu:)) {
134136
result = @"showMenu";
135137
}
138+
else if (selector == @selector(setLaunchAtLogin:)) {
139+
result = @"setLaunchAtLogin";
140+
}
136141

137142
return result;
138143
}
@@ -205,6 +210,12 @@ - (void)resetMenubarIcon
205210
}
206211
}
207212

213+
- (void)setLaunchAtLogin:(BOOL)launchAtLogin
214+
{
215+
LaunchAtLoginController *launchController = [[LaunchAtLoginController alloc] init];
216+
launchController.launchAtLogin = launchAtLogin;
217+
}
218+
208219
- (void)notify:(WebScriptObject *)obj
209220
{
210221
QSHWebScriptObjectConverter *converter = [[QSHWebScriptObjectConverter alloc] initWithWebView:self.webView];

0 commit comments

Comments
 (0)