Skip to content

Commit 6edd830

Browse files
committed
Make sure themes are reset when updating from previous version
1 parent 6e76a31 commit 6edd830

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

Sources/WCBoardThreadController.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,7 @@ - (void)reloadDataAndSelectPost:(WCBoardPost *)selectPost {
390390
#pragma mark -
391391
#pragma mark Reload CSS Template
392392

393-
- (void)reloadTemplate {
394-
NSLog(@"Thread reloadTemplate");
395-
393+
- (void)reloadTemplate {
396394
WITemplateBundle *template;
397395

398396
template = [WITemplateBundle templateWithPath:_templatePath];

Sources/WCBoards.m

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -323,19 +323,15 @@ - (void)appleInterfaceThemeChanged:(NSNotification *) notification {
323323

324324

325325

326-
- (void)_themeDidChange {
327-
NSLog(@"_themeDidChange");
328-
326+
- (void)_themeDidChange {
329327
NSDictionary *theme;
330328
NSString *templatePath;
331329
WITemplateBundle *templateBundle;
332330

333331
theme = [[WCSettings settings] themeWithIdentifier:[[WCSettings settings] objectForKey:WCTheme]];
334332
templateBundle = [[WCSettings settings] templateBundleWithIdentifier:[theme objectForKey:WCThemesTemplate]];
335333
templatePath = [templateBundle bundlePath];
336-
337-
NSLog(@"theme : %@", [theme valueForKey:WCThemesName]);
338-
334+
339335
[_threadController setFont:WIFontFromString([theme objectForKey:WCThemesBoardsFont])];
340336
[_threadController setTextColor:WIColorFromString([theme objectForKey:WCThemesBoardsTextColor])];
341337
[_threadController setBackgroundColor:WIColorFromString([theme objectForKey:WCThemesBoardsBackgroundColor])];

Sources/WCSettings.m

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,20 @@ - (void)_upgrade {
539539
// if(![self objectForKey:WCApplicationMenuEnabled])
540540
// [self setObject:[NSNumber numberWithBool:NO] forKey:WCApplicationMenuEnabled];
541541

542-
NSLog(@"upgrade");
542+
NSLog(@"Upgrade settings...");
543+
544+
if (![self boolForKey:@"WCMigratedTo_2_5__31"]) {
545+
NSLog(@"Upgrade settings to 2_5__31...");
546+
547+
// make sure to reset old versions themes
548+
[self removeObjectForKey:WCThemes];
549+
[self setString:[NSApp darkModeEnabled] ? darkThemeIdentifier : lightThemeIdentifier forKey:WCTheme];
550+
551+
[self setObject:[NSArray arrayWithObjects: [self _defaultLightTheme], [self _defaultDarkTheme], NULL]
552+
forKey:WCThemes];
553+
554+
[self setBool:true forKey:@"WCMigratedTo_2_5__31"];
555+
}
543556
}
544557

545558

en.lproj/PublicChatWindow.xib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
<point key="canvasLocation" x="116" y="87"/>
197197
</window>
198198
<segmentedControl verticalHuggingPriority="750" id="691">
199-
<rect key="frame" x="-5" y="0.0" width="84" height="23"/>
199+
<rect key="frame" x="-5.5" y="0.0" width="85" height="23"/>
200200
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
201201
<segmentedCell key="cell" borderStyle="border" alignment="left" style="texturedSquare" trackingMode="selectAny" id="692">
202202
<font key="font" metaFont="system"/>

0 commit comments

Comments
 (0)