1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 08:19:42 +01:00
This commit is contained in:
Alejandro Wainzinger 2011-08-14 07:04:48 -07:00
commit c1cbc3576c
46 changed files with 213 additions and 1090 deletions

View File

@ -23,26 +23,28 @@ SET( TOMAHAWK_VERSION_RC 1 )
# build options
option(BUILD_GUI "Build Tomahawk with GUI" ON)
option(BUILD_RELEASE "Generate TOMAHAWK_VERSION without GIT info" OFF)
# generate version string
IF( NOT CMAKE_BUILD_TYPE STREQUAL "Release" )
# Use the date as the tweak level.
INCLUDE( CMakeDateStamp )
SET( TOMAHAWK_VERSION_TWEAK "${CMAKE_DATESTAMP_YEAR}${CMAKE_DATESTAMP_MONTH}${CMAKE_DATESTAMP_DAY}" )
INCLUDE( CMakeVersionSource )
ENDIF()
# base string used in release and unstable builds
SET( TOMAHAWK_VERSION ${TOMAHAWK_VERSION_MAJOR}.${TOMAHAWK_VERSION_MINOR}.${TOMAHAWK_VERSION_PATCH} )
IF( ${TOMAHAWK_VERSION_TWEAK} GREATER 0)
SET( TOMAHAWK_VERSION ${TOMAHAWK_VERSION}.${TOMAHAWK_VERSION_TWEAK} )
ENDIF()
IF( TOMAHAWK_VERSION_RC )
SET( CMake_VERSION ${TOMAHAWK_VERSION}rc${TOMAHAWK_VERSION_RC} )
SET( TOMAHAWK_VERSION ${TOMAHAWK_VERSION}rc${TOMAHAWK_VERSION_RC} )
ENDIF()
IF( CMAKE_VERSION_SOURCE )
SET( TOMAHAWK_VERSION ${TOMAHAWK_VERSION}-${CMAKE_VERSION_SOURCE} )
# additional info for non-release builds
IF( NOT BUILD_RELEASE )
INCLUDE( CMakeDateStamp )
SET( TOMAHAWK_VERSION_DATE "${CMAKE_DATESTAMP_YEAR}${CMAKE_DATESTAMP_MONTH}${CMAKE_DATESTAMP_DAY}" )
IF( ${TOMAHAWK_VERSION_DATE} GREATER 0)
SET( TOMAHAWK_VERSION ${TOMAHAWK_VERSION}.${TOMAHAWK_VERSION_DATE} )
ENDIF()
INCLUDE( CMakeVersionSource )
IF( CMAKE_VERSION_SOURCE )
SET( TOMAHAWK_VERSION ${TOMAHAWK_VERSION}-${CMAKE_VERSION_SOURCE} )
ENDIF()
ENDIF()
@ -54,7 +56,7 @@ SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
# installer creation
INCLUDE( CPack )
INCLUDE( TomahawkCPack.cmake )
#deps
INCLUDE( MacroOptionalFindPackage )

View File

@ -28,18 +28,15 @@
; 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! ^
!define VLC_PLUGIN_PATH "${VLC_PATH}\plugins"
!define VLC_PATH "${SOURCE_PATH}\admin\win\vlc\prefix" ; SIC! ^
!define VLC_BIN "${VLC_PATH}\bin"
!define VLC_PLUGIN_PATH "${VLC_BIN}\plugins"
!define NSI_PATH "@CMAKE_SOURCE_DIR@/admin/win/nsi"
!define NSI_PATH "${SOURCE_PATH}/admin/win/nsi"
;-----------------------------------------------------------------------------
; Increment installer revision number as part of this script.
; Installer version
;-----------------------------------------------------------------------------
!define /file REVISION_LAST ${NSI_PATH}/revision.txt
!define /math REVISION ${REVISION_LAST} + 1
!delfile revision.txt
!appendfile revision.txt ${REVISION}
!define VER_MAJOR "@CPACK_PACKAGE_VERSION_MAJOR@"
!define VER_MINOR "@CPACK_PACKAGE_VERSION_MINOR@"
@ -333,15 +330,15 @@ Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER
File "${MING_BIN}\libdbus-1-3.dll"
File "${MING_BIN}\dbus-daemon.exe"
File "${MING_BIN}\libphonon.dll"
File "${VLC_BIN}\libphonon.dll"
SetOutPath "$INSTDIR\phonon_backend"
File "${VLC_PATH}\phonon_backend\phonon_vlc.dll"
File "${VLC_BIN}\phonon_backend\phonon_vlc.dll"
SetOutPath "$INSTDIR"
;VLC
;SetOutPath "$INSTDIR\phonon_backend"
File "${VLC_PATH}\libvlc.dll"
File "${VLC_PATH}\libvlccore.dll"
File "${VLC_BIN}\libvlc.dll"
File "${VLC_BIN}\libvlccore.dll"
SetOutPath "$INSTDIR\plugins"
File /r "${VLC_PLUGIN_PATH}\*.dll"
SetOutPath "$INSTDIR"

View File

@ -1 +0,0 @@
122

View File

