extragear/multimedia/amarok/src
Leo Franchi
lfranchi at kde.org
Sun Feb 22 14:37:00 CET 2009
SVN commit 929971 by lfranchi:
so, it turns out Qt has built-in support for Growl, through QSystemTrayIcon. it must be one of the most obscurely hidden features....
anyway, remove our own bundled growl, as Qt will use the system one if it exists. minor regression: if it is not installed, it won't work. but that's not really our probem.
this should make packaging much easier too. thank god.
CCMAIL: amarok-devel at kde.org
M +1 -0 App.h
M +1 -9 CMakeLists.txt
D mac/Growl-WithInstaller.framework/Growl-WithInstaller
D mac/Growl-WithInstaller.framework/Headers
D mac/Growl-WithInstaller.framework/Resources
D mac/Growl-WithInstaller.framework/Versions/A/Growl-WithInstaller
D mac/Growl-WithInstaller.framework/Versions/A/Headers/Growl.h
D mac/Growl-WithInstaller.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h
D mac/Growl-WithInstaller.framework/Versions/A/Headers/GrowlApplicationBridge.h
D mac/Growl-WithInstaller.framework/Versions/A/Headers/GrowlDefines.h
D mac/Growl-WithInstaller.framework/Versions/A/Resources/English.lproj/GrowlInstallation.strings
D mac/Growl-WithInstaller.framework/Versions/A/Resources/English.lproj/GrowlInstallationPrompt-Carbon.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/English.lproj/GrowlInstallationPrompt-Carbon.nib/info.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/English.lproj/GrowlInstallationPrompt-Carbon.nib/objects.xib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/English.lproj/GrowlInstallationPrompt.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/English.lproj/GrowlInstallationPrompt.nib/info.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/English.lproj/GrowlInstallationPrompt.nib/keyedobjects.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/Growl.prefPane.zip
D mac/Growl-WithInstaller.framework/Versions/A/Resources/GrowlPrefPaneInfo.plist
D mac/Growl-WithInstaller.framework/Versions/A/Resources/Info.plist
D mac/Growl-WithInstaller.framework/Versions/A/Resources/cs.lproj/GrowlInstallation.strings
D mac/Growl-WithInstaller.framework/Versions/A/Resources/cs.lproj/GrowlInstallationPrompt-Carbon.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/cs.lproj/GrowlInstallationPrompt-Carbon.nib/objects.xib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/cs.lproj/GrowlInstallationPrompt.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/cs.lproj/GrowlInstallationPrompt.nib/keyedobjects.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/de.lproj/GrowlInstallation.strings
D mac/Growl-WithInstaller.framework/Versions/A/Resources/de.lproj/GrowlInstallationPrompt-Carbon.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/de.lproj/GrowlInstallationPrompt-Carbon.nib/info.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/de.lproj/GrowlInstallationPrompt-Carbon.nib/objects.xib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/de.lproj/GrowlInstallationPrompt.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/de.lproj/GrowlInstallationPrompt.nib/info.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/de.lproj/GrowlInstallationPrompt.nib/keyedobjects.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/fr.lproj/GrowlInstallation.strings
D mac/Growl-WithInstaller.framework/Versions/A/Resources/fr.lproj/GrowlInstallationPrompt-Carbon.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/fr.lproj/GrowlInstallationPrompt-Carbon.nib/objects.xib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/fr.lproj/GrowlInstallationPrompt.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/fr.lproj/GrowlInstallationPrompt.nib/keyedobjects.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/ja.lproj/GrowlInstallation.strings
D mac/Growl-WithInstaller.framework/Versions/A/Resources/ja.lproj/GrowlInstallationPrompt-Carbon.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/ja.lproj/GrowlInstallationPrompt-Carbon.nib/info.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/ja.lproj/GrowlInstallationPrompt-Carbon.nib/objects.xib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/ja.lproj/GrowlInstallationPrompt.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/ja.lproj/GrowlInstallationPrompt.nib/info.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/ja.lproj/GrowlInstallationPrompt.nib/keyedobjects.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/nb.lproj/GrowlInstallation.strings
D mac/Growl-WithInstaller.framework/Versions/A/Resources/nb.lproj/GrowlInstallationPrompt-Carbon.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/nb.lproj/GrowlInstallationPrompt-Carbon.nib/info.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/nb.lproj/GrowlInstallationPrompt-Carbon.nib/objects.xib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/nb.lproj/GrowlInstallationPrompt.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/nb.lproj/GrowlInstallationPrompt.nib/info.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/nb.lproj/GrowlInstallationPrompt.nib/keyedobjects.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/nl.lproj/GrowlInstallation.strings
D mac/Growl-WithInstaller.framework/Versions/A/Resources/nl.lproj/GrowlInstallationPrompt-Carbon.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/nl.lproj/GrowlInstallationPrompt-Carbon.nib/objects.xib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/nl.lproj/GrowlInstallationPrompt.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/nl.lproj/GrowlInstallationPrompt.nib/keyedobjects.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/pl.lproj/GrowlInstallation.strings
D mac/Growl-WithInstaller.framework/Versions/A/Resources/pl.lproj/GrowlInstallationPrompt.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/pl.lproj/GrowlInstallationPrompt.nib/keyedobjects.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/pt_BR.lproj/GrowlInstallation.strings
D mac/Growl-WithInstaller.framework/Versions/A/Resources/pt_BR.lproj/GrowlInstallationPrompt-Carbon.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/pt_BR.lproj/GrowlInstallationPrompt-Carbon.nib/objects.xib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/pt_BR.lproj/GrowlInstallationPrompt.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/pt_BR.lproj/GrowlInstallationPrompt.nib/keyedobjects.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/ru.lproj/GrowlInstallation.strings
D mac/Growl-WithInstaller.framework/Versions/A/Resources/ru.lproj/GrowlInstallationPrompt-Carbon.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/ru.lproj/GrowlInstallationPrompt-Carbon.nib/objects.xib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/ru.lproj/GrowlInstallationPrompt.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/ru.lproj/GrowlInstallationPrompt.nib/info.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/ru.lproj/GrowlInstallationPrompt.nib/keyedobjects.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/sv.lproj/GrowlInstallation.strings
D mac/Growl-WithInstaller.framework/Versions/A/Resources/sv.lproj/GrowlInstallationPrompt-Carbon.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/sv.lproj/GrowlInstallationPrompt-Carbon.nib/objects.xib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/sv.lproj/GrowlInstallationPrompt.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/sv.lproj/GrowlInstallationPrompt.nib/keyedobjects.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/zh_CN.lproj/GrowlInstallation.strings
D mac/Growl-WithInstaller.framework/Versions/A/Resources/zh_CN.lproj/GrowlInstallationPrompt-Carbon.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/zh_CN.lproj/GrowlInstallationPrompt-Carbon.nib/objects.xib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/zh_CN.lproj/GrowlInstallationPrompt.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/zh_CN.lproj/GrowlInstallationPrompt.nib/keyedobjects.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/zh_TW.lproj/GrowlInstallation.strings
D mac/Growl-WithInstaller.framework/Versions/A/Resources/zh_TW.lproj/GrowlInstallationPrompt-Carbon.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/zh_TW.lproj/GrowlInstallationPrompt-Carbon.nib/objects.xib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/zh_TW.lproj/GrowlInstallationPrompt.nib/classes.nib
D mac/Growl-WithInstaller.framework/Versions/A/Resources/zh_TW.lproj/GrowlInstallationPrompt.nib/keyedobjects.nib
D mac/Growl-WithInstaller.framework/Versions/Current
M +12 -31 mac/GrowlInterface.cpp
M +0 -1 mac/GrowlInterface.h
--- trunk/extragear/multimedia/amarok/src/App.h #929970:929971
@@ -53,6 +53,7 @@
void setUniqueInstance( bool isUnique ) { m_isUniqueInstance = isUnique; }
bool isNonUniqueInstance() const { return m_isUniqueInstance; }
+ Amarok::TrayIcon* trayIcon() { return m_tray; }
static void handleCliArgs();
static void initCliArgs( int argc, char *argv[] );
static void initCliArgs();
--- trunk/extragear/multimedia/amarok/src/CMakeLists.txt #929970:929971
@@ -11,13 +11,8 @@
mac/GrowlInterface.cpp
)
- include_directories ( services/lastfm/
- mac/Growl-WithInstaller.framework/Headers )
+ include_directories ( services/lastfm/ )
set( MAC_FILES_DIR ${CMAKE_SOURCE_DIR}/src/mac )
- set( GROWL_FRAMEWORK ${CMAKE_SOURCE_DIR}/src/mac/Growl-WithInstaller.framework )
- set( GROWL_LIBRARIES "-framework Growl-WithInstaller -F${CMAKE_SOURCE_DIR}/src/mac" CACHE FILEPATH "Growl-WithInstaller framework" FORCE)
- mark_as_advanced( GROWL_FRAMEWORK GROWL_LIBRARIES )
- set( EXTRA_LIBS ${GROWL_LIBRARIES} amarok_service_liblastfm )
endif(APPLE)
# add_subdirectory( playlistmanager )
@@ -630,9 +625,6 @@
kde4_add_executable(Amarok ${amarok_SRCS})
target_link_libraries(Amarok ${KDE4_KDECORE_LIBS} amaroklib )
SET_TARGET_PROPERTIES(Amarok PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
- # also install growl to the app bundle
- install(DIRECTORY ${GROWL_FRAMEWORK} DESTINATION ${BUNDLE_INSTALL_DIR}/Amarok.app/Contents/Frameworks)
- install( FILES "${MAC_FILES_DIR}/Growl Registration Ticket.growlRegDict" DESTINATION ${BUNDLE_INSTALL_DIR}/Amarok.app/Contents/Resources )
install(TARGETS Amarok ${INSTALL_TARGETS_DEFAULT_ARGS})
else(Q_WS_MAC)
kde4_add_executable(amarok ${amarok_SRCS})
--- trunk/extragear/multimedia/amarok/src/mac/GrowlInterface.cpp #929970:929971
@@ -14,26 +14,16 @@
#include "GrowlInterface.h"
#include "AmarokConfig.h"
+#include "App.h"
#include "Debug.h"
#include "EngineController.h"
#include "MetaUtility.h" // for secToPrettyTime
+#include "Systray.h"
-#include "lastfm/core/mac/CFStringToQString.h"
-#include <GrowlApplicationBridge-Carbon.h>
-#include <CoreFoundation/CFString.h>
-
-
-struct Growl_Delegate delegate;
-
GrowlInterface::GrowlInterface( QString appName ) :
m_appName( appName )
, EngineObserver( The::engineController() )
-{
- CFStringRef app = QStringToCFString( appName );
- InitGrowlDelegate(&delegate);
- delegate.applicationName = CFSTR( "Amarok" );
- Growl_SetDelegate(&delegate);
-}
+{}
void
GrowlInterface::show( Meta::TrackPtr track )
@@ -64,25 +54,16 @@
if( text.isEmpty() ) //still
text = i18n("No information available for this track");
- QImage image;
- if( track && track->album() )
- image = track->album()->imageWithBorder( 100, 5 ).toImage();
-
- CFDataRef imgData = CFDataCreate( kCFAllocatorDefault, image.bits(), image.numBytes() );
+ if( App::instance()->trayIcon() )
+ {
+ App::instance()->trayIcon()->setVisible( true );
+ if( track && track->album() )
+ App::instance()->trayIcon()->setIcon( QIcon( track->album()->imageWithBorder( 100, 5 ) ) );
+ App::instance()->trayIcon()->showMessage( "Amarok", text );
+ }
- show( text, imgData );
-
-
}
-void
-GrowlInterface::show( QString text, CFDataRef img )
-{
- debug() << "is growl enabled:" << AmarokConfig::growlEnabled();
- if( AmarokConfig::growlEnabled() )
- Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext( CFSTR( "Amarok" ), QStringToCFString( text ), CFSTR( "Song Playing"), img, 0, false, 0 );
-}
-
void
GrowlInterface::engineNewTrackPlaying()
{
@@ -102,8 +83,8 @@
{
Q_UNUSED( oldState )
DEBUG_BLOCK
- if( state == Phonon::PausedState )
- show( i18n( "Paused" ), 0 );
+ // if( state == Phonon::PausedState )
+ // show( i18n( "Paused" ) );
}
--- trunk/extragear/multimedia/amarok/src/mac/GrowlInterface.h #929970:929971
@@ -33,7 +33,6 @@
GrowlInterface( QString appName );
void show( Meta::TrackPtr );
- void show( QString text, CFDataRef );
protected:
// Reimplemented from EngineObserver
More information about the Amarok-devel
mailing list