1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-13 20:39:57 +01:00

Merge pull request #325 from tomahawk-player/branding

Branding and download manager updates
This commit is contained in:
Christian Muehlhaeuser 2015-10-10 21:12:12 +02:00
commit ed5b4b25ec
46 changed files with 665 additions and 271 deletions

View File

@ -20,6 +20,7 @@ SET( TOMAHAWK_ORGANIZATION_NAME "Tomahawk" )
SET( TOMAHAWK_ORGANIZATION_DOMAIN "tomahawk-player.org" )
SET( TOMAHAWK_APPLICATION_NAME "Tomahawk" )
SET( TOMAHAWK_DESCRIPTION_SUMMARY "The social media player" )
SET( TOMAHAWK_APPLICATION_PACKAGE_NAME "org.tomahawk-player.Tomahawk")
IF(APPLE)
SET( TOMAHAWK_TARGET_NAME "Tomahawk" )
ELSE()
@ -81,9 +82,9 @@ option(BUILD_HATCHET "Build the Hatchet plugin" ON)
option(BUILD_WITH_QT4 "Build Tomahawk with Qt4 instead of Qt5" OFF)
if(UNIX AND NOT APPLE)
set(CRASHREPORTER_ENABLED_BY_DEFAULT OFF)
set(CRASHREPORTER_ENABLED_BY_DEFAULT OFF)
else()
set(CRASHREPORTER_ENABLED_BY_DEFAULT ON)
set(CRASHREPORTER_ENABLED_BY_DEFAULT ON)
endif()
option(WITH_CRASHREPORTER "Build with CrashReporter" ${CRASHREPORTER_ENABLED_BY_DEFAULT})
option(WITH_BINARY_ATTICA "Enable support for downloading binary resolvers automatically" ON)
@ -174,9 +175,9 @@ if( NOT BUILD_WITH_QT4 )
find_package(Qt5DBus REQUIRED)
endif()
if(APPLE)
if(APPLE)
find_package(Qt5MacExtras REQUIRED)
endif()
endif()
if(WIN32)
find_package(Qt5WinExtras REQUIRED)
@ -195,7 +196,7 @@ if( NOT BUILD_WITH_QT4 )
qt5_add_translation(${ARGN})
endmacro()
if( UNIX AND NOT APPLE )
if( UNIX AND NOT APPLE )
macro(qt_add_dbus_interface)
qt5_add_dbus_interface(${ARGN})
endmacro()
@ -203,7 +204,7 @@ if( NOT BUILD_WITH_QT4 )
macro(qt_add_dbus_adaptor)
qt5_add_dbus_adaptor(${ARGN})
endmacro()
endif()
endif()
macro(setup_qt)
endmacro()
@ -278,7 +279,6 @@ else( Qt5Core_DIR )
endif( Qt5Core_DIR )
set( TOMAHAWK_QT5 ${TOMAHAWK_QT5_TMP} CACHE BOOL "Build Tomahawk with Qt5")
if( BUILD_GUI AND UNIX AND NOT APPLE )
macro_optional_find_package( X11 )
macro_log_feature(X11_FOUND "X11" "The Xorg libraries" "http://www.x.org/wiki/" TRUE "" "Xorg libraries are used by libqnetwm to bring windows to front reliably")
@ -481,9 +481,10 @@ configure_file(TomahawkUse.cmake.in "${PROJECT_BINARY_DIR}/TomahawkUse.cmake" @O
file(COPY TomahawkAddPlugin.cmake DESTINATION "${PROJECT_BINARY_DIR}")
file(COPY TomahawkAddLibrary.cmake DESTINATION "${PROJECT_BINARY_DIR}")
SET( TOMAHAWK_LIBRARIES tomahawklib )
SET( TOMAHAWK_WIDGETS_LIBRARIES tomahawk-widgets )
SET( TOMAHAWK_PLAYDARAPI_LIBRARIES tomahawk-playdarapi )
SET( TOMAHAWK_LIBRARY ${TOMAHAWK_TARGET_NAME}lib )
SET( TOMAHAWK_LIBRARIES ${TOMAHAWK_LIBRARY} )
SET( TOMAHAWK_WIDGETS_LIBRARIES ${TOMAHAWK_TARGET_NAME}-widgets )
SET( TOMAHAWK_PLAYDARAPI_LIBRARIES ${TOMAHAWK_TARGET_NAME}-playdarapi )
ADD_SUBDIRECTORY( thirdparty )
ADD_SUBDIRECTORY( src )
@ -497,7 +498,7 @@ ENDIF()
# Add all targets to the build-tree export set
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/Tomahawk" CACHE PATH "Installation directory for CMake files")
set(CMAKE_INSTALL_FULL_CMAKEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR}")
export(TARGETS tomahawklib
export(TARGETS ${TOMAHAWK_LIBRARY}
FILE "${PROJECT_BINARY_DIR}/TomahawkLibraryDepends.cmake")
# Export the package for use from the build-tree

View File

@ -18,6 +18,11 @@
!ifndef MING_PATH
!define MING_PATH "/usr/i686-w64-mingw32/sys-root/mingw"
!endif
!define APPLICATION_NAME "Tomahawk"
!define TARGET_NAME "tomahawk"
;define app id needed for Windows 8 notifications
!define AppUserModelId @TOMAHAWK_APPLICATION_PACKAGE_NAME@
!define MING_BIN "${MING_PATH}/bin"
!define MING_LIB "${MING_PATH}/lib"
!define BUILD_PATH "@CMAKE_BINARY_DIR@"
@ -26,7 +31,6 @@
!define SQLITE_DLL_PATH "${MING_LIB}/qt5/plugins/sqldrivers"
!define IMAGEFORMATS_DLL_PATH "${MING_LIB}/qt5/plugins/imageformats"
; We use official release plugins
; mingw32-vlc from obs misses a lot and has even broken ones probably
!define VLC_PATH "${SOURCE_PATH}\admin\win\vlc\" ; SIC! ^
@ -53,11 +57,11 @@
; Initial installer setup and definitions.
;-----------------------------------------------------------------------------
Name "@CPACK_NSIS_PACKAGE_NAME@"
Caption "Tomahawk Installer"
BrandingText "Tomahawk ${VERSION} -- ${BUILD_TIME}"
Caption "${APPLICATION_NAME} Installer"
BrandingText "${APPLICATION_NAME} ${VERSION} -- ${BUILD_TIME}"
OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@"
InstallDir "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
InstallDirRegKey HKCU "Software\Tomahawk" ""
InstallDirRegKey HKCU "Software\{APPLICATION_NAME}" ""
InstType Standard
InstType Full
InstType Minimal
@ -82,17 +86,15 @@ ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
!include UAC.nsh ;Used by the UAC elevation to install as user or admin.
!include ${NSI_PATH}\SnoreNotify.nsh ; Macro for creation of a shortcut with a AppUserModelId.
;-----------------------------------------------------------------------------
; Memento selections stored in registry.
;-----------------------------------------------------------------------------
!define MEMENTO_REGISTRY_ROOT HKLM
!define MEMENTO_REGISTRY_KEY Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk
!define MEMENTO_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}"
;-----------------------------------------------------------------------------
; Setup macros for the creation of a shortcut supporting Windows 8 notifications.
;-----------------------------------------------------------------------------
!define AppUserModelId org.tomahawk-player.Tomahawk
!define SnoreToastExe "$INSTDIR\SnoreToast.exe"
;-----------------------------------------------------------------------------
@ -156,7 +158,7 @@ Function LaunchTomahawk
FunctionEnd
Function LaunchTomahawkAsUser
Exec "$INSTDIR\tomahawk.exe"
Exec "$INSTDIR\${APPLICATION_NAME}.exe"
FunctionEnd
##############################################################################
@ -166,31 +168,31 @@ FunctionEnd
##############################################################################
!macro CheckForProcess processName gotoWhenFound gotoWhenNotFound
Processes::FindProcess ${processName}
StrCmp $R0 "0" ${gotoWhenNotFound} ${gotoWhenFound}
Processes::FindProcess "${processName}"
StrCmp $R0 "0" "${gotoWhenNotFound}" "${gotoWhenFound}"
!macroend
!macro ConfirmEndProcess processName
!macro ConfirmEndProcess processTitle processName
MessageBox MB_YESNO|MB_ICONEXCLAMATION \
"Found ${processName} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?" \
IDYES process_${processName}_kill IDNO process_${processName}_ended
process_${processName}_kill:
IDYES "process_${processTitle}_kill" IDNO "process_${processTitle}_ended"
process_${processTitle}_kill:
DetailPrint "Killing ${processName} processes."
Processes::KillProcess ${processName}
Processes::KillProcess "${processName}"
Sleep 1500
StrCmp $R0 "1" process_${processName}_ended
StrCmp $R0 "1" "process_${processTitle}_ended"
DetailPrint "Process to kill not found!"
process_${processName}_ended:
process_${processTitle}_ended:
!macroend
!macro CheckAndConfirmEndProcess processName
!insertmacro CheckForProcess ${processName} 0 no_process_${processName}_to_end
!insertmacro ConfirmEndProcess ${processName}
no_process_${processName}_to_end:
!macro CheckAndConfirmEndProcess processTitle processName
!insertmacro CheckForProcess "${processName}" 0 "no_process_${processTitle}_to_end"
!insertmacro ConfirmEndProcess "${processTitle}" "${processName}"
no_process_${processTitle}_to_end:
!macroend
Function EnsureTomahawkShutdown
!insertmacro CheckAndConfirmEndProcess "tomahawk.exe"
!insertmacro CheckAndConfirmEndProcess "${TARGET_NAME}" "${APPLICATION_NAME}.exe"
FunctionEnd
##############################################################################
@ -200,40 +202,40 @@ FunctionEnd
##############################################################################
Function PageReinstall
ReadRegStr $R0 HKLM "Software\Tomahawk" ""
ReadRegStr $R0 HKLM "Software\${APPLICATION_NAME}" ""
StrCmp $R0 "" 0 +2
Abort
;Detect version
ReadRegDWORD $R0 HKLM "Software\Tomahawk" "VersionMajor"
ReadRegDWORD $R0 HKLM "Software\${APPLICATION_NAME}" "VersionMajor"
IntCmp $R0 ${VER_MAJOR} minor_check new_version older_version
minor_check:
ReadRegDWORD $R0 HKLM "Software\Tomahawk" "VersionMinor"
ReadRegDWORD $R0 HKLM "Software\${APPLICATION_NAME}" "VersionMinor"
IntCmp $R0 ${VER_MINOR} build_check new_version older_version
build_check:
ReadRegDWORD $R0 HKLM "Software\Tomahawk" "VersionBuild"
ReadRegDWORD $R0 HKLM "Software\${APPLICATION_NAME}" "VersionBuild"
IntCmp $R0 ${VER_BUILD} same_version new_version older_version
new_version:
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" "An older version of Tomahawk is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 2" "Text" "Uninstall before installing"
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 3" "Text" "Do not uninstall"
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install Tomahawk."
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${APPLICATION_NAME}."
StrCpy $R0 "1"
Goto reinst_start
older_version:
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" "A newer version of Tomahawk is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 2" "Text" "Uninstall before installing"
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 3" "Text" "Do not uninstall"
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install Tomahawk."
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${APPLICATION_NAME}."
StrCpy $R0 "1"
Goto reinst_start
same_version:
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" "Tomahawk ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 2" "Text" "Add/Reinstall components"
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 3" "Text" "Uninstall Tomahawk"
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 3" "Text" "Uninstall ${APPLICATION_NAME}"
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
StrCpy $R0 "2"
@ -248,12 +250,12 @@ Function PageLeaveReinstall
StrCmp $R0 "2" 0 +3
StrCmp $R1 "1" reinst_done reinst_uninstall
reinst_uninstall:
ReadRegStr $R1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "UninstallString"
ReadRegStr $R1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}" "UninstallString"
HideWindow
ClearErrors
ExecWait '$R1 _?=$INSTDIR'
IfErrors no_remove_uninstaller
IfFileExists "$INSTDIR\tomahawk.exe" no_remove_uninstaller
IfFileExists "$INSTDIR\${APPLICATION_NAME}.exe" no_remove_uninstaller
Delete $R1
RMDir $INSTDIR
no_remove_uninstaller:
@ -269,40 +271,40 @@ FunctionEnd
# INSTALLER SECTIONS #
# #
##############################################################################
Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER
Section "${APPLICATION_NAME}" SEC_TOMAHAWK_PLAYER
SectionIn 1 2 3 RO
SetDetailsPrint listonly
SetDetailsPrint textonly
DetailPrint "Installing Tomahawk Player essentials."
DetailPrint "Installing ${APPLICATION_NAME} essentials."
SetDetailsPrint listonly
SetOutPath "$INSTDIR"
!ifdef INSTALL_PATH
;Main executable.
File "${INSTALL_PATH}\bin\tomahawk.exe"
File "${INSTALL_PATH}\bin\${APPLICATION_NAME}.exe"
File "${INSTALL_PATH}\bin\tomahawk_crash_reporter.exe"
File "${INSTALL_PATH}\bin\${TARGET_NAME}_crash_reporter.exe"
File "${INSTALL_PATH}\bin\libtomahawk.dll"
File "${INSTALL_PATH}\bin\libtomahawk-widgets.dll"
File "${INSTALL_PATH}\bin\libtomahawk-playdarapi.dll"
File "${INSTALL_PATH}\bin\lib${TARGET_NAME}.dll"
File "${INSTALL_PATH}\bin\lib${TARGET_NAME}-widgets.dll"
File "${INSTALL_PATH}\bin\lib${TARGET_NAME}-playdarapi.dll"
; plugins
File "${INSTALL_PATH}\lib\libtomahawk_*_*.dll"
File "${INSTALL_PATH}\lib\lib${TARGET_NAME}_*_*.dll"
!endif
!ifndef INSTALL_PATH
;Main executable.
File "${BUILD_PATH}\tomahawk.exe"
File "${BUILD_PATH}\${APPLICATION_NAME}.exe"
File "${BUILD_PATH}\tomahawk_crash_reporter.exe"
File "${BUILD_PATH}\${TARGET_NAME}_crash_reporter.exe"
File "${BUILD_PATH}\libtomahawk.dll"
File "${BUILD_PATH}\libtomahawk-widgets.dll"
File "${BUILD_PATH}\libtomahawk-playdarapi.dll"
File "${BUILD_PATH}\lib${TARGET_NAME}.dll"
File "${BUILD_PATH}\lib${TARGET_NAME}-widgets.dll"
File "${BUILD_PATH}\lib${TARGET_NAME}-playdarapi.dll"
; plugins
File "${BUILD_PATH}\libtomahawk_*_*.dll"
File "${BUILD_PATH}\lib${TARGET_NAME}_*_*.dll"
!endif
;License & release notes.
@ -338,7 +340,7 @@ Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER
File "${QT_DLL_PATH}\libGLESv2.dll"
File "${QT_DLL_PATH}\libwebp-5.dll"
;Boost fnord
;Boost fnord
File "${QT_DLL_PATH}\icuuc53.dll"
File "${QT_DLL_PATH}\icudata53.dll"
File "${QT_DLL_PATH}\icui18n53.dll"
@ -350,7 +352,7 @@ Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER
File "${MING_BIN}\libsqlite3-0.dll"
;Qt platform plugins
SetOutPath "$INSTDIR\platforms"
SetOutPath "$INSTDIR\platforms"
File "${MING_LIB}/qt5/plugins/platforms/qwindows.dll"
SetOutPath "$INSTDIR"
@ -435,15 +437,16 @@ SectionGroup "Shortcuts"
${MementoSection} "Start Menu Program Group" SEC_START_MENU
SectionIn 1 2
SetDetailsPrint textonly
DetailPrint "Adding shortcuts for the Tomahawk program group to the Start Menu."
DetailPrint "Adding shortcuts for the ${APPLICATION_NAME} program group to the Start Menu."
SetDetailsPrint listonly
SetShellVarContext all
RMDir /r "$SMPROGRAMS\Tomahawk"
CreateDirectory "$SMPROGRAMS\Tomahawk"
CreateShortCut "$SMPROGRAMS\Tomahawk\LICENSE.lnk" "$INSTDIR\LICENSE.txt"
!insertmacro SnoreShortcut "$SMPROGRAMS\Tomahawk\Tomahawk.lnk" "$INSTDIR\tomahawk.exe" "${AppUserModelId}"
CreateShortCut "$SMPROGRAMS\Tomahawk\Release notes.lnk" "$INSTDIR\NOTES.txt"
CreateShortCut "$SMPROGRAMS\Tomahawk\Uninstall.lnk" "$INSTDIR\uninstall.exe"
RMDir /r "$SMPROGRAMS\${APPLICATION_NAME}"
CreateDirectory "$SMPROGRAMS\${APPLICATION_NAME}"
CreateShortCut "$SMPROGRAMS\${APPLICATION_NAME}\LICENSE.lnk" "$INSTDIR\LICENSE.txt"
CreateShortCut "$SMPROGRAMS\${APPLICATION_NAME}\${APPLICATION_NAME}.lnk" "$INSTDIR\${APPLICATION_NAME}.exe"
!insertmacro SnoreShortcut "$SMPROGRAMS\${APPLICATION_NAME}\${APPLICATION_NAME}.lnk" "$INSTDIR\${APPLICATION_NAME}.exe" "${AppUserModelId}"
CreateShortCut "$SMPROGRAMS\${APPLICATION_NAME}\Release notes.lnk" "$INSTDIR\NOTES.txt"
CreateShortCut "$SMPROGRAMS\${APPLICATION_NAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
SetShellVarContext current
${MementoSectionEnd}
!endif
@ -454,7 +457,7 @@ SectionGroup "Shortcuts"
SetDetailsPrint textonly
DetailPrint "Creating Desktop Shortcuts"
SetDetailsPrint listonly
CreateShortCut "$DESKTOP\Tomahawk.lnk" "$INSTDIR\tomahawk.exe"
CreateShortCut "$DESKTOP\${APPLICATION_NAME}.lnk" "$INSTDIR\${APPLICATION_NAME}.exe"
${MementoSectionEnd}
!endif
@ -464,7 +467,7 @@ SectionGroup "Shortcuts"
SetDetailsPrint textonly
DetailPrint "Creating Quick Launch Shortcut"
SetDetailsPrint listonly
CreateShortCut "$QUICKLAUNCH\Tomahawk.lnk" "$INSTDIR\tomahawk.exe"
CreateShortCut "$QUICKLAUNCH\${APPLICATION_NAME}.lnk" "$INSTDIR\${APPLICATION_NAME}.exe"
${MementoSectionEnd}
!endif
@ -475,10 +478,10 @@ ${MementoSectionDone}
; Installer section descriptions
;--------------------------------
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_TOMAHAWK_PLAYER} "Tomahawk player essentials."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_START_MENU} "Tomahawk program group."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_DESKTOP} "Desktop shortcut for Tomahawk."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_QUICK_LAUNCH} "Quick Launch shortcut for Tomahawk."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_TOMAHAWK_PLAYER} "${APPLICATION_NAME} essentials."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_START_MENU} "${APPLICATION_NAME} program group."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_DESKTOP} "Desktop shortcut for ${APPLICATION_NAME}."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_QUICK_LAUNCH} "Quick Launch shortcut for ${APPLICATION_NAME}."
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Section -post
@ -495,98 +498,98 @@ Section -post
SetDetailsPrint listonly
;Version numbers used to detect existing installation version for comparisson.
WriteRegStr HKLM "Software\Tomahawk" "" $INSTDIR
WriteRegDWORD HKLM "Software\Tomahawk" "VersionMajor" "${VER_MAJOR}"
WriteRegDWORD HKLM "Software\Tomahawk" "VersionMinor" "${VER_MINOR}"
WriteRegDWORD HKLM "Software\Tomahawk" "VersionRevision" "${REVISION}"
WriteRegDWORD HKLM "Software\Tomahawk" "VersionBuild" "${VER_BUILD}"
WriteRegStr HKLM "Software\${APPLICATION_NAME}" "" $INSTDIR
WriteRegDWORD HKLM "Software\${APPLICATION_NAME}" "VersionMajor" "${VER_MAJOR}"
WriteRegDWORD HKLM "Software\${APPLICATION_NAME}" "VersionMinor" "${VER_MINOR}"
WriteRegDWORD HKLM "Software\${APPLICATION_NAME}" "VersionRevision" "${REVISION}"
WriteRegDWORD HKLM "Software\${APPLICATION_NAME}" "VersionBuild" "${VER_BUILD}"
;Add or Remove Programs entry.
WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "UninstallString" '"$INSTDIR\Uninstall.exe"'
WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "InstallLocation" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "DisplayName" "Tomahawk"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "Publisher" "Tomahawk-player.org"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "DisplayVersion" "${VERSION}"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "VersionMajor" "${VER_MAJOR}"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "VersionMinor" "${VER_MINOR}.${REVISION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "URLInfoAbout" "http://tomahawk-player.org/"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "HelpLink" "http://tomahawk-player.org/"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "NoModify" "1"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "NoRepair" "1"
WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}" "InstallLocation" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}" "DisplayName" "${APPLICATION_NAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}" "Publisher" "@TOMAHAWK_ORGANIZATION_DOMAIN@"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}" "DisplayVersion" "${VERSION}"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}" "VersionMajor" "${VER_MAJOR}"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}" "VersionMinor" "${VER_MINOR}.${REVISION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}" "URLInfoAbout" "http://@TOMAHAWK_ORGANIZATION_DOMAIN@/"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}" "HelpLink" "http://@TOMAHAWK_ORGANIZATION_DOMAIN@/"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}" "NoModify" "1"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}" "NoRepair" "1"
; Register tomahawk:// protocol handler
WriteRegStr HKCR "tomahawk" "" "URL:Tomahawk Protocol"
WriteRegStr HKCR "tomahawk" "URL Protocol" ""
WriteRegStr HKCR "tomahawk\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR "tomahawk\DefaultIcon" "" "$INSTDIR\${APPLICATION_NAME}.exe,1"
WriteRegStr HKCR "tomahawk\shell" "" "open"
WriteRegStr HKCR "tomahawk\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
WriteRegStr HKCR "tomahawk\shell\open\command" "" '"$INSTDIR\${APPLICATION_NAME}.exe" "%1"'
; Register file associations
WriteRegStr HKCR ".mp3" "" "MPEG Audio Layer 3"
WriteRegStr HKCR ".mp3\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR ".mp3\DefaultIcon" "" "$INSTDIR\${APPLICATION_NAME}.exe,1"
WriteRegStr HKCR ".mp3\shell" "" "open"
WriteRegStr HKCR ".mp3\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
WriteRegStr HKCR ".mp3\shell\open\command" "" '"$INSTDIR\${APPLICATION_NAME}.exe" "%1"'
WriteRegStr HKCR ".oga" "" "Ogg Audio File"
WriteRegStr HKCR ".oga\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR ".oga\DefaultIcon" "" "$INSTDIR\${APPLICATION_NAME}.exe,1"
WriteRegStr HKCR ".oga\shell" "" "open"
WriteRegStr HKCR ".oga\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
WriteRegStr HKCR ".oga\shell\open\command" "" '"$INSTDIR\${APPLICATION_NAME}.exe" "%1"'
WriteRegStr HKCR ".ogg" "" "Ogg Audio File"
WriteRegStr HKCR ".ogg\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR ".ogg\DefaultIcon" "" "$INSTDIR\${APPLICATION_NAME}.exe,1"
WriteRegStr HKCR ".ogg\shell" "" "open"
WriteRegStr HKCR ".ogg\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
WriteRegStr HKCR ".ogg\shell\open\command" "" '"$INSTDIR\${APPLICATION_NAME}.exe" "%1"'
WriteRegStr HKCR ".opus" "" "OPUS File"
WriteRegStr HKCR ".opus\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR ".opus\DefaultIcon" "" "$INSTDIR\${APPLICATION_NAME}.exe,1"
WriteRegStr HKCR ".opus\shell" "" "open"
WriteRegStr HKCR ".opus\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
WriteRegStr HKCR ".opus\shell\open\command" "" '"$INSTDIR\${APPLICATION_NAME}.exe" "%1"'
WriteRegStr HKCR ".mp4" "" "AAC File"
WriteRegStr HKCR ".mp4\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR ".mp4\DefaultIcon" "" "$INSTDIR\${APPLICATION_NAME}.exe,1"
WriteRegStr HKCR ".mp4\shell" "" "open"
WriteRegStr HKCR ".mp4\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
WriteRegStr HKCR ".mp4\shell\open\command" "" '"$INSTDIR\${APPLICATION_NAME}.exe" "%1"'
WriteRegStr HKCR ".aac" "" "AAC File"
WriteRegStr HKCR ".aac\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR ".aac\DefaultIcon" "" "$INSTDIR\${APPLICATION_NAME}.exe,1"
WriteRegStr HKCR ".aac\shell" "" "open"
WriteRegStr HKCR ".aac\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
WriteRegStr HKCR ".aac\shell\open\command" "" '"$INSTDIR\${APPLICATION_NAME}.exe" "%1"'
WriteRegStr HKCR ".m4a" "" "AAC File"
WriteRegStr HKCR ".m4a\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR ".m4a\DefaultIcon" "" "$INSTDIR\${APPLICATION_NAME}.exe,1"
WriteRegStr HKCR ".m4a\shell" "" "open"
WriteRegStr HKCR ".m4a\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
WriteRegStr HKCR ".m4a\shell\open\command" "" '"$INSTDIR\${APPLICATION_NAME}.exe" "%1"'
WriteRegStr HKCR ".mpc" "" "Musepack Audio File"
WriteRegStr HKCR ".mpc\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR ".mpc\DefaultIcon" "" "$INSTDIR\${APPLICATION_NAME}.exe,1"
WriteRegStr HKCR ".mpc\shell" "" "open"
WriteRegStr HKCR ".mpc\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
WriteRegStr HKCR ".mpc\shell\open\command" "" '"$INSTDIR\${APPLICATION_NAME}.exe" "%1"'
WriteRegStr HKCR ".wma" "" "Windows Media Audio"
WriteRegStr HKCR ".wma\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR ".wma\DefaultIcon" "" "$INSTDIR\${APPLICATION_NAME}.exe,1"
WriteRegStr HKCR ".wma\shell" "" "open"
WriteRegStr HKCR ".wma\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
WriteRegStr HKCR ".wma\shell\open\command" "" '"$INSTDIR\${APPLICATION_NAME}.exe" "%1"'
WriteRegStr HKCR ".aiff" "" "AIFF File"
WriteRegStr HKCR ".aiff\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR ".aiff\DefaultIcon" "" "$INSTDIR\${APPLICATION_NAME}.exe,1"
WriteRegStr HKCR ".aiff\shell" "" "open"
WriteRegStr HKCR ".aiff\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
WriteRegStr HKCR ".aiff\shell\open\command" "" '"$INSTDIR\${APPLICATION_NAME}.exe" "%1"'
WriteRegStr HKCR ".aif" "" "AIFF File"
WriteRegStr HKCR ".aif\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR ".aif\DefaultIcon" "" "$INSTDIR\${APPLICATION_NAME}.exe,1"
WriteRegStr HKCR ".aif\shell" "" "open"
WriteRegStr HKCR ".aif\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
WriteRegStr HKCR ".aif\shell\open\command" "" '"$INSTDIR\${APPLICATION_NAME}.exe" "%1"'
WriteRegStr HKCR ".wv" "" "WavePack Audio File"
WriteRegStr HKCR ".wv\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR ".wv\DefaultIcon" "" "$INSTDIR\${APPLICATION_NAME}.exe,1"
WriteRegStr HKCR ".wv\shell" "" "open"
WriteRegStr HKCR ".wv\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
WriteRegStr HKCR ".wv\shell\open\command" "" '"$INSTDIR\${APPLICATION_NAME}.exe" "%1"'
WriteRegStr HKCR ".flac" "" "FLAC Audio File"
WriteRegStr HKCR ".flac\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR ".flac\DefaultIcon" "" "$INSTDIR\${APPLICATION_NAME}.exe,1"
WriteRegStr HKCR ".flac\shell" "" "open"
WriteRegStr HKCR ".flac\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
WriteRegStr HKCR ".flac\shell\open\command" "" '"$INSTDIR\${APPLICATION_NAME}.exe" "%1"'
SetDetailsPrint textonly
DetailPrint "Finsihed."
@ -604,7 +607,7 @@ Var UnPageUserAppDataCheckbox_State
Var UnPageUserAppDataEditBox
Function un.UnPageUserAppData
!insertmacro MUI_HEADER_TEXT "Uninstall Tomahawk" "Remove Tomahawk's data folder from your computer."
!insertmacro MUI_HEADER_TEXT "Uninstall ${APPLICATION_NAME}" "Remove ${APPLICATION_NAME}'s data folder from your computer."
nsDialogs::Create /NOUNLOAD 1018
Pop $UnPageUserAppDataDialog
@ -612,10 +615,10 @@ Function un.UnPageUserAppData
Abort
${EndIf}
${NSD_CreateLabel} 0 0 100% 12u "Do you want to delete Tomahawk's data folder?"
${NSD_CreateLabel} 0 0 100% 12u "Do you want to delete ${APPLICATION_NAME}'s data folder?"
Pop $0
${NSD_CreateText} 0 13u 100% 12u "$LOCALAPPDATA\Tomahawk"
${NSD_CreateText} 0 13u 100% 12u "$LOCALAPPDATA\${APPLICATION_NAME}"
Pop $UnPageUserAppDataEditBox
SendMessage $UnPageUserAppDataEditBox ${EM_SETREADONLY} 1 0
@ -633,41 +636,41 @@ Function un.UnPageUserAppDataLeave
FunctionEnd
Section Uninstall
IfFileExists "$INSTDIR\tomahawk.exe" tomahawk_installed
MessageBox MB_YESNO "It does not appear that Tomahawk is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?" IDYES tomahawk_installed
IfFileExists "$INSTDIR\${APPLICATION_NAME}.exe" tomahawk_installed
MessageBox MB_YESNO "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?" IDYES tomahawk_installed
Abort "Uninstall aborted by user"
tomahawk_installed:
;Delete registry keys.
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk"
DeleteRegValue HKLM "Software\Tomahawk" "VersionBuild"
DeleteRegValue HKLM "Software\Tomahawk" "VersionMajor"
DeleteRegValue HKLM "Software\Tomahawk" "VersionMinor"
DeleteRegValue HKLM "Software\Tomahawk" "VersionRevision"
DeleteRegValue HKLM "Software\Tomahawk" ""
DeleteRegKey HKLM "Software\Tomahawk"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}"
DeleteRegValue HKLM "Software\${APPLICATION_NAME}" "VersionBuild"
DeleteRegValue HKLM "Software\${APPLICATION_NAME}" "VersionMajor"
DeleteRegValue HKLM "Software\${APPLICATION_NAME}" "VersionMinor"
DeleteRegValue HKLM "Software\${APPLICATION_NAME}" "VersionRevision"
DeleteRegValue HKLM "Software\${APPLICATION_NAME}" ""
DeleteRegKey HKLM "Software\${APPLICATION_NAME}"
;DeleteRegKey HKCR "Software\Tomahawk"
;DeleteRegKey HKCR "Software\TomahawkSpotify"
DeleteRegKey HKCR "tomahawk"
;DeleteRegKey HKCR "Software\${APPLICATION_NAME}"
;DeleteRegKey HKCR "Software\${APPLICATION_NAME}Spotify"
DeleteRegKey HKCR "${APPLICATION_NAME}"
;Start menu shortcuts.
!ifdef OPTION_SECTION_SC_START_MENU
SetShellVarContext all
RMDir /r "$SMPROGRAMS\Tomahawk"
RMDir /r "$SMPROGRAMS\${APPLICATION_NAME}"
SetShellVarContext current
!endif
;Desktop shortcut.
!ifdef OPTION_SECTION_SC_DESKTOP
IfFileExists "$DESKTOP\Tomahawk.lnk" 0 +2
Delete "$DESKTOP\Tomahawk.lnk"
IfFileExists "$DESKTOP\${APPLICATION_NAME}.lnk" 0 +2
Delete "$DESKTOP\${APPLICATION_NAME}.lnk"
!endif
;Quick Launch shortcut.
!ifdef OPTION_SECTION_SC_QUICK_LAUNCH
IfFileExists "$QUICKLAUNCH\Tomahawk.lnk" 0 +2
Delete "$QUICKLAUNCH\Tomahawk.lnk"
IfFileExists "$QUICKLAUNCH\${APPLICATION_NAME}.lnk" 0 +2
Delete "$QUICKLAUNCH\${APPLICATION_NAME}.lnk"
!endif
;Remove all the Program Files.
@ -675,7 +678,7 @@ Section Uninstall
;Uninstall User Data if option is checked, otherwise skip.
${If} $UnPageUserAppDataCheckbox_State == ${BST_CHECKED}
RMDir /r "$LOCALAPPDATA\Tomahawk"
RMDir /r "$LOCALAPPDATA\${APPLICATION_NAME}"
${EndIf}
SetDetailsPrint textonly
@ -729,7 +732,7 @@ Function .onInit
;Use available InstallLocation when possible. This is useful in the uninstaller
;via re-install, which would otherwise use a default location - a bug.
ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "InstallLocation"
ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}" "InstallLocation"
StrCmp $R0 "" SkipSetInstDir
StrCpy $INSTDIR $R0
SkipSetInstDir:

View File

@ -19,37 +19,50 @@ function(tomahawk_add_plugin)
# message("NO_INSTALL: ${PLUGIN_NO_INSTALL}")
# create target name once for convenience
set(target "tomahawk_${PLUGIN_TYPE}_${PLUGIN_NAME}")
set(target "${TOMAHAWK_TARGET_NAME}_${PLUGIN_TYPE}_${PLUGIN_NAME}")
# determine target type
if(NOT ${PLUGIN_SHARED_LIB})
set(target_type "MODULE")
else()
set(target_type "SHARED")
# create option to disable plugins
string(TOUPPER "${PLUGIN_TYPE}" PLUGIN_TYPE_UPPER)
string(TOUPPER "${PLUGIN_NAME}" PLUGIN_NAME_UPPER)
set(PLUGIN_OPTION "BUILD_${PLUGIN_TYPE_UPPER}_${PLUGIN_NAME_UPPER}")
if(NOT DEFINED ${PLUGIN_OPTION})
set(${PLUGIN_OPTION} ON)
endif()
list(APPEND tomahawk_add_library_args
"${target}"
"EXPORT_MACRO" "${PLUGIN_EXPORT_MACRO}"
"TARGET_TYPE" "${target_type}"
"SOURCES" "${PLUGIN_SOURCES}"
)
option(${PLUGIN_OPTION} "Build Tomahawk with the ${PLUGIN_NAME} ${PLUGIN_TYPE}" ${${PLUGIN_OPTION}})
if(PLUGIN_UI)
list(APPEND tomahawk_add_library_args "UI" "${PLUGIN_UI}")
if(${PLUGIN_OPTION})
# determine target type
if(NOT ${PLUGIN_SHARED_LIB})
set(target_type "MODULE")
else()
set(target_type "SHARED")
endif()
list(APPEND tomahawk_add_library_args
"${target}"
"EXPORT_MACRO" "${PLUGIN_EXPORT_MACRO}"
"TARGET_TYPE" "${target_type}"
"SOURCES" "${PLUGIN_SOURCES}"
)
if(PLUGIN_UI)
list(APPEND tomahawk_add_library_args "UI" "${PLUGIN_UI}")
endif()
if(PLUGIN_LINK_LIBRARIES)
list(APPEND tomahawk_add_library_args "LINK_LIBRARIES" "${PLUGIN_LINK_LIBRARIES}")
endif()
if(PLUGIN_COMPILE_DEFINITIONS)
list(APPEND tomahawk_add_library_args "COMPILE_DEFINITIONS" ${PLUGIN_COMPILE_DEFINITIONS})
endif()
list(APPEND tomahawk_add_library_args "NO_VERSION")
list(APPEND tomahawk_add_library_args "INSTALL_BINDIR" "${CMAKE_INSTALL_LIBDIR}")
tomahawk_add_library(${tomahawk_add_library_args})
endif()
if(PLUGIN_LINK_LIBRARIES)
list(APPEND tomahawk_add_library_args "LINK_LIBRARIES" "${PLUGIN_LINK_LIBRARIES}")
endif()
if(PLUGIN_COMPILE_DEFINITIONS)
list(APPEND tomahawk_add_library_args "COMPILE_DEFINITIONS" ${PLUGIN_COMPILE_DEFINITIONS})
endif()
list(APPEND tomahawk_add_library_args "NO_VERSION")
list(APPEND tomahawk_add_library_args "INSTALL_BINDIR" "${CMAKE_INSTALL_LIBDIR}")
tomahawk_add_library(${tomahawk_add_library_args})
endfunction()