@ -1,667 +0,0 @@
;Tomahawk installer script.
;-----------------------------------------------------------------------------
; Some installer script options (comment-out options not required)
;-----------------------------------------------------------------------------
;!define OPTION_LICENSE_AGREEMENT
!define OPTION_UAC_PLUGIN_ENHANCED
!define OPTION_SECTION_SC_START_MENU
!define OPTION_SECTION_SC_DESKTOP
!define OPTION_SECTION_SC_QUICK_LAUNCH
!define OPTION_FINISHPAGE
!define OPTION_FINISHPAGE_LAUNCHER
!define OPTION_FINISHPAGE_RELEASE_NOTES
;-----------------------------------------------------------------------------
; Some paths.
;-----------------------------------------------------------------------------
!ifndef MING_PATH
!define MING_PATH "/usr/i686-w64-mingw32/sys-root/mingw"
!endif
!define MING_BIN "${MING_PATH}/bin"
!define MING_LIB "${MING_PATH}/lib"
!define ROOT_PATH "..\..\.." ; assuming the script is in ROOT/admin/win/nsi
!define BUILD_PATH "${ROOT_PATH}\build"
!define QT_DLL_PATH "${MING_BIN}"
!define SQLITE_DLL_PATH "${MING_LIB}/qt4/plugins/sqldrivers"
!define IMAGEFORMATS_DLL_PATH "${MING_LIB}/qt4/plugins/imageformats"
!define VLC_PLUGIN_PATH "${MING_LIB}\vlc\plugins"
;-----------------------------------------------------------------------------
; Increment installer revision number as part of this script.
;-----------------------------------------------------------------------------
!define /file REVISION_LAST revision.txt
!define /math REVISION ${REVISION_LAST} + 1
!delfile revision.txt
!appendfile revision.txt ${REVISION}
!ifndef VER_MAJOR && VER_MINOR && VER_BUILD
!define VER_MAJOR "0"
!define VER_MINOR "2"
!define VER_BUILD "0prealpha"
!endif
!define VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_BUILD}"
;-----------------------------------------------------------------------------
; Installer build timestamp.
;-----------------------------------------------------------------------------
!define /date BUILD_TIME "built on %Y/%m/%d at %I:%M %p (rev. ${REVISION})"
;-----------------------------------------------------------------------------
; Initial installer setup and definitions.
;-----------------------------------------------------------------------------
Name "Tomahawk"
Caption "Tomahawk Installer"
BrandingText "Tomahawk ${VERSION} -- ${BUILD_TIME}"
OutFile "${ROOT_PATH}\build\tomahawk-${VERSION}.exe"
InstallDir "$PROGRAMFILES\Tomahawk"
InstallDirRegKey HKCU "Software\Tomahawk" ""
InstType Standard
InstType Full
InstType Minimal
CRCCheck On
SetCompressor /SOLID lzma
RequestExecutionLevel user ;Now using the UAC plugin.
ReserveFile tomahawk.ini
ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
;-----------------------------------------------------------------------------
; Include some required header files.
;-----------------------------------------------------------------------------
!include LogicLib.nsh ;Used by APPDATA uninstaller.
!include nsDialogs.nsh ;Used by APPDATA uninstaller.
!include MUI2.nsh ;Used by APPDATA uninstaller.
!include InstallOptions.nsh ;Required by MUI2 to support old MUI_INSTALLOPTIONS.
!include Memento.nsh ;Remember user selections.
!include WinVer.nsh ;Windows version detection.
!include WordFunc.nsh ;Used by VersionCompare macro function.
!include UAC.nsh ;Used by the UAC elevation to install as user or admin.
;-----------------------------------------------------------------------------
; Memento selections stored in registry.
;-----------------------------------------------------------------------------
!define MEMENTO_REGISTRY_ROOT HKLM
!define MEMENTO_REGISTRY_KEY Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk
;-----------------------------------------------------------------------------
; Modern User Interface (MUI) defintions and setup.
;-----------------------------------------------------------------------------
!define MUI_ABORTWARNING
!define MUI_ICON installer.ico
!define MUI_UNICON installer.ico
!define MUI_WELCOMEFINISHPAGE_BITMAP welcome.bmp
!define MUI_WELCOMEPAGE_TITLE "Tomahawk ${VERSION} Setup$\r$\nInstaller Build Revision ${REVISION}"
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation.$\r$\n$\r$\n$_CLICK"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP page_header.bmp
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_FINISHPAGE_TITLE "Tomahawk Install Completed"
!define MUI_FINISHPAGE_LINK "Click here to visit the Tomahawk website."
!define MUI_FINISHPAGE_LINK_LOCATION "http://tomahawk-player.org/"
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!ifdef OPTION_FINISHPAGE_RELEASE_NOTES
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NOTES.txt"
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show release notes"
!endif
!ifdef OPTION_FINISHPAGE_LAUNCHER
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchTomahawk"
!endif
;-----------------------------------------------------------------------------
; Page macros.
;-----------------------------------------------------------------------------
!insertmacro MUI_PAGE_WELCOME
!ifdef OPTION_LICENSE_AGREEMENT
!insertmacro MUI_PAGE_LICENSE "LICENSE.txt"
!endif
Page custom PageReinstall PageLeaveReinstall
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!ifdef OPTION_FINISHPAGE
!insertmacro MUI_PAGE_FINISH
!endif
!insertmacro MUI_UNPAGE_CONFIRM
UninstPage custom un.UnPageUserAppData un.UnPageUserAppDataLeave
!insertmacro MUI_UNPAGE_INSTFILES
;-----------------------------------------------------------------------------
; Other MUI macros.
;-----------------------------------------------------------------------------
!insertmacro MUI_LANGUAGE "English"
##############################################################################
# #
# FINISH PAGE LAUNCHER FUNCTIONS #
# #
##############################################################################
Function LaunchTomahawk
${UAC.CallFunctionAsUser} LaunchTomahawkAsUser
FunctionEnd
Function LaunchTomahawkAsUser
Exec "$INSTDIR\tomahawk.exe"
FunctionEnd
##############################################################################
# #
# PROCESS HANDLING FUNCTIONS AND MACROS #
# #
##############################################################################
!macro CheckForProcess processName gotoWhenFound gotoWhenNotFound
Processes::FindProcess ${processName}
StrCmp $R0 "0" ${gotoWhenNotFound} ${gotoWhenFound}
!macroend
!macro ConfirmEndProcess 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:
DetailPrint "Killing ${processName} processes."
Processes::KillProcess ${processName}
Sleep 1500
StrCmp $R0 "1" process_${processName}_ended
DetailPrint "Process to kill not found!"
process_${processName}_ended:
!macroend
!macro CheckAndConfirmEndProcess processName
!insertmacro CheckForProcess ${processName} 0 no_process_${processName}_to_end
!insertmacro ConfirmEndProcess ${processName}
no_process_${processName}_to_end:
!macroend
Function EnsureTomahawkShutdown
!insertmacro CheckAndConfirmEndProcess "tomahawk.exe"
FunctionEnd
##############################################################################
# #
# RE-INSTALLER FUNCTIONS #
# #
##############################################################################
Function PageReinstall
ReadRegStr $R0 HKLM "Software\Tomahawk" ""
StrCmp $R0 "" 0 +2
Abort
;Detect version
ReadRegDWORD $R0 HKLM "Software\Tomahawk" "VersionMajor"
IntCmp $R0 ${VER_MAJOR} minor_check new_version older_version
minor_check:
ReadRegDWORD $R0 HKLM "Software\Tomahawk" "VersionMinor"
IntCmp $R0 ${VER_MINOR} build_check new_version older_version
build_check:
ReadRegDWORD $R0 HKLM "Software\Tomahawk" "VersionBuild"
IntCmp $R0 ${VER_BUILD} revision_check new_version older_version
revision_check:
ReadRegDWORD $R0 HKLM "Software\Tomahawk" "VersionRevision"
IntCmp $R0 ${REVISION} same_version new_version older_version
new_version:
!insertmacro INSTALLOPTIONS_WRITE "tomahawk.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 "tomahawk.ini" "Field 2" "Text" "Uninstall before installing"
!insertmacro INSTALLOPTIONS_WRITE "tomahawk.ini" "Field 3" "Text" "Do not uninstall"
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install Tomahawk."
StrCpy $R0 "1"
Goto reinst_start
older_version:
!insertmacro INSTALLOPTIONS_WRITE "tomahawk.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 "tomahawk.ini" "Field 2" "Text" "Uninstall before installing"
!insertmacro INSTALLOPTIONS_WRITE "tomahawk.ini" "Field 3" "Text" "Do not uninstall"
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install Tomahawk."
StrCpy $R0 "1"
Goto reinst_start
same_version:
!insertmacro INSTALLOPTIONS_WRITE "tomahawk.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 "tomahawk.ini" "Field 2" "Text" "Add/Reinstall components"
!insertmacro INSTALLOPTIONS_WRITE "tomahawk.ini" "Field 3" "Text" "Uninstall Tomahawk"
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
StrCpy $R0 "2"
reinst_start:
!insertmacro INSTALLOPTIONS_DISPLAY "tomahawk.ini"
FunctionEnd
Function PageLeaveReinstall
!insertmacro INSTALLOPTIONS_READ $R1 "tomahawk.ini" "Field 2" "State"
StrCmp $R0 "1" 0 +2
StrCmp $R1 "1" reinst_uninstall reinst_done
StrCmp $R0 "2" 0 +3
StrCmp $R1 "1" reinst_done reinst_uninstall
reinst_uninstall:
ReadRegStr $R1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "UninstallString"
HideWindow
ClearErrors
ExecWait '$R1 _?=$INSTDIR'
IfErrors no_remove_uninstaller
IfFileExists "$INSTDIR\tomahawk.exe" no_remove_uninstaller
Delete $R1
RMDir $INSTDIR
no_remove_uninstaller:
StrCmp $R0 "2" 0 +3
UAC::Unload
Quit
BringToFront
reinst_done:
FunctionEnd
##############################################################################
# #
# INSTALLER SECTIONS #
# #
##############################################################################
Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER
SectionIn 1 2 3 RO
SetDetailsPrint listonly
SetDetailsPrint textonly
DetailPrint "Installing Tomahawk Player essentials."
SetDetailsPrint listonly
SetOutPath "$INSTDIR"
!ifdef INSTALL_PATH
;Main executable.
File "${INSTALL_PATH}\bin\tomahawk.exe"
File "${INSTALL_PATH}\bin\libqxtweb-standalone.dll"
File "${INSTALL_PATH}\bin\libtomahawk_portfwd.dll"
File "${INSTALL_PATH}\bin\libtomahawk_lastfm2.dll"
File "${INSTALL_PATH}\bin\libtomahawklib.dll"
File "${INSTALL_PATH}\lib\libtomahawk_sip*.dll"
!endif
!ifndef INSTALL_PATH
;Main executable.
File "${BUILD_PATH}\tomahawk.exe"
File "${BUILD_PATH}\libtomahawklib.dll"
File "${BUILD_PATH}\libqxtweb-standalone.dll"
File "${BUILD_PATH}\libtomahawk_portfwd.dll"
File "${BUILD_PATH}\libtomahawk_lastfm2.dll"
File "${BUILD_PATH}\libtomahawk_sip*.dll"
!endif
;License & release notes.
File "${ROOT_PATH}\LICENSE.txt"
File /oname=NOTES.txt RELEASE_NOTES.txt
;QT stuff:
File "${QT_DLL_PATH}\QtCore4.dll"
File "${QT_DLL_PATH}\QtGui4.dll"
File "${QT_DLL_PATH}\QtNetwork4.dll"
File "${QT_DLL_PATH}\QtSql4.dll"
File "${QT_DLL_PATH}\QtXml4.dll"
File "${QT_DLL_PATH}\QtWebKit4.dll"
;SQLite driver
SetOutPath "$INSTDIR\sqldrivers"
File "${SQLITE_DLL_PATH}\qsqlite4.dll"
SetOutPath "$INSTDIR"
;Image plugins
SetOutPath "$INSTDIR\imageformats"
File "${IMAGEFORMATS_DLL_PATH}\qgif4.dll"
File "${IMAGEFORMATS_DLL_PATH}\qjpeg4.dll"
SetOutPath "$INSTDIR"
;Cygwin/c++ stuff
;File "${MING_BIN}\cygmad-0.dll"
;File "${MING_BIN}\libgcc_s_dw2-1.dll"
;File "${MING_BIN}\mingwm10.dll"
File "${MING_BIN}\libgcc_s_sjlj-1.dll"
File "${MING_BIN}\libstdc++-6.dll"
;Phonon stuff
;Fix the phonon build to not use Dbus
File "${QT_DLL_PATH}\QtDbus4.dll"
File "${MING_BIN}\libdbus-1-3.dll"
File "${MING_BIN}\dbus-daemon.exe"
File "${MING_BIN}\libphonon.dll"
SetOutPath "$INSTDIR\phonon_backend"
File "${MING_BIN}\phonon_backend\phonon_vlc.dll"
SetOutPath "$INSTDIR"
;VLC
;SetOutPath "$INSTDIR\phonon_backend"
File "${MING_BIN}\libvlc.dll"
File "${MING_BIN}\libvlccore.dll"
SetOutPath "$INSTDIR\plugins"
File /r "${VLC_PLUGIN_PATH}\*.dll"
SetOutPath "$INSTDIR"
File "${MING_BIN}\libmad-0.dll" ; MP3
File "${MING_BIN}\libFLAC-8.dll" ; FLAC
File "${MING_BIN}\libogg-0.dll" ; OGG, FLAC
File "${MING_BIN}\libvorbis-0.dll" ; OGG
File "${MING_BIN}\libvorbisenc-2.dll" ; OGG
; Other
File "${MING_BIN}\libqjson.dll"
File "${MING_BIN}\libtag.dll"
File "${MING_BIN}\libpng15-15.dll"
File "${MING_BIN}\libjpeg-8.dll"
File "${MING_BIN}\zlib1.dll"
File "${MING_BIN}\libechonest.dll"
File "${MING_BIN}\libQTweetLib.dll"
; Jabber
File "${MING_BIN}\libjreen.dll"
File "${MING_BIN}\libqca.dll"
SetOutPath "$INSTDIR\crypto"
File "${MING_LIB}\qt4\plugins\crypto\libqca-ossl.dll"
SetOutPath "$INSTDIR"
File "${MING_BIN}\libssl-8.dll"
File "${MING_BIN}\libcrypto-8.dll"
File "${MING_LIB}\libclucene-core.dll"
File "${MING_LIB}\libclucene-shared.dll"
File "${MING_BIN}\libqtsparkle.dll"
SectionEnd
SectionGroup "Shortcuts"
!ifdef OPTION_SECTION_SC_START_MENU
${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."
SetDetailsPrint listonly
SetShellVarContext all
RMDir /r "$SMPROGRAMS\Tomahawk"
CreateDirectory "$SMPROGRAMS\Tomahawk"
CreateShortCut "$SMPROGRAMS\Tomahawk\LICENSE.lnk" "$INSTDIR\LICENSE.txt"
CreateShortCut "$SMPROGRAMS\Tomahawk\Tomahawk.lnk" "$INSTDIR\tomahawk.exe"
CreateShortCut "$SMPROGRAMS\Tomahawk\Release notes.lnk" "$INSTDIR\NOTES.txt"
CreateShortCut "$SMPROGRAMS\Tomahawk\Uninstall.lnk" "$INSTDIR\uninstall.exe"
SetShellVarContext current
${MementoSectionEnd}
!endif
!ifdef OPTION_SECTION_SC_DESKTOP
${MementoSection} "Desktop Shortcut" SEC_DESKTOP
SectionIn 1 2
SetDetailsPrint textonly
DetailPrint "Creating Desktop Shortcuts"
SetDetailsPrint listonly
CreateShortCut "$DESKTOP\Tomahawk.lnk" "$INSTDIR\tomahawk.exe"
${MementoSectionEnd}
!endif
!ifdef OPTION_SECTION_SC_QUICK_LAUNCH
${MementoSection} "Quick Launch Shortcut" SEC_QUICK_LAUNCH
SectionIn 1 2
SetDetailsPrint textonly
DetailPrint "Creating Quick Launch Shortcut"
SetDetailsPrint listonly
CreateShortCut "$QUICKLAUNCH\Tomahawk.lnk" "$INSTDIR\tomahawk.exe"
${MementoSectionEnd}
!endif
SectionGroupEnd
${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_FUNCTION_DESCRIPTION_END
Section -post
;Uninstaller file.
SetDetailsPrint textonly
DetailPrint "Writing Uninstaller"
SetDetailsPrint listonly
WriteUninstaller $INSTDIR\uninstall.exe
;Registry keys required for installer version handling and uninstaller.
SetDetailsPrint textonly
DetailPrint "Writing Installer Registry Keys"
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}"
;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"
; Register tomahawk:// protocol handler
WriteRegStr HKCR "tomahawk" "" "URL: Tomahawk Protocol"
WriteRegStr HKCR "tomahawk\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR "tomahawk\shell" "" "open"
WriteRegStr HKCR "tomahawk\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'
SetDetailsPrint textonly
DetailPrint "Finsihed."
SectionEnd
##############################################################################
# #
# UNINSTALLER SECTION #
# #
##############################################################################
Var UnPageUserAppDataDialog
Var UnPageUserAppDataCheckbox
Var UnPageUserAppDataCheckbox_State
Var UnPageUserAppDataEditBox
Function un.UnPageUserAppData
!insertmacro MUI_HEADER_TEXT "Uninstall Tomahawk" "Remove Tomahawk's data folder from your computer."
nsDialogs::Create /NOUNLOAD 1018
Pop $UnPageUserAppDataDialog
${If} $UnPageUserAppDataDialog == error
Abort
${EndIf}
${NSD_CreateLabel} 0 0 100% 12u "Do you want to delete Tomahawk's data folder?"
Pop $0
${NSD_CreateText} 0 13u 100% 12u "$LOCALAPPDATA\Tomahawk"
Pop $UnPageUserAppDataEditBox
SendMessage $UnPageUserAppDataEditBox ${EM_SETREADONLY} 1 0
${NSD_CreateLabel} 0 46u 100% 24u "Leave unchecked to keep the data folder for later use or check to delete the data folder."
Pop $0
${NSD_CreateCheckbox} 0 71u 100% 8u "Yes, delete this data folder."
Pop $UnPageUserAppDataCheckbox
nsDialogs::Show
FunctionEnd
Function un.UnPageUserAppDataLeave
${NSD_GetState} $UnPageUserAppDataCheckbox $UnPageUserAppDataCheckbox_State
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
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 HKCR "tomahawk"
;Start menu shortcuts.
!ifdef OPTION_SECTION_SC_START_MENU
SetShellVarContext all
RMDir /r "$SMPROGRAMS\Tomahawk"
SetShellVarContext current
!endif
;Desktop shortcut.
!ifdef OPTION_SECTION_SC_DESKTOP
IfFileExists "$DESKTOP\Tomahawk.lnk" 0 +2
Delete "$DESKTOP\Tomahawk.lnk"
!endif
;Quick Launch shortcut.
!ifdef OPTION_SECTION_SC_QUICK_LAUNCH
IfFileExists "$QUICKLAUNCH\Tomahawk.lnk" 0 +2
Delete "$QUICKLAUNCH\Tomahawk.lnk"
!endif
;Remove all the Program Files.
RMDir /r $INSTDIR
;Uninstall User Data if option is checked, otherwise skip.
${If} $UnPageUserAppDataCheckbox_State == ${BST_CHECKED}
RMDir /r "$LOCALAPPDATA\Tomahawk"
${EndIf}
SetDetailsPrint textonly
DetailPrint "Finsihed."
SectionEnd
##############################################################################
# #
# NSIS Installer Event Handler Functions #
# #
##############################################################################
Function .onInit
!insertmacro INSTALLOPTIONS_EXTRACT "tomahawk.ini"
;Remove Quick Launch option from Windows 7, as no longer applicable - usually.
${IfNot} ${AtMostWinVista}
SectionSetText ${SEC_QUICK_LAUNCH} "Quick Launch Shortcut (N/A)"
SectionSetFlags ${SEC_QUICK_LAUNCH} ${SF_RO}
SectionSetInstTypes ${SEC_QUICK_LAUNCH} 0
${EndIf}
${MementoSectionRestore}
UAC_Elevate:
UAC::RunElevated
StrCmp 1223 $0 UAC_ElevationAborted ; UAC dialog aborted by user?
StrCmp 0 $0 0 UAC_Err ; Error?
StrCmp 1 $1 0 UAC_Success ;Are we the real deal or just the wrapper?
Quit
UAC_Err:
MessageBox MB_ICONSTOP "Unable to elevate, error $0"
Abort
UAC_ElevationAborted:
Abort
UAC_Success:
StrCmp 1 $3 +4 ;Admin?
StrCmp 3 $1 0 UAC_ElevationAborted ;Try again?
MessageBox MB_ICONSTOP "This installer requires admin access, try again"
goto UAC_Elevate
;Prevent multiple instances.
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "tomahawkInstaller") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
Abort
;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"
StrCmp $R0 "" SkipSetInstDir
StrCpy $INSTDIR $R0
SkipSetInstDir:
;Shutdown Tomahawk in case Add/Remove re-installer option used.
Call EnsureTomahawkShutdown
FunctionEnd
Function .onInstSuccess
${MementoSectionSave}
UAC::Unload ;Must call unload!
FunctionEnd
Function .onInstFailed
UAC::Unload ;Must call unload!
FunctionEnd
##############################################################################
# #
# NSIS Uninstaller Event Handler Functions #
# #
##############################################################################
Function un.onInit
UAC_Elevate:
UAC::RunElevated
StrCmp 1223 $0 UAC_ElevationAborted ; UAC dialog aborted by user?
StrCmp 0 $0 0 UAC_Err ; Error?
StrCmp 1 $1 0 UAC_Success ;Are we the real deal or just the wrapper?
Quit
UAC_Err:
MessageBox MB_ICONSTOP "Unable to elevate, error $0"
Abort
UAC_ElevationAborted:
Abort
UAC_Success:
StrCmp 1 $3 +4 ;Admin?
StrCmp 3 $1 0 UAC_ElevationAborted ;Try again?
MessageBox MB_ICONSTOP "This uninstaller requires admin access, try again"
goto UAC_Elevate
;Prevent multiple instances.
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "tomahawkUninstaller") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "This uninstaller is already running."
Abort
FunctionEnd
Function un.onUnInstSuccess
UAC::Unload ;Must call unload!
FunctionEnd
Function un.onUnInstFailed
UAC::Unload ;Must call unload!
FunctionEnd

