diff --git a/src/MacVim/English.lproj/MainMenu.nib/designable.nib b/src/MacVim/English.lproj/MainMenu.nib/designable.nib index 5e5de7a1ac..d863cec491 100644 --- a/src/MacVim/English.lproj/MainMenu.nib/designable.nib +++ b/src/MacVim/English.lproj/MainMenu.nib/designable.nib @@ -26,7 +26,7 @@ - + @@ -208,6 +208,5 @@ - diff --git a/src/MacVim/English.lproj/MainMenu.nib/keyedobjects.nib b/src/MacVim/English.lproj/MainMenu.nib/keyedobjects.nib index 711003b4a0..5e2a234639 100644 Binary files a/src/MacVim/English.lproj/MainMenu.nib/keyedobjects.nib and b/src/MacVim/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/src/MacVim/English.lproj/Preferences.nib/designable.nib b/src/MacVim/English.lproj/Preferences.nib/designable.nib index 889450913a..6db7e56add 100644 --- a/src/MacVim/English.lproj/Preferences.nib/designable.nib +++ b/src/MacVim/English.lproj/Preferences.nib/designable.nib @@ -1,8 +1,8 @@ - + - + @@ -12,6 +12,7 @@ + @@ -21,182 +22,206 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NSNegateBoolean - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This applies to files opened from the Finder (e.g. by double-clicking on a file or by dragging a file onto the MacVim dock icon) or from external programs such as Xcode. - - - - - - - - - - - - - - - - - - + + + + + + + + - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NSNegateBoolean + + + + + + + + + + + + + + + + + + + This applies to files opened from the Finder (e.g. by double-clicking on a file or by dragging a file onto the MacVim dock icon) or from external programs such as Xcode. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -204,7 +229,7 @@ - + @@ -214,7 +239,7 @@ - - + @@ -236,7 +261,7 @@ - - + @@ -258,7 +283,7 @@ - - + @@ -279,7 +304,7 @@ - + diff --git a/src/MacVim/English.lproj/Preferences.nib/keyedobjects.nib b/src/MacVim/English.lproj/Preferences.nib/keyedobjects.nib index 3dc85ed47f..45fc2c7f13 100644 Binary files a/src/MacVim/English.lproj/Preferences.nib/keyedobjects.nib and b/src/MacVim/English.lproj/Preferences.nib/keyedobjects.nib differ diff --git a/src/MacVim/MMAppController.h b/src/MacVim/MMAppController.h index 566502fba0..13b85a2ecc 100644 --- a/src/MacVim/MMAppController.h +++ b/src/MacVim/MMAppController.h @@ -14,6 +14,7 @@ @class MMWindowController; @class MMVimController; +@class SUUpdater; @interface MMAppController : NSObject { @@ -30,6 +31,8 @@ int numChildProcesses; NSMutableDictionary *inputQueues; int processingFlag; + + SUUpdater *updater; FSEventStreamRef fsEventStream; } @@ -52,6 +55,7 @@ - (IBAction)orderFrontPreferencePanel:(id)sender; - (IBAction)openWebsite:(id)sender; - (IBAction)showVimHelp:(id)sender; +- (IBAction)checkForUpdates:(id)sender; - (IBAction)zoomAll:(id)sender; - (IBAction)stayInFront:(id)sender; - (IBAction)stayInBack:(id)sender; diff --git a/src/MacVim/MMAppController.m b/src/MacVim/MMAppController.m index df594f43e2..a75dbde0ee 100644 --- a/src/MacVim/MMAppController.m +++ b/src/MacVim/MMAppController.m @@ -43,6 +43,7 @@ #import "MMWindowController.h" #import "MMTextView.h" #import "Miscellaneous.h" +#import "Sparkle.framework/Headers/Sparkle.h" #import #import // Need Carbon for TIS...() functions @@ -298,6 +299,12 @@ - (id)init ASLogCrit(@"Failed to register connection with name '%@'", name); [connection release]; connection = nil; } + +#if !DISABLE_SPARKLE + // Sparkle is enabled (this is the default). Initialize it. It will + // automatically check for update. + updater = [[SUUpdater alloc] init]; +#endif return self; } @@ -315,6 +322,7 @@ - (void)dealloc [recentFilesMenuItem release]; recentFilesMenuItem = nil; [defaultMainMenu release]; defaultMainMenu = nil; [appMenuItemTemplate release]; appMenuItemTemplate = nil; + [updater release]; updater = nil; [super dealloc]; } @@ -892,6 +900,14 @@ - (void)setMainMenu:(NSMenu *)mainMenu // private so this will have to be considered a bit of a hack!) NSMenu *appMenu = [mainMenu findApplicationMenu]; [NSApp performSelector:@selector(setAppleMenu:) withObject:appMenu]; + +#if DISABLE_SPARKLE + // If Sparkle is disabled, we want to remove the "Check for Updates" menu + // item since it's no longer useful. + NSMenuItem *checkForUpdatesItem = [appMenu itemAtIndex: + [appMenu indexOfItemWithAction:@selector(checkForUpdates:)]]; + checkForUpdatesItem.hidden = true; +#endif NSMenu *servicesMenu = [mainMenu findServicesMenu]; [NSApp setServicesMenu:servicesMenu]; @@ -1195,6 +1211,15 @@ - (IBAction)showVimHelp:(id)sender @"-c", @":h gui_mac", @"-c", @":res", nil] workingDirectory:nil]; } + +- (IBAction)checkForUpdates:(id)sender +{ +#if !DISABLE_SPARKLE + // Check for updates for new versions manually. + ASLogDebug(@"Check for software updates"); + [updater checkForUpdates:sender]; +#endif +} - (IBAction)zoomAll:(id)sender { diff --git a/src/MacVim/MMPreferenceController.h b/src/MacVim/MMPreferenceController.h index 0e8deb39cb..9beec0252f 100644 --- a/src/MacVim/MMPreferenceController.h +++ b/src/MacVim/MMPreferenceController.h @@ -18,9 +18,11 @@ // General pane IBOutlet NSPopUpButton *layoutPopUpButton; IBOutlet NSButton *autoInstallUpdateButton; + IBOutlet NSView *sparkleUpdaterPane; } // General pane +- (IBAction)showWindow:(id)sender; - (IBAction)openInCurrentWindowSelectionChanged:(id)sender; - (IBAction)checkForUpdatesChanged:(id)sender; diff --git a/src/MacVim/MMPreferenceController.m b/src/MacVim/MMPreferenceController.m index 5314ba8a50..a7c714705a 100644 --- a/src/MacVim/MMPreferenceController.m +++ b/src/MacVim/MMPreferenceController.m @@ -43,6 +43,16 @@ static void loadSymbols() @implementation MMPreferenceController +- (IBAction)showWindow:(id)sender +{ + [super showWindow:sender]; + #if DISABLE_SPARKLE + // If Sparkle is disabled in config, we don't want to show the preference pane + // which could be confusing as it won't do anything. + [sparkleUpdaterPane setHidden:YES]; + #endif +} + - (void)setupToolbar { loadSymbols(); diff --git a/src/MacVim/MacVim.xcodeproj/project.pbxproj b/src/MacVim/MacVim.xcodeproj/project.pbxproj index a6bd3c99aa..f0860f173d 100644 --- a/src/MacVim/MacVim.xcodeproj/project.pbxproj +++ b/src/MacVim/MacVim.xcodeproj/project.pbxproj @@ -66,7 +66,7 @@ 1DFE25A50C527BC4003000F7 /* PSMTabBarControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */; }; 52818B031C1C08CE00F59085 /* QLStephen.qlgenerator in Copy QuickLookPlugin */ = {isa = PBXBuildFile; fileRef = 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 528DA66A1426D4F9003380F1 /* macvim-askpass in Copy Scripts */ = {isa = PBXBuildFile; fileRef = 528DA6691426D4EB003380F1 /* macvim-askpass */; }; - 52A364731C4A5789005757EC /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52A364721C4A5789005757EC /* Sparkle.framework */; }; + 52A364731C4A5789005757EC /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52A364721C4A5789005757EC /* Sparkle.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 52A364761C4A57C1005757EC /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 52A364721C4A5789005757EC /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 52B7ED9B1C4A4D6900AFFF15 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 52B7ED9A1C4A4D6900AFFF15 /* dsa_pub.pem */; }; 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; }; diff --git a/src/MacVim/README b/src/MacVim/README index 7c2018934f..459ae35f1a 100644 --- a/src/MacVim/README +++ b/src/MacVim/README @@ -162,6 +162,16 @@ be in when executing these commands): 1. Configure Vim (call "./configure --help" to see a list of flags) src/$ ./configure + MacVim-specific flags that `./configure` supports: + --disable-sparkle: Disable Sparkle auto-update. This is useful if you want + to manually sync or building this as part of a package + manager. + --with-macsdk: Build MacVim against specific SDK versions. + + You can also use environment variable `MACOSX_DEPLOYMENT_TARGET` to specify + minimum target macOS version to deploy (e.g. '10.14'), and `XCODEFLAGS` for + additional command-line arguments to pass to `xcodebuild`. + 2. Build src/$ make diff --git a/src/auto/configure b/src/auto/configure index 3f972a5583..c3a67dd745 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -782,6 +782,7 @@ ac_user_opts=' enable_option_checking enable_fail_if_missing enable_darwin +enable_sparkle with_developer_dir with_macsdk with_macarchs @@ -1476,6 +1477,7 @@ Optional Features: --enable-fail-if-missing Fail if dependencies on additional features specified on the command line are missing. --disable-darwin Disable Darwin (Mac OS X) support. + --disable-sparkle Disable Sparkle updater (MacVim). --disable-smack Do not check for Smack support. --disable-selinux Do not check for SELinux support. --disable-xsmp Disable XSMP session management @@ -4591,6 +4593,24 @@ $as_echo "no, Darwin support disabled" >&6; } $as_echo "yes, Darwin support excluded" >&6; } fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-sparkle argument" >&5 +$as_echo_n "checking --disable-sparkle argument... " >&6; } + # Check whether --enable-sparkle was given. +if test "${enable_sparkle+set}" = set; then : + enableval=$enable_sparkle; +else + enable_sparkle="yes" +fi + + if test "$enable_sparkle" == "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + XCODEFLAGS="$XCODEFLAGS GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS DISABLE_SPARKLE=1'" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-developer-dir argument" >&5 $as_echo_n "checking --with-developer-dir argument... " >&6; } diff --git a/src/configure.ac b/src/configure.ac index ef07f78d77..461b5cfb00 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -190,6 +190,17 @@ if test "`(uname) 2>/dev/null`" = Darwin; then AC_MSG_RESULT([yes, Darwin support excluded]) fi + AC_MSG_CHECKING(--disable-sparkle argument) + AC_ARG_ENABLE(sparkle, + [ --disable-sparkle Disable Sparkle updater (MacVim).], + , [enable_sparkle="yes"]) + if test "$enable_sparkle" == "yes"; then + AC_MSG_RESULT(no) + else + AC_MSG_RESULT(yes) + XCODEFLAGS="$XCODEFLAGS GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS DISABLE_SPARKLE=1'" + fi + AC_MSG_CHECKING(--with-developer-dir argument) AC_ARG_WITH(developer-dir, [ --with-developer-dir=PATH use PATH as location for Xcode developer tools], DEVELOPER_DIR="$withval"; AC_MSG_RESULT($DEVELOPER_DIR),