View File

@ -2,7 +2,7 @@ INCLUDE( InstallRequiredSystemLibraries )
SET( CPACK_PACKAGE_CONTACT "Dominik Schmidt <domme@tomahawk-player.org>" )
SET( CPACK_PACKAGE_FILE_NAME tomahawk-${TOMAHAWK_VERSION} ) # Package file name without extension. Also a directory of installer cmake-2.5.0-Linux-i686
SET( CPACK_PACKAGE_FILE_NAME "${TOMAHAWK_APPLICATION_NAME}-${TOMAHAWK_VERSION}" ) # Package file name without extension. Also a directory of installer cmake-2.5.0-Linux-i686
# CPACK_GENERATOR CPack generator to be used STGZ;TGZ;TZ
# CPACK_INCLUDE_TOPLEVEL_DIRECTORY Controls whether CPack adds a top-level directory, usually of the form ProjectName-Version-OS, to the top of package tree. 0 to disable, 1 to enable
@ -22,7 +22,7 @@ SET( CPACK_PACKAGE_VERSION_PATCH ${TOMAHAWK_VERSION_PATCH} )
SET( CPACK_SOURCE_GENERATOR TGZ )
SET( CPACK_SOURCE_IGNORE_FILES "/\\\\.git/" ".*~$" ".kate-swp$" "/build_dir/" "/clang/" "/gcc/" "/build/" "/win/" ) # Pattern of files in the source tree that won't be packaged
SET( CPACK_SOURCE_PACKAGE_FILE_NAME tomahawk-${TOMAHAWK_VERSION} ) # Name of the source package
SET( CPACK_SOURCE_PACKAGE_FILE_NAME ${TOMAHAWK_APPLICATION_NAME}-${TOMAHAWK_VERSION} ) # Name of the source package
# CPACK_SOURCE_STRIP_FILES List of files in the source tree that will be stripped. Starting with CMake 2.6.0 CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables stripping of all files (a list of files evaluates to TRUE in CMake, so this change is compatible).
# CPACK_STRIP_FILES List of files to be stripped. Starting with CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which enables stripping of all files (a list of files evaluates to TRUE in CMake, so this change is compatible). bin/ccmake;bin/cmake;bin/cpack;bin/ctest
# CPACK_SYSTEM_NAME System name, defaults to the value of ${CMAKE_SYSTEM_NAME}. Linux-i686

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="342px" height="115px" viewBox="0 0 342 115" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<title>downloadbutton</title>
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<g id="Rectangle-1-+-BUY-----&gt;-+-&gt;-+-DOWNLOAD" sketch:type="MSLayerGroup">
<g id="Rectangle-1-+-BUY-----&gt;" fill="#000000" sketch:type="MSShapeGroup">
<path d="M0,0 L0,115 L57.393263,115 L342,115 L342,0 L0,0 Z" id="Rectangle-1"></path>
</g>
<path d="M283,58.2686567 L267,52 L267,54.6492537 L274.869464,57.5597015 L279.867133,59.4253731 L279.867133,59.5746269 L274.869464,61.4402985 L267,64.3507463 L267,67 L283,60.7313433 L283,58.2686567 Z" id="&gt;" stroke="#FFFFFF" fill="#FFFFFF" sketch:type="MSShapeGroup" transform="translate(275.000000, 60.000000) rotate(90.000000) translate(-275.000000, -60.000000) "></path>
<path d="M69,69 L75.0117417,69 C80.9921722,69 85,65.6180982 85,58.4033742 C85,51.1886503 80.9921722,48 74.7612524,48 L69,48 L69,69 Z M74,65 L74,52 L74.9201878,52 C78.5680751,52 81,53.5072464 81,58.4057971 C81,63.3043478 78.5680751,65 74.9201878,65 L74,65 Z M97.5,70 C103.148649,70 107,65.8343195 107,58.9023669 C107,52.0029586 103.148649,48 97.5,48 C91.8513514,48 88,51.9704142 88,58.9023669 C88,65.8343195 91.8513514,70 97.5,70 Z M97.5,66 C94.737931,66 93,63.2464455 93,58.9004739 C93,54.5876777 94.737931,52 97.5,52 C100.262069,52 102,54.5876777 102,58.9004739 C102,63.2464455 100.262069,66 97.5,66 Z M112.848601,69 L118.637405,69 L120.577608,59.4662577 C120.927481,57.8558282 121.181934,56.148773 121.436387,54.6027607 L121.563613,54.6027607 C121.78626,56.148773 122.040712,57.8558282 122.390585,59.4662577 L124.426209,69 L130.310433,69 L134,48 L129.515267,48 L128.083969,57.8236196 C127.79771,59.9815951 127.51145,62.2039877 127.225191,64.458589 L127.097964,64.458589 C126.684478,62.2039877 126.270992,59.9493865 125.857506,57.8236196 L123.631043,48 L119.655216,48 L117.428753,57.8236196 C117.015267,60.0138037 116.601781,62.2361963 116.188295,64.458589 L116.061069,64.458589 C115.806616,62.2361963 115.48855,60.0138037 115.234097,57.8236196 L113.802799,48 L109,48 L112.848601,69 Z M137,69 L141.383562,69 L141.383562,61.559816 C141.383562,59.0797546 141.007828,56.2776074 140.819961,53.958589 L140.945205,53.958589 L142.949119,58.5322086 L148.272016,69 L153,69 L153,48 L148.616438,48 L148.616438,55.4079755 C148.616438,57.8880368 148.992172,60.851227 149.180039,63.0736196 L149.054795,63.0736196 L147.050881,58.4355828 L141.727984,48 L137,48 L137,69 Z M158,69 L171,69 L171,65.006135 L162.718519,65.006135 L162.718519,48 L158,48 L158,69 Z M183.5,70 C189.148649,70 193,65.8343195 193,58.9023669 C193,52.0029586 189.148649,48 183.5,48 C177.851351,48 174,51.9704142 174,58.9023669 C174,65.8343195 177.851351,70 183.5,70 Z M183.5,66 C180.737931,66 179,63.2464455 179,58.9004739 C179,54.5876777 180.737931,52 183.5,52 C186.262069,52 188,54.5876777 188,58.9004739 C188,63.2464455 186.262069,66 183.5,66 Z M207.933333,69 L213,69 L206.374359,48 L200.625641,48 L194,69 L198.871795,69 L200.17094,64.0076687 L206.634188,64.0076687 L207.933333,69 Z M201,61 L201.460432,59 C201.978417,56.8333333 202.467626,54.3 202.928058,52 L203.043165,52 C203.532374,54.2666667 204.05036,56.8333333 204.568345,59 L205,61 L201,61 Z M215,69 L221.011742,69 C226.992172,69 231,65.6180982 231,58.4033742 C231,51.1886503 226.992172,48 220.761252,48 L215,48 L215,69 Z M220,65 L220,52 L220.920188,52 C224.568075,52 227,53.5072464 227,58.4057971 C227,63.3043478 224.568075,65 220.920188,65 L220,65 Z" id="DOWNLOAD" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -166,5 +166,6 @@
<file>data/images/repeat-all.svg</file>
<file>data/images/repeat-one.svg</file>
<file>data/images/downloads.svg</file>
<file>data/images/downloadbutton.svg</file>
</qresource>
</RCC>