View File

@ -1,19 +1,45 @@
#!/bin/bash
echo "Remove old vlc dir..."
mkdir -p vlc/
cd vlc/
#rm -vf vlc-*.7z
rm -rf vlc/
#rm -rf vlc/
echo "Download specified binary..."
#wget -c "http://downloads.sourceforge.net/project/vlc/1.1.9/win32/vlc-1.1.9-win32.7z?r=http%3A%2F%2Fwww.videolan.org%2Fvlc%2Fdownload-windows.html&ts=1306272584&use_mirror=leaseweb"
wget -c "http://download.tomahawk-player.org/tomahawk-vlc-0.1.zip"
#wget -c "http://download.tomahawk-player.org/tomahawk-vlc-0.1.zip"
wget -c http://people.videolan.org/~jb/phonon/phonon-vlc-last.7z
echo "Extract binary..."
#7z x vlc-*.7z
7z x phonon-vlc-last.7z
#mv -v vlc-*/ vlc/
unzip tomahawk-vlc-0.1.zip
#unzip tomahawk-vlc-0.1.zip
#echo "Strip unneeded plugins from vlc/plugins..."
# cd vlc/plugins/
echo "Strip unneeded plugins from vlc/plugins..."
cd prefix/bin/plugins
rm -rvf libold* libvcd* libdvd* liblibass* libx264* libschroe* liblibmpeg2* \
libstream_out_* libmjpeg_plugin* libh264_plugin* libzvbi_plugin* lib*sub* \
*qt4* *skins2* libaccess_bd_plugin.dll \
libaudiobargraph_* libball_plugin.dll \
libdirac_plugin.dll \
libgnutls_plugin.dll \
libcaca_plugin.dll \
libfreetype_plugin.dll \
libaccess_output_shout_plugin.dll \
libremoteosd_plugin.dll \
libsdl_image_plugin.dll \
libvout_sdl_plugin.dll \
libpng_plugin.dll \
libgoom_plugin.dll \
libatmo_plugin.dll \
libmux_ts_plugin.dll \
libkate_plugin.dll \
libtaglib_plugin.dll
# this is for vlc-1.2
# rm -rvf video_*/ gui/ */libold* */libvcd* */libdvd* */liblibass* */libx264* */libschroe* */liblibmpeg2* \
# */libstream_out_* */libmjpeg_plugin* */libh264_plugin* */libzvbi_plugin* */lib*sub* \
# services_discover/ visualization/ control/ misc/

