Compare commits
44 Commits
0.8.0rc1
...
stable-0.8
Author | SHA1 | Date | |
---|---|---|---|
|
c2dc409e40 | ||
|
8526aac3f0 | ||
|
fdfbf8c3e4 | ||
|
6369a20c08 | ||
|
bb4ad2684c | ||
|
b1537607b2 | ||
|
d3b600890f | ||
|
fcbb3f31da | ||
|
e791977982 | ||
|
197d76ead5 | ||
|
d5746e794a | ||
|
4dacab3d8a | ||
|
92811215a5 | ||
|
c1d99b4868 | ||
|
8bb14cc26c | ||
|
d74c465e58 | ||
|
69653c4934 | ||
|
46239947f5 | ||
|
eee50b2f93 | ||
|
655edf3e98 | ||
|
45e6d52db7 | ||
|
b6dd736fea | ||
|
0229746f8b | ||
|
ea18ab891f | ||
|
906285e442 | ||
|
0812855b60 | ||
|
5e2253881f | ||
|
e9c7fd7a16 | ||
|
1a6a15844b | ||
|
8dd8c77610 | ||
|
16a3e9eccb | ||
|
225d5764e7 | ||
|
44ffefb1fb | ||
|
1d3d8001a4 | ||
|
29ba03444b | ||
|
51fe1aa0df | ||
|
5d9b42182b | ||
|
01534d222f | ||
|
8a58114f73 | ||
|
a8642a687f | ||
|
fb66be9746 | ||
|
22a58b7e21 | ||
|
f55ff6f13b | ||
|
af0b14b728 |
@@ -20,6 +20,11 @@ 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" )
|
||||
IF(APPLE)
|
||||
SET( TOMAHAWK_TARGET_NAME "Tomahawk" )
|
||||
ELSE()
|
||||
SET( TOMAHAWK_TARGET_NAME "tomahawk" )
|
||||
ENDIF()
|
||||
|
||||
IF( WIN32 )
|
||||
SET( TOMAHAWK_SYSTEM "Windows" )
|
||||
@@ -235,7 +240,8 @@ else( Qt5Core_DIR )
|
||||
endif( Qt5Core_DIR )
|
||||
|
||||
if( BUILD_GUI AND UNIX AND NOT APPLE )
|
||||
find_package( X11 )
|
||||
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")
|
||||
endif()
|
||||
|
||||
# Check if we can use <functional> or need <tr1/functional>
|
||||
|
@@ -12,8 +12,8 @@ SET(WINDRES_EXECUTABLE ${CMAKE_RC_COMPILER})
|
||||
|
||||
# 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})
|
||||
macro (TOMAHAWK_ADD_APP_ICON appsources outfilename pattern)
|
||||
set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${outfilename})
|
||||
|
||||
if (WIN32)
|
||||
if(NOT WINCE)
|
||||
@@ -86,9 +86,9 @@ macro (KDE4_ADD_APP_ICON appsources pattern)
|
||||
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
|
||||
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}
|
||||
)
|
||||
|
||||
@@ -111,4 +111,4 @@ macro (KDE4_ADD_APP_ICON appsources pattern)
|
||||
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)
|
||||
endmacro (TOMAHAWK_ADD_APP_ICON)
|
||||
|
@@ -35,8 +35,6 @@ VERSION=$1
|
||||
|
||||
cd Tomahawk.app
|
||||
|
||||
header "Renaming icon"
|
||||
mv Contents/Resources/tomahawkSources.icns Contents/Resources/Tomahawk.icns
|
||||
cp $ROOT/../admin/mac/qt.conf Contents/Resources/qt.conf
|
||||
|
||||
header "Copying Sparkle framework"
|
||||
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 151 KiB |
BIN
data/icons/tomahawk-white-icon-128x128.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 893 KiB |
Before Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 294 KiB After Width: | Height: | Size: 266 KiB |
Before Width: | Height: | Size: 659 KiB After Width: | Height: | Size: 507 KiB |
@@ -1,7 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>data/images/collection_background.png</file>
|
||||
<file>data/images/collection_background_small.png</file>
|
||||
<file>data/images/playlist_background.png</file>
|
||||
<file>data/images/filter.svg</file>
|
||||
<file>data/images/loved.svg</file>
|
||||
@@ -162,5 +161,6 @@
|
||||
<file>data/images/copy.svg</file>
|
||||
<file>data/icons/tomahawk-icon-1024x1024.png</file>
|
||||
<file>data/images/plugins.svg</file>
|
||||
<file>data/icons/tomahawk-white-icon-128x128.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@@ -28,6 +28,103 @@
|
||||
#include "utils/TomahawkUtils.h"
|
||||
#include "utils/Logger.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <windows.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <numeric>
|
||||
|
||||
// code taken from http://stackoverflow.com/questions/20734831/compress-string-with-gzip-using-qcompress
|
||||
static const quint32 crc_32_tab[] = { /* CRC polynomial 0xedb88320 */
|
||||
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
|
||||
0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
|
||||
0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
|
||||
0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
|
||||
0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
|
||||
0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
|
||||
0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,
|
||||
0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
|
||||
0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
|
||||
0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
|
||||
0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,
|
||||
0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
|
||||
0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
|
||||
0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
|
||||
0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
|
||||
0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
|
||||
0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
|
||||
0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
|
||||
0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
|
||||
0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
|
||||
0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
|
||||
0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
|
||||
0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
|
||||
0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
|
||||
0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
|
||||
0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
|
||||
0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
|
||||
0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
|
||||
0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
|
||||
0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
|
||||
0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
|
||||
0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
|
||||
0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
|
||||
0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
|
||||
0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
|
||||
0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
|
||||
0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
|
||||
0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
|
||||
0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
|
||||
0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
|
||||
0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
|
||||
0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
|
||||
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
|
||||
};
|
||||
|
||||
quint32 updateCRC32(quint32 crc, unsigned char ch)
|
||||
{
|
||||
return (crc_32_tab[((crc) ^ ((quint8)ch)) & 0xff] ^ ((crc) >> 8));
|
||||
}
|
||||
|
||||
quint32 crc32buf(const QByteArray& data)
|
||||
{
|
||||
return ~std::accumulate(
|
||||
data.begin(),
|
||||
data.end(),
|
||||
quint32(0xFFFFFFFF),
|
||||
updateCRC32);
|
||||
}
|
||||
|
||||
QByteArray gzip_compress(const QByteArray& data)
|
||||
{
|
||||
QByteArray compressedData = qCompress(data);
|
||||
// Strip the first six bytes (a 4-byte length put on by qCompress and a 2-byte zlib header)
|
||||
// and the last four bytes (a zlib integrity check).
|
||||
compressedData.remove(0, 6);
|
||||
compressedData.chop(4);
|
||||
|
||||
QByteArray header;
|
||||
QDataStream ds1(&header, QIODevice::WriteOnly);
|
||||
// Prepend a generic 10-byte gzip header (see RFC 1952),
|
||||
ds1 << quint16(0x1f8b)
|
||||
<< quint16(0x0800)
|
||||
<< quint16(0x0000)
|
||||
<< quint16(0x0000)
|
||||
<< quint16(0x000b);
|
||||
|
||||
// Append a four-byte CRC-32 of the uncompressed data
|
||||
// Append 4 bytes uncompressed input size modulo 2^32
|
||||
QByteArray footer;
|
||||
QDataStream ds2(&footer, QIODevice::WriteOnly);
|
||||
ds2.setByteOrder(QDataStream::LittleEndian);
|
||||
ds2 << crc32buf(data)
|
||||
<< quint32(data.size());
|
||||
|
||||
return header + compressedData + footer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const char* k_usage =
|
||||
"Usage:\n"
|
||||
@@ -35,6 +132,26 @@ const char* k_usage =
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
#ifdef Q_OS_WIN // log to console window
|
||||
if ( fileno( stdout ) != -1 && _get_osfhandle( fileno( stdout ) ) != -1 )
|
||||
{
|
||||
/* stdout is fine, presumably redirected to a file or pipe */
|
||||
}
|
||||
else
|
||||
{
|
||||
typedef BOOL (WINAPI * AttachConsole_t) (DWORD);
|
||||
AttachConsole_t p_AttachConsole = (AttachConsole_t) GetProcAddress( GetModuleHandleW( L"kernel32.dll" ), "AttachConsole" );
|
||||
|
||||
if ( p_AttachConsole != NULL && p_AttachConsole( ATTACH_PARENT_PROCESS ) )
|
||||
{
|
||||
_wfreopen ( L"CONOUT$", L"w", stdout );
|
||||
dup2( fileno( stdout ), 1 );
|
||||
_wfreopen ( L"CONOUT$", L"w", stderr );
|
||||
dup2( fileno( stderr ), 2 );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// used by some Qt stuff, eg QSettings
|
||||
// leave first! As Settings object is created quickly
|
||||
QCoreApplication::setApplicationName( "Tomahawk" );
|
||||
@@ -100,7 +217,7 @@ int main( int argc, char* argv[] )
|
||||
// send log
|
||||
QFile logFile( TomahawkUtils::logFilePath() );
|
||||
logFile.open( QFile::ReadOnly );
|
||||
reporter.setReportData( "upload_file_tomahawklog", qCompress( logFile.readAll() ), "application/x-gzip", QFileInfo( logFile ).fileName().toUtf8());
|
||||
reporter.setReportData( "upload_file_tomahawklog", gzip_compress( logFile.readAll() ), "application/x-gzip", QFileInfo( logFile ).fileName().toUtf8());
|
||||
logFile.close();
|
||||
|
||||
reporter.show();
|
||||
|
@@ -38,7 +38,6 @@ set( libGuiSources
|
||||
playlist/InboxModel.cpp
|
||||
playlist/InboxView.cpp
|
||||
playlist/ContextView.cpp
|
||||
playlist/FlexibleTreeView.cpp
|
||||
playlist/TreeModel.cpp
|
||||
playlist/TreeProxyModel.cpp
|
||||
playlist/TreeProxyModelPlaylistInterface.cpp
|
||||
@@ -121,6 +120,7 @@ set( libGuiSources
|
||||
viewpages/AlbumViewPage.cpp
|
||||
viewpages/TrackViewPage.cpp
|
||||
viewpages/PlaylistViewPage.cpp
|
||||
viewpages/CollectionViewPage.cpp
|
||||
|
||||
widgets/AnimatedSplitter.cpp
|
||||
widgets/BasicHeader.cpp
|
||||
|
@@ -1528,7 +1528,6 @@ TomahawkSettings::setPrivateListeningMode( TomahawkSettings::PrivateListeningMod
|
||||
void
|
||||
TomahawkSettings::updateIndex()
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO;
|
||||
if ( !Database::instance() || !Database::instance()->isReady() )
|
||||
{
|
||||
QTimer::singleShot( 0, this, SLOT( updateIndex() ) );
|
||||
|
@@ -27,7 +27,6 @@
|
||||
#include "audio/AudioEngine.h"
|
||||
|
||||
#include "playlist/ContextView.h"
|
||||
#include "playlist/FlexibleTreeView.h"
|
||||
#include "playlist/TreeModel.h"
|
||||
#include "playlist/PlaylistModel.h"
|
||||
#include "playlist/TrackView.h"
|
||||
@@ -42,13 +41,12 @@
|
||||
#include "playlist/RecentlyPlayedModel.h"
|
||||
#include "playlist/dynamic/widgets/DynamicWidget.h"
|
||||
|
||||
#include "resolvers/ScriptCollection.h"
|
||||
|
||||
#include "viewpages/PlaylistViewPage.h"
|
||||
#include "viewpages/SourceViewPage.h"
|
||||
#include "viewpages/ArtistViewPage.h"
|
||||
#include "viewpages/AlbumViewPage.h"
|
||||
#include "viewpages/TrackViewPage.h"
|
||||
#include "viewpages/CollectionViewPage.h"
|
||||
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/TomahawkUtilsGui.h"
|
||||
@@ -261,32 +259,12 @@ ViewManager::show( const Tomahawk::collection_ptr& collection )
|
||||
{
|
||||
m_currentCollection = collection;
|
||||
|
||||
FlexibleTreeView* view;
|
||||
CollectionViewPage* view;
|
||||
if ( !m_collectionViews.contains( collection ) || m_collectionViews.value( collection ).isNull() )
|
||||
{
|
||||
view = new FlexibleTreeView();
|
||||
|
||||
view->columnView()->proxyModel()->setStyle( PlayableProxyModel::Collection );
|
||||
TreeModel* model = new TreeModel();
|
||||
PlayableModel* flatModel = new PlayableModel();
|
||||
PlayableModel* albumModel = new PlayableModel();
|
||||
|
||||
view->setTreeModel( model );
|
||||
view->setFlatModel( flatModel );
|
||||
view->setAlbumModel( albumModel );
|
||||
|
||||
model->addCollection( collection );
|
||||
flatModel->appendTracks( collection );
|
||||
albumModel->appendAlbums( collection );
|
||||
|
||||
view = new CollectionViewPage( collection );
|
||||
setPage( view );
|
||||
|
||||
if ( !collection.isNull() )
|
||||
view->setEmptyTip( collection->emptyText() );
|
||||
|
||||
if ( collection.objectCast<ScriptCollection>() )
|
||||
view->trackView()->setEmptyTip( tr( "Cloud collections aren't supported in the flat view yet. We will have them covered soon. Switch to another view to navigate them." ) );
|
||||
|
||||
m_collectionViews.insert( collection, view );
|
||||
}
|
||||
else
|
||||
|
@@ -42,7 +42,7 @@ class AlbumInfoWidget;
|
||||
class ArtistInfoWidget;
|
||||
class CollectionModel;
|
||||
class PlaylistViewPage;
|
||||
class FlexibleTreeView;
|
||||
class CollectionViewPage;
|
||||
class PlaylistModel;
|
||||
class TrackProxyModel;
|
||||
class TrackModel;
|
||||
@@ -164,7 +164,7 @@ private:
|
||||
QHash< QString, boost::function< Tomahawk::ViewPage*() > > m_dynamicPagesInstanceLoaders;
|
||||
|
||||
QHash< Tomahawk::dynplaylist_ptr, QPointer<Tomahawk::DynamicWidget> > m_dynamicWidgets;
|
||||
QHash< Tomahawk::collection_ptr, QPointer<FlexibleTreeView> > m_collectionViews;
|
||||
QHash< Tomahawk::collection_ptr, QPointer<CollectionViewPage> > m_collectionViews;
|
||||
QHash< Tomahawk::artist_ptr, QPointer<ArtistInfoWidget> > m_artistViews;
|
||||
QHash< Tomahawk::album_ptr, QPointer<AlbumInfoWidget> > m_albumViews;
|
||||
QHash< Tomahawk::query_ptr, QPointer<TrackInfoWidget> > m_trackViews;
|
||||
|
@@ -98,13 +98,6 @@ Collection::bigIcon() const
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Collection::emptyText() const
|
||||
{
|
||||
return tr( "This collection is empty." );
|
||||
}
|
||||
|
||||
|
||||
const
|
||||
source_ptr& Collection::source() const
|
||||
{
|
||||
|
@@ -67,7 +67,6 @@ public:
|
||||
virtual BackendType backendType() const { return NullCollectionType; }
|
||||
virtual QIcon icon() const;
|
||||
virtual QPixmap bigIcon() const; //for the ViewPage header
|
||||
virtual QString emptyText() const;
|
||||
|
||||
virtual void loadPlaylists();
|
||||
virtual void loadAutoPlaylists();
|
||||
|
@@ -119,6 +119,7 @@ Database::Database( const QString& dbname, QObject* parent )
|
||||
tDebug() << Q_FUNC_INFO << "Using" << m_maxConcurrentThreads << "database worker threads";
|
||||
|
||||
connect( m_impl, SIGNAL( indexReady() ), SLOT( markAsReady() ) );
|
||||
connect( m_impl, SIGNAL( indexStarted() ), SIGNAL( indexStarted() ) );
|
||||
connect( m_impl, SIGNAL( indexReady() ), SIGNAL( indexReady() ) );
|
||||
|
||||
Q_ASSERT( m_workerRW );
|
||||
|
@@ -101,7 +101,8 @@ public:
|
||||
}
|
||||
|
||||
signals:
|
||||
void indexReady(); // search index
|
||||
void indexStarted();
|
||||
void indexReady();
|
||||
void ready();
|
||||
|
||||
void newJobRO( Tomahawk::dbcmd_ptr );
|
||||
|
@@ -145,9 +145,14 @@ DatabaseCommand_Resolve::resolve( DatabaseImpl* lib )
|
||||
}
|
||||
|
||||
track_ptr track = Track::get( files_query.value( 9 ).toUInt(), files_query.value( 12 ).toString(), files_query.value( 14 ).toString(), files_query.value( 13 ).toString(), files_query.value( 5 ).toUInt(), files_query.value( 15 ).toString(), files_query.value( 17 ).toUInt(), files_query.value( 11 ).toUInt() );
|
||||
if ( !track )
|
||||
continue;
|
||||
track->loadAttributes();
|
||||
|
||||
result = Result::get( url, track );
|
||||
if ( !result )
|
||||
continue;
|
||||
|
||||
result->setModificationTime( files_query.value( 1 ).toUInt() );
|
||||
result->setSize( files_query.value( 2 ).toUInt() );
|
||||
result->setMimetype( files_query.value( 4 ).toString() );
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2010-2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||
* Copyright 2010-2014, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||
* Copyright 2012 Leo Franchi <lfranchi@kde.org>
|
||||
*
|
||||
* Tomahawk is free software: you can redistribute it and/or modify
|
||||
@@ -26,9 +26,6 @@
|
||||
#include "TomahawkSqlQuery.h"
|
||||
|
||||
#include "fuzzyindex/DatabaseFuzzyIndex.h"
|
||||
#include "jobview/IndexingJobItem.h"
|
||||
#include "jobview/JobStatusView.h"
|
||||
#include "jobview/JobStatusModel.h"
|
||||
#include "utils/Logger.h"
|
||||
|
||||
namespace Tomahawk
|
||||
@@ -36,22 +33,14 @@ namespace Tomahawk
|
||||
|
||||
DatabaseCommand_UpdateSearchIndex::DatabaseCommand_UpdateSearchIndex()
|
||||
: DatabaseCommand()
|
||||
, m_statusJob( new IndexingJobItem )
|
||||
{
|
||||
tLog() << Q_FUNC_INFO << "Updating index.";
|
||||
|
||||
JobStatusView::addJob( m_statusJob );
|
||||
tDebug() << Q_FUNC_INFO << "Updating index.";
|
||||
}
|
||||
|
||||
|
||||
DatabaseCommand_UpdateSearchIndex::~DatabaseCommand_UpdateSearchIndex()
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO;
|
||||
|
||||
if ( ! m_statusJob.isNull() )
|
||||
{
|
||||
m_statusJob.data()->done();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -23,8 +23,6 @@
|
||||
#include "DllMacro.h"
|
||||
#include <QPointer>
|
||||
|
||||
class IndexingJobItem;
|
||||
|
||||
namespace Tomahawk
|
||||
{
|
||||
|
||||
@@ -47,9 +45,6 @@ public:
|
||||
virtual QString commandname() const { return "updatesearchindex"; }
|
||||
virtual bool doesMutates() const { return true; }
|
||||
virtual void exec( DatabaseImpl* db );
|
||||
|
||||
private:
|
||||
QPointer<IndexingJobItem> m_statusJob;
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -199,6 +199,7 @@ Tomahawk::DatabaseImpl::dumpDatabase()
|
||||
void
|
||||
Tomahawk::DatabaseImpl::loadIndex()
|
||||
{
|
||||
connect( m_fuzzyIndex, SIGNAL( indexStarted() ), SIGNAL( indexStarted() ) );
|
||||
connect( m_fuzzyIndex, SIGNAL( indexReady() ), SIGNAL( indexReady() ) );
|
||||
m_fuzzyIndex->loadLuceneIndex();
|
||||
}
|
||||
|
@@ -86,7 +86,9 @@ public:
|
||||
void loadIndex();
|
||||
|
||||
signals:
|
||||
void indexStarted();
|
||||
void indexReady();
|
||||
|
||||
void schemaUpdateStarted();
|
||||
void schemaUpdateStatus( const QString& message );
|
||||
void schemaUpdateDone();
|
||||
|
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
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
|
||||
@@ -42,10 +41,3 @@ LocalCollection::prettyName() const
|
||||
{
|
||||
return tr( "Your Collection" );
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
LocalCollection::emptyText() const
|
||||
{
|
||||
return tr( "After you have scanned your music collection you will find your tracks right here." );
|
||||
}
|
||||
|
@@ -34,7 +34,6 @@ public:
|
||||
explicit LocalCollection( const Tomahawk::source_ptr& source, QObject* parent = 0 );
|
||||
|
||||
virtual QString prettyName() const;
|
||||
virtual QString emptyText() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -1,3 +1,21 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2010-2014, 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 "DatabaseFuzzyIndex.h"
|
||||
|
||||
#include "database/DatabaseImpl.h"
|
||||
@@ -8,7 +26,6 @@ namespace Tomahawk {
|
||||
DatabaseFuzzyIndex::DatabaseFuzzyIndex( QObject* parent, bool wipe )
|
||||
: FuzzyIndex( parent, "tomahawk.lucene", wipe )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,3 +1,21 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2010-2014, 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 TOMAHAWK_DATABASEFUZZYINDEX_H
|
||||
#define TOMAHAWK_DATABASEFUZZYINDEX_H
|
||||
|
||||
|
@@ -94,6 +94,7 @@ FuzzyIndex::updateIndexSlot()
|
||||
void
|
||||
FuzzyIndex::beginIndexing()
|
||||
{
|
||||
emit indexStarted();
|
||||
m_mutex.lock();
|
||||
|
||||
try
|
||||
|
@@ -52,6 +52,7 @@ public:
|
||||
virtual void updateIndex();
|
||||
|
||||
signals:
|
||||
void indexStarted();
|
||||
void indexReady();
|
||||
|
||||
public slots:
|
||||
|
@@ -18,7 +18,11 @@
|
||||
|
||||
#include "IndexingJobItem.h"
|
||||
|
||||
#include "JobStatusModel.h"
|
||||
#include "JobStatusView.h"
|
||||
#include "database/Database.h"
|
||||
#include "utils/TomahawkUtilsGui.h"
|
||||
#include "utils/Logger.h"
|
||||
|
||||
#include <QPixmap>
|
||||
|
||||
@@ -29,16 +33,40 @@ IndexingJobItem::mainText() const
|
||||
return tr( "Indexing Music Library" );
|
||||
}
|
||||
|
||||
|
||||
QPixmap
|
||||
IndexingJobItem::icon() const
|
||||
{
|
||||
return TomahawkUtils::defaultPixmap( TomahawkUtils::ViewRefresh, TomahawkUtils::Original, QSize( 128, 128 ) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
void IndexingJobItem::done()
|
||||
void
|
||||
IndexingJobItem::done()
|
||||
{
|
||||
emit finished();
|
||||
}
|
||||
|
||||
|
||||
IndexStatusManager::IndexStatusManager( QObject* parent )
|
||||
: QObject( parent )
|
||||
{
|
||||
connect( Tomahawk::Database::instance(), SIGNAL( indexStarted() ), SLOT( started() ) );
|
||||
connect( Tomahawk::Database::instance(), SIGNAL( indexReady() ), SLOT( finished() ) );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IndexStatusManager::started()
|
||||
{
|
||||
m_curItem = new IndexingJobItem;
|
||||
JobStatusView::instance()->model()->addJob( m_curItem.data() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IndexStatusManager::finished()
|
||||
{
|
||||
if ( m_curItem )
|
||||
m_curItem->done();
|
||||
}
|
||||
|
@@ -19,8 +19,9 @@
|
||||
#ifndef INDEXINGJOBITEM_H
|
||||
#define INDEXINGJOBITEM_H
|
||||
|
||||
#include <jobview/JobStatusItem.h>
|
||||
#include "JobStatusItem.h"
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
class IndexingJobItem : public JobStatusItem
|
||||
{
|
||||
@@ -37,4 +38,19 @@ public:
|
||||
virtual QString type() const { return "indexerjob"; }
|
||||
};
|
||||
|
||||
class IndexStatusManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit IndexStatusManager( QObject* parent = 0 );
|
||||
virtual ~IndexStatusManager() {}
|
||||
|
||||
private slots:
|
||||
void started();
|
||||
void finished();
|
||||
|
||||
private:
|
||||
QPointer<IndexingJobItem> m_curItem;
|
||||
};
|
||||
|
||||
#endif // INDEXINGJOBITEM_H
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||
* Copyright 2010-2014, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
|
||||
*
|
||||
* Tomahawk is free software: you can redistribute it and/or modify
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "JobStatusDelegate.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "Source.h"
|
||||
#include "IndexingJobItem.h"
|
||||
#include "PipelineStatusItem.h"
|
||||
#include "TransferStatusItem.h"
|
||||
#include "LatchedStatusItem.h"
|
||||
@@ -92,6 +93,7 @@ JobStatusView::JobStatusView( AnimatedSplitter* parent )
|
||||
m_view->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||
m_view->setUniformItemSizes( false );
|
||||
|
||||
new IndexStatusManager( this );
|
||||
new PipelineStatusManager( this );
|
||||
new TransferStatusManager( this );
|
||||
new LatchedStatusManager( this );
|
||||
|
@@ -110,7 +110,7 @@ void
|
||||
ColumnView::setModel( QAbstractItemModel* model )
|
||||
{
|
||||
Q_UNUSED( model );
|
||||
tDebug() << "Explicitly use setPlaylistModel instead";
|
||||
tDebug() << "Explicitly use setTreeModel instead";
|
||||
Q_ASSERT( false );
|
||||
}
|
||||
|
||||
|
@@ -50,7 +50,7 @@ ContextView::ContextView( QWidget* parent, const QString& caption )
|
||||
m_trackView->proxyModel()->setStyle( PlayableProxyModel::Fancy );
|
||||
TomahawkStyle::styleScrollBar( m_trackView->verticalScrollBar() );
|
||||
|
||||
setLayout( new QVBoxLayout( this ) );
|
||||
setLayout( new QVBoxLayout() );
|
||||
TomahawkUtils::unmarginLayout( layout() );
|
||||
|
||||
m_trackView->setStyleSheet( QString( "QTreeView { background-color: white; }" ) );
|
||||
@@ -63,7 +63,7 @@ ContextView::ContextView( QWidget* parent, const QString& caption )
|
||||
vbox->setPalette( pal );
|
||||
vbox->setAutoFillBackground( true );
|
||||
|
||||
QVBoxLayout* vboxl = new QVBoxLayout( this );
|
||||
QVBoxLayout* vboxl = new QVBoxLayout();
|
||||
TomahawkUtils::unmarginLayout( vboxl );
|
||||
vboxl->setContentsMargins( 32, 32, 32, 32 );
|
||||
vboxl->setSpacing( 32 );
|
||||
@@ -71,11 +71,11 @@ ContextView::ContextView( QWidget* parent, const QString& caption )
|
||||
vbox->setLayout( vboxl );
|
||||
|
||||
QWidget* hbox = new QWidget;
|
||||
QHBoxLayout* hboxl = new QHBoxLayout( this );
|
||||
QHBoxLayout* hboxl = new QHBoxLayout();
|
||||
TomahawkUtils::unmarginLayout( hboxl );
|
||||
hboxl->setSpacing( 32 );
|
||||
|
||||
m_innerLayout = new QVBoxLayout( this );
|
||||
m_innerLayout = new QVBoxLayout();
|
||||
TomahawkUtils::unmarginLayout( m_innerLayout );
|
||||
m_innerLayout->addWidget( m_trackView, 1 );
|
||||
m_innerLayout->addStretch();
|
||||
|
@@ -566,3 +566,10 @@ GridView::onScrollTimeout()
|
||||
m_proxyModel->updateDetailedInfo( m_proxyModel->index( i, 0 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PlayableModel*
|
||||
GridView::model() const
|
||||
{
|
||||
return m_model.data();
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@ public:
|
||||
|
||||
void setProxyModel( PlayableProxyModel* model );
|
||||
|
||||
PlayableModel* model() const { return m_model; }
|
||||
PlayableModel* model() const;
|
||||
PlayableProxyModel* proxyModel() const { return m_proxyModel; }
|
||||
GridItemDelegate* delegate() const { return m_delegate; }
|
||||
|
||||
@@ -117,7 +117,7 @@ private slots:
|
||||
void verifySize();
|
||||
|
||||
private:
|
||||
PlayableModel* m_model;
|
||||
QPointer<PlayableModel> m_model;
|
||||
PlayableProxyModel* m_proxyModel;
|
||||
GridItemDelegate* m_delegate;
|
||||
AnimatedSpinner* m_loadingSpinner;
|
||||
|
@@ -137,7 +137,7 @@ private:
|
||||
bool visibilityFilterAcceptsRow( int sourceRow, const QModelIndex& sourceParent, PlayableProxyModelFilterMemo& memo ) const;
|
||||
bool lessThan( int column, const Tomahawk::query_ptr& left, const Tomahawk::query_ptr& right ) const;
|
||||
|
||||
PlayableModel* m_model;
|
||||
QPointer<PlayableModel> m_model;
|
||||
|
||||
bool m_showOfflineResults;
|
||||
bool m_hideEmptyParents;
|
||||
|
@@ -27,8 +27,6 @@
|
||||
#include <QPainter>
|
||||
#include <QToolTip>
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
|
||||
#include "Query.h"
|
||||
#include "Result.h"
|
||||
#include "Artist.h"
|
||||
@@ -673,7 +671,7 @@ PlaylistItemDelegate::drawTrack( QPainter* painter, const QStyleOptionViewItem&
|
||||
{
|
||||
painter->save();
|
||||
painter->setPen( Qt::transparent );
|
||||
painter->setBrush( Qt::darkRed );
|
||||
painter->setBrush( QColor( "#ff004c" ));
|
||||
|
||||
QRect playBar = r.adjusted( 0, r.height() + 2, 0, 0 );
|
||||
playBar.setHeight( 2 );
|
||||
|
@@ -941,3 +941,10 @@ TrackView::selectFirstTrack()
|
||||
currentChanged( idx, QModelIndex() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PlayableModel*
|
||||
TrackView::model() const
|
||||
{
|
||||
return m_model.data();
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@ public:
|
||||
virtual void setModel( QAbstractItemModel* model );
|
||||
void setProxyModel( PlayableProxyModel* model );
|
||||
|
||||
virtual PlayableModel* model() const { return m_model; }
|
||||
virtual PlayableModel* model() const;
|
||||
PlayableProxyModel* proxyModel() const { return m_proxyModel; }
|
||||
PlaylistItemDelegate* delegate() const { return m_delegate; }
|
||||
ViewHeader* header() const { return m_header; }
|
||||
@@ -143,7 +143,7 @@ private:
|
||||
void updateHoverIndex( const QPoint& pos );
|
||||
|
||||
QString m_guid;
|
||||
PlayableModel* m_model;
|
||||
QPointer<PlayableModel> m_model;
|
||||
PlayableProxyModel* m_proxyModel;
|
||||
PlaylistItemDelegate* m_delegate;
|
||||
ViewHeader* m_header;
|
||||
|
@@ -131,30 +131,6 @@ TreeModel::fetchMore( const QModelIndex& parent )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TreeModel::addAllCollections()
|
||||
{
|
||||
startLoading();
|
||||
|
||||
DatabaseCommand_AllArtists* cmd = new DatabaseCommand_AllArtists();
|
||||
|
||||
connect( cmd, SIGNAL( artists( QList<Tomahawk::artist_ptr> ) ),
|
||||
SLOT( onArtistsAdded( QList<Tomahawk::artist_ptr> ) ) );
|
||||
|
||||
Database::instance()->enqueue( Tomahawk::dbcmd_ptr( cmd ) );
|
||||
|
||||
connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), SLOT( onSourceAdded( Tomahawk::source_ptr ) ), Qt::UniqueConnection );
|
||||
|
||||
QList<Tomahawk::source_ptr> sources = SourceList::instance()->sources();
|
||||
foreach ( const source_ptr& source, sources )
|
||||
{
|
||||
connect( source->dbCollection().data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
||||
}
|
||||
|
||||
setTitle( tr( "All Artists" ) );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TreeModel::addArtists( const artist_ptr& artist )
|
||||
{
|
||||
@@ -262,25 +238,12 @@ TreeModel::addCollection( const collection_ptr& collection )
|
||||
this, SLOT( onArtistsAdded( QList< Tomahawk::artist_ptr > ) ), Qt::UniqueConnection );
|
||||
req->enqueue();
|
||||
|
||||
connect( collection.data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
||||
|
||||
setIcon( collection->bigIcon() );
|
||||
setTitle( collection->prettyName() );
|
||||
setDescription( collection->description() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TreeModel::reloadCollection()
|
||||
{
|
||||
if ( m_collection.isNull() )
|
||||
return;
|
||||
|
||||
if ( !isLoading() )
|
||||
onCollectionChanged();
|
||||
}
|
||||
|
||||
|
||||
//void
|
||||
//TreeModel::addFilteredCollection( const collection_ptr& collection, unsigned int amount, DatabaseCommand_AllArtists::SortOrder order )
|
||||
//{
|
||||
@@ -305,25 +268,6 @@ TreeModel::reloadCollection()
|
||||
//}
|
||||
|
||||
|
||||
void
|
||||
TreeModel::onSourceAdded( const Tomahawk::source_ptr& source )
|
||||
{
|
||||
connect( source->dbCollection().data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TreeModel::onCollectionChanged()
|
||||
{
|
||||
clear();
|
||||
|
||||
if ( m_collection )
|
||||
addCollection( m_collection );
|
||||
else
|
||||
addAllCollections();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TreeModel::onArtistsAdded( const QList<Tomahawk::artist_ptr>& artists )
|
||||
{
|
||||
|
@@ -51,7 +51,6 @@ public:
|
||||
|
||||
Tomahawk::collection_ptr collection() const;
|
||||
|
||||
void addAllCollections();
|
||||
void addCollection( const Tomahawk::collection_ptr& collection );
|
||||
//TODO: Unused, but will be useful for supporting filtered queries. - Teo 1/2013
|
||||
//void addFilteredCollection( const Tomahawk::collection_ptr& collection, unsigned int amount, DatabaseCommand_AllArtists::SortOrder order );
|
||||
@@ -71,7 +70,6 @@ public:
|
||||
|
||||
public slots:
|
||||
void addAlbums( const QModelIndex& parent, const QList<Tomahawk::album_ptr>& albums );
|
||||
void reloadCollection();
|
||||
|
||||
signals:
|
||||
void modeChanged( Tomahawk::ModelMode mode );
|
||||
@@ -86,9 +84,6 @@ private slots:
|
||||
void onTracksAdded( const QList<Tomahawk::query_ptr>& tracks, const QModelIndex& index );
|
||||
void onTracksFound( const QList<Tomahawk::query_ptr>& tracks, Tomahawk::ModelMode mode, Tomahawk::collection_ptr collection );
|
||||
|
||||
void onSourceAdded( const Tomahawk::source_ptr& source );
|
||||
void onCollectionChanged();
|
||||
|
||||
private:
|
||||
Tomahawk::ModelMode m_mode;
|
||||
Tomahawk::collection_ptr m_collection;
|
||||
|
@@ -45,7 +45,7 @@ TreeProxyModel::TreeProxyModel( QObject* parent )
|
||||
void
|
||||
TreeProxyModel::setSourcePlayableModel( TreeModel* model )
|
||||
{
|
||||
if ( sourceModel() )
|
||||
if ( m_model )
|
||||
{
|
||||
disconnect( m_model, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( onRowsInserted( QModelIndex, int, int ) ) );
|
||||
disconnect( m_model, SIGNAL( modelReset() ), this, SLOT( onModelReset() ) );
|
||||
@@ -54,7 +54,7 @@ TreeProxyModel::setSourcePlayableModel( TreeModel* model )
|
||||
PlayableProxyModel::setSourcePlayableModel( model );
|
||||
m_model = model;
|
||||
|
||||
if ( sourceModel() )
|
||||
if ( m_model )
|
||||
{
|
||||
connect( m_model, SIGNAL( rowsInserted( QModelIndex, int, int ) ), SLOT( onRowsInserted( QModelIndex, int, int ) ) );
|
||||
connect( m_model, SIGNAL( modelReset() ), SLOT( onModelReset() ) );
|
||||
|
@@ -78,7 +78,7 @@ private:
|
||||
Tomahawk::ArtistsRequest* m_artistsFilterCmd;
|
||||
|
||||
QString m_filter;
|
||||
TreeModel* m_model;
|
||||
QPointer<TreeModel> m_model;
|
||||
};
|
||||
|
||||
#endif // TREEPROXYMODEL_H
|
||||
|
@@ -17,7 +17,7 @@
|
||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "FlexibleTreeView.h"
|
||||
#include "CollectionViewPage.h"
|
||||
|
||||
#include <QRadioButton>
|
||||
#include <QStackedWidget>
|
||||
@@ -29,7 +29,8 @@
|
||||
#include "playlist/ColumnView.h"
|
||||
#include "playlist/TrackView.h"
|
||||
#include "playlist/GridView.h"
|
||||
#include "PlayableProxyModelPlaylistInterface.h"
|
||||
#include "playlist/PlayableProxyModelPlaylistInterface.h"
|
||||
#include "resolvers/ScriptCollection.h"
|
||||
#include "TomahawkSettings.h"
|
||||
#include "utils/ImageRegistry.h"
|
||||
#include "utils/TomahawkStyle.h"
|
||||
@@ -40,7 +41,7 @@
|
||||
using namespace Tomahawk;
|
||||
|
||||
|
||||
FlexibleTreeView::FlexibleTreeView( QWidget* parent, QWidget* extraHeader )
|
||||
CollectionViewPage::CollectionViewPage( const Tomahawk::collection_ptr& collection, QWidget* parent )
|
||||
: QWidget( parent )
|
||||
, m_header( new FilterHeader( this ) )
|
||||
, m_columnView( new ColumnView() )
|
||||
@@ -48,22 +49,16 @@ FlexibleTreeView::FlexibleTreeView( QWidget* parent, QWidget* extraHeader )
|
||||
, m_albumView( new GridView() )
|
||||
, m_model( 0 )
|
||||
, m_flatModel( 0 )
|
||||
, m_temporary( false )
|
||||
, m_albumModel( 0 )
|
||||
{
|
||||
qRegisterMetaType< FlexibleTreeViewMode >( "FlexibleTreeViewMode" );
|
||||
qRegisterMetaType< CollectionViewPageMode >( "CollectionViewPageMode" );
|
||||
|
||||
m_header->setBackgroundColor( Qt::black );
|
||||
m_header->setBackground( ImageRegistry::instance()->pixmap( RESPATH "images/collection_background_small.png", QSize( 0, 0 ) ), false );
|
||||
m_header->setBackground( ImageRegistry::instance()->pixmap( RESPATH "images/collection_background.png", QSize( 0, 0 ) ), false );
|
||||
setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultCollection, TomahawkUtils::Original, QSize( 256, 256 ) ) );
|
||||
|
||||
// m_trackView->setPlaylistInterface( m_playlistInterface );
|
||||
// m_columnView->setPlaylistInterface( m_trackView->proxyModel()->playlistInterface() );
|
||||
// m_gridView->setPlaylistInterface( m_trackView->proxyModel()->playlistInterface() );
|
||||
|
||||
/* m_columnView->setColumnHidden( PlayableModel::Age, true ); // Hide age column per default
|
||||
m_columnView->setColumnHidden( PlayableModel::Filesize, true ); // Hide filesize column per default
|
||||
m_columnView->setColumnHidden( PlayableModel::Composer, true ); // Hide composer column per default*/
|
||||
m_columnView->proxyModel()->setStyle( PlayableProxyModel::Collection );
|
||||
|
||||
m_trackView->setColumnHidden( PlayableModel::Composer, true );
|
||||
m_trackView->setColumnHidden( PlayableModel::Origin, true );
|
||||
m_trackView->setColumnHidden( PlayableModel::Score, true );
|
||||
m_trackView->setGuid( QString( "trackview/flat" ) );
|
||||
@@ -71,7 +66,6 @@ FlexibleTreeView::FlexibleTreeView( QWidget* parent, QWidget* extraHeader )
|
||||
{
|
||||
m_albumView->setAutoResize( false );
|
||||
m_albumView->setAutoFitItems( true );
|
||||
// m_albumView->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
m_albumView->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
m_albumView->setItemSize( QSize( 170, 170 + 56 ) );
|
||||
|
||||
@@ -105,14 +99,12 @@ FlexibleTreeView::FlexibleTreeView( QWidget* parent, QWidget* extraHeader )
|
||||
m_header->ui->anchor2Label->setFixedWidth( fm.width( m_header->ui->anchor2Label->text() ) + 16 );
|
||||
m_header->ui->anchor3Label->setFixedWidth( fm.width( m_header->ui->anchor3Label->text() ) + 16 );
|
||||
|
||||
NewClosure( m_header->ui->anchor1Label, SIGNAL( clicked() ), const_cast< FlexibleTreeView* >( this ), SLOT( setCurrentMode( FlexibleTreeViewMode ) ), FlexibleTreeView::Columns )->setAutoDelete( false );
|
||||
NewClosure( m_header->ui->anchor2Label, SIGNAL( clicked() ), const_cast< FlexibleTreeView* >( this ), SLOT( setCurrentMode( FlexibleTreeViewMode ) ), FlexibleTreeView::Albums )->setAutoDelete( false );
|
||||
NewClosure( m_header->ui->anchor3Label, SIGNAL( clicked() ), const_cast< FlexibleTreeView* >( this ), SLOT( setCurrentMode( FlexibleTreeViewMode ) ), FlexibleTreeView::Flat )->setAutoDelete( false );
|
||||
NewClosure( m_header->ui->anchor1Label, SIGNAL( clicked() ), const_cast< CollectionViewPage* >( this ), SLOT( setCurrentMode( CollectionViewPageMode ) ), CollectionViewPage::Columns )->setAutoDelete( false );
|
||||
NewClosure( m_header->ui->anchor2Label, SIGNAL( clicked() ), const_cast< CollectionViewPage* >( this ), SLOT( setCurrentMode( CollectionViewPageMode ) ), CollectionViewPage::Albums )->setAutoDelete( false );
|
||||
NewClosure( m_header->ui->anchor3Label, SIGNAL( clicked() ), const_cast< CollectionViewPage* >( this ), SLOT( setCurrentMode( CollectionViewPageMode ) ), CollectionViewPage::Flat )->setAutoDelete( false );
|
||||
}
|
||||
|
||||
layout()->addWidget( m_header );
|
||||
if ( extraHeader )
|
||||
layout()->addWidget( extraHeader );
|
||||
layout()->addWidget( m_stack );
|
||||
|
||||
m_stack->addWidget( m_columnView );
|
||||
@@ -120,108 +112,89 @@ FlexibleTreeView::FlexibleTreeView( QWidget* parent, QWidget* extraHeader )
|
||||
m_stack->addWidget( m_trackView );
|
||||
|
||||
connect( m_header, SIGNAL( filterTextChanged( QString ) ), SLOT( setFilter( QString ) ) );
|
||||
|
||||
loadCollection( collection );
|
||||
}
|
||||
|
||||
|
||||
FlexibleTreeView::~FlexibleTreeView()
|
||||
CollectionViewPage::~CollectionViewPage()
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FlexibleTreeView::setTrackView( TrackView* view )
|
||||
CollectionViewPage::loadCollection( const collection_ptr& collection )
|
||||
{
|
||||
if ( m_trackView )
|
||||
if ( m_collection )
|
||||
{
|
||||
m_stack->removeWidget( m_trackView );
|
||||
delete m_trackView;
|
||||
disconnect( collection.data(), SIGNAL( changed() ), this, SLOT( onCollectionChanged() ) );
|
||||
}
|
||||
|
||||
// view->setPlaylistInterface( m_playlistInterface );
|
||||
m_collection = collection;
|
||||
connect( collection.data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
||||
|
||||
m_trackView = view;
|
||||
m_stack->addWidget( view );
|
||||
onCollectionChanged();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FlexibleTreeView::setColumnView( ColumnView* view )
|
||||
CollectionViewPage::setTreeModel( TreeModel* model )
|
||||
{
|
||||
if ( m_columnView )
|
||||
{
|
||||
m_stack->removeWidget( m_columnView );
|
||||
delete m_columnView;
|
||||
}
|
||||
|
||||
connect( view, SIGNAL( destroyed( QWidget* ) ), SLOT( onWidgetDestroyed( QWidget* ) ), Qt::UniqueConnection );
|
||||
|
||||
// view->setPlaylistInterface( m_trackView->proxyModel()->playlistInterface() );
|
||||
|
||||
m_columnView = view;
|
||||
m_stack->addWidget( view );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FlexibleTreeView::setTreeModel( TreeModel* model )
|
||||
{
|
||||
if ( m_model )
|
||||
{
|
||||
disconnect( m_model, SIGNAL( changed() ), this, SLOT( onModelChanged() ) );
|
||||
delete m_model;
|
||||
}
|
||||
|
||||
QPointer<PlayableModel> oldModel = m_model;
|
||||
m_model = model;
|
||||
|
||||
// m_trackView->setPlayableModel( model );
|
||||
m_columnView->setTreeModel( model );
|
||||
|
||||
/* m_trackView->setSortingEnabled( false );
|
||||
m_trackView->sortByColumn( -1 );
|
||||
m_trackView->proxyModel()->sort( -1 );
|
||||
m_columnView->proxyModel()->sort( -1 );
|
||||
m_gridView->proxyModel()->sort( -1 );*/
|
||||
|
||||
connect( model, SIGNAL( changed() ), SLOT( onModelChanged() ), Qt::UniqueConnection );
|
||||
onModelChanged();
|
||||
|
||||
if ( oldModel )
|
||||
{
|
||||
disconnect( oldModel.data(), SIGNAL( changed() ), this, SLOT( onModelChanged() ) );
|
||||
delete oldModel.data();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FlexibleTreeView::setFlatModel( PlayableModel* model )
|
||||
CollectionViewPage::setFlatModel( PlayableModel* model )
|
||||
{
|
||||
if ( m_flatModel )
|
||||
{
|
||||
// disconnect( m_flatModel, SIGNAL( changed() ), this, SLOT( onModelChanged() ) );
|
||||
delete m_flatModel;
|
||||
}
|
||||
QPointer<PlayableModel> oldModel = m_flatModel;
|
||||
|
||||
m_flatModel = model;
|
||||
|
||||
m_trackView->setPlayableModel( model );
|
||||
|
||||
m_trackView->setSortingEnabled( true );
|
||||
m_trackView->sortByColumn( 0, Qt::AscendingOrder );
|
||||
|
||||
/* connect( model, SIGNAL( changed() ), SLOT( onModelChanged() ), Qt::UniqueConnection );
|
||||
onModelChanged();*/
|
||||
if ( oldModel )
|
||||
{
|
||||
disconnect( oldModel.data(), SIGNAL( changed() ), this, SLOT( onModelChanged() ) );
|
||||
delete oldModel.data();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FlexibleTreeView::setAlbumModel( PlayableModel* model )
|
||||
CollectionViewPage::setAlbumModel( PlayableModel* model )
|
||||
{
|
||||
QPointer<PlayableModel> oldModel = m_albumModel;
|
||||
|
||||
if ( m_albumModel )
|
||||
delete m_albumModel;
|
||||
|
||||
m_albumModel = model;
|
||||
m_albumView->setPlayableModel( model );
|
||||
|
||||
/* connect( model, SIGNAL( changed() ), SLOT( onModelChanged() ), Qt::UniqueConnection );
|
||||
* onModelChanged();*/
|
||||
if ( oldModel )
|
||||
{
|
||||
disconnect( oldModel.data(), SIGNAL( changed() ), this, SLOT( onModelChanged() ) );
|
||||
delete oldModel.data();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FlexibleTreeView::setCurrentMode( FlexibleTreeViewMode mode )
|
||||
CollectionViewPage::setCurrentMode( CollectionViewPageMode mode )
|
||||
{
|
||||
if ( m_mode != mode )
|
||||
{
|
||||
@@ -289,35 +262,35 @@ FlexibleTreeView::setCurrentMode( FlexibleTreeViewMode mode )
|
||||
|
||||
|
||||
Tomahawk::playlistinterface_ptr
|
||||
FlexibleTreeView::playlistInterface() const
|
||||
CollectionViewPage::playlistInterface() const
|
||||
{
|
||||
return m_columnView->proxyModel()->playlistInterface();
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
FlexibleTreeView::title() const
|
||||
CollectionViewPage::title() const
|
||||
{
|
||||
return m_model->title();
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
FlexibleTreeView::description() const
|
||||
CollectionViewPage::description() const
|
||||
{
|
||||
return m_model->description();
|
||||
}
|
||||
|
||||
|
||||
QPixmap
|
||||
FlexibleTreeView::pixmap() const
|
||||
CollectionViewPage::pixmap() const
|
||||
{
|
||||
return m_pixmap;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
FlexibleTreeView::jumpToCurrentTrack()
|
||||
CollectionViewPage::jumpToCurrentTrack()
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO;
|
||||
|
||||
@@ -333,7 +306,7 @@ FlexibleTreeView::jumpToCurrentTrack()
|
||||
|
||||
|
||||
bool
|
||||
FlexibleTreeView::setFilter( const QString& pattern )
|
||||
CollectionViewPage::setFilter( const QString& pattern )
|
||||
{
|
||||
ViewPage::setFilter( pattern );
|
||||
|
||||
@@ -346,27 +319,29 @@ FlexibleTreeView::setFilter( const QString& pattern )
|
||||
|
||||
|
||||
void
|
||||
FlexibleTreeView::restoreViewMode()
|
||||
CollectionViewPage::restoreViewMode()
|
||||
{
|
||||
//FIXME: needs be moved to TomahawkSettings
|
||||
TomahawkSettings::instance()->beginGroup( "ui" );
|
||||
int modeNumber = TomahawkSettings::instance()->value( "flexibleTreeViewMode", Columns ).toInt();
|
||||
m_mode = static_cast< FlexibleTreeViewMode >( modeNumber );
|
||||
m_mode = static_cast< CollectionViewPageMode >( modeNumber );
|
||||
TomahawkSettings::instance()->endGroup();
|
||||
|
||||
setCurrentMode( (FlexibleTreeViewMode)modeNumber );
|
||||
setCurrentMode( (CollectionViewPageMode)modeNumber );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FlexibleTreeView::setEmptyTip( const QString& tip )
|
||||
CollectionViewPage::setEmptyTip( const QString& tip )
|
||||
{
|
||||
m_columnView->setEmptyTip( tip );
|
||||
m_albumView->setEmptyTip( tip );
|
||||
m_trackView->setEmptyTip( tip );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FlexibleTreeView::setPixmap( const QPixmap& pixmap, bool tinted )
|
||||
CollectionViewPage::setPixmap( const QPixmap& pixmap, bool tinted )
|
||||
{
|
||||
m_pixmap = pixmap;
|
||||
m_header->setPixmap( pixmap, tinted );
|
||||
@@ -374,40 +349,50 @@ FlexibleTreeView::setPixmap( const QPixmap& pixmap, bool tinted )
|
||||
|
||||
|
||||
void
|
||||
FlexibleTreeView::onModelChanged()
|
||||
CollectionViewPage::onModelChanged()
|
||||
{
|
||||
setPixmap( m_model->icon(), false );
|
||||
m_header->setCaption( m_model->title() );
|
||||
m_header->setDescription( m_model->description() );
|
||||
|
||||
setEmptyTip( tr( "This collection is currently empty." ) );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FlexibleTreeView::onWidgetDestroyed( QWidget* widget )
|
||||
CollectionViewPage::onCollectionChanged()
|
||||
{
|
||||
Q_UNUSED( widget );
|
||||
emit destroyed( this );
|
||||
TreeModel* model = new TreeModel();
|
||||
PlayableModel* flatModel = new PlayableModel();
|
||||
PlayableModel* albumModel = new PlayableModel();
|
||||
|
||||
setTreeModel( model );
|
||||
setFlatModel( flatModel );
|
||||
setAlbumModel( albumModel );
|
||||
|
||||
model->addCollection( m_collection );
|
||||
flatModel->appendTracks( m_collection );
|
||||
albumModel->appendAlbums( m_collection );
|
||||
|
||||
if ( m_collection && m_collection->source() && m_collection->source()->isLocal() )
|
||||
{
|
||||
setEmptyTip( tr( "After you have scanned your music collection you will find your tracks right here." ) );
|
||||
}
|
||||
else
|
||||
setEmptyTip( tr( "This collection is empty." ) );
|
||||
|
||||
if ( m_collection.objectCast<ScriptCollection>() )
|
||||
m_trackView->setEmptyTip( tr( "Cloud collections aren't supported in the flat view yet. We will have them covered soon. Switch to another view to navigate them." ) );
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
FlexibleTreeView::isTemporaryPage() const
|
||||
CollectionViewPage::isTemporaryPage() const
|
||||
{
|
||||
return m_temporary;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FlexibleTreeView::setTemporaryPage( bool b )
|
||||
{
|
||||
m_temporary = b;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
FlexibleTreeView::isBeingPlayed() const
|
||||
CollectionViewPage::isBeingPlayed() const
|
||||
{
|
||||
if ( !playlistInterface() )
|
||||
return false;
|
@@ -17,8 +17,8 @@
|
||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef FLEXIBLETREEVIEW_H
|
||||
#define FLEXIBLETREEVIEW_H
|
||||
#ifndef COLLECTIONVIEWPAGE_H
|
||||
#define COLLECTIONVIEWPAGE_H
|
||||
|
||||
#include "ViewPage.h"
|
||||
#include "PlaylistInterface.h"
|
||||
@@ -34,16 +34,16 @@ class PlayableModel;
|
||||
class PlaylistModel;
|
||||
class FilterHeader;
|
||||
|
||||
class DLLEXPORT FlexibleTreeView : public QWidget, public Tomahawk::ViewPage
|
||||
class DLLEXPORT CollectionViewPage : public QWidget, public Tomahawk::ViewPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum FlexibleTreeViewMode
|
||||
enum CollectionViewPageMode
|
||||
{ Columns = 0, Albums = 1, Flat = 2 };
|
||||
|
||||
explicit FlexibleTreeView( QWidget* parent = 0, QWidget* extraHeader = 0 );
|
||||
~FlexibleTreeView();
|
||||
explicit CollectionViewPage( const Tomahawk::collection_ptr& collection, QWidget* parent = 0 );
|
||||
~CollectionViewPage();
|
||||
|
||||
virtual QWidget* widget() { return this; }
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const;
|
||||
@@ -55,13 +55,6 @@ public:
|
||||
virtual bool jumpToCurrentTrack();
|
||||
virtual bool isTemporaryPage() const;
|
||||
virtual bool isBeingPlayed() const;
|
||||
void setTemporaryPage( bool b );
|
||||
|
||||
ColumnView* columnView() const { return m_columnView; }
|
||||
TrackView* trackView() const { return m_trackView; }
|
||||
|
||||
void setColumnView( ColumnView* view );
|
||||
void setTrackView( TrackView* view );
|
||||
|
||||
void setTreeModel( TreeModel* model );
|
||||
void setFlatModel( PlayableModel* model );
|
||||
@@ -71,17 +64,19 @@ public:
|
||||
void setEmptyTip( const QString& tip );
|
||||
|
||||
public slots:
|
||||
void setCurrentMode( FlexibleTreeViewMode mode );
|
||||
void setCurrentMode( CollectionViewPageMode mode );
|
||||
virtual bool setFilter( const QString& pattern );
|
||||
void restoreViewMode(); //ViewManager calls this on every show
|
||||
|
||||
void loadCollection( const Tomahawk::collection_ptr& collection );
|
||||
|
||||
signals:
|
||||
void modeChanged( FlexibleTreeViewMode mode );
|
||||
void modeChanged( CollectionViewPageMode mode );
|
||||
void destroyed( QWidget* widget );
|
||||
|
||||
private slots:
|
||||
void onModelChanged();
|
||||
void onWidgetDestroyed( QWidget* widget );
|
||||
void onCollectionChanged();
|
||||
|
||||
private:
|
||||
FilterHeader* m_header;
|
||||
@@ -96,10 +91,11 @@ private:
|
||||
PlayableModel* m_albumModel;
|
||||
QStackedWidget* m_stack;
|
||||
|
||||
FlexibleTreeViewMode m_mode;
|
||||
bool m_temporary;
|
||||
Tomahawk::collection_ptr m_collection;
|
||||
|
||||
CollectionViewPageMode m_mode;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE( FlexibleTreeView::FlexibleTreeViewMode );
|
||||
Q_DECLARE_METATYPE( CollectionViewPage::CollectionViewPageMode );
|
||||
|
||||
#endif // FLEXIBLETREEVIEW_H
|
||||
#endif // COLLECTIONVIEWPAGE_H
|
@@ -59,9 +59,9 @@ if( APPLE )
|
||||
FILE( WRITE ${CMAKE_BINARY_DIR}/Info.plist "${edited_plist}" )
|
||||
|
||||
FILE(COPY ${CMAKE_SOURCE_DIR}/admin/mac/sparkle_pub.pem
|
||||
DESTINATION "${CMAKE_BINARY_DIR}/tomahawk.app/Contents/Resources")
|
||||
DESTINATION "${CMAKE_BINARY_DIR}/Tomahawk.app/Contents/Resources")
|
||||
|
||||
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")
|
||||
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)
|
||||
|
@@ -146,18 +146,23 @@ IF( BUILD_GUI )
|
||||
qt_wrap_ui( tomahawkUI_H ${tomahawkUI} )
|
||||
ENDIF()
|
||||
|
||||
kde4_add_app_icon( tomahawkSources "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-*.png" )
|
||||
tomahawk_add_app_icon( tomahawkSources Tomahawk "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-*.png" )
|
||||
qt_add_resources( RC_SRCS "../../resources.qrc" )
|
||||
|
||||
SET( final_src ${final_src} ${tomahawkUI_H} ${tomahawkMoc} ${tomahawkSources} ${RC_SRCS} )
|
||||
|
||||
if(APPLE)
|
||||
set(TOMAHAWK_RUNTIME_OUTPUT_NAME "Tomahawk")
|
||||
else()
|
||||
set(TOMAHAWK_RUNTIME_OUTPUT_NAME "tomahawk")
|
||||
endif()
|
||||
|
||||
ADD_EXECUTABLE( tomahawk_bin WIN32 MACOSX_BUNDLE ${final_src} )
|
||||
SET_TARGET_PROPERTIES(tomahawk_bin
|
||||
PROPERTIES
|
||||
AUTOMOC TRUE
|
||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_BINARY_DIR}/Info.plist"
|
||||
RUNTIME_OUTPUT_NAME tomahawk
|
||||
RUNTIME_OUTPUT_NAME ${TOMAHAWK_RUNTIME_OUTPUT_NAME}
|
||||
)
|
||||
|
||||
|
||||
@@ -194,7 +199,7 @@ TARGET_LINK_LIBRARIES( tomahawk_bin
|
||||
IF( APPLE )
|
||||
IF( HAVE_SPARKLE )
|
||||
MESSAGE("Sparkle Found, installing framekwork in bundle")
|
||||
INSTALL(DIRECTORY "${SPARKLE}/Versions/Current/Resources" DESTINATION "${CMAKE_BINARY_DIR}/tomahawk.app/Contents/Frameworks/Sparkle.framework")
|
||||
INSTALL(DIRECTORY "${SPARKLE}/Versions/Current/Resources" DESTINATION "${CMAKE_BINARY_DIR}/Tomahawk.app/Contents/Frameworks/Sparkle.framework")
|
||||
|
||||
ENDIF( HAVE_SPARKLE )
|
||||
ENDIF( APPLE )
|
||||
|
@@ -46,7 +46,7 @@ AccountWidget::AccountWidget( QWidget* parent )
|
||||
: QWidget( parent )
|
||||
, TomahawkUtils::DpiScaler( this )
|
||||
{
|
||||
QHBoxLayout *mainLayout = new QHBoxLayout( this );
|
||||
QHBoxLayout *mainLayout = new QHBoxLayout();
|
||||
TomahawkUtils::unmarginLayout( mainLayout );
|
||||
setLayout( mainLayout );
|
||||
setContentsMargins( 0, scaledY( 8 ), 0, scaledY( 8 ) );
|
||||
@@ -55,7 +55,7 @@ AccountWidget::AccountWidget( QWidget* parent )
|
||||
mainLayout->addWidget( m_imageLabel );
|
||||
mainLayout->setSpacing( scaledX( 4 ) );
|
||||
|
||||
QGridLayout* vLayout = new QGridLayout( this );
|
||||
QGridLayout* vLayout = new QGridLayout();
|
||||
vLayout->setSpacing( 8 );
|
||||
mainLayout->addLayout( vLayout );
|
||||
|
||||
@@ -63,7 +63,7 @@ AccountWidget::AccountWidget( QWidget* parent )
|
||||
idContainer->setAttribute( Qt::WA_TranslucentBackground, false );
|
||||
vLayout->addWidget( idContainer, 0, 0 );
|
||||
|
||||
QHBoxLayout* idContLayout = new QHBoxLayout( idContainer );
|
||||
QHBoxLayout* idContLayout = new QHBoxLayout();
|
||||
idContainer->setLayout( idContLayout );
|
||||
idContainer->setContentsMargins( 0, 0, 0, 0 );
|
||||
idContLayout->setMargin( 2 );
|
||||
@@ -96,7 +96,7 @@ AccountWidget::AccountWidget( QWidget* parent )
|
||||
m_statusToggle->setContentsMargins( 0, 0, 0, 0 );
|
||||
m_statusToggle->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
|
||||
m_statusToggle->setFixedSize( m_statusToggle->sizeHint() );
|
||||
QHBoxLayout *statusToggleLayout = new QHBoxLayout( this );
|
||||
QHBoxLayout *statusToggleLayout = new QHBoxLayout();
|
||||
vLayout->addLayout( statusToggleLayout, 0, 1, 1, 1 );
|
||||
statusToggleLayout->addStretch();
|
||||
statusToggleLayout->addWidget( m_statusToggle );
|
||||
@@ -109,7 +109,7 @@ AccountWidget::AccountWidget( QWidget* parent )
|
||||
m_inviteContainer->setContentsMargins( 1, 1, 1, 2 );
|
||||
m_inviteContainer->setAttribute( Qt::WA_TranslucentBackground, false );
|
||||
|
||||
QHBoxLayout* containerLayout = new QHBoxLayout( m_inviteContainer );
|
||||
QHBoxLayout* containerLayout = new QHBoxLayout();
|
||||
m_inviteContainer->setLayout( containerLayout );
|
||||
TomahawkUtils::unmarginLayout( containerLayout );
|
||||
containerLayout->setContentsMargins( 1, 1, 0, 0 );
|
||||
|