Merge branch 'master' of https://github.com/dschmidt/tomahawk into dschmidt-master
112
CMakeModules/AddAppIconMacro.cmake
Normal file
@ -0,0 +1,112 @@
|
||||
# This macro is taken from kdelibs/cmake/modules/KDE4Macros.cmake.
|
||||
#
|
||||
# Copyright (c) 2006-2009 Alexander Neundorf, <neundorf@kde.org>
|
||||
# Copyright (c) 2006, 2007, Laurent Montel, <montel@kde.org>
|
||||
# Copyright (c) 2007 Matthias Kretz <kretz@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file [in KDE repositories].
|
||||
|
||||
|
||||
# adds application icon to target source list
|
||||
# for detailed documentation see the top of FindKDE4Internal.cmake
|
||||
macro (KDE4_ADD_APP_ICON appsources pattern)
|
||||
set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${appsources})
|
||||
|
||||
if (WIN32)
|
||||
if(NOT WINCE)
|
||||
find_program(PNG2ICO_EXECUTABLE NAMES png2ico)
|
||||
else(NOT WINCE)
|
||||
find_program(PNG2ICO_EXECUTABLE NAMES png2ico PATHS ${HOST_BINDIR} NO_DEFAULT_PATH )
|
||||
endif(NOT WINCE)
|
||||
find_program(WINDRES_EXECUTABLE NAMES windres)
|
||||
if(MSVC)
|
||||
set(WINDRES_EXECUTABLE TRUE)
|
||||
endif(MSVC)
|
||||
if (PNG2ICO_EXECUTABLE AND WINDRES_EXECUTABLE)
|
||||
string(REPLACE "*" "(.*)" pattern_rx "${pattern}")
|
||||
file(GLOB files "${pattern}")
|
||||
foreach (it ${files})
|
||||
string(REGEX REPLACE "${pattern_rx}" "\\1" fn "${it}")
|
||||
if (fn MATCHES ".*16.*" )
|
||||
list (APPEND _icons ${it})
|
||||
endif (fn MATCHES ".*16.*")
|
||||
if (fn MATCHES ".*32.*" )
|
||||
list (APPEND _icons ${it})
|
||||
endif (fn MATCHES ".*32.*")
|
||||
if (fn MATCHES ".*48.*" )
|
||||
list (APPEND _icons ${it})
|
||||
endif (fn MATCHES ".*48.*")
|
||||
if (fn MATCHES ".*64.*" )
|
||||
list (APPEND _icons ${it})
|
||||
endif (fn MATCHES ".*64.*")
|
||||
if (fn MATCHES ".*128.*" )
|
||||
list (APPEND _icons ${it})
|
||||
endif (fn MATCHES ".*128.*")
|
||||
endforeach (it)
|
||||
if (_icons)
|
||||
add_custom_command(OUTPUT ${_outfilename}.ico ${_outfilename}.rc
|
||||
COMMAND ${PNG2ICO_EXECUTABLE} ARGS --rcfile ${_outfilename}.rc ${_outfilename}.ico ${_icons}
|
||||
DEPENDS ${PNG2ICO_EXECUTABLE} ${_icons}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
if (MINGW)
|
||||
add_custom_command(OUTPUT ${_outfilename}_res.o
|
||||
COMMAND ${WINDRES_EXECUTABLE} ARGS -i ${_outfilename}.rc -o ${_outfilename}_res.o --include-dir=${CMAKE_CURRENT_SOURCE_DIR}
|
||||
DEPENDS ${WINDRES_EXECUTABLE} ${_outfilename}.rc
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
list(APPEND ${appsources} ${_outfilename}_res.o)
|
||||
else(MINGW)
|
||||
list(APPEND ${appsources} ${_outfilename}.rc)
|
||||
endif(MINGW)
|
||||
else(_icons)
|
||||
message(STATUS "Unable to find a related icon that matches pattern ${pattern} for variable ${appsources} - application will not have an application icon!")
|
||||
endif(_icons)
|
||||
else(PNG2ICO_EXECUTABLE AND WINDRES_EXECUTABLE)
|
||||
message(STATUS "Unable to find the png2ico or windres utilities - application will not have an application icon!")
|
||||
endif(PNG2ICO_EXECUTABLE AND WINDRES_EXECUTABLE)
|
||||
endif(WIN32)
|
||||
if (Q_WS_MAC)
|
||||
# first convert image to a tiff using the Mac OS X "sips" utility,
|
||||
# then use tiff2icns to convert to an icon
|
||||
find_program(SIPS_EXECUTABLE NAMES sips)
|
||||
find_program(TIFF2ICNS_EXECUTABLE NAMES tiff2icns)
|
||||
if (SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
|
||||
file(GLOB_RECURSE files "${pattern}")
|
||||
# we can only test for the 128-icon like that - we don't use patterns anymore
|
||||
foreach (it ${files})
|
||||
if (it MATCHES ".*128.*" )
|
||||
set (_icon ${it})
|
||||
endif (it MATCHES ".*128.*")
|
||||
endforeach (it)
|
||||
|
||||
if (_icon)
|
||||
|
||||
# first, get the basename of our app icon
|
||||
add_custom_command(OUTPUT ${_outfilename}.icns ${outfilename}.tiff
|
||||
COMMAND ${SIPS_EXECUTABLE} -s format tiff ${_icon} --out ${outfilename}.tiff
|
||||
COMMAND ${TIFF2ICNS_EXECUTABLE} ${outfilename}.tiff ${_outfilename}.icns
|
||||
DEPENDS ${_icon}
|
||||
)
|
||||
|
||||
# This will register the icon into the bundle
|
||||
set(MACOSX_BUNDLE_ICON_FILE ${appsources}.icns)
|
||||
|
||||
# Append the icns file to the sources list so it will be a dependency to the
|
||||
# main target
|
||||
list(APPEND ${appsources} ${_outfilename}.icns)
|
||||
|
||||
# Install the icon into the Resources dir in the bundle
|
||||
set_source_files_properties(${_outfilename}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
||||
|
||||
else(_icon)
|
||||
# TODO - try to scale a non-128 icon...? Try to convert an SVG on the fly?
|
||||
message(STATUS "Unable to find an 128x128 icon that matches pattern ${pattern} for variable ${appsources} - application will not have an application icon!")
|
||||
endif(_icon)
|
||||
|
||||
else(SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
|
||||
message(STATUS "Unable to find the sips and tiff2icns utilities - application will not have an application icon!")
|
||||
endif(SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
|
||||
endif(Q_WS_MAC)
|
||||
endmacro (KDE4_ADD_APP_ICON)
|
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 643 B |
Before Width: | Height: | Size: 856 B After Width: | Height: | Size: 856 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 780 B After Width: | Height: | Size: 780 B |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 55 KiB |
@ -61,14 +61,14 @@
|
||||
<file>./data/images/volume-slider-bkg.png</file>
|
||||
<file>./data/images/volume-slider-level.png</file>
|
||||
<file>./data/topbar-radiobuttons.css</file>
|
||||
<file>./data/icons/tomahawk-icon-16.png</file>
|
||||
<file>./data/icons/tomahawk-icon-32.png</file>
|
||||
<file>./data/icons/tomahawk-icon-64.png</file>
|
||||
<file>./data/icons/tomahawk-icon-128.png</file>
|
||||
<file>./data/icons/tomahawk-icon-256.png</file>
|
||||
<file>./data/icons/tomahawk-icon-512.png</file>
|
||||
<file>./data/icons/audio-x-generic-22.png</file>
|
||||
<file>./data/icons/audio-x-generic-32.png</file>
|
||||
<file>./data/icons/audio-x-generic-16.png</file>
|
||||
<file>./data/icons/tomahawk-icon-16x16.png</file>
|
||||
<file>./data/icons/tomahawk-icon-32x32.png</file>
|
||||
<file>./data/icons/tomahawk-icon-64x64.png</file>
|
||||
<file>./data/icons/tomahawk-icon-128x128.png</file>
|
||||
<file>./data/icons/tomahawk-icon-256x256.png</file>
|
||||
<file>./data/icons/tomahawk-icon-512x512.png</file>
|
||||
<file>./data/icons/audio-x-generic-22x22.png</file>
|
||||
<file>./data/icons/audio-x-generic-32x32.png</file>
|
||||
<file>./data/icons/audio-x-generic-16x16.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -9,6 +9,8 @@ SET( QT_USE_QTNETWORK TRUE )
|
||||
SET( QT_USE_QTXML TRUE )
|
||||
INCLUDE( ${QT_USE_FILE} )
|
||||
|
||||
INCLUDE( ${CMAKE_MODULE_PATH}/AddAppIconMacro.cmake )
|
||||
|
||||
SET( CMAKE_BUILD_TYPE "debugfull" )
|
||||
SET( CMAKE_VERBOSE_MAKEFILE ON )
|
||||
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
|
||||
@ -294,6 +296,7 @@ IF( UNIX AND NOT APPLE )
|
||||
INCLUDE( "CMakeLists.linux.txt" )
|
||||
ENDIF( UNIX AND NOT APPLE )
|
||||
|
||||
kde4_add_app_icon( tomahawkSources "${CMAKE_CURRENT_SOURCE_DIR}/../data/icons/tomahawk-icon-*.png" )
|
||||
qt4_add_resources( RC_SRCS "../resources.qrc" )
|
||||
qt4_wrap_cpp( tomahawkMoc ${tomahawkHeaders} )
|
||||
|
||||
@ -321,9 +324,17 @@ MESSAGE( STATUS "OS_SPECIFIC_LINK_LIBRARIES: ${OS_SPECIFIC_LINK_LIBRARIES}" )
|
||||
TARGET_LINK_LIBRARIES( tomahawk
|
||||
${QT_LIBRARIES}
|
||||
${MAC_EXTRA_LIBS}
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
echonest
|
||||
portfwd
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
lastfm
|
||||
qjson
|
||||
tag
|
||||
mad
|
||||
vorbis
|
||||
vorbisenc
|
||||
vorbisfile
|
||||
gloox
|
||||
echonest
|
||||
)
|
||||
|
||||
INCLUDE( "CPack.txt" )
|
||||
|
@ -1,6 +1,8 @@
|
||||
ADD_DEFINITIONS( /DNOMINMAX )
|
||||
ADD_DEFINITIONS( /DWIN32_LEAN_AND_MEAN )
|
||||
ADD_DEFINITIONS( -static-libgcc )
|
||||
ADD_DEFINITIONS( /DNO_LIBLASTFM )
|
||||
ADD_DEFINITIONS( -DNO_OGG )
|
||||
|
||||
# Add manual locations to stuff:
|
||||
INCLUDE_DIRECTORIES(
|
||||
@ -16,12 +18,8 @@ INCLUDE_DIRECTORIES(
|
||||
)
|
||||
|
||||
SET( OS_SPECIFIC_LINK_LIBRARIES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../../gloox-1.0/src/.libs/libgloox.a"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../../qjson/build/lib/libqjson.dll.a"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../../taglib-1.6.3/build/taglib/libtag.dll"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../../zlib-1.2.3/lib/libz.a"
|
||||
"secur32.dll"
|
||||
"Crypt32.dll"
|
||||
"crypt32.dll"
|
||||
"ws2_32.dll"
|
||||
"dnsapi.dll"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../qxtweb-standalone/libqxtweb-standalone.dll"
|
||||
@ -29,7 +27,7 @@ SET( OS_SPECIFIC_LINK_LIBRARIES
|
||||
|
||||
SET( OS_SPECIFIC_LINK_LIBRARIES
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../admin/win/tomahawk.res"
|
||||
#"${CMAKE_CURRENT_SOURCE_DIR}/../admin/win/tomahawk.res"
|
||||
)
|
||||
|
||||
IF( "${gui}" STREQUAL "no" )
|
||||
@ -42,10 +40,9 @@ ELSE()
|
||||
SET( OS_SPECIFIC_LINK_LIBRARIES
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
"dsound.dll"
|
||||
"winmm.dll"
|
||||
"winmm.dll"
|
||||
"iphlpapi.a"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../rtaudio/librtaudio.dll"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../admin/win/dlls/libmad.dll"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../admin/win/dlls/libvorbisfile.dll"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../admin/win/dlls/liblastfm.dll"
|
||||
)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
@ -384,7 +384,7 @@ TrackView::createDragPixmap( int itemCount ) const
|
||||
int y = 0;
|
||||
for( int i = 0; i < itemCount; ++i )
|
||||
{
|
||||
const QPixmap pixmap = QPixmap( QString( ":/data/icons/audio-x-generic-%2.png" ).arg( size ) );
|
||||
const QPixmap pixmap = QPixmap( QString( ":/data/icons/audio-x-generic-%2x%2.png" ).arg( size ) );
|
||||
painter.drawPixmap( x, y, pixmap );
|
||||
|
||||
x += size + 1;
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <QDebug>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QNetworkProxy>
|
||||
|
||||
#ifndef NO_LIBLASTFM
|
||||
#include <lastfm/ws.h>
|
||||
|
@ -114,7 +114,7 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
||||
m_audioEngine = 0;
|
||||
m_mainwindow = 0;
|
||||
m_headless = arguments().contains( "--headless" );
|
||||
setWindowIcon( QIcon( RESPATH "icons/tomahawk-icon-128.png" ) );
|
||||
setWindowIcon( QIcon( RESPATH "icons/tomahawk-icon-128x128.png" ) );
|
||||
#ifndef NO_LIBLASTFM
|
||||
m_scrobbler = 0;
|
||||
#endif
|
||||
|
@ -42,7 +42,7 @@ TomahawkWindow::TomahawkWindow( QWidget* parent )
|
||||
, m_playlistManager( new PlaylistManager( this ) )
|
||||
{
|
||||
qApp->setStyle( new ProxyStyle() );
|
||||
setWindowIcon( QIcon( RESPATH "icons/tomahawk-icon-128.png" ) );
|
||||
setWindowIcon( QIcon( RESPATH "icons/tomahawk-icon-128x128.png" ) );
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
setUnifiedTitleAndToolBarOnMac( true );
|
||||
|