View File

@ -1,70 +0,0 @@
# cd build ; cmake -DCPACK_GENERATOR=DEB .. ; make package
INCLUDE(InstallRequiredSystemLibraries)
set(CPACK_PACKAGING_INSTALL_PREFIX /usr/local)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Tomahawk Player")
SET(CPACK_PACKAGE_NAME "tomahawk")
SET(CPACK_PACKAGE_VENDOR "tomahawk-player.org")
SET(CPACK_PACKAGE_CONTACT "Christian Muehlhaeuser")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "muesli@tomahawk-player.org")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../README")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "0")
SET(CPACK_PACKAGE_VERSION_PATCH "1")
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
#SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386") # Default: Output of dpkg --print-architecture or i386
# Copied from generator script, needs to be set for inclusion into filename of package:
# $ dpkg --print-architecture
FIND_PROGRAM(DPKG_CMD dpkg)
IF(NOT DPKG_CMD)
MESSAGE(STATUS "Can not find dpkg in your path, default to i386.")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
ELSE(NOT DPKG_CMD)
EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
ENDIF(NOT DPKG_CMD)
EXECUTE_PROCESS(COMMAND "date" "+%s"
OUTPUT_VARIABLE TIMEMARK
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# eg: tomahawk-i386-1.0.0
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}-${CPACK_PACKAGE_VERSION}_${TIMEMARK}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
IF(WIN32 AND NOT UNIX)
###
ELSE(WIN32 AND NOT UNIX)
# SET(CPACK_STRIP_FILES "tomahawk")
# SET(CPACK_SOURCE_STRIP_FILES "")
ENDIF(WIN32 AND NOT UNIX)
# Nsis only? SET(CPACK_PACKAGE_EXECUTABLES "tomahawk" "tomahawk")
#gnutls is in here because gloox needs it, and we link statically to gloox:
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libqtgui4 (>=4:4.7.0-0ubuntu1), libtag1c2a (>=1.6.2-0ubuntu1), liblastfm-dev (>=0.4.0~really0.3.3-0ubuntu1), libqt4-sql-sqlite (>=4:4.7.0-0ubuntu1), libvorbis0a (>=1.2.3-3ubuntu1), libmad0 (>=0.15.1b-4ubuntu1), libasound2 (>=1.0.22-0ubuntu7), zlib1g (>=1:1.2.3.3.dfsg-15ubuntu1), libqjson-dev (>=0.7.1-1), libgnutls26 (>= 2.7.14-0), libgloox8 (>=1.0-1)")
#SET(CPACK_DEBIAN_PACKAGE_SECTION "music")
INSTALL(
TARGETS tomahawk DESTINATION bin
RUNTIME DESTINATION bin
# LIBRARY DESTINATION lib${LIB_SUFFIX}
# ARCHIVE DESTINATION lib${LIB_SUFFIX}
)
INSTALL(
PROGRAMS ${CMAKE_BINARY_DIR}/tomahawk
DESTINATION bin
)
INCLUDE(CPack)

View File

@ -78,8 +78,6 @@ PipelineStatusView::PipelineStatusView( AnimatedSplitter* parent )
void
PipelineStatusView::onPipelineUpdate( const query_ptr& query )
{
tDebug() << Q_FUNC_INFO << query.isNull();
QTreeWidgetItem* ti = m_tree->invisibleRootItem()->child( 0 );
if ( Pipeline::instance()->activeQueryCount() && !query.isNull() )

View File

@ -517,6 +517,7 @@ AudioControls::onTrackClicked()
ViewManager::instance()->showCurrentTrack();
}
void
AudioControls::dragEnterEvent( QDragEnterEvent* e )
{
@ -524,13 +525,15 @@ AudioControls::dragEnterEvent( QDragEnterEvent* e )
e->acceptProposedAction();
}
void
AudioControls::dragMoveEvent( QDragMoveEvent* e )
AudioControls::dragMoveEvent( QDragMoveEvent* /* e */ )
{
// if ( GlobalActionManager::instance()->acceptsMimeData( e->mimeData() ) )
// e->acceptProposedAction();
}
void
AudioControls::dropEvent( QDropEvent* e )
{
@ -544,6 +547,7 @@ AudioControls::dropEvent( QDropEvent* e )
}
}
void
AudioControls::droppedTracks( QList< query_ptr > tracks )
{

View File

@ -21,7 +21,6 @@ set( libSources
artist.cpp
album.cpp
collection.cpp
webcollection.cpp
playlist.cpp
resolver.cpp
query.cpp
@ -165,7 +164,6 @@ set( libSources
utils/elidedlabel.cpp
utils/imagebutton.cpp
utils/logger.cpp
utils/progresstreeview.cpp
utils/proxystyle.cpp
utils/widgetdragfilter.cpp
utils/animatedsplitter.cpp
@ -202,7 +200,6 @@ set( libHeaders
aclsystem.h
collection.h
webcollection.h
query.h
resolver.h
result.h
@ -214,7 +211,6 @@ set( libHeaders
artist.h
album.h
track.h
playlist.h
sip/SipPlugin.h
@ -347,7 +343,6 @@ set( libHeaders
utils/elidedlabel.h
utils/animatedcounterlabel.h
utils/imagebutton.h
utils/progresstreeview.h
utils/widgetdragfilter.h
utils/animatedsplitter.h
utils/xspfloader.h

View File

@ -38,7 +38,7 @@ public:
ModificationTime = 1
};
explicit DatabaseCommand_AllAlbums( const Tomahawk::collection_ptr& collection, const Tomahawk::artist_ptr& artist = Tomahawk::artist_ptr(), QObject* parent = 0 )
explicit DatabaseCommand_AllAlbums( const Tomahawk::collection_ptr& collection = Tomahawk::collection_ptr(), const Tomahawk::artist_ptr& artist = Tomahawk::artist_ptr(), QObject* parent = 0 )
: DatabaseCommand( parent )
, m_collection( collection )
, m_artist( artist )
@ -55,6 +55,7 @@ public:
void execForCollection( DatabaseImpl* );
void execForArtist( DatabaseImpl* );
void setArtist( const Tomahawk::artist_ptr& artist ) { m_artist = artist; }
void setLimit( unsigned int amount ) { m_amount = amount; }
void setSortOrder( DatabaseCommand_AllAlbums::SortOrder order ) { m_sortOrder = order; }
void setSortDescending( bool descending ) { m_sortDescending = descending; }

View File

@ -61,19 +61,32 @@ AlbumItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
initStyleOption( &opt, QModelIndex() );
qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );
#ifndef Q_OS_MAC
if ( option.state & QStyle::State_Selected )
{
opt.palette.setColor( QPalette::Text, opt.palette.color( QPalette::HighlightedText ) );
}
#endif
painter->save();
// painter->setRenderHint( QPainter::Antialiasing );
// painter->drawPixmap( option.rect.adjusted( 4, 4, -4, -38 ), m_shadowPixmap );
QPixmap cover = item->cover.isNull() ? m_defaultCover : item->cover;
QRect r = option.rect.adjusted( 6, 4, -6, -41 );
QRect r = option.rect.adjusted( 6, 5, -6, -41 );
if ( option.state & QStyle::State_Selected )
{
#ifndef Q_OS_MAC
opt.palette.setColor( QPalette::Text, opt.palette.color( QPalette::HighlightedText ) );
#else
painter->save();
painter->setRenderHint( QPainter::Antialiasing );
QPainterPath border;
border.addRoundedRect( r.adjusted( -2, -2, 2, 2 ), 3, 3 );
QPen borderPen( QColor( 86, 170, 243 ) );
borderPen.setWidth( 5 );
painter->setPen( borderPen );
painter->drawPath( border );
painter->restore();
#endif
}
QPixmap scover;
if ( m_cache.contains( cover.cacheKey() ) )

View File

@ -300,9 +300,9 @@ AlbumModel::addAlbums( const QList<Tomahawk::album_ptr>& albums )
}
emit endInsertRows();
qDebug() << rowCount( QModelIndex() );
}
void
AlbumModel::clear()
{
@ -355,7 +355,6 @@ void
AlbumModel::infoSystemFinished( QString target )
{
Q_UNUSED( target );
// qDebug() << Q_FUNC_INFO;
}

View File

@ -102,6 +102,7 @@ AlbumView::setAlbumModel( AlbumModel* model )
}
connect( m_proxyModel, SIGNAL( filterChanged( QString ) ), SLOT( onFilterChanged( QString ) ) );
connect( m_proxyModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), SLOT( onViewChanged() ) );
setAcceptDrops( false );
}

View File

