Skip to content

Commit 36bf173

Browse files
author
Roman Sokolov
authored
Merge pull request #13 from Stillness-2/fix
Fix
2 parents 4891eb0 + 5038c70 commit 36bf173

4 files changed

Lines changed: 22 additions & 7 deletions

File tree

BeardedSpice/AppDelegate.m

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#import "Beardie-Swift.h"
4444

4545
#define VOLUME_RELAXING_TIMEOUT 2 //seconds
46+
#define AUTOUPDATE_COMPATIBILITY_INTERVAL 3600*24 // 24 hours
4647

4748
NSString *const InUpdatingStrategiesState = @"InUpdatingStrategiesState";
4849

@@ -120,8 +121,7 @@ - (void)applicationWillFinishLaunching:(NSNotification *)aNotification
120121

121122
#if !DEBUG_STRATEGY
122123
/* Check for strategy updates from the master github repo */
123-
if ([[NSUserDefaults standardUserDefaults] boolForKey:BeardedSpiceUpdateAtLaunch])
124-
[self checkForCompUpdates:self];
124+
[self setAutoCompUpdates];
125125
#endif
126126
}
127127

@@ -966,6 +966,22 @@ - (void)repairLaunchAtLogin {
966966

967967
}
968968

969+
- (void)setAutoCompUpdates {
970+
static dispatch_source_t updateTimer;
971+
static dispatch_once_t onceToken;
972+
dispatch_once(&onceToken, ^{
973+
updateTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue());
974+
int64_t begin = [[NSUserDefaults standardUserDefaults] boolForKey:BeardedSpiceUpdateAtLaunch] ? 0 : AUTOUPDATE_COMPATIBILITY_INTERVAL;
975+
dispatch_source_set_timer(updateTimer, dispatch_time(DISPATCH_TIME_NOW, begin * NSEC_PER_SEC),
976+
AUTOUPDATE_COMPATIBILITY_INTERVAL * NSEC_PER_SEC,
977+
AUTOUPDATE_COMPATIBILITY_INTERVAL * NSEC_PER_SEC);
978+
dispatch_source_set_event_handler(updateTimer, ^{
979+
[self checkForCompUpdates:self];
980+
});
981+
dispatch_resume(updateTimer);
982+
});
983+
}
984+
969985
/////////////////////////////////////////////////////////////////////////
970986
#pragma mark Notifications methods
971987
/////////////////////////////////////////////////////////////////////////

BeardedSpice/UI/Preferences/BSPreferencesWindowController.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ @implementation BSPreferencesWindowController
1616

1717
- (void)windowDidLoad {
1818
[super windowDidLoad];
19-
20-
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
19+
[self.window center];
2120
}
2221

2322
// We redefine this method. Now method does nothing.

BrowserExtensions/safari/Safari Extension/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@
6464
<key>NSHumanReadableCopyright</key>
6565
<string>$(BS_COPYRIGHT)</string>
6666
<key>NSHumanReadableDescription</key>
67-
<string>This is a Safari Extension. You should tell us what your extension does here.</string>
67+
<string>Beardie is the application for Mac for controlling various media players through keyboard shotcuts. This extension allow you to use Beardie for controlling media players on appropriate sites.</string>
6868
</dict>
6969
</plist>

Config.xcconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ XC_SPL = /
1919

2020
BS_NAME = Beardie
2121
BS_COPYRIGHT = Copyright © 2021 Beardie. All rights reserved.
22-
BS_VERSION = 3.0.9
23-
BS_BUILD = 69
22+
BS_VERSION = 3.0.10
23+
BS_BUILD = 70
2424
BS_CHANNEL =
2525
BS_UPDATE_APPCAST = https:$(XC_SPL)/stillness-2.github.io/beardie/distrib-support/appcast.xml
2626
BS_HOMEPAGE = https:$(XC_SPL)/github.com/Stillness-2/beardie

0 commit comments

Comments
 (0)