View File

@ -10,5 +10,5 @@ tomahawk_add_plugin(google
SOURCES
GoogleWrapper.cpp
LINK_LIBRARIES
tomahawk_account_xmpp
${TOMAHAWK_TARGET_NAME}_account_xmpp
)

View File

@ -90,7 +90,7 @@ GoogleWrapper::GoogleWrapper ( const QString& pluginID )
config->m_disableChecksForGoogle = true;
config->m_ui->headerLabel->setText( tr( "Configure this Google Account" ) );
config->m_ui->emailLabel->setText( tr( "Google Address:" ) );
config->m_ui->xmppBlurb->setText( tr( "Enter your Google login to connect with your friends using Tomahawk!" ) );
config->m_ui->xmppBlurb->setText( tr( "Enter your Google login to connect with your friends using %applicationName!" ) );
config->m_ui->xmppUsername->setPlaceholderText( tr( "username@gmail.com" ) );
config->m_ui->logoLabel->setPixmap( QPixmap( ":/google-account/gmail-logo.png" ) );
config->m_ui->xmppServer->setText( "talk.google.com" );

View File

@ -41,7 +41,7 @@ public:
virtual QString prettyName() const { return "Google"; }
virtual QString factoryId() const { return "googleaccount"; }
QString description() const { return tr( "Login to directly connect to your Google Talk contacts that also use Tomahawk." ); }
QString description() const { return tr( "Login to directly connect to your Google Talk contacts that also use %applicationName." ); }
virtual QPixmap icon() const;
virtual Account* createAccount( const QString& pluginId );
};

View File

@ -50,7 +50,7 @@ public:
virtual ~XmppAccountFactory() {}
QString prettyName() const { return "Jabber (XMPP)"; }
QString description() const { return tr( "Login to connect to your Jabber/XMPP contacts that also use Tomahawk." ); }
QString description() const { return tr( "Login to connect to your Jabber/XMPP contacts that also use %applicationName." ); }
QString factoryId() const { return "xmppaccount"; }
QPixmap icon() const { return QPixmap( ":/xmpp-account/xmpp-icon.png" ); }
AccountTypes types() const { return AccountTypes( SipType | StatusPushType ); }

