Commit 3249695d authored by David Fuhrmann's avatar David Fuhrmann

macosx: only enable sparkle update if --enable-update-check is set

parent b88ecc0a
......@@ -2,13 +2,13 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1060</int>
<string key="IBDocument.SystemVersion">14B25</string>
<string key="IBDocument.InterfaceBuilderVersion">6254</string>
<string key="IBDocument.AppKitVersion">1343.16</string>
<string key="IBDocument.HIToolboxVersion">755.00</string>
<string key="IBDocument.SystemVersion">14D136</string>
<string key="IBDocument.InterfaceBuilderVersion">7706</string>
<string key="IBDocument.AppKitVersion">1347.57</string>
<string key="IBDocument.HIToolboxVersion">758.70</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">6254</string>
<string key="NS.object.0">7706</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>NSBox</string>
......@@ -1755,7 +1755,7 @@
</object>
<nil key="NSUserInterfaceItemIdentifier"/>
<object class="NSView" key="NSWindowView" id="500944643">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSTextField" id="855729941">
......@@ -1763,6 +1763,7 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{-3, 79}, {240, 17}}</string>
<reference key="NSSuperview" ref="500944643"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="255325351">
<int key="NSCellFlags">67108864</int>
......@@ -1801,6 +1802,7 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{20, 52}, {159, 19}}</string>
<reference key="NSSuperview" ref="500944643"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="14047052">
<int key="NSCellFlags">-1804599231</int>
......@@ -1837,6 +1839,7 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{150, 13}, {84, 28}}</string>
<reference key="NSSuperview" ref="500944643"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="96901269">
<int key="NSCellFlags">67108864</int>
......@@ -1859,6 +1862,7 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{185, 50}, {15, 22}}</string>
<reference key="NSSuperview" ref="500944643"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSStepperCell" key="NSCell" id="789174514">
<int key="NSCellFlags">786464</int>
......@@ -1876,6 +1880,7 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{68, 13}, {84, 28}}</string>
<reference key="NSSuperview" ref="500944643"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="20272293">
<int key="NSCellFlags">67108864</int>
......@@ -1898,6 +1903,7 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{203, 54}, {34, 14}}</string>
<reference key="NSSuperview" ref="500944643"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="621474557">
<int key="NSCellFlags">67108864</int>
......@@ -1913,8 +1919,10 @@
</object>
</array>
<string key="NSFrameSize">{249, 103}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1027}}</string>
<string key="NSScreenRect">{{0, 0}, {1280, 777}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
......@@ -2052,18 +2060,16 @@
<object class="NSCustomObject" id="651263286">
<string key="NSClassName">VLCMainMenu</string>
</object>
<object class="NSCustomObject" id="1040926652">
<string key="NSClassName">SUUpdater</string>
</object>
<object class="NSCustomView" id="560875128">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSTextField" id="103751139">
<reference key="NSNextResponder" ref="560875128"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{19, 35}, {270.79689999999999, 18}}</string>
<string key="NSFrame">{{19, 35}, {271, 18}}</string>
<reference key="NSSuperview" ref="560875128"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="385075814">
<int key="NSCellFlags">68157504</int>
......@@ -2086,6 +2092,7 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{19, 35}, {273, 18}}</string>
<reference key="NSSuperview" ref="560875128"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="678671392">
<int key="NSCellFlags">605028416</int>
......@@ -2108,6 +2115,7 @@
<int key="NSvFlags">12</int>
<string key="NSFrame">{{156, 11}, {5, 8}}</string>
<reference key="NSSuperview" ref="560875128"/>
<reference key="NSWindow"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
<int key="NSCellFlags">67108864</int>
......@@ -2134,8 +2142,9 @@
<object class="NSTextField" id="811878628">
<reference key="NSNextResponder" ref="560875128"/>
<int key="NSvFlags">265</int>
<string key="NSFrame">{{101.762, 19}, {115.422, 14}}</string>
<string key="NSFrame">{{101.5, 19}, {115.5, 14}}</string>
<reference key="NSSuperview" ref="560875128"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="923605742">
<int key="NSCellFlags">68157504</int>
......@@ -2152,8 +2161,9 @@
<object class="NSTextField" id="754695396">
<reference key="NSNextResponder" ref="560875128"/>
<int key="NSvFlags">265</int>
<string key="NSFrame">{{210.90199999999999, 19}, {79.097700000000003, 14}}</string>
<string key="NSFrame">{{211, 19}, {79, 14}}</string>
<reference key="NSSuperview" ref="560875128"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="908114002">
<int key="NSCellFlags">68157504</int>
......@@ -2170,8 +2180,9 @@
<object class="NSTextField" id="421148087">
<reference key="NSNextResponder" ref="560875128"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{27, 19}, {76.964799999999997, 14}}</string>
<string key="NSFrame">{{27, 19}, {77, 14}}</string>
<reference key="NSSuperview" ref="560875128"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="647762012">
<int key="NSCellFlags">605028416</int>
......@@ -2190,6 +2201,7 @@
<int key="NSvFlags">298</int>
<string key="NSFrame">{{28, 3}, {261, 16}}</string>
<reference key="NSSuperview" ref="560875128"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSliderCell" key="NSCell" id="819871674">
<int key="NSCellFlags">-1543241472</int>
......@@ -2209,6 +2221,8 @@
</object>
</array>
<string key="NSFrameSize">{307, 53}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="455649453">
......@@ -2753,14 +2767,6 @@
</object>
<int key="connectionID">5592</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">checkForUpdates:</string>
<reference key="source" ref="1040926652"/>
<reference key="destination" ref="354414928"/>
</object>
<int key="connectionID">4371</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_dmi_mute</string>
......@@ -5380,11 +5386,6 @@
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">4370</int>
<reference key="object" ref="1040926652"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4397</int>
<reference key="object" ref="629699013"/>
......@@ -6269,7 +6270,6 @@
<string key="4329.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="4330.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="4331.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="4370.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="4397.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="4398.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="4412.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
......
......@@ -49,6 +49,10 @@
#import "DebugMessageVisualizer.h"
#import "AddonsWindowController.h"
#ifdef UPDATE_CHECK
#import <Sparkle/Sparkle.h>
#endif
@implementation VLCMainMenu
static VLCMainMenu *_o_sharedInstance = nil;
......@@ -143,6 +147,13 @@ static VLCMainMenu *_o_sharedInstance = nil;
[self setRateControlsEnabled:NO];
p_intf = VLCIntf;
#ifdef UPDATE_CHECK
[o_mi_checkForUpdate setAction:@selector(checkForUpdates:)];
[o_mi_checkForUpdate setTarget:[SUUpdater sharedUpdater]];
#else
[o_mi_checkForUpdate setEnabled:NO];
#endif
}
- (void)applicationWillFinishLaunching:(NSNotification *)o_notification
......
......@@ -67,7 +67,9 @@
#import "VideoEffects.h"
#import "AudioEffects.h"
#ifdef UPDATE_CHECK
#import <Sparkle/Sparkle.h> /* we're the update delegate */
#endif
#import "iTunes.h"
#import "Spotify.h"
......@@ -789,7 +791,9 @@ static VLCMain *_o_sharedMainInstance = nil;
// So lets enqueue it into the loop for later execution.
[o_mainwindow performSelector:@selector(makeKeyAndOrderFront:) withObject:nil afterDelay:0];
#ifdef UPDATE_CHECK
[[SUUpdater sharedUpdater] setDelegate:self];
#endif
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
......@@ -975,6 +979,8 @@ static bool f_appExit = false;
#pragma mark -
#pragma mark Sparkle delegate
#ifdef UPDATE_CHECK
/* received directly before the update gets installed, so let's shut down a bit */
- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update
{
......@@ -991,6 +997,7 @@ static bool f_appExit = false;
return YES;
}
#endif
#pragma mark -
#pragma mark Media Key support
......
......@@ -38,7 +38,9 @@
#import "AppleRemote.h"
#import "CoreInteraction.h"
#ifdef UPDATE_CHECK
#import <Sparkle/Sparkle.h> //for o_intf_last_update_lbl
#endif
static const char *const ppsz_language[] =
{
......@@ -218,6 +220,16 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
{
[self initStrings];
#ifdef UPDATE_CHECK
[o_intf_update_ckb bind:@"value"
toObject:[SUUpdater sharedUpdater]
withKeyPath:@"automaticallyChecksForUpdates"
options:nil];
#else
[o_intf_update_ckb setState:NSOffState];
[o_intf_update_ckb setEnabled:NO];
#endif
/* setup the toolbar */
NSToolbar * o_sprefs_toolbar = [[[NSToolbar alloc] initWithIdentifier: VLCSPrefsToolbarIdentifier] autorelease];
[o_sprefs_toolbar setAllowsUserCustomization: NO];
......@@ -578,10 +590,14 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
[self setupButton: o_intf_appleremote_sysvol_ckb forBoolValue: "macosx-appleremote-sysvol"];
[self setupButton: o_intf_mediakeys_ckb forBoolValue: "macosx-mediakeys"];
#ifdef UPDATE_CHECK
if ([[SUUpdater sharedUpdater] lastUpdateCheckDate] != NULL)
[o_intf_last_update_lbl setStringValue: [NSString stringWithFormat: _NS("Last check on: %@"), [[[SUUpdater sharedUpdater] lastUpdateCheckDate] descriptionWithLocale: [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]]]];
else
[o_intf_last_update_lbl setStringValue: _NS("No check was performed yet.")];
#endif
psz_tmp = config_GetPsz(p_intf, "control");
if (psz_tmp) {
[o_intf_enableGrowl_ckb setState: (NSInteger)strstr(psz_tmp, "growl")];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment