Skip to content

Commit 5af4e39

Browse files
authored
Merge pull request #816 from ychin/auto-update-preference-pane
Expose "automatically install updates" option in preference pane
2 parents b397052 + 03e13e7 commit 5af4e39

File tree

4 files changed

+60
-26
lines changed

4 files changed

+60
-26
lines changed

src/MacVim/English.lproj/Preferences.nib/designable.nib

Lines changed: 44 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

src/MacVim/MMPreferenceController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717

1818
// General pane
1919
IBOutlet NSPopUpButton *layoutPopUpButton;
20+
IBOutlet NSButton *autoInstallUpdateButton;
2021
}
2122

2223
// General pane
2324
- (IBAction)openInCurrentWindowSelectionChanged:(id)sender;
25+
- (IBAction)checkForUpdatesChanged:(id)sender;
2426

2527
@end

src/MacVim/MMPreferenceController.m

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,20 @@ - (IBAction)openInCurrentWindowSelectionChanged:(id)sender
8686
BOOL openInCurrentWindowSelected = ([[sender selectedCell] tag] != 0);
8787
BOOL useWindowsLayout =
8888
([[layoutPopUpButton selectedItem] tag] == MMLayoutWindows);
89-
if (openInCurrentWindowSelected && useWindowsLayout)
90-
[layoutPopUpButton selectItemWithTag:MMLayoutTabs];
89+
if (openInCurrentWindowSelected && useWindowsLayout) {
90+
[[NSUserDefaults standardUserDefaults] setInteger:MMLayoutTabs forKey:MMOpenLayoutKey];
91+
}
92+
}
93+
94+
- (IBAction)checkForUpdatesChanged:(id)sender
95+
{
96+
// Sparkle's auto-install update preference trumps "check for update", so
97+
// need to make sure to unset that if the user unchecks "check for update".
98+
NSButton *button = (NSButton *)sender;
99+
BOOL checkForUpdates = ([button state] != 0);
100+
if (!checkForUpdates) {
101+
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"SUAutomaticallyUpdate"];
102+
}
91103
}
92104

93105
@end

0 commit comments

Comments
 (0)