@ -128,6 +128,7 @@ ArtistView::setTreeModel( TreeModel* model )
connect( m_model, SIGNAL( loadingFinished() ), m_loadingSpinner, SLOT( fadeOut() ) );
connect( m_proxyModel, SIGNAL( filterChanged( QString ) ), SLOT( onFilterChanged( QString ) ) );
connect( m_proxyModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), SLOT( onViewChanged() ) );
setAcceptDrops( false );
}
@ -166,6 +167,7 @@ ArtistView::keyPressEvent( QKeyEvent* event )
}
}
void
ArtistView::paintEvent( QPaintEvent* event )
{

View File

@ -407,7 +407,7 @@ DynamicWidget::generatorError( const QString& title, const QString& content )
void
DynamicWidget::paintRoundedFilledRect( QPainter& p, QPalette& pal, QRect& r, qreal opacity )
DynamicWidget::paintRoundedFilledRect( QPainter& p, QPalette& /* pal */, QRect& r, qreal opacity )
{
p.setBackgroundMode( Qt::TransparentMode );
p.setRenderHint( QPainter::Antialiasing );
@ -427,6 +427,7 @@ DynamicWidget::paintRoundedFilledRect( QPainter& p, QPalette& pal, QRect& r, qre
p.drawRoundedRect( r, 10, 10 );
}
QPixmap
DynamicWidget::pixmap() const
{

View File

@ -42,7 +42,7 @@ PlaylistModel::PlaylistModel( QObject* parent )
m_dropStorage.parent = QPersistentModelIndex();
m_dropStorage.row = -10;
setReadOnly( false );
setReadOnly( true );
}
@ -155,7 +155,6 @@ PlaylistModel::loadHistory( const Tomahawk::source_ptr& source, unsigned int amo
}
m_playlist.clear();
setReadOnly( true );
DatabaseCommand_PlaybackHistory* cmd = new DatabaseCommand_PlaybackHistory( source );
cmd->setLimit( amount );
@ -371,10 +370,10 @@ PlaylistModel::dropMimeData( const QMimeData* data, Qt::DropAction action, int r
return true;
}
void
PlaylistModel::parsedDroppedTracks( QList< query_ptr > tracks )
{
if ( m_dropStorage.row == -10 ) // nope
return;

View File

@ -74,6 +74,7 @@ public:
virtual void removeIndex( const QModelIndex& index, bool moreToCome = false );
bool isTemporary() const;
signals:
void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void shuffleModeChanged( bool enabled );

View File

@ -24,19 +24,13 @@
#include "widgets/overlaywidget.h"
#include "utils/logger.h"
#ifdef Q_WS_MAC
#define MINIMUM_HEIGHT 38
#else
#define MINIMUM_HEIGHT 27
#endif
using namespace Tomahawk;
QueueView::QueueView( AnimatedSplitter* parent )
: AnimatedWidget( parent )
{
setHiddenSize( QSize( 0, MINIMUM_HEIGHT ) );
setHiddenSize( QSize( 0, 0 ) );
setLayout( new QVBoxLayout() );
m_queue = new PlaylistView( this );
@ -46,14 +40,8 @@ QueueView::QueueView( AnimatedSplitter* parent )
m_queue->setAttribute( Qt::WA_MacShowFocusRect, 0 );
m_queue->overlay()->setEnabled( false );
m_button = new QPushButton();
m_button->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
m_button->setText( tr( "Click to show queue" ) );
connect( m_button, SIGNAL( clicked() ), SIGNAL( showWidget() ) );
layout()->setMargin( 0 );
layout()->addWidget( m_queue );
layout()->addWidget( m_button );
}
@ -71,10 +59,6 @@ QueueView::onShown( QWidget* widget, bool animated )
return;
AnimatedWidget::onShown( widget, animated );
m_button->setText( tr( "Click to hide queue" ) );
disconnect( m_button, SIGNAL( clicked() ), this, SIGNAL( showWidget() ) );
connect( m_button, SIGNAL( clicked() ), SIGNAL( hideWidget() ) );
}
@ -86,8 +70,4 @@ QueueView::onHidden( QWidget* widget, bool animated )
return;
AnimatedWidget::onHidden( widget, animated );
m_button->setText( tr( "Click to show queue" ) );
disconnect( m_button, SIGNAL( clicked() ), this, SIGNAL( hideWidget() ) );
connect( m_button, SIGNAL( clicked() ), SIGNAL( showWidget() ) );
}

View File

@ -44,7 +44,6 @@ public slots:
private:
PlaylistView* m_queue;
QPushButton* m_button;
};
#endif // QUEUEVIEW_H

View File

@ -87,6 +87,7 @@ TrackModel::columnCount( const QModelIndex& parent ) const
switch ( m_style )
{
case Short:
case ShortWithAvatars:
return 1;
break;

View File

@ -62,6 +62,7 @@ public:
virtual QModelIndex parent( const QModelIndex& child ) const;
virtual bool isReadOnly() const { return m_readOnly; }
virtual void setReadOnly( bool b ) { m_readOnly = b; }
virtual QString title() const { return m_title; }
virtual void setTitle( const QString& title ) { m_title = title; }
@ -114,9 +115,6 @@ public slots:
virtual void setRepeatMode( Tomahawk::PlaylistInterface::RepeatMode /*mode*/ ) {}
virtual void setShuffled( bool /*shuffled*/ ) {}
protected:
virtual void setReadOnly( bool b ) { m_readOnly = b; }
private slots:
void onPlaybackFinished( const Tomahawk::result_ptr& result );
void onPlaybackStopped();

View File

@ -27,7 +27,6 @@
#include "queueview.h"
#include "trackmodel.h"
#include "trackproxymodel.h"
#include "track.h"
#include "audio/audioengine.h"
#include "widgets/overlaywidget.h"

View File

@ -75,19 +75,35 @@ TreeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
opacity = qMax( (float)0.3, opacity );
QColor textColor = TomahawkUtils::alphaBlend( option.palette.color( QPalette::Foreground ), option.palette.color( QPalette::Background ), opacity );
if ( const QStyleOptionViewItem *vioption = qstyleoption_cast<const QStyleOptionViewItem *>(&option))
{
QStyleOptionViewItemV4 o( *vioption );
QStyleOptionViewItemV4 o = option;
initStyleOption( &o, QModelIndex() );
painter->save();
o.palette.setColor( QPalette::Text, textColor );
if ( o.state & QStyle::State_Selected && o.state & QStyle::State_Active )
{
o.palette.setColor( QPalette::Text, o.palette.color( QPalette::HighlightedText ) );
}
if ( item->isPlaying() )
{
o.palette.setColor( QPalette::Highlight, o.palette.color( QPalette::Mid ) );
o.palette.setColor( QPalette::Text, o.palette.color( QPalette::HighlightedText ) );
if ( o.state & QStyle::State_Selected )
o.palette.setColor( QPalette::Text, textColor );
o.state |= QStyle::State_Selected;
}
int oldX = 0;
if ( m_view->header()->visualIndex( index.column() ) == 0 )
{
oldX = o.rect.x();
o.rect.setX( 0 );
}
qApp->style()->drawControl( QStyle::CE_ItemViewItem, &o, painter );
if ( oldX > 0 )
o.rect.setX( oldX );
{
QRect r = o.rect.adjusted( 3, 0, 0, 0 );
@ -106,7 +122,9 @@ TreeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
QString text = painter->fontMetrics().elidedText( index.data().toString(), Qt::ElideRight, r.width() - 3 );
painter->drawText( r.adjusted( 0, 1, 0, 0 ), text, to );
}
painter->restore();
}
return;
}
else

View File

