mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 00:24:12 +02:00
Add sparkle support for OSX
This commit is contained in:
@@ -24,6 +24,7 @@ void macMain();
|
||||
void setShortcutHandler(Tomahawk::MacShortcutHandler* engine);
|
||||
// used for opening files with tomahawk
|
||||
void setApplicationHandler(PlatformInterface* handler);
|
||||
void checkForUpdates();
|
||||
|
||||
};
|
||||
|
||||
|
@@ -16,6 +16,10 @@
|
||||
#import <AppKit/NSEvent.h>
|
||||
#import <AppKit/NSNibDeclarations.h>
|
||||
|
||||
#ifdef HAVE_SPARKLE
|
||||
#import <Sparkle/SUUpdater.h>
|
||||
#endif
|
||||
|
||||
// Capture global media keys on Mac (Cocoa only!)
|
||||
// See: http://www.rogueamoeba.com/utm/2007/09/29/apple-keyboard-media-key-event-handling/
|
||||
|
||||
@@ -146,10 +150,10 @@ void Tomahawk::macMain() {
|
||||
[[NSAutoreleasePool alloc] init];
|
||||
// Creates and sets the magic global variable so QApplication will find it.
|
||||
[MacApplication sharedApplication];
|
||||
#ifdef HAVE_SPARKLE
|
||||
#ifdef HAVE_SPARKLE
|
||||
// Creates and sets the magic global variable for Sparkle.
|
||||
[[SUUpdater sharedUpdater] setDelegate: NSApp];
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -161,8 +165,8 @@ void Tomahawk::setApplicationHandler(Tomahawk::PlatformInterface* handler) {
|
||||
[NSApp setApplicationHandler: handler];
|
||||
}
|
||||
|
||||
void CheckForUpdates() {
|
||||
#ifdef HAVE_SPARKLE
|
||||
void Tomahawk::checkForUpdates() {
|
||||
#ifdef HAVE_SPARKLE
|
||||
[[SUUpdater sharedUpdater] checkForUpdates: NSApp];
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user