View File

@ -101,7 +101,7 @@
</sizepolicy>
</property>
<property name="text">
<string>Enter your XMPP login to connect with your friends using Tomahawk!</string>
<string>Enter your XMPP login to connect with your friends using %applicationName!</string>
</property>
<property name="wordWrap">
<bool>false</bool>

View File

@ -74,14 +74,14 @@
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>This plugin will automatically find other users running Tomahawk on your local network</string>
<string>This plugin will automatically find other users running %applicationName on your local network</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="autoConnectCheckbox">
<property name="text">
<string>Connect automatically when Tomahawk starts</string>
<string>Connect automatically when %applicationName starts</string>
</property>
</widget>
</item>
@ -101,7 +101,6 @@
</layout>
</widget>
<resources>
<include location="../jreen/resources.qrc"/>
<include location="resources.qrc"/>
<include location="resources.qrc"/>
</resources>

View File

@ -1,6 +1,8 @@
PROJECT( CrashReporter )
cmake_policy(SET CMP0017 NEW)
set(TOMAHAWK_CRASH_REPORTER_TARGET ${TOMAHAWK_TARGET_NAME}_crash_reporter)
setup_qt()
list(APPEND crashreporter_SOURCES main.cpp)
@ -16,16 +18,18 @@ else()
set(CRASHREPORTER_RELEASE_CHANNEL "nightly")
endif()
set(CRASHREPORTER_SUBMIT_URL "https://crash-reports.tomahawk-player.org/submit")
set(CRASHREPORTER_ICON ":/tomahawk-icon.png")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CrashReporterConfig.h.in
${CMAKE_CURRENT_BINARY_DIR}/CrashReporterConfig.h)
include_directories( ${CMAKE_CURRENT_BINARY_DIR}
include_directories(${CMAKE_CURRENT_BINARY_DIR}
../../libtomahawk
../../thirdparty/libcrashreporter-qt/src
)
add_executable( tomahawk_crash_reporter WIN32
add_executable( ${TOMAHAWK_CRASH_REPORTER_TARGET} WIN32
${crashreporter_SOURCES}
${crashreporter_HEADERS_MOC}
${crashreporter_UI_HEADERS}
@ -33,13 +37,13 @@ add_executable( tomahawk_crash_reporter WIN32
)
target_link_libraries(tomahawk_crash_reporter
tomahawklib
target_link_libraries( ${TOMAHAWK_CRASH_REPORTER_TARGET}
${TOMAHAWK_LIBRARIES}
crashreporter-gui
${QT_LIBRARIES}
)
set_target_properties(tomahawk_crash_reporter PROPERTIES AUTOMOC ON)
install(TARGETS tomahawk_crash_reporter RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})
set_target_properties(${TOMAHAWK_CRASH_REPORTER_TARGET} PROPERTIES AUTOMOC ON)
install(TARGETS ${TOMAHAWK_CRASH_REPORTER_TARGET} RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})
qt5_use_modules(tomahawk_crash_reporter Widgets Network)
qt5_use_modules(${TOMAHAWK_CRASH_REPORTER_TARGET} Widgets Network)

View File

@ -1,8 +1,23 @@
#ifndef CRASHREPORTERCONFIG_H
#define CRASHREPORTERCONFIG_H
// QCoreApplication settings for QSettings
#cmakedefine TOMAHAWK_ORGANIZATION_NAME "${TOMAHAWK_ORGANIZATION_NAME}"
#cmakedefine TOMAHAWK_ORGANIZATION_DOMAIN "${TOMAHAWK_ORGANIZATION_DOMAIN}"
#cmakedefine TOMAHAWK_APPLICATION_NAME "${TOMAHAWK_APPLICATION_NAME}"
#cmakedefine TOMAHAWK_VERSION "${TOMAHAWK_VERSION}"
#define CRASHREPORTER_BUILD_ID "@CMAKE_DATESTAMP_YEAR@@CMAKE_DATESTAMP_MONTH@@CMAKE_DATESTAMP_DAY@000000"
#define CRASHREPORTER_RELEASE_CHANNEL "@CRASHREPORTER_RELEASE_CHANNEL@"
#define CRASHREPORTER_PRODUCT_NAME "@TOMAHAWK_APPLICATION_NAME@"
#define CRASHREPORTER_VERSION_STRING "@TOMAHAWK_VERSION_STRING@"
#define CRASHREPORTER_SUBMIT_URL "@CRASHREPORTER_SUBMIT_URL@"
#define CRASHREPORTER_ICON "@CRASHREPORTER_ICON@"
#endif // CRASHREPORTERCONFIG_H

View File

@ -154,9 +154,10 @@ int main( int argc, char* argv[] )
// used by some Qt stuff, eg QSettings
// leave first! As Settings object is created quickly
QCoreApplication::setApplicationName( "Tomahawk" );
QCoreApplication::setOrganizationName( "Tomahawk" );
QCoreApplication::setOrganizationDomain( "tomahawk-player.org" );
QCoreApplication::setOrganizationName( QLatin1String( TOMAHAWK_ORGANIZATION_NAME ) );
QCoreApplication::setOrganizationDomain( QLatin1String( TOMAHAWK_ORGANIZATION_DOMAIN ) );
QCoreApplication::setApplicationName( QLatin1String( TOMAHAWK_APPLICATION_NAME ) );
QCoreApplication::setApplicationVersion( QLatin1String( TOMAHAWK_VERSION ) );
QApplication app( argc, argv );
TomahawkUtils::installTranslator( &app );
@ -167,19 +168,23 @@ int main( int argc, char* argv[] )
return 1;
}
CrashReporter reporter( QUrl( "https://crash-reports.tomahawk-player.org/submit" ), app.arguments() );
reporter.setLogo(QPixmap(":/tomahawk-icon.png"));
CrashReporter reporter( QUrl( CRASHREPORTER_SUBMIT_URL ), app.arguments() );
#ifdef CRASHREPORTER_ICON
reporter.setLogo( QPixmap( CRASHREPORTER_ICON ) );
#endif
reporter.setWindowTitle( CRASHREPORTER_PRODUCT_NAME );
reporter.setText("<html><head/><body><p><span style=\" font-weight:600;\">Sorry!</span> " CRASHREPORTER_PRODUCT_NAME " crashed. Please tell us about it! " CRASHREPORTER_PRODUCT_NAME " has created an error report for you that can help improve the stability in the future. You can now send this report directly to the " CRASHREPORTER_PRODUCT_NAME " developers.</p></body></html>");
reporter.setReportData( "BuildID", CRASHREPORTER_BUILD_ID );
reporter.setReportData( "ProductName", "Tomahawk" );
reporter.setReportData( "Version", TomahawkUtils::appFriendlyVersion().toLocal8Bit() );
reporter.setReportData( "ProductName", CRASHREPORTER_PRODUCT_NAME );
reporter.setReportData( "Version", CRASHREPORTER_VERSION_STRING );
reporter.setReportData( "ReleaseChannel", CRASHREPORTER_RELEASE_CHANNEL);
//reporter.setReportData( "timestamp", QByteArray::number( QDateTime::currentDateTime().toTime_t() ) );
// add parameters
// QList<Pair> pairs;

View File

@ -20,13 +20,13 @@
#include "SnoreNotifyPlugin.h"
#include "TomahawkSettings.h"
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "utils/TomahawkUtilsGui.h"
#include "TomahawkVersion.h"
#include <snore/core/application.h>
#include <snore/core/notification/icon.h>
@ -81,8 +81,8 @@ SnoreNotifyPlugin::SnoreNotifyPlugin()
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << m_snore->primaryNotificationBackend();
m_application = Snore::Application( qApp->applicationName(), m_defaultIcon );
m_application.hints().setValue( "windows_app_id", "org.tomahawk-player.Tomahawk" );
m_application.hints().setValue( "desktop-entry", "tomahawk" );
m_application.hints().setValue( "windows_app_id", TOMAHAWK_APPLICATION_PACKAGE_NAME );
m_application.hints().setValue( "desktop-entry", TOMAHAWK_APPLICATION_NAME );
addAlert( InfoNotifyUser, tr( "Notify User" ) );
addAlert( InfoNowPlaying, tr( "Now Playing" ) );
@ -121,7 +121,7 @@ SnoreNotifyPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
switch ( pushData.type )
{
case Tomahawk::InfoSystem::InfoTrackUnresolved:
notifyUser( Tomahawk::InfoSystem::InfoTrackUnresolved,"The current track could not be resolved. Tomahawk will pick back up with the next resolvable track from this source." );
notifyUser( Tomahawk::InfoSystem::InfoTrackUnresolved, tr( "The current track could not be resolved. %applicationName will pick back up with the next resolvable track from this source." ) );
return;
case Tomahawk::InfoSystem::InfoNotifyUser:
@ -129,7 +129,7 @@ SnoreNotifyPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
return;
case Tomahawk::InfoSystem::InfoNowStopped:
notifyUser( Tomahawk::InfoSystem::InfoNowStopped, "Tomahawk stopped playback." );
notifyUser( Tomahawk::InfoSystem::InfoNowStopped, tr( "%applicationName stopped playback." ) );
return;
case Tomahawk::InfoSystem::InfoNowPlaying:

View File

@ -127,7 +127,7 @@ FdoNotifyPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
switch ( pushData.type )
{
case Tomahawk::InfoSystem::InfoTrackUnresolved:
notifyUser( tr( "The current track could not be resolved. Tomahawk will pick back up with the next resolvable track from this source." ) );
notifyUser( tr( "The current track could not be resolved. %applicationName will pick back up with the next resolvable track from this source." ) );
return;
case Tomahawk::InfoSystem::InfoNotifyUser:
@ -135,7 +135,7 @@ FdoNotifyPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
return;
case Tomahawk::InfoSystem::InfoNowStopped:
notifyUser( tr( "Tomahawk is stopped." ) );
notifyUser( tr( "%applicationName is stopped." ) );
return;
case Tomahawk::InfoSystem::InfoNowPlaying:
@ -311,7 +311,7 @@ FdoNotifyPlugin::nowPlaying( const QVariant& input )
TOMAHAWK_APPLICATION_NAME, // app_name
m_nowPlayingId, // notification_id
"", // app_icon
tr( "Tomahawk - Now Playing" ), // summary
tr( "%applicationName - Now Playing" ), // summary
messageText, // body
QStringList(), // actions
hints, // hints

View File

@ -1,5 +1,5 @@
set(TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET tomahawk-playdarapi)
set(TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET ${TOMAHAWK_TARGET_NAME}-playdarapi)
list(APPEND ${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET}_SOURCES
Api_v1.cpp

View File

@ -1,5 +1,5 @@
set(TOMAHAWK_WIDGETS_LIBRARY_TARGET tomahawk-widgets)
set(TOMAHAWK_WIDGETS_LIBRARY_TARGET ${TOMAHAWK_TARGET_NAME}-widgets)
list(APPEND ${TOMAHAWK_WIDGETS_LIBRARY_TARGET}_SOURCES
PlaylistDelegate.cpp

View File

@ -113,7 +113,7 @@ ActionCollection::initActions()
m_actionCollection[ "rescanCollection" ] = new QAction( tr( "Fully &Rescan Collection" ), this );
m_actionCollection[ "showOfflineSources" ] = new QAction( tr( "Show Offline Friends" ), this );
m_actionCollection[ "showOfflineSources" ]->setCheckable( true );
m_actionCollection[ "preferences" ] = new QAction( tr( "&Configure Tomahawk..." ), this );
m_actionCollection[ "preferences" ] = new QAction( tr( "&Configure %applicationName..." ), this );
m_actionCollection[ "preferences" ]->setMenuRole( QAction::PreferencesRole );
#ifdef Q_OS_MAC
m_actionCollection[ "minimize" ] = new QAction( tr( "Minimize" ), this );
@ -129,7 +129,7 @@ ActionCollection::initActions()
#endif
m_actionCollection[ "diagnostics" ] = new QAction( tr( "Diagnostics..." ), this );
m_actionCollection[ "diagnostics" ]->setMenuRole( QAction::ApplicationSpecificRole );
m_actionCollection[ "aboutTomahawk" ] = new QAction( tr( "About &Tomahawk..." ), this );
m_actionCollection[ "aboutTomahawk" ] = new QAction( tr( "About &%applicationName..." ), this );
m_actionCollection[ "aboutTomahawk" ]->setMenuRole( QAction::AboutRole );
m_actionCollection[ "legalInfo" ] = new QAction( tr( "&Legal Information..." ), this );
m_actionCollection[ "legalInfo" ]->setMenuRole( QAction::ApplicationSpecificRole );
@ -140,7 +140,7 @@ ActionCollection::initActions()
m_actionCollection[ "checkForUpdates" ]->setMenuRole( QAction::ApplicationSpecificRole );
#endif
m_actionCollection[ "crashNow" ] = new QAction( "Crash now...", this );
m_actionCollection[ "whatsnew_0_8" ] = new QAction( tr( "0.8" ) , this );
m_actionCollection[ "whatsnew_0_8" ] = new QAction( tr( "%applicationName 0.8" ) , this );
m_actionCollection[ "whatsnew_0_8" ]->setMenuRole( QAction::ApplicationSpecificRole );
m_actionCollection[ "reportBug" ] = new QAction( tr( "Report a Bug" ) , this );
m_actionCollection[ "getSupport" ] = new QAction( tr( "Get Support" ) , this );

View File

@ -237,6 +237,46 @@ Album::sortname() const
}
QString
Album::purchaseUrl() const
{
Q_D( const Album );
if ( !d->purchaseUrlLoaded )
{
Tomahawk::InfoSystem::InfoStringHash albumInfo;
albumInfo["artist"] = d->artist->name();
albumInfo["album"] = d->name;
Tomahawk::InfoSystem::InfoRequestData requestData;
requestData.caller = infoid();
requestData.type = Tomahawk::InfoSystem::InfoAlbumPurchaseUrl;
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( albumInfo );
requestData.customData = QVariantMap();
requestData.allSources = true;
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) );
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
SIGNAL( finished( QString ) ),
SLOT( infoSystemFinished( QString ) ) );
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData );
}
return d->purchaseUrl;
}
bool
Album::purchased() const
{
Q_D( const Album );
return d->purchased;
}
QPixmap
Album::cover( const QSize& size, bool forceLoad ) const
{
@ -318,8 +358,20 @@ void
Album::infoSystemInfo( const Tomahawk::InfoSystem::InfoRequestData& requestData, const QVariant& output )
{
Q_D( Album );
if ( requestData.caller != infoid() ||
requestData.type != Tomahawk::InfoSystem::InfoAlbumCoverArt )
if ( requestData.caller != infoid() )
return;
if ( requestData.type == Tomahawk::InfoSystem::InfoAlbumPurchaseUrl && output.isValid() )
{
QVariantMap returnedData = output.value< QVariantMap >();
d->purchaseUrlLoaded = true;
d->purchaseUrl = returnedData["url"].toString();
d->purchased = returnedData["purchased"].toBool();
emit updated();
return;
}
if ( requestData.type != Tomahawk::InfoSystem::InfoAlbumCoverArt )
{
return;
}

View File

@ -32,7 +32,6 @@
#include "infosystem/InfoSystem.h"
#include "DllMacro.h"
#include "Query.h"
#include "Typedefs.h"
@ -61,6 +60,8 @@ public:
artist_ptr artist() const;
QPixmap cover( const QSize& size, bool forceLoad = true ) const;
bool coverLoaded() const;
QString purchaseUrl() const;
bool purchased() const;
QList<Tomahawk::query_ptr> tracks( ModelMode mode = Mixed, const Tomahawk::collection_ptr& collection = Tomahawk::collection_ptr() );
Tomahawk::playlistinterface_ptr playlistInterface( ModelMode mode, const Tomahawk::collection_ptr& collection = Tomahawk::collection_ptr() );

View File

@ -36,6 +36,8 @@ public:
, id( _id )
, name( _name )
, artist( _artist )
, purchaseUrlLoaded( false )
, purchased( false )
, coverLoaded( false )
, coverLoading( false )
, cover( 0 )
@ -49,6 +51,8 @@ public:
, id( 0 )
, name( _name )
, artist( _artist )
, purchaseUrlLoaded( false )
, purchased( false )
, coverLoaded( false )
, coverLoading( false )
, cover( 0 )
@ -67,6 +71,10 @@ private:
artist_ptr artist;
mutable bool purchaseUrlLoaded;
mutable bool purchased;
mutable QString purchaseUrl;
mutable bool coverLoaded;
mutable bool coverLoading;
mutable QString uuid;

View File

@ -376,6 +376,7 @@ list(APPEND libSources
utils/GuiHelpers.cpp
utils/WeakObjectHash.cpp
utils/WeakObjectList.cpp
utils/WebPopup.cpp
utils/PluginLoader.cpp
)
@ -424,7 +425,7 @@ include_directories(
IF(LIBATTICA_FOUND)
SET( libGuiSources ${libGuiSources} AtticaManager.cpp )
INCLUDE_DIRECTORIES( ${LIBATTICA_INCLUDE_DIR} )
LIST(APPEND PRIVATE_LINK_LIBRARIES ${LIBATTICA_LIBRARIES} ${LibAttica_LIBRARIES} ${QUAZIP_LIBRARIES} )
LIST(APPEND PRIVATE_LINK_LIBRARIES ${LIBATTICA_LIBRARIES} ${LibAttica_LIBRARIES} ${QUAZIP_LIBRARIES})
IF( TOMAHAWK_QT5 )
LIST(APPEND LINK_LIBRARIES KF5::Attica )
ENDIF( TOMAHAWK_QT5 )
@ -444,7 +445,7 @@ IF( WIN32 )
"dsound.dll"
"winmm.dll"
"advapi32.dll"
"shlwapi.dll"
"shlwapi.dll"
)
ENDIF( WIN32 )
@ -493,22 +494,23 @@ qt_wrap_ui(libUI_H ${libUI})
SET( libSources ${libSources} ${libUI_H} )
add_library( tomahawklib SHARED ${libSources})
add_library( ${TOMAHAWK_LIBRARY} SHARED ${libSources})
set_target_properties(
tomahawklib
${TOMAHAWK_LIBRARY}
PROPERTIES
AUTOMOC TRUE
VERSION ${TOMAHAWK_VERSION_SHORT}
SOVERSION ${TOMAHAWK_VERSION_SHORT}
OUTPUT_NAME "tomahawk"
OUTPUT_NAME ${TOMAHAWK_TARGET_NAME}
)
qt5_use_modules(tomahawklib Widgets Network Sql WebKitWidgets Concurrent Xml UiTools Svg)
qt5_use_modules(${TOMAHAWK_LIBRARY} Widgets Network Sql WebKitWidgets Concurrent Xml UiTools Svg)
IF(APPLE)
qt5_use_modules(tomahawklib MacExtras)
qt5_use_modules(${TOMAHAWK_LIBRARY} MacExtras)
ENDIF()
IF(QCA2_FOUND)
INCLUDE_DIRECTORIES( ${QCA2_INCLUDE_DIR} )
LIST(APPEND LINK_LIBRARIES ${QCA2_LIBRARIES} )
@ -516,10 +518,10 @@ ENDIF(QCA2_FOUND)
IF( UNIX AND NOT APPLE )
LIST(APPEND LINK_LIBRARIES ${QT_QTDBUS_LIBRARIES} )
qt5_use_modules(tomahawklib DBus)
qt5_use_modules(${TOMAHAWK_LIBRARY} DBus)
ENDIF( UNIX AND NOT APPLE )
TARGET_LINK_LIBRARIES( tomahawklib
TARGET_LINK_LIBRARIES( ${TOMAHAWK_LIBRARY}
LINK_PRIVATE
${LIBVLC_LIBRARY}
${LIBVLCCORE_LIBRARY}
@ -549,7 +551,7 @@ TARGET_LINK_LIBRARIES( tomahawklib
${LINK_LIBRARIES}
)
INSTALL( TARGETS tomahawklib
INSTALL( TARGETS ${TOMAHAWK_LIBRARY}
EXPORT TomahawkLibraryDepends
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

View File

@ -68,6 +68,8 @@ ContextMenu::clear()
m_queries.clear();
m_albums.clear();
m_artists.clear();
m_supportedActions = ActionPlay | ActionQueue | ActionPlaylist | ActionCopyLink | ActionLove | ActionStopAfter | ActionPage | ActionEditMetadata | ActionSend;
}
@ -124,6 +126,9 @@ ContextMenu::setQueries( const QList<Tomahawk::query_ptr>& queries )
if ( m_supportedActions & ActionPlay && itemCount() == 1 )
m_sigmap->setMapping( addAction( ImageRegistry::instance()->icon( RESPATH "images/play.svg" ), tr( "&Play" ) ), ActionPlay );
if ( m_supportedActions & ActionDownload )
m_sigmap->setMapping( addAction( ImageRegistry::instance()->icon( RESPATH "images/downloads.svg" ), tr( "Download" ) ), ActionDownload );
if ( m_supportedActions & ActionQueue )
m_sigmap->setMapping( addAction( ImageRegistry::instance()->icon( RESPATH "images/queue.svg" ), tr( "Add to &Queue" ) ), ActionQueue );

View File

@ -44,13 +44,14 @@ public:
ActionLove = 16,
ActionStopAfter = 32,
ActionPage = 64,
ActionTrackPage = 65,
ActionArtistPage = 66,
ActionAlbumPage = 67,
ActionEditMetadata = 128,
ActionPlaylist = 256,
ActionSend = 512,
ActionMarkListened = 1024
ActionTrackPage = 128,
ActionArtistPage = 256,
ActionAlbumPage = 512,
ActionEditMetadata = 1024,
ActionPlaylist = 2048,
ActionSend = 4096,
ActionMarkListened = 8192,
ActionDownload = 16384
};
explicit ContextMenu( QWidget* parent = 0 );

View File

@ -88,18 +88,28 @@ DownloadManager::localFileForDownload( const QString& url ) const
void
DownloadManager::storeJobs( const QList<downloadjob_ptr>& jobs )
{
tDebug() << Q_FUNC_INFO;
QVariantList downloads = TomahawkSettings::instance()->downloadStates();
foreach ( const downloadjob_ptr& job, jobs )
{
if ( job->state() != DownloadJob::Finished )
continue;
tDebug() << "Storing job:" << job->format().url << job->localFile();
tDebug() << Q_FUNC_INFO << "Storing job:" << job->format().url << job->localFile();
QVariantMap map;
map[ "url" ] = job->format().url;
map[ "localfile" ] = job->localFile();
m_downloadStates[ map[ "url" ].toString() ] = map;
downloads << map;
bool dupe = false;
foreach ( const QVariant& m, downloads )
{
if ( m.toMap()[ "url" ] == map[ "url" ] )
dupe = true;
}
if ( !dupe )
downloads << map;
}
TomahawkSettings::instance()->setDownloadStates( downloads );
@ -162,8 +172,8 @@ DownloadManager::addJob( const downloadjob_ptr& job )
connect( job.data(), SIGNAL( finished() ), SLOT( onJobFinished() ) );
connect( job.data(), SIGNAL( finished() ), SLOT( checkJobs() ) );
connect( job.data(), SIGNAL( finished() ), SIGNAL( jobFinished() ) );
connect( job.data(), SIGNAL( stateChanged( DownloadJob::TrackState, DownloadJob::TrackState ) ), SLOT( checkJobs() ) ) ;
// connect( job.data(), SIGNAL( stateChanged( DownloadJob::TrackState, DownloadJob::TrackState ) ), SIGNAL( stateChanged( DownloadJob::TrackState, DownloadJob::TrackState ) ) );
checkJobs();
return true;
@ -226,6 +236,9 @@ DownloadManager::state() const
case DownloadJob::Running:
return DownloadManager::Running;
default:
break;
}
}
@ -239,10 +252,23 @@ DownloadManager::checkJobs()
if ( !m_globalState )
return;
if ( state() == DownloadManager::Waiting && !currentJob().isNull() )
if ( state() == DownloadManager::Waiting )
{
downloadjob_ptr job = currentJob();
job->download();
if ( !currentJob().isNull() )
{
downloadjob_ptr job = currentJob();
/* connect( job.data(), SIGNAL( finished() ), SLOT( checkJobs() ) );
connect( job.data(), SIGNAL( stateChanged( DownloadJob::TrackState, DownloadJob::TrackState ) ), SLOT( checkJobs() ) ) ;
connect( job.data(), SIGNAL( stateChanged( DownloadJob::TrackState, DownloadJob::TrackState ) ), SIGNAL( stateChanged( Track::TrackState, Track::TrackState ) ) );*/
job->download();
emit stateChanged( DownloadManager::Running, DownloadManager::Waiting );
}
else
{
emit stateChanged( DownloadManager::Waiting , DownloadManager::Running );
}
}
}
@ -257,9 +283,25 @@ DownloadManager::onJobFinished()
ScanManager::instance()->runFileScan( files, true );
Tomahawk::InfoSystem::InfoPushData pushData( "DownloadManager", Tomahawk::InfoSystem::InfoNotifyUser,
tr( "Tomahawk finished downloading %1 by %2." ).arg( job->track()->track() ).arg( job->track()->artist() ),
tr( "%applicationName finished downloading %1 by %2." ).arg( job->track()->track() ).arg( job->track()->artist() ),
Tomahawk::InfoSystem::PushNoFlag );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( pushData );
storeJobs( jobs( DownloadJob::Finished ) );
}
void
DownloadManager::cancelAll()
{
foreach ( const downloadjob_ptr& job, jobs( DownloadJob::Waiting ) )
{
removeJob( job );
}
foreach ( const downloadjob_ptr& job, jobs( DownloadJob::Running ) )
{
job->abort();
}
}

View File

@ -51,6 +51,7 @@ public slots:
bool removeJob( const downloadjob_ptr& job );
void checkJobs();
void cancelAll();
void pause();
void resume();
@ -59,7 +60,8 @@ public slots:
signals:
void jobAdded( const downloadjob_ptr& job );
void jobRemoved( const downloadjob_ptr& job );
void jobFinished();
void stateChanged( DownloadManager::DownloadManagerState newState, DownloadManager::DownloadManagerState oldState );
private slots:
void onJobFinished();

View File

@ -135,7 +135,7 @@ GlobalActionManager::installResolverFromFile( const QString& resolverPath )
tr( "Install plug-in" ),
tr( "<b>%1</b> %2<br/>"
"by <b>%3</b><br/><br/>"
"You are attempting to install a Tomahawk "
"You are attempting to install a %applicationName "
"plug-in from an unknown source. Plug-ins from "
"untrusted sources may put your data at risk.<br/>"
"Do you want to install this plug-in?" )

View File

@ -414,7 +414,7 @@ Pipeline::addResultsToQuery( const query_ptr& query, const QList< result_ptr >&
void
Pipeline::onResultUrlCheckerDone( )
Pipeline::onResultUrlCheckerDone()
{
ResultUrlChecker* checker = qobject_cast< ResultUrlChecker* >( sender() );
if ( !checker )

View File

@ -532,6 +532,9 @@ Result::track() const
void
Result::setDownloadFormats( const QList<DownloadFormat>& formats )
{
if ( formats.isEmpty() )
return;
m_formats.clear();
foreach ( const DownloadFormat& format, formats )
{
@ -574,12 +577,25 @@ Result::toDownloadJob( const DownloadFormat& format )
{
m_downloadJob = downloadjob_ptr( new DownloadJob( weakRef().toStrongRef(), format ) );
connect( m_downloadJob.data(), SIGNAL( progress( int ) ), SIGNAL( updated() ) );
connect( m_downloadJob.data(), SIGNAL( stateChanged( DownloadJob::TrackState, DownloadJob::TrackState ) ),
SLOT( onDownloadJobStateChanged( DownloadJob::TrackState, DownloadJob::TrackState ) ) );
}
return m_downloadJob;
}
void
Result::onDownloadJobStateChanged( DownloadJob::TrackState newState, DownloadJob::TrackState oldState )
{
if ( newState == DownloadJob::Aborted )
{
m_downloadJob.clear();
emit updated();
}
}
QWeakPointer<Result>
Result::weakRef()
{

View File

@ -153,6 +153,8 @@ private slots:
void onResolverRemoved( Tomahawk::Resolver* resolver );
void doneEditing();
void onDownloadJobStateChanged( DownloadJob::TrackState newState, DownloadJob::TrackState oldState );
void onSettingsChanged();
private:

View File

@ -473,6 +473,22 @@ AccountManager::localConfigStorage()
}
Account*
AccountManager::accountByFriendlyName( const QString& friendlyName ) const
{
foreach( Tomahawk::Accounts::Account* curAccount, m_accounts )
{
// GAH, friendlyname is uservisible and no id ... :-/
if ( curAccount->accountFriendlyName() == friendlyName )
{
return curAccount;
}
}
return nullptr;
}
void
AccountManager::hookupAccount( Account* account ) const
{

View File

@ -98,6 +98,9 @@ public:
ConfigStorage* configStorageForAccount( const QString& accountId );
ConfigStorage* localConfigStorage();
Account* accountByFriendlyName( const QString& friendlyName ) const;
public slots:
void connectAll();
void disconnectAll();

View File

@ -20,7 +20,7 @@ if( KDE4_FOUND )
SOURCES
KdeTelepathyConfigWidget.cpp
LINK_LIBRARIES
tomahawk_configstorage_telepathy
${TOMAHAWK_TARGET_NAME}_configstorage_telepathy
${KDE4_KCMUTILS_LIBS}
)
endif()

View File

@ -133,7 +133,7 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Right click on any Tomahawk playlist to sync it to Spotify.</string>
<string>Right click on any %applicationNames playlist to sync it to Spotify.</string>
</property>
<property name="margin">
<number>0</number>
@ -186,7 +186,7 @@
<item>
<widget class="QCheckBox" name="deleteOnUnsync">
<property name="text">
<string>Delete Tomahawk playlist when removing synchronization</string>
<string>Delete %applicationName playlist when removing synchronization</string>
</property>
</widget>
</item>

View File

@ -909,7 +909,7 @@ AudioEngine::playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk:
}
JobStatusView::instance()->model()->addJob(
new ErrorStatusMessage( tr( "Sorry, Tomahawk couldn't find the track '%1' by %2" ).arg( query->queryTrack()->track() ).arg( query->queryTrack()->artist() ), 15 ) );
new ErrorStatusMessage( tr( "Sorry, %applicationName couldn't find the track '%1' by %2" ).arg( query->queryTrack()->track() ).arg( query->queryTrack()->artist() ), 15 ) );
if ( isStopped() )
emit stopped(); // we do this so the original caller knows we couldn't find this track
@ -933,7 +933,7 @@ AudioEngine::playItem( const Tomahawk::artist_ptr& artist )
if ( pli->tracks().isEmpty() )
{
JobStatusView::instance()->model()->addJob(
new ErrorStatusMessage( tr( "Sorry, Tomahawk couldn't find the artist '%1'" ).arg( artist->name() ), 15 ) );
new ErrorStatusMessage( tr( "Sorry, %applicationName couldn't find the artist '%1'" ).arg( artist->name() ), 15 ) );
if ( isStopped() )
emit stopped(); // we do this so the original caller knows we couldn't find this track
@ -959,7 +959,7 @@ AudioEngine::playItem( const Tomahawk::album_ptr& album )
if ( pli->tracks().isEmpty() )
{
JobStatusView::instance()->model()->addJob(
new ErrorStatusMessage( tr( "Sorry, Tomahawk couldn't find the album '%1' by %2" ).arg( album->name() ).arg( album->artist()->name() ), 15 ) );
new ErrorStatusMessage( tr( "Sorry, %applicationName couldn't find the album '%1' by %2" ).arg( album->name() ).arg( album->artist()->name() ), 15 ) );
if ( isStopped() )
emit stopped(); // we do this so the original caller knows we couldn't find this track

View File

@ -182,7 +182,7 @@ ACLJobItem::createDelegate( QObject* parent )
m_delegate = new ACLJobDelegate( parent );
Tomahawk::InfoSystem::InfoPushData pushData( "ACLJobItem", Tomahawk::InfoSystem::InfoNotifyUser, tr( "Tomahawk needs you to decide whether %1 is allowed to connect." ).arg( m_username ), Tomahawk::InfoSystem::PushNoFlag );
Tomahawk::InfoSystem::InfoPushData pushData( "ACLJobItem", Tomahawk::InfoSystem::InfoNotifyUser, tr( "%applicationName needs you to decide whether %1 is allowed to connect." ).arg( m_username ), Tomahawk::InfoSystem::PushNoFlag );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( pushData );
}

View File

@ -22,6 +22,8 @@
#include <QStackedWidget>
#include <QVBoxLayout>
#include "DownloadManager.h"
#include "Result.h"
#include "audio/AudioEngine.h"
#include "widgets/CaptionLabel.h"
#include "playlist/PlayableModel.h"
@ -140,6 +142,32 @@ ContextView::setCaption( const QString& caption )
}
void
ContextView::onDownloadAll()
{
for ( int i = 0; i < m_trackView->proxyModel()->rowCount( QModelIndex() ); i++ )
{
PlayableItem* item = m_trackView->proxyModel()->itemFromIndex( m_trackView->proxyModel()->mapToSource( m_trackView->proxyModel()->index( i, 0, QModelIndex() ) ) );
if ( !item || !item->query() || !item->query()->results().count() )
continue;
if ( !item->query()->results().first()->downloadFormats().count() )
continue;
if ( !DownloadManager::instance()->localFileForDownload( item->query()->results().first()->downloadFormats().first().url.toString() ).isEmpty() )
continue;
if ( !item->result()->downloadFormats().isEmpty() )
DownloadManager::instance()->addJob( item->result()->toDownloadJob( item->result()->downloadFormats().first() ) );
}
}
void
ContextView::onDownloadCancel()
{
DownloadManager::instance()->cancelAll();
}
void
ContextView::onQuerySelected( const Tomahawk::query_ptr& query )
{
@ -149,6 +177,7 @@ ContextView::onQuerySelected( const Tomahawk::query_ptr& query )
}
m_query = query;
m_detailView->setQuery( m_query );
if ( m_query )
{
@ -292,3 +321,10 @@ ContextView::setShowCloseButton( bool b )
{
m_captionLabel->setShowCloseButton( b );
}
TrackDetailView*
ContextView::trackDetailView() const
{
return m_detailView;
}

View File

@ -51,6 +51,7 @@ public:
void setTrackView( TrackView* view );
TrackView* trackView() const { return m_trackView; }
TrackDetailView* trackDetailView() const;
void setCaption( const QString& caption );
void setGuid( const QString& guid );
@ -73,6 +74,9 @@ private slots:
void onQuerySelected( const Tomahawk::query_ptr& query );
void onCoverUpdated();
void onDownloadAll();
void onDownloadCancel();
private:
CaptionLabel* m_captionLabel;
TrackView* m_trackView;

View File

@ -149,11 +149,11 @@ appConfigDir()
#else
if ( getenv( "XDG_CONFIG_HOME" ) )
{
ret = QDir( QString( "%1/Tomahawk" ).arg( getenv( "XDG_CONFIG_HOME" ) ) );
ret = QDir( QString( "%1/" TOMAHAWK_APPLICATION_NAME ).arg( getenv( "XDG_CONFIG_HOME" ) ) );
}
else if ( getenv( "HOME" ) )
{
ret = QDir( QString( "%1/.config/Tomahawk" ).arg( getenv( "HOME" ) ) );
ret = QDir( QString( "%1/.config/" TOMAHAWK_APPLICATION_NAME ).arg( getenv( "HOME" ) ) );
}
else
{
@ -219,7 +219,7 @@ appLogDir()
const QString
logFilePath()
{
return TomahawkUtils::appLogDir().filePath( "Tomahawk.log" );
return TomahawkUtils::appLogDir().filePath( TOMAHAWK_APPLICATION_NAME ".log" );
}
QString
@ -651,6 +651,8 @@ operatingSystemVersionDetail()
version.append( QString( " %1.%2" ).arg( osvi.dwMajorVersion ).arg( osvi.dwMinorVersion ) );
return version;
#elif defined ( Q_OS_MAC )
return "OS X";
#else
return "Unknown";
#endif
@ -667,6 +669,39 @@ userAgentString( const QString& applicationName, const QString& applicationVersi
}
class TomahawkTranslator : public QTranslator
{
public:
TomahawkTranslator( QObject* parent ) : QTranslator( parent )
{
};
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
QString translate( const char * context, const char * sourceText, const char * disambiguation = 0 ) const Q_DECL_OVERRIDE
{
QString translation = QTranslator::translate( context, sourceText, disambiguation );
#else
QString translate( const char * context, const char * sourceText, const char * disambiguation = 0, int n = -1) const Q_DECL_OVERRIDE
{
QString translation = QTranslator::translate( context, sourceText, disambiguation, n );
#endif
if( translation.isEmpty() )
{
translation = QString::fromUtf8( sourceText );
}
// // lowercase all strings not on whats new page ...
// // TODO: rather scan disambiguation for nolowercase, but too lazy for that right now
// if( strcmp( context, "WhatsNewWidget_0_8" ) )
// {
// translation = translation.toLower();
// }
return translation.replace( "%applicationName", TOMAHAWK_APPLICATION_NAME, Qt::CaseInsensitive );
}
};
void
installTranslator( QObject* parent )
{
@ -679,7 +714,7 @@ installTranslator( QObject* parent )
locale = "en";
// Tomahawk translations
QTranslator* translator = new QTranslator( parent );
QTranslator* translator = new TomahawkTranslator( parent );
if ( translator->load( QString( ":/lang/tomahawk_" ) + locale ) )
{
qDebug() << "Translation: Tomahawk: Using system locale:" << locale;

View File

@ -0,0 +1,61 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2014, Dominik Schmidt <domme@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "WebPopup.h"
#include <QDesktopServices>
bool
ExternalBrowserWebPage::acceptNavigationRequest( QWebFrame*, const QNetworkRequest& request, NavigationType )
{
QDesktopServices::openUrl( request.url() );
return false;
}
WebPopup::WebPopup( const QUrl& url, const QSize& size )
: QWebView( 0 )
{
setAttribute( Qt::WA_DeleteOnClose, true );
settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled, true );
settings()->setAttribute( QWebSettings::JavascriptCanCloseWindows, true );
page()->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAsNeeded );
page()->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAsNeeded );
connect( page(), SIGNAL( windowCloseRequested() ), SLOT( close() ) );
if ( !size.isEmpty() )
{
resize( size );
}
load( url );
show();
}
QWebView*
WebPopup::createWindow( QWebPage::WebWindowType )
{
QWebView* fakeWindow = new QWebView();
fakeWindow->setPage( new ExternalBrowserWebPage( fakeWindow ) );
fakeWindow->deleteLater();
return fakeWindow;
}

View File

@ -0,0 +1,53 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2014, Dominik Schmidt <domme@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef WEBPOPUP_H
#define WEBPOPUP_H
#include "DllMacro.h"
#include "Typedefs.h"
#include <QWebView>
#include <QWebFrame>
class ExternalBrowserWebPage : public QWebPage
{
Q_OBJECT
public:
ExternalBrowserWebPage( QObject* parent )
: QWebPage(parent)
{
}
protected:
bool acceptNavigationRequest( QWebFrame*, const QNetworkRequest& request, NavigationType ) override;
};
class WebPopup : public QWebView
{
Q_OBJECT
public:
WebPopup( const QUrl& url, const QSize& size );
QWebView* createWindow( QWebPage::WebWindowType );
};
#endif // WEBPOPUP_H

View File

@ -42,26 +42,21 @@ if( APPLE )
# Use two different sparkle update tracks for debug and release
# We have to change the URL in the Info.plist file :-/
FILE(READ ${CMAKE_SOURCE_DIR}/admin/mac/Info.plist plist)
STRING( REPLACE "TOMAHAWK_VERSION"
${TOMAHAWK_VERSION}
edited_plist # save in this variable
"${plist}" # from the contents of this var
)
# Disable non-release sparkle for now. We haven't used it yet.
set(TOMAHAWK_SPARKLE_UPDATE_URL "http://download.tomahawk-player.org/sparkle/update.php")
# Disable non-release sparkle for now. We haven't used it yet.
# IF( NOT CMAKE_BUILD_TYPE STREQUAL "Release" )
# STRING( REPLACE "http://download.tomahawk-player.org/sparkle" # match this
# "http://download.tomahawk-player.org/sparkle-debug" #replace with debug url
# edited_plist # save in this variable
# "${edited_plist}" # from the contents of this var
# )
# set(TOMAHAWK_SPARKLE_UPDATE_URL "http://download.tomahawk-player.org/sparkle-debug")
# ENDIF()
FILE( WRITE ${CMAKE_BINARY_DIR}/Info.plist "${edited_plist}" )
configure_file(${CMAKE_SOURCE_DIR}/admin/mac/Info.plist ${CMAKE_BINARY_DIR}/Info.plist)
FILE(COPY ${CMAKE_SOURCE_DIR}/admin/mac/sparkle_pub.pem
DESTINATION "${CMAKE_BINARY_DIR}/Tomahawk.app/Contents/Resources")
DESTINATION "${CMAKE_BINARY_DIR}/${TOMAHAWK_APPLICATION_NAME}.app/Contents/Resources")
FILE(COPY /usr/bin/SetFile DESTINATION "${CMAKE_BINARY_DIR}/${TOMAHAWK_APPLICATION_NAME}.app/Contents/MacOS")
FILE(COPY /usr/bin/GetFileInfo DESTINATION "${CMAKE_BINARY_DIR}/${TOMAHAWK_APPLICATION_NAME}.app/Contents/MacOS")
FILE(COPY /usr/bin/SetFile DESTINATION "${CMAKE_BINARY_DIR}/Tomahawk.app/Contents/MacOS")
FILE(COPY /usr/bin/GetFileInfo DESTINATION "${CMAKE_BINARY_DIR}/Tomahawk.app/Contents/MacOS")
endif (APPLE)

View File

@ -1,6 +1,8 @@
PROJECT( tomahawk )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
set(TOMAHAWK_APPLICATION_TARGET "tomahahawk-bin")
include( AddAppIconMacro )
# SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
@ -158,8 +160,8 @@ else()
set(TOMAHAWK_RUNTIME_OUTPUT_NAME "tomahawk")
endif()
ADD_EXECUTABLE( tomahawk_bin WIN32 MACOSX_BUNDLE ${final_src} )
SET_TARGET_PROPERTIES(tomahawk_bin
ADD_EXECUTABLE( ${TOMAHAWK_APPLICATION_TARGET} WIN32 MACOSX_BUNDLE ${final_src} )
SET_TARGET_PROPERTIES(${TOMAHAWK_APPLICATION_TARGET}
PROPERTIES
AUTOMOC TRUE
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_BINARY_DIR}/Info.plist"
@ -167,12 +169,12 @@ SET_TARGET_PROPERTIES(tomahawk_bin
)
qt5_use_modules(tomahawk_bin Core Widgets Network Sql WebKitWidgets)
qt5_use_modules(${TOMAHAWK_APPLICATION_TARGET} Core Widgets Network Sql WebKitWidgets)
if(APPLE)
qt5_use_modules(tomahawk_bin MacExtras)
qt5_use_modules(${TOMAHAWK_APPLICATION_TARGET} MacExtras)
endif()
if(WIN32)
qt5_use_modules(tomahawk_bin WinExtras)
qt5_use_modules(${TOMAHAWK_APPLICATION_TARGET} WinExtras)
endif()
MESSAGE( STATUS "OS_SPECIFIC_LINK_LIBRARIES: ${OS_SPECIFIC_LINK_LIBRARIES}" )
@ -187,7 +189,7 @@ IF( WITH_CRASHREPORTER )
LIST(APPEND LINK_LIBRARIES ${LINK_LIBRARIES} crashreporter-handler )
ENDIF()
TARGET_LINK_LIBRARIES( tomahawk_bin
TARGET_LINK_LIBRARIES( ${TOMAHAWK_APPLICATION_TARGET}
kdsingleapplicationguard
${LINK_LIBRARIES}
${TOMAHAWK_WIDGETS_LIBRARIES}
@ -209,7 +211,7 @@ IF( APPLE )
ENDIF( HAVE_SPARKLE )
ENDIF( APPLE )
INSTALL( TARGETS tomahawk_bin BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
INSTALL( TARGETS ${TOMAHAWK_APPLICATION_TARGET} BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
IF( UNIX AND NOT APPLE AND KDE4_INSTALLED AND LEGACY_KDE_INTEGRATION ) #install protocol file
FILE( READ ${CMAKE_SOURCE_DIR}/admin/unix/tomahawk.protocol protocol )

View File

@ -4,6 +4,8 @@
#cmakedefine TOMAHAWK_ORGANIZATION_NAME "${TOMAHAWK_ORGANIZATION_NAME}"
#cmakedefine TOMAHAWK_ORGANIZATION_DOMAIN "${TOMAHAWK_ORGANIZATION_DOMAIN}"
#cmakedefine TOMAHAWK_APPLICATION_NAME "${TOMAHAWK_APPLICATION_NAME}"
#cmakedefine TOMAHAWK_TARGET_NAME "${TOMAHAWK_TARGET_NAME}"
#cmakedefine TOMAHAWK_APPLICATION_PACKAGE_NAME "${TOMAHAWK_APPLICATION_PACKAGE_NAME}"
#cmakedefine TOMAHAWK_VERSION "${TOMAHAWK_VERSION}"
#cmakedefine TOMAHAWK_SYSTEM "${TOMAHAWK_SYSTEM}"