@ -498,7 +498,6 @@ TreeModel::onArtistsAdded( const QList<Tomahawk::artist_ptr>& artists )
}
emit endInsertRows();
qDebug() << rowCount( QModelIndex() );
emit loadingFinished();
}
@ -599,12 +598,9 @@ TreeModel::onTracksAdded( const QList<Tomahawk::query_ptr>& tracks, const QVaria
void
TreeModel::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output )
{
// qDebug() << Q_FUNC_INFO;
if ( requestData.caller != s_tmInfoIdentifier ||
( requestData.type != Tomahawk::InfoSystem::InfoAlbumCoverArt && requestData.type != Tomahawk::InfoSystem::InfoArtistImages ) )
{
// qDebug() << "Info of wrong type or not with our identifier";
return;
}

View File

@ -42,6 +42,8 @@ Source::Source( int id, const QString& username )
, m_username( username )
, m_id( id )
, m_cc( 0 )
, m_avatar( 0 )
, m_fancyAvatar( 0 )
{
qDebug() << Q_FUNC_INFO << id << username;
@ -62,6 +64,8 @@ Source::Source( int id, const QString& username )
Source::~Source()
{
qDebug() << Q_FUNC_INFO << friendlyName();
delete m_avatar;
delete m_fancyAvatar;
}
@ -122,22 +126,21 @@ Source::friendlyName() const
void
Source::setAvatar( const QPixmap& avatar )
{
m_avatar = avatar;
delete m_avatar;
m_avatar = new QPixmap( avatar );
}
QPixmap
Source::avatar( AvatarStyle style ) const
{
if ( style == FancyStyle &&
!m_avatar.isNull() &&
m_fancyAvatar.isNull() )
m_fancyAvatar = TomahawkUtils::createAvatarFrame( m_avatar );
if ( style == FancyStyle && m_avatar && !m_fancyAvatar )
m_fancyAvatar = new QPixmap( TomahawkUtils::createAvatarFrame( QPixmap( *m_avatar ) ) );
if ( style == Original && !m_avatar.isNull() )
return m_avatar;
else if ( style == FancyStyle && !m_fancyAvatar.isNull() )
return m_fancyAvatar;
if ( style == Original && m_avatar )
return QPixmap( *m_avatar );
else if ( style == FancyStyle && m_fancyAvatar )
return QPixmap( *m_fancyAvatar );
else
return QPixmap();
}

View File

@ -133,8 +133,8 @@ private:
ControlConnection* m_cc;
QPixmap m_avatar;
mutable QPixmap m_fancyAvatar;
QPixmap* m_avatar;
mutable QPixmap* m_fancyAvatar;
Tomahawk::playlistinterface_ptr m_playlistInterface;
};

View File

@ -134,8 +134,6 @@ SourceList::add( const source_ptr& source )
void
SourceList::removeAllRemote()
{
Q_ASSERT( m_isReady );
foreach( const source_ptr& s, m_sources )
{
qDebug() << "Disconnecting" << s->friendlyName() << s->isLocal() << s->controlConnection() << s->isOnline();

View File

@ -1,53 +0,0 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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 TOMAHAWKTRACK_H
#define TOMAHAWKTRACK_H
#include <QObject>
#include <QSharedPointer>
#include "artist.h"
#include "typedefs.h"
#include "dllmacro.h"
namespace Tomahawk
{
class DLLEXPORT Track : public QObject
{
Q_OBJECT
public:
Track( Tomahawk::artist_ptr artist, const QString& name )
: m_name( name )
, m_artist( artist )
{}
const QString& name() const { return m_name; }
const artist_ptr artist() const { return m_artist; }
private:
QString m_name;
artist_ptr m_artist;
};
}; // ns
#endif

View File

@ -139,24 +139,14 @@ setupLogfile()
using namespace Logger;
TLog::TLog( unsigned int debugLevel )
: m_debugLevel( debugLevel )
: QDebug( &m_msg )
, m_debugLevel( debugLevel )
{
}
TLog::~TLog()
{
log( m_msgs.join( " " ).toAscii().data(), m_debugLevel );
}
TLog&
TLog::operator<<( const QVariant& v )
{
QString const s = v.toString();
if ( !s.isEmpty() )
m_msgs << s;
return *this;
log( m_msg.toAscii().data(), m_debugLevel );
}

View File

@ -26,16 +26,14 @@
namespace Logger
{
class DLLEXPORT TLog
class DLLEXPORT TLog : public QDebug
{
public:
TLog( unsigned int debugLevel = 0 );
virtual ~TLog();
TLog& operator<<( const QVariant& v );
private:
QStringList m_msgs;
QString m_msg;
unsigned int m_debugLevel;
};

View File

@ -1,28 +0,0 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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 "progresstreeview.h"
#include "utils/logger.h"
ProgressTreeView::ProgressTreeView( QWidget* parent )
: QTreeView( parent )
, m_progressBar( 0 )
{
}

View File

@ -1,44 +0,0 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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 PROGRESSTREEVIEW_H
#define PROGRESSTREEVIEW_H
#include <QTreeView>
#include <QProgressBar>
#include "dllmacro.h"
class DLLEXPORT ProgressTreeView : public QTreeView
{
Q_OBJECT
public:
ProgressTreeView( QWidget* parent );
void connectProgressBar( QProgressBar* progressBar ) { m_progressBar = progressBar; progressBar->setVisible( false ); }
void setProgressStarted( int length ) { if ( m_progressBar ) { m_progressBar->setRange( 0, length ); m_progressBar->setValue( 0 ); m_progressBar->setVisible( true ); } }
void setProgressEnded() { if ( m_progressBar ) m_progressBar->setVisible( false ); }
void setProgressCompletion( int completion ) { if ( m_progressBar ) m_progressBar->setValue( completion ); }
private:
QProgressBar* m_progressBar;
};
#endif // PROGRESSTREEVIEW_H

View File

@ -505,13 +505,15 @@ setNam( QNetworkAccessManager* nam )
s_nam = QWeakPointer< QNetworkAccessManager >( nam );
}
#ifndef Q_OS_MAC
void
bringToFront() {
bringToFront()
{
}
#endif
QPixmap
createAvatarFrame( const QPixmap &avatar )
{

View File

@ -89,7 +89,7 @@ namespace TomahawkUtils
/// Platform-specific bringing tomahawk mainwindow to front, b/c qt's activate() and such don't seem to work well enough for us
DLLEXPORT void bringToFront();
DLLEXPORT QPixmap createAvatarFrame(const QPixmap &avatar);
DLLEXPORT QPixmap createAvatarFrame( const QPixmap &avatar );
}
#endif // TOMAHAWKUTILS_H

View File

@ -86,9 +86,14 @@ ViewManager::ViewManager( QObject* parent )
m_splitter->setGreedyWidget( 0 );
m_splitter->addWidget( m_stack );
m_queueButton = new QPushButton();
m_queueButton->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
m_queueButton->setText( tr( "Click to show queue" ) );
m_queueView = new QueueView( m_splitter );
m_queueModel = new PlaylistModel( m_queueView );
m_queueView->queue()->setPlaylistModel( m_queueModel );
m_queueView->queue()->playlistModel()->setReadOnly( false );
AudioEngine::instance()->setQueue( m_queueView->queue()->proxyModel() );
m_splitter->addWidget( m_queueView );
@ -97,6 +102,7 @@ ViewManager::ViewManager( QObject* parent )
m_widget->layout()->addWidget( m_infobar );
m_widget->layout()->addWidget( m_topbar );
m_widget->layout()->addWidget( m_splitter );
m_widget->layout()->addWidget( m_queueButton );
m_superCollectionView = new ArtistView();
m_superCollectionModel = new TreeModel( m_superCollectionView );
@ -121,18 +127,12 @@ ViewManager::ViewManager( QObject* parent )
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::PlaylistInterface* ) ), this, SLOT( playlistInterfaceChanged( Tomahawk::PlaylistInterface* ) ) );
connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) );
connect( m_queueButton, SIGNAL( clicked() ), SLOT( showQueue() ) );
connect( m_topbar, SIGNAL( filterTextChanged( QString ) ),
SLOT( setFilter( QString ) ) );
connect( m_topbar, SIGNAL( flatMode() ),
SLOT( setTableMode() ) );
connect( m_topbar, SIGNAL( artistMode() ),
SLOT( setTreeMode() ) );
connect( m_topbar, SIGNAL( albumMode() ),
SLOT( setAlbumMode() ) );
connect( m_topbar, SIGNAL( filterTextChanged( QString ) ), SLOT( setFilter( QString ) ) );
connect( m_topbar, SIGNAL( flatMode() ), SLOT( setTableMode() ) );
connect( m_topbar, SIGNAL( artistMode() ), SLOT( setTreeMode() ) );
connect( m_topbar, SIGNAL( albumMode() ), SLOT( setAlbumMode() ) );
}
@ -475,6 +475,10 @@ ViewManager::showQueue()
return;
}
m_queueButton->setText( tr( "Click to hide queue" ) );
disconnect( m_queueButton, SIGNAL( clicked() ), this, SLOT( showQueue() ) );
connect( m_queueButton, SIGNAL( clicked() ), SLOT( hideQueue() ) );
m_splitter->show( 1 );
}
@ -489,6 +493,10 @@ ViewManager::hideQueue()
return;
}
m_queueButton->setText( tr( "Click to show queue" ) );
disconnect( m_queueButton, SIGNAL( clicked() ), this, SLOT( hideQueue() ) );
connect( m_queueButton, SIGNAL( clicked() ), SLOT( showQueue() ) );
m_splitter->hide( 1 );
}

View File

