Skip to content

Expose "automatically install updates" option in preference pane #816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 44 additions & 24 deletions src/MacVim/English.lproj/Preferences.nib/designable.nib

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified src/MacVim/English.lproj/Preferences.nib/keyedobjects.nib
Binary file not shown.
2 changes: 2 additions & 0 deletions src/MacVim/MMPreferenceController.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@

// General pane
IBOutlet NSPopUpButton *layoutPopUpButton;
IBOutlet NSButton *autoInstallUpdateButton;
}

// General pane
- (IBAction)openInCurrentWindowSelectionChanged:(id)sender;
- (IBAction)checkForUpdatesChanged:(id)sender;

@end
16 changes: 14 additions & 2 deletions src/MacVim/MMPreferenceController.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,20 @@ - (IBAction)openInCurrentWindowSelectionChanged:(id)sender
BOOL openInCurrentWindowSelected = ([[sender selectedCell] tag] != 0);
BOOL useWindowsLayout =
([[layoutPopUpButton selectedItem] tag] == MMLayoutWindows);
if (openInCurrentWindowSelected && useWindowsLayout)
[layoutPopUpButton selectItemWithTag:MMLayoutTabs];
if (openInCurrentWindowSelected && useWindowsLayout) {
[[NSUserDefaults standardUserDefaults] setInteger:MMLayoutTabs forKey:MMOpenLayoutKey];
}
}

- (IBAction)checkForUpdatesChanged:(id)sender
{
// Sparkle's auto-install update preference trumps "check for update", so
// need to make sure to unset that if the user unchecks "check for update".
NSButton *button = (NSButton *)sender;
BOOL checkForUpdates = ([button state] != 0);
if (!checkForUpdates) {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"SUAutomaticallyUpdate"];
}
}

@end