@ -51,6 +51,7 @@ class SourceInfoWidget;
class InfoBar;
class TopBar;
class WelcomeWidget;
class QPushButton;
namespace Tomahawk
{
@ -170,6 +171,7 @@ private:
QWidget* m_widget;
InfoBar* m_infobar;
TopBar* m_topbar;
QPushButton* m_queueButton;
QStackedWidget* m_stack;
AnimatedSplitter* m_splitter;

View File

@ -1,32 +0,0 @@
/*
Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
This program 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 2 of the License, or
(at your option) any later version.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "webcollection.h"
using namespace Tomahawk;
WebCollection::WebCollection( const source_ptr& source, const QString& name, QObject* parent )
: Collection( source, name, parent )
{
}
WebCollection::~WebCollection()
{
}

View File

@ -1,43 +0,0 @@
/*
Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
This program 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 2 of the License, or
(at your option) any later version.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef WEBCOLLECTION_H
#define WEBCOLLECTION_H
#include "collection.h"
#include "dllmacro.h"
namespace Tomahawk
{
class DLLEXPORT WebCollection : public Collection
{
Q_OBJECT
public:
WebCollection( const source_ptr& source, const QString& name = QString(), QObject* parent = 0 );
virtual ~WebCollection();
virtual void removeTracks( const QDir& ) {}
virtual void addTracks( const QList< QVariant >& ) {}
};
}
#endif // WEBCOLLECTION_H

View File

@ -20,6 +20,7 @@
#include "ui_AlbumInfoWidget.h"
#include "viewmanager.h"
#include "database/database.h"
#include "playlist/treemodel.h"
#include "playlist/albummodel.h"
@ -39,7 +40,6 @@ using namespace Tomahawk;
AlbumInfoWidget::AlbumInfoWidget( const Tomahawk::album_ptr& album, QWidget* parent )
: QWidget( parent )
, ui( new Ui::AlbumInfoWidget )
, m_album( album )
{
ui->setupUi( this );
@ -55,6 +55,7 @@ AlbumInfoWidget::AlbumInfoWidget( const Tomahawk::album_ptr& album, QWidget* par
m_tracksModel = new TreeModel( ui->tracksView );
ui->tracksView->setTreeModel( m_tracksModel );
ui->tracksView->setRootIsDecorated( false );
m_pixmap = QPixmap( RESPATH "images/no-album-art-placeholder.png" ).scaledToWidth( 48, Qt::SmoothTransformation );
@ -77,13 +78,20 @@ AlbumInfoWidget::~AlbumInfoWidget()
void
AlbumInfoWidget::load( const album_ptr& album )
{
m_album = album;
m_title = album->name();
m_description = album->artist()->name();
ui->albumsLabel->setText( tr( "Other Albums by %1" ).arg( album->artist()->name() ) );
m_tracksModel->addTracks( album, QModelIndex() );
QList<album_ptr> al;
al << album;
m_albumsModel->addAlbums( al );
DatabaseCommand_AllAlbums* cmd = new DatabaseCommand_AllAlbums();
cmd->setArtist( album->artist() );
connect( cmd, SIGNAL( albums( QList<Tomahawk::album_ptr>, QVariant ) ),
SLOT( gotAlbums( QList<Tomahawk::album_ptr> ) ) );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );
Tomahawk::InfoSystem::InfoCriteriaHash trackInfo;
trackInfo["artist"] = album->artist()->name();
@ -99,6 +107,17 @@ AlbumInfoWidget::load( const album_ptr& album )
}
void
AlbumInfoWidget::gotAlbums( const QList<Tomahawk::album_ptr>& albums )
{
QList<Tomahawk::album_ptr> al = albums;
if ( al.contains( m_album ) )
al.removeAll( m_album );
m_albumsModel->addAlbums( al );
}
void
AlbumInfoWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output )
{

View File

@ -86,6 +86,8 @@ protected:
void changeEvent( QEvent* e );
private slots:
void gotAlbums( const QList<Tomahawk::album_ptr>& albums );
void infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
void infoSystemFinished( QString target );

View File

@ -256,9 +256,7 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
QColor c = painter->pen().color();
painter->setPen( QColor( Qt::gray ).darker() );
QFont font2 = font;
#ifdef Q_OS_MAC
font2.setPointSize( font2.pointSize() - 1 );
#endif
painter->setFont( font2 );
QRect rectText = option.rect.adjusted( 66, 20, -100, -8 );
@ -294,7 +292,6 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
painter->restore();
}
QPixmap avatar = index.data( WelcomePlaylistModel::PlaylistRole ).value< Tomahawk::playlist_ptr >()->author()->avatar( Source::FancyStyle );
if ( avatar.isNull() )
avatar = m_defaultAvatar;

View File

@ -65,6 +65,7 @@ ScriptResolver::ScriptResolver( const QString& exe )
ScriptResolver::~ScriptResolver()
{
stop();
m_proc.waitForFinished();
Tomahawk::Pipeline::instance()->removeResolver( this );

View File

@ -19,14 +19,35 @@ void SettingsListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
initStyleOption( &opt, QModelIndex() );
qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );
QRect iconRect = option.rect.adjusted( 23, 6, -option.rect.width() + option.decorationSize.width() + 7, -option.rect.height() + option.decorationSize.height() + 2 - 12 );
QPixmap avatar = index.data( Qt::DecorationRole ).value<QIcon>().pixmap( iconRect.size() );
painter->drawPixmap( iconRect, avatar.scaledToHeight( iconRect.height(), Qt::SmoothTransformation ) );
#ifdef Q_OS_MAC
// On mac draw our own selection rect as we don't get one from osx (around the whole icon or around just text)
if ( opt.state & QStyle::State_Selected )
{
painter->save();
painter->setRenderHint( QPainter::Antialiasing );
QPainterPath p;
p.addRoundedRect( opt.rect.adjusted( 2, 1, -1, -1 ), 5, 5 );
QColor fill( 214, 214, 214 );
QColor border( 107, 107, 107 );
painter->setPen( border );
painter->drawPath( p );
painter->fillPath( p, fill );
painter->restore();
}
#else
if ( ( option.state & QStyle::State_Selected ) == QStyle::State_Selected )
{
painter->setPen( option.palette.color( QPalette::HighlightedText ) );
}
#endif
QRect iconRect = option.rect.adjusted( 23, 6, -option.rect.width() + option.decorationSize.width() + 7, -option.rect.height() + option.decorationSize.height() + 2 - 12 );
QPixmap avatar = index.data( Qt::DecorationRole ).value<QIcon>().pixmap( iconRect.size() );
painter->drawPixmap( iconRect, avatar.scaledToHeight( iconRect.height(), Qt::SmoothTransformation ) );
QRect textRect = option.rect.adjusted( 6, iconRect.height() + 8, -6, 0 );
QString text = painter->fontMetrics().elidedText( index.data( Qt::DisplayRole ).toString(), Qt::ElideRight, textRect.width() );
QTextOption to( Qt::AlignHCenter );

View File

@ -46,7 +46,6 @@ CollectionItem::CollectionItem( SourcesModel* mdl, SourceTreeItem* parent, cons
, m_coolPlaylistsPage( 0 )
, m_lovedTracksPage( 0 )
{
m_lovedTracksItem = new GenericPageItem( model(), this, ( m_source.isNull() ? tr( "Top Loved Tracks" ) : tr( "Loved Tracks" ) ), QIcon( RESPATH "images/loved_playlist.png" ),
boost::bind( &CollectionItem::lovedTracksClicked, this ),
boost::bind( &CollectionItem::getLovedTracksPage, this )

View File

@ -51,7 +51,6 @@
#include "scanmanager.h"
#include "tomahawksettings.h"
#include "globalactionmanager.h"
#include "webcollection.h"
#include "database/localcollection.h"
#include "musicscanner.h"
@ -482,14 +481,6 @@ TomahawkApp::initLocalCollection()
src->addCollection( coll );
SourceList::instance()->setLocal( src );
// src->collection()->tracks();
// dummy source/collection for web-based result-hints.
source_ptr dummy( new Source( -1, "" ) );
dummy->setOnline();
collection_ptr dummycol( new WebCollection( dummy ) );
dummy->addCollection( dummycol );
SourceList::instance()->setWebSource( dummy );
SourceList::instance()->loadSources();
// to make the stats signal be emitted by our local source