diff --git a/data/images/beatsmusic.svg b/data/images/beatsmusic.svg new file mode 100644 index 000000000..f23df5766 --- /dev/null +++ b/data/images/beatsmusic.svg @@ -0,0 +1,45 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/data/images/ipv6-logo.svg b/data/images/ipv6-logo.svg new file mode 100644 index 000000000..aea75bdf3 --- /dev/null +++ b/data/images/ipv6-logo.svg @@ -0,0 +1,42 @@ + + + + + + + + + + diff --git a/resources.qrc b/resources.qrc index 3c36da712..12c87028c 100644 --- a/resources.qrc +++ b/resources.qrc @@ -192,5 +192,7 @@ data/js/cryptojs/tripledes.js data/js/cryptojs-core.js data/www/index.html + data/images/beatsmusic.svg + data/images/ipv6-logo.svg diff --git a/src/libtomahawk/CMakeLists.txt b/src/libtomahawk/CMakeLists.txt index d61ceba05..c6a76d67a 100644 --- a/src/libtomahawk/CMakeLists.txt +++ b/src/libtomahawk/CMakeLists.txt @@ -138,6 +138,7 @@ set( libGuiSources widgets/BreadcrumbButton.cpp widgets/ChartDataLoader.cpp widgets/CheckDirTree.cpp + widgets/ClickableLabel.cpp widgets/ComboBox.cpp widgets/ElidedLabel.cpp widgets/FadingPixmap.cpp diff --git a/src/libtomahawk/ViewPage.h b/src/libtomahawk/ViewPage.h index 4f407b44d..3c7609c53 100644 --- a/src/libtomahawk/ViewPage.h +++ b/src/libtomahawk/ViewPage.h @@ -72,6 +72,14 @@ public: virtual bool jumpToCurrentTrack() = 0; virtual bool isTemporaryPage() const { return false; } + /** + * This page is actually a constant page that will be shown on every + * restart of Tomahawk until the user selects it to be removed. + * + * The main distinction between this and isTemporaryPage() is that the + * page will not be listed in the search history. + */ + virtual bool isDeletable() const { return false; } virtual bool isBeingPlayed() const { return false; } virtual QList updaters() const { return QList(); } diff --git a/src/libtomahawk/widgets/ClickableLabel.cpp b/src/libtomahawk/widgets/ClickableLabel.cpp new file mode 100644 index 000000000..8f670ef2c --- /dev/null +++ b/src/libtomahawk/widgets/ClickableLabel.cpp @@ -0,0 +1,78 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2010-2011, Christian Muehlhaeuser + * Copyright 2014, Uwe L. Korn + * + * 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 . + */ + +#include "ClickableLabel.h" + +#include +#include + +ClickableLabel::ClickableLabel( QWidget* parent ) + : QLabel( parent ) + , m_pressed( false ) + , m_moved( false ) +{ +} + +ClickableLabel::~ClickableLabel() +{ +} + + +void +ClickableLabel::mousePressEvent( QMouseEvent* event ) +{ + QLabel::mousePressEvent( event ); + + if ( !m_moved ) + { + m_time.start(); + + m_pressed = true; + m_dragPoint = event->pos(); + } +} + + +void +ClickableLabel::mouseReleaseEvent( QMouseEvent* event ) +{ + QLabel::mouseReleaseEvent( event ); + + if ( !m_moved && m_time.elapsed() < qApp->doubleClickInterval() ) + emit clicked(); + + m_pressed = false; + m_moved = false; +} + + +void +ClickableLabel::mouseMoveEvent( QMouseEvent* event ) +{ + if ( m_pressed ) + { + QPoint delta = m_dragPoint - event->pos(); + if ( abs( delta.y() ) > 3 ) + { + m_moved = true; + emit resized( delta ); + } + } +} + diff --git a/src/libtomahawk/widgets/ClickableLabel.h b/src/libtomahawk/widgets/ClickableLabel.h new file mode 100644 index 000000000..a960dc852 --- /dev/null +++ b/src/libtomahawk/widgets/ClickableLabel.h @@ -0,0 +1,57 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2010-2011, Christian Muehlhaeuser + * Copyright 2014, Uwe L. Korn + * + * 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 . + */ + +#pragma once +#ifndef CLICKABLELABEL_H +#define CLICKABLELABEL_H + +#include +#include + +#include "DllMacro.h" + +class DLLEXPORT ClickableLabel : public QLabel +{ + Q_OBJECT + +public: + + ClickableLabel( QWidget* parent ); + virtual ~ClickableLabel(); + +signals: + + void clicked(); + void resized( const QPoint& delta ); + +public slots: + + void mousePressEvent( QMouseEvent* event ); + void mouseReleaseEvent( QMouseEvent* event ); + void mouseMoveEvent( QMouseEvent* event ); + +private: + + QPoint m_dragPoint; + bool m_pressed; + bool m_moved; + QTime m_time; +}; + +#endif // CLICKABLELABEL_H diff --git a/src/libtomahawk/widgets/HeaderLabel.cpp b/src/libtomahawk/widgets/HeaderLabel.cpp index 2e3a22561..7b681d788 100644 --- a/src/libtomahawk/widgets/HeaderLabel.cpp +++ b/src/libtomahawk/widgets/HeaderLabel.cpp @@ -18,9 +18,7 @@ #include "HeaderLabel.h" -#include #include -#include #include "utils/Logger.h" #include "utils/TomahawkStyle.h" @@ -28,10 +26,8 @@ HeaderLabel::HeaderLabel( QWidget* parent ) - : QLabel( parent ) + : ClickableLabel( parent ) , m_parent( parent ) - , m_pressed( false ) - , m_moved( false ) { QFont f( font() ); f.setBold( true ); @@ -55,49 +51,6 @@ HeaderLabel::sizeHint() const } -void -HeaderLabel::mousePressEvent( QMouseEvent* event ) -{ - QFrame::mousePressEvent( event ); - - if ( !m_moved ) - { - m_time.start(); - - m_pressed = true; - m_dragPoint = event->pos(); - } -} - - -void -HeaderLabel::mouseReleaseEvent( QMouseEvent* event ) -{ - QFrame::mouseReleaseEvent( event ); - - if ( !m_moved && m_time.elapsed() < qApp->doubleClickInterval() ) - emit clicked(); - - m_pressed = false; - m_moved = false; -} - - -void -HeaderLabel::mouseMoveEvent( QMouseEvent* event ) -{ - if ( m_pressed ) - { - QPoint delta = m_dragPoint - event->pos(); - if ( abs( delta.y() ) > 3 ) - { - m_moved = true; - emit resized( delta ); - } - } -} - - void HeaderLabel::paintEvent( QPaintEvent* /* event */ ) { diff --git a/src/libtomahawk/widgets/HeaderLabel.h b/src/libtomahawk/widgets/HeaderLabel.h index 88f244c7e..6df29fc31 100644 --- a/src/libtomahawk/widgets/HeaderLabel.h +++ b/src/libtomahawk/widgets/HeaderLabel.h @@ -19,16 +19,14 @@ #ifndef HEADERLABEL_H #define HEADERLABEL_H -#include -#include - +#include "ClickableLabel.h" #include "DllMacro.h" /** * \class HeaderLabel * \brief A styled label for use in headers. */ -class DLLEXPORT HeaderLabel : public QLabel +class DLLEXPORT HeaderLabel : public ClickableLabel { Q_OBJECT @@ -41,25 +39,12 @@ public: static int defaultFontSize(); -signals: - void clicked(); - void resized( const QPoint& delta ); - protected: // void changeEvent( QEvent* e ); void paintEvent( QPaintEvent* event ); - void mousePressEvent( QMouseEvent* event ); - void mouseReleaseEvent( QMouseEvent* event ); - void mouseMoveEvent( QMouseEvent* event ); - private: QWidget* m_parent; - QTime m_time; - - QPoint m_dragPoint; - bool m_pressed; - bool m_moved; }; #endif // HEADERLABEL_H diff --git a/src/tomahawk/sourcetree/SourceDelegate.cpp b/src/tomahawk/sourcetree/SourceDelegate.cpp index edc7ccd9b..a200276d4 100644 --- a/src/tomahawk/sourcetree/SourceDelegate.cpp +++ b/src/tomahawk/sourcetree/SourceDelegate.cpp @@ -723,10 +723,7 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co } else if ( type == SourcesModel::TemporaryPage ) { - TemporaryPageItem* gpi = qobject_cast< TemporaryPageItem* >( item ); - Q_ASSERT( gpi ); - - if ( gpi && opt.state & QStyle::State_MouseOver ) + if ( opt.state & QStyle::State_MouseOver ) { int padding = 3; m_iconHeight = ( opt.rect.height() - 2 * padding ); @@ -852,7 +849,7 @@ SourceDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, const QSt SourcesModel::RowType type = static_cast< SourcesModel::RowType >( index.data( SourcesModel::SourceTreeItemTypeRole ).toInt() ); if ( type == SourcesModel::TemporaryPage ) { - TemporaryPageItem* gpi = qobject_cast< TemporaryPageItem* >( index.data( SourcesModel::SourceTreeItemRole ).value< SourceTreeItem* >() ); + SourceTreeItem* gpi = index.data( SourcesModel::SourceTreeItemRole ).value< SourceTreeItem* >(); Q_ASSERT( gpi ); QMouseEvent* ev = static_cast< QMouseEvent* >( event ); diff --git a/src/tomahawk/sourcetree/SourcesModel.cpp b/src/tomahawk/sourcetree/SourcesModel.cpp index 81b74be9a..475d06ad9 100644 --- a/src/tomahawk/sourcetree/SourcesModel.cpp +++ b/src/tomahawk/sourcetree/SourcesModel.cpp @@ -304,23 +304,23 @@ SourcesModel::appendGroups() m_myMusicGroup = new GroupItem( this, m_rootItem, tr( "My Music" ), 3 ); InboxItem* inbox = new InboxItem( this, m_browse ); - inbox->setSortValue( 3 ); + inbox->setSortValue( 4 ); // super collection /* GenericPageItem* sc = new GenericPageItem( this, m_browse, tr( "SuperCollection" ), ImageRegistry::instance()->icon( RESPATH "images/supercollection.svg" ), boost::bind( &ViewManager::showSuperCollection, ViewManager::instance() ), boost::bind( &ViewManager::superCollectionView, ViewManager::instance() ) ); - sc->setSortValue( 4 );*/ + sc->setSortValue( 5 );*/ GenericPageItem* newReleases = new GenericPageItem( this, m_browse, tr( "New Releases" ), ImageRegistry::instance()->icon( RESPATH "images/new-releases.svg" ), boost::bind( &ViewManager::showNewReleasesPage, ViewManager::instance() ), boost::bind( &ViewManager::newReleasesWidget, ViewManager::instance() ) ); - newReleases->setSortValue( 6 ); + newReleases->setSortValue( 7 ); GenericPageItem* recent = new GenericPageItem( this, m_browse, tr( "Recently Played" ), ImageRegistry::instance()->icon( RESPATH "images/recently-played.svg" ), boost::bind( &ViewManager::showRecentPlaysPage, ViewManager::instance() ), boost::bind( &ViewManager::recentPlaysWidget, ViewManager::instance() ) ); - recent->setSortValue( 7 ); + recent->setSortValue( 8 ); m_collectionsGroup = new GroupItem( this, m_rootItem, tr( "Friends" ), 4 ); m_cloudGroup = new GroupItem( this, m_rootItem, tr( "Cloud" ), 5 ); @@ -343,6 +343,8 @@ SourcesModel::appendPageItem( const QString& name, ViewPage* page, int sortValue GenericPageItem* pageItem = new GenericPageItem( this, m_browse, page->title(), page->pixmap(), boost::bind( &ViewManager::showDynamicPage, ViewManager::instance(), name ), boost::bind( &ViewManager::dynamicPageWidget, ViewManager::instance(), name ) ); + pageItem->setDeletable( page->isDeletable() ); + if ( sortValue ) { pageItem->setSortValue( sortValue ); diff --git a/src/tomahawk/sourcetree/items/GenericPageItems.cpp b/src/tomahawk/sourcetree/items/GenericPageItems.cpp index 1748014df..fb6745726 100644 --- a/src/tomahawk/sourcetree/items/GenericPageItems.cpp +++ b/src/tomahawk/sourcetree/items/GenericPageItems.cpp @@ -116,6 +116,20 @@ GenericPageItem::isBeingPlayed() const } +void +GenericPageItem::setDeletable( bool deletable ) +{ + if ( deletable ) + { + setRowType( SourcesModel::TemporaryPage ); + } + else + { + setRowType( SourcesModel::GenericPage ); + } +} + + int GenericPageItem::peerSortValue() const { diff --git a/src/tomahawk/sourcetree/items/GenericPageItems.h b/src/tomahawk/sourcetree/items/GenericPageItems.h index 58ee3fb97..e7e50e984 100644 --- a/src/tomahawk/sourcetree/items/GenericPageItems.h +++ b/src/tomahawk/sourcetree/items/GenericPageItems.h @@ -41,6 +41,7 @@ public: virtual int peerSortValue() const; // How to sort relative to peers in the tree. virtual bool isBeingPlayed() const; + void setDeletable( bool deletable ); void setText( const QString& text ); void setSortValue( int value ); diff --git a/src/tomahawk/sourcetree/items/SourceTreeItem.cpp b/src/tomahawk/sourcetree/items/SourceTreeItem.cpp index 768a2f0cd..e2ad9fadd 100644 --- a/src/tomahawk/sourcetree/items/SourceTreeItem.cpp +++ b/src/tomahawk/sourcetree/items/SourceTreeItem.cpp @@ -261,3 +261,26 @@ SourceTreeItem::setParentItem(SourceTreeItem* item) { m_parent = item; } + +void +SourceTreeItem::removeFromList() +{ + pageDestroyed(); +} + + +void +SourceTreeItem::pageDestroyed() +{ + model()->removeSourceItemLink( this ); + + int idx = parent()->children().indexOf( this ); + parent()->beginRowsRemoved( idx, idx ); + parent()->removeChild( this ); + parent()->endRowsRemoved(); + + emit removed(); + deleteLater(); +} + + diff --git a/src/tomahawk/sourcetree/items/SourceTreeItem.h b/src/tomahawk/sourcetree/items/SourceTreeItem.h index 91a9c9e54..9f744f6ac 100644 --- a/src/tomahawk/sourcetree/items/SourceTreeItem.h +++ b/src/tomahawk/sourcetree/items/SourceTreeItem.h @@ -81,9 +81,11 @@ public: public slots: virtual void activate() {} virtual void doubleClicked() {} + virtual void removeFromList(); signals: void updated(); + bool removed(); void selectRequest( SourceTreeItem* ); void expandRequest( SourceTreeItem* ); void toggleExpandRequest( SourceTreeItem* ); @@ -100,6 +102,7 @@ protected: private slots: void checkPlayingStatus(); + void pageDestroyed(); private: SourcesModel::RowType m_type; diff --git a/src/tomahawk/sourcetree/items/TemporaryPageItem.cpp b/src/tomahawk/sourcetree/items/TemporaryPageItem.cpp index b1c6bdef4..69fbd54a4 100644 --- a/src/tomahawk/sourcetree/items/TemporaryPageItem.cpp +++ b/src/tomahawk/sourcetree/items/TemporaryPageItem.cpp @@ -131,29 +131,6 @@ TemporaryPageItem::IDValue() const } -void -TemporaryPageItem::removeFromList() -{ - pageDestroyed(); - ViewManager::instance()->destroyPage( m_page ); -} - - -void -TemporaryPageItem::pageDestroyed() -{ - model()->removeSourceItemLink( this ); - - int idx = parent()->children().indexOf( this ); - parent()->beginRowsRemoved( idx, idx ); - parent()->removeChild( this ); - parent()->endRowsRemoved(); - - emit removed(); - deleteLater(); -} - - void TemporaryPageItem::linkActionTriggered( QAction* action ) { @@ -211,3 +188,12 @@ TemporaryPageItem::isBeingPlayed() const { return m_page->isBeingPlayed(); } + + +void +TemporaryPageItem::removeFromList() +{ + SourceTreeItem::removeFromList(); + + ViewManager::instance()->destroyPage( m_page ); +} diff --git a/src/tomahawk/sourcetree/items/TemporaryPageItem.h b/src/tomahawk/sourcetree/items/TemporaryPageItem.h index 389cd1ac7..546356a4c 100644 --- a/src/tomahawk/sourcetree/items/TemporaryPageItem.h +++ b/src/tomahawk/sourcetree/items/TemporaryPageItem.h @@ -46,12 +46,8 @@ public: public slots: void removeFromList(); -signals: - bool removed(); - private slots: void linkActionTriggered( QAction* ); - void pageDestroyed(); private: Tomahawk::ViewPage* m_page; diff --git a/src/viewpages/dashboard/Dashboard.h b/src/viewpages/dashboard/Dashboard.h index 42952ecb0..9fcb0b5da 100644 --- a/src/viewpages/dashboard/Dashboard.h +++ b/src/viewpages/dashboard/Dashboard.h @@ -102,7 +102,7 @@ public: QString description() const Q_DECL_OVERRIDE { return tr( "An overview of your friends' recent activity" ); } const QString pixmapPath() const Q_DECL_OVERRIDE { return ( RESPATH "images/dashboard.svg" ); } - int sortValue() Q_DECL_OVERRIDE { return 1; } + int sortValue() Q_DECL_OVERRIDE { return 2; } bool showInfoBar() const Q_DECL_OVERRIDE { return true; } }; diff --git a/src/viewpages/networkactivity/NetworkActivity.h b/src/viewpages/networkactivity/NetworkActivity.h index 9447868d0..0e6dd554b 100644 --- a/src/viewpages/networkactivity/NetworkActivity.h +++ b/src/viewpages/networkactivity/NetworkActivity.h @@ -59,7 +59,7 @@ public: virtual const QString pixmapPath() const { return ( RESPATH "images/trending.svg" ); } virtual bool showInfoBar() const { return true; } - virtual int sortValue() { return 2; } + virtual int sortValue() { return 3; } }; } // Widgets diff --git a/src/viewpages/whatsnew_0_8/CMakeLists.txt b/src/viewpages/whatsnew_0_8/CMakeLists.txt new file mode 100644 index 000000000..dc3ae1ab5 --- /dev/null +++ b/src/viewpages/whatsnew_0_8/CMakeLists.txt @@ -0,0 +1,10 @@ +tomahawk_add_plugin(whatsnew_0_8 + TYPE viewpage + EXPORT_MACRO TOMAHAWK_VIEWPAGE_EXPORT_PRO + SOURCES + WhatsNew_0_8.cpp + UI + WhatsNewWidget_0_8.ui + LINK_LIBRARIES + tomahawk-widgets +) diff --git a/src/viewpages/whatsnew_0_8/WhatsNewWidget_0_8.ui b/src/viewpages/whatsnew_0_8/WhatsNewWidget_0_8.ui new file mode 100644 index 000000000..a8917099b --- /dev/null +++ b/src/viewpages/whatsnew_0_8/WhatsNewWidget_0_8.ui @@ -0,0 +1,1388 @@ + + + WhatsNewWidget_0_8 + + + + 0 + 0 + 965 + 600 + + + + + 0 + 0 + + + + Form + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 16 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 79 + + + + + 8 + + + 0 + + + + + + 0 + 0 + + + + + 64 + 100 + + + + border-width: 2px; +border-style: solid; +border-radius: 4px; +border-color: white; +color: white; +border-bottom: none; +border-bottom-right-radius: 0px; +border-bottom-left-radius: 0px; +background-color:#292f34; + + + + 8 + + + 8 + + + 8 + + + 8 + + + 16 + + + + + + 75 + true + + + + border-style: none; + + + Inbox + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 64 + 64 + + + + + 64 + 64 + + + + border-style:none; +margin-bottom: 4px; + + + + + + + + + + + + + + 64 + 100 + + + + border-width: 2px; +border-style: solid; +border-radius: 4px; +border-color: grey; +color: grey; + + + + 8 + + + 8 + + + + + + 75 + true + + + + border:none + + + Open URL + + + Qt::AlignCenter + + + + + + + + 64 + 64 + + + + + 64 + 64 + + + + border: none; + + + + + + :/whatsnew_0_8/data/images/universal-link-icon.png + + + true + + + + + + + + + + + 64 + 79 + + + + border-width: 2px; +border-style: solid; +border-radius: 4px; +border-color: grey; +color: grey; + + + + 8 + + + 8 + + + + + + 75 + true + + + + border: none; + + + Trending + + + Qt::AlignCenter + + + + + + + + 64 + 64 + + + + + 64 + 64 + + + + border: none; + + + + + + + + + + + + + + 64 + 100 + + + + border-width: 2px; +border-style: solid; +border-radius: 4px; +border-color: grey; +color: grey; + + + + 8 + + + 8 + + + + + + 75 + true + + + + border: none; + + + Beats + + + Qt::AlignCenter + + + + + + + + 64 + 64 + + + + + 64 + 64 + + + + border: none; + + + + + + + + + + + + + + 64 + 79 + + + + border-width: 2px; +border-style: solid; +border-radius: 4px; +border-color: grey; +color: grey; + + + + 8 + + + 8 + + + + + + 75 + true + + + + border: none; + + + GMusic + + + Qt::AlignCenter + + + + + + + + 64 + 64 + + + + + 64 + 64 + + + + border: none; + + + + + + :/whatsnew_0_8/data/images/gmusic.png + + + true + + + + + + + + + + + 64 + 79 + + + + border-width: 2px; +border-style: solid; +border-radius: 4px; +border-color: grey; +color: grey; + + + + 8 + + + 8 + + + + + + 75 + true + + + + border: none; + + + IPv6+ + + + Qt::AlignCenter + + + + + + + + 64 + 64 + + + + + 64 + 64 + + + + border: none; + + + + + + + + + + + + + + 64 + 79 + + + + border-width: 2px; +border-style: solid; +border-radius: 4px; +border-color: grey; +color: grey; + + + + 8 + + + 8 + + + + + + 75 + true + + + + border: none; + + + Design + + + Qt::AlignCenter + + + + + + + + 64 + 64 + + + + + 64 + 64 + + + + border: none; + + + + + + :/whatsnew_0_8/data/images/design.png + + + true + + + + + + + + + + + 64 + 79 + + + + border-width: 2px; +border-style: solid; +border-radius: 4px; +border-color: grey; +color: grey; + + + + 8 + + + 8 + + + + + + 75 + true + + + + border: none; + + + Android + + + Qt::AlignCenter + + + + + + + + 64 + 64 + + + + + 64 + 64 + + + + border: none; + + + + + + :/whatsnew_0_8/data/images/android.png + + + true + + + + + + + + + + + + + true + + + + 0 + 0 + + + + + 820 + 0 + + + + + 720 + 16777215 + + + + border-width: 2px; +border-style: solid; +border-radius: 4px; +border-color: white; +padding: 2px; +color: white; +background-color:#292f34; + + + + 0 + + + + border: none; + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Send your friends songs you think they should check out. Just drag and drop them onto your friend's avatar to send. All of the songs your friends send you will show up in your Inbox. + + + false + + + true + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + border-width: 1px; +border-radius: 0px; +border-style: solid; +border-color: #ccc; + + + + + + + :/whatsnew_0_8/data/images/inbox-screenshot.png + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + 0 + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 20 + 20 + + + + + + + + + border: none; + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Love that your friends and influencers are posting music links across the web and your social networks but hate that they are links for music services you don’t use? Just drag Rdio, Deezer, Beats Music and other music service URLs into Tomahawk and have them automatically play from your preferred source. + + + false + + + true + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + :/whatsnew_0_8/data/images/universal-link-network.png + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 20 + 20 + + + + + + + + + border: none; + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Get a quick look at all of the songs, playlists and artists that are trending across your network. Check out the hot songs your friends are listening to, and their playlists that are trending with their friends. Or just listen to a dynamic playlist of your network’s latest Loves, most Loved or top played songs - from last week to all-time. + + + false + + + true + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + border-width: 1px; +border-radius: 0px; +border-style: solid; +border-color: #ccc; + + + + :/whatsnew_0_8/data/images/trending.png + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 20 + 20 + + + + + + + + + border: none; + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Beats Music (recently acquired by Apple) is now available as a resolver. This means that Beats Music subscribers can enjoy Tomahawk Stations playlists from their friends that use other services, and can easily drop Spotify, Rdio and other service links into Tomahawk and have those playlists, albums and tracks stream from your Beats account. Welcome Beats Music subscribers! + + + false + + + true + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + :/whatsnew_0_8/data/images/beatsmusic.png + + + + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + + border: none; + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Google Music is another of our latest supported services - both for your music you've uploaded to the Google Music "locker" as well as their full streaming catalog for your Google Play Music All Access subscribers. + + + false + + + true + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + :/whatsnew_0_8/data/images/gmusic-banner.png + + + + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + + border: none; + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Tomahawk now supports multiple IP addresses (IPv6). This improves the discoverability and connection and between Tomahawk users on the same local network - particularly large networks often found in work and university settings. + + + false + + + true + + + + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + Display an Image here + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + border: none; + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Lots of new views - artist pages, album pages, track pages and more. A new Loved Widget shows what friends have loved tracks throughout the app. Some cleaner fonts, some new colors. Retina display support and more. + + + false + + + true + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + border-width: 1px; +border-radius: 0px; +border-style: solid; +border-color: #ccc; + + + :/whatsnew_0_8/data/images/design-screenshot.png + + + + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + + border: none; + + + + 0 + + + 0 + + + + + + border: none; + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + <html><head/><body><p>Tomahawk for Android is now in beta! The majority of the same resolvers are supported in the Android app - plus a couple of additional ones in Rdio &amp; Deezer. Create a <a href="https://hatchet.is/beta"><span style=" text-decoration: underline; color:#fff;">Hatchet</span></a> account to sync all of your playlists from your desktop to your mobile. Find current and future music influencers with Hatchet accounts (from across a range of music service providers) and follow them to discover and hear what they love. Even when you are listening to other music apps, Tomahawk can capture all of that playback data and add it to your Hatchet profile.</p></body></html> + + + false + + + true + + + + + + + + 0 + 0 + + + + + + + :/whatsnew_0_8/data/images/tomahawk-android.png + + + + + + + Qt::Vertical + + + + 20 + 10 + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 20 + 10 + + + + + + + + + + + + + + 16777215 + 1 + + + + Qt::Horizontal + + + + + + + + 16777215 + 1 + + + + Qt::Horizontal + + + + + + + + ClickableLabel + QLabel +
widgets/ClickableLabel.h
+
+
+ + + + +
diff --git a/src/viewpages/whatsnew_0_8/WhatsNew_0_8.cpp b/src/viewpages/whatsnew_0_8/WhatsNew_0_8.cpp new file mode 100644 index 000000000..981eb3586 --- /dev/null +++ b/src/viewpages/whatsnew_0_8/WhatsNew_0_8.cpp @@ -0,0 +1,306 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2014, Uwe L. Korn + * + * 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 . + */ + +#include "WhatsNew_0_8.h" +#include "ui_WhatsNewWidget_0_8.h" + +#include "utils/ImageRegistry.h" +#include "utils/TomahawkStyle.h" + +#include +#include +#include + +using namespace Tomahawk; +using namespace Tomahawk::Widgets; + +const char* activeWidgetThumbStylesheet = "QWidget {" + "border-width: 2px;" + "border-style: solid;" + "border-radius: 4px;" + "border-color: white;" + "color: white;" + "border-bottom: none;" + "border-bottom-right-radius: 0px;" + "border-bottom-left-radius: 0px;" + "background-color:#292f34;" + "}"; + +const char* inactiveWidgetThumbStylesheet = " QWidget {" + "border-width: 2px;" + "border-style: solid;" + "border-radius: 4px;" + "border-color: grey;" + "color: grey;" + "}"; + +WhatsNew_0_8::WhatsNew_0_8( QWidget* parent ) +{ + Q_UNUSED( parent ); +} + + +WhatsNew_0_8::~WhatsNew_0_8() +{ + +} + + +WhatsNewWidget_0_8::WhatsNewWidget_0_8( QWidget* parent ) + : QWidget( parent ) + , ui( new Ui::WhatsNewWidget_0_8 ) +{ + QWidget* widget = new QWidget; + ui->setupUi( widget ); + + ui->lineAbove->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) ); + ui->lineBelow->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) ); + + + { + QScrollArea* area = new QScrollArea(); + area->setWidgetResizable( true ); + area->setWidget( widget ); + + QPalette pal = palette(); + pal.setBrush( backgroundRole(), TomahawkStyle::HEADER_BACKGROUND ); + area->setPalette( pal ); + area->setAutoFillBackground( true ); + area->setFrameShape( QFrame::NoFrame ); + area->setAttribute( Qt::WA_MacShowFocusRect, 0 ); + + QVBoxLayout* layout = new QVBoxLayout(); + layout->addWidget( area ); + setLayout( layout ); + TomahawkUtils::unmarginLayout( layout ); + } + + { + QPalette pal = palette(); + pal.setBrush( backgroundRole(), TomahawkStyle::PAGE_BACKGROUND ); + ui->widget->setPalette( pal ); + ui->widget->setAutoFillBackground( true ); + } + + { + QPixmap inboxPixmap = ImageRegistry::instance()->pixmap( RESPATH "images/inbox.svg", QSize( 64, 64 ) ); + ui->inboxBoxImage->setPixmap( inboxPixmap ); + + connect( ui->inboxBoxHeader, SIGNAL( clicked() ), SLOT( inboxBoxClicked() ) ); + connect( ui->inboxBoxImage, SIGNAL( clicked() ), SLOT( inboxBoxClicked() ) ); + } + + { + connect( ui->urlLookupBoxHeader, SIGNAL( clicked() ), SLOT( urlLookupBoxClicked() ) ); + connect( ui->urlLookupBoxImage, SIGNAL( clicked() ), SLOT( urlLookupBoxClicked() ) ); + } + + { + QPixmap trendingPixmap = ImageRegistry::instance()->pixmap( RESPATH "images/trending.svg", QSize( 64, 64 ) ); + ui->trendingBoxImage->setPixmap( trendingPixmap ); + + connect( ui->trendingBoxHeader, SIGNAL( clicked() ), SLOT( trendingBoxClicked() ) ); + connect( ui->trendingBoxImage, SIGNAL( clicked() ), SLOT( trendingBoxClicked() ) ); + } + + { + QPixmap beatsPixmap = ImageRegistry::instance()->pixmap( RESPATH "images/beatsmusic.svg", QSize( 64, 64 ) ); + ui->beatsBoxImage->setPixmap( beatsPixmap ); + + connect( ui->beatsBoxHeader, SIGNAL( clicked() ), SLOT( beatsBoxClicked() ) ); + connect( ui->beatsBoxImage, SIGNAL( clicked() ), SLOT( beatsBoxClicked() ) ); + } + + { + // TODO: Add GMusic Pixmap + + connect( ui->gmusicBoxHeader, SIGNAL( clicked() ), SLOT( gmusicBoxClicked() ) ); + connect( ui->gmusicBoxImage, SIGNAL( clicked() ), SLOT( gmusicBoxClicked() ) ); + } + + { + QPixmap networkingPixmap = ImageRegistry::instance()->pixmap( RESPATH "images/ipv6-logo.svg", QSize( 64, 64 ) ); + ui->networkingBoxImage->setPixmap( networkingPixmap ); + + connect( ui->networkingBoxHeader, SIGNAL( clicked() ), SLOT( networkingBoxClicked() ) ); + connect( ui->networkingBoxImage, SIGNAL( clicked() ), SLOT( networkingBoxClicked() ) ); + } + + { + connect( ui->designBoxHeader, SIGNAL( clicked() ), SLOT( designBoxClicked() ) ); + connect( ui->designBoxImage, SIGNAL( clicked() ), SLOT( designBoxClicked() ) ); + } + + { + connect( ui->androidBoxHeader, SIGNAL( clicked() ), SLOT( androidBoxClicked() ) ); + connect( ui->androidBoxImage, SIGNAL( clicked() ), SLOT( androidBoxClicked() ) ); + } + + { + QFont font = ui->label_2->font(); + + int fontSize = TomahawkUtils::defaultFontSize() + 2; + font.setPointSize( fontSize ); + font.setFamily( "Titillium Web" ); + + ui->label_2->setFont( font ); + ui->label_3->setFont( font ); + ui->label_5->setFont( font ); + ui->label_7->setFont( font ); + ui->label_9->setFont( font ); + ui->label_11->setFont( font ); + ui->label_13->setFont( font ); + ui->label_17->setFont( font ); + } +} + + +WhatsNewWidget_0_8::~WhatsNewWidget_0_8() +{ + delete ui; +} + + +playlistinterface_ptr +WhatsNewWidget_0_8::playlistInterface() const +{ + return playlistinterface_ptr(); +} + + +bool +WhatsNewWidget_0_8::jumpToCurrentTrack() +{ + return false; +} + + +bool +WhatsNewWidget_0_8::isBeingPlayed() const +{ + return false; +} + + +void +WhatsNewWidget_0_8::changeEvent( QEvent* e ) +{ + QWidget::changeEvent( e ); + switch ( e->type() ) + { + case QEvent::LanguageChange: + ui->retranslateUi( this ); + break; + + default: + break; + } +} + + +void +WhatsNewWidget_0_8::inboxBoxClicked() +{ + activateBox( ui->inboxBox, 0 ); +} + + +void +WhatsNewWidget_0_8::urlLookupBoxClicked() +{ + activateBox( ui->urlLookupBox, 1 ); +} + + +void +WhatsNewWidget_0_8::trendingBoxClicked() +{ + activateBox( ui->trendingBox, 2 ); +} + + +void +WhatsNewWidget_0_8::beatsBoxClicked() +{ + activateBox( ui->beatsBox, 3 ); +} + + +void +WhatsNewWidget_0_8::gmusicBoxClicked() +{ + activateBox( ui->gmusicBox, 4 ); +} + + +void +WhatsNewWidget_0_8::networkingBoxClicked() +{ + activateBox( ui->networkingBox, 5 ); +} + + +void +WhatsNewWidget_0_8::designBoxClicked() +{ + activateBox( ui->designBox, 6 ); +} + + +void +WhatsNewWidget_0_8::androidBoxClicked() +{ + activateBox( ui->androidBox, 8 ); +} + + +void +WhatsNewWidget_0_8::activateBox( QWidget* widget, int activeIndex ) +{ + deactivateAllBoxes(); + + widget->layout()->setContentsMargins( 8, 8, 8, 16 ); + widget->setStyleSheet( activeWidgetThumbStylesheet ); + + ui->stackedWidget->setCurrentIndex( activeIndex ); +} + + +void +WhatsNewWidget_0_8::deactivateBox( QWidget* widget ) +{ + widget->layout()->setContentsMargins( 8, 8, 8, 8 ); + widget->setStyleSheet( inactiveWidgetThumbStylesheet ); +} + + +void +WhatsNewWidget_0_8::deactivateAllBoxes() +{ + deactivateBox( ui->inboxBox ); + deactivateBox( ui->urlLookupBox ); + deactivateBox( ui->trendingBox ); + deactivateBox( ui->beatsBox ); + deactivateBox( ui->gmusicBox ); + deactivateBox( ui->networkingBox ); + deactivateBox( ui->designBox ); + deactivateBox( ui->androidBox ); +} + + +Q_EXPORT_PLUGIN2( ViewPagePlugin, WhatsNew_0_8 ) diff --git a/src/viewpages/whatsnew_0_8/WhatsNew_0_8.h b/src/viewpages/whatsnew_0_8/WhatsNew_0_8.h new file mode 100644 index 000000000..761a2ba8c --- /dev/null +++ b/src/viewpages/whatsnew_0_8/WhatsNew_0_8.h @@ -0,0 +1,101 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2014, Uwe L. Korn + * + * 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 . + */ + +#ifndef WHATSNEW_0_8_H +#define WHATSNEW_0_8_H + +#include "ViewPagePlugin.h" +#include "ViewPageLazyLoader.h" + +#include + +#include "../ViewPageDllMacro.h" + +namespace Ui +{ + class WhatsNewWidget_0_8; +} + +namespace Tomahawk +{ +namespace Widgets +{ + + +class WhatsNewWidget_0_8 : public QWidget +{ +Q_OBJECT + +friend class WhatsNew_0_8; + +public: + WhatsNewWidget_0_8( QWidget* parent = 0 ); + virtual ~WhatsNewWidget_0_8(); + + virtual bool isBeingPlayed() const; + virtual playlistinterface_ptr playlistInterface() const; + virtual bool jumpToCurrentTrack(); + +protected: + void changeEvent( QEvent* e ); + +private slots: + void inboxBoxClicked(); + void urlLookupBoxClicked(); + void trendingBoxClicked(); + void beatsBoxClicked(); + void gmusicBoxClicked(); + void networkingBoxClicked(); + void designBoxClicked(); + void androidBoxClicked(); + +private: + void activateBox( QWidget* widget, int activeIndex ); + void deactivateBox( QWidget* widget ); + void deactivateAllBoxes(); + + Ui::WhatsNewWidget_0_8 *ui; +}; + +const QString WHATSNEW_0_8_VIEWPAGE_NAME = "whatsnew_0_8"; + +class TOMAHAWK_VIEWPAGE_EXPORT WhatsNew_0_8 : public Tomahawk::ViewPageLazyLoader< WhatsNewWidget_0_8 > +{ +Q_OBJECT +Q_INTERFACES( Tomahawk::ViewPagePlugin ) +Q_PLUGIN_METADATA( IID "org.tomahawk-player.Player.ViewPagePlugin" ) + +public: + WhatsNew_0_8( QWidget* parent = 0 ); + virtual ~WhatsNew_0_8(); + + const QString defaultName() { return WHATSNEW_0_8_VIEWPAGE_NAME; } + QString title() const { return tr( "What's new in 0.8?" ); } + QString description() const { return tr( "An overview of the changes and additions since 0.7." ); } + const QString pixmapPath() const { return ( ":/whatsnew_0_8/data/images/whatsnew.png" ); } + bool isDeletable() const { return true; } + + int sortValue() { return 1; } + + bool showInfoBar() const { return true; } +}; + + +} // Widgets +} // Tomahawk +#endif // WHATSNEW_0_8_H diff --git a/src/viewpages/whatsnew_0_8/data/images/android.png b/src/viewpages/whatsnew_0_8/data/images/android.png new file mode 100644 index 000000000..dbabc70b6 Binary files /dev/null and b/src/viewpages/whatsnew_0_8/data/images/android.png differ diff --git a/src/viewpages/whatsnew_0_8/data/images/beatsmusic.png b/src/viewpages/whatsnew_0_8/data/images/beatsmusic.png new file mode 100644 index 000000000..4c0133701 Binary files /dev/null and b/src/viewpages/whatsnew_0_8/data/images/beatsmusic.png differ diff --git a/src/viewpages/whatsnew_0_8/data/images/design-screenshot.png b/src/viewpages/whatsnew_0_8/data/images/design-screenshot.png new file mode 100644 index 000000000..b97147031 Binary files /dev/null and b/src/viewpages/whatsnew_0_8/data/images/design-screenshot.png differ diff --git a/src/viewpages/whatsnew_0_8/data/images/design.png b/src/viewpages/whatsnew_0_8/data/images/design.png new file mode 100644 index 000000000..5e2ff0ee0 Binary files /dev/null and b/src/viewpages/whatsnew_0_8/data/images/design.png differ diff --git a/src/viewpages/whatsnew_0_8/data/images/gmusic-banner.png b/src/viewpages/whatsnew_0_8/data/images/gmusic-banner.png new file mode 100644 index 000000000..bd60f4aa8 Binary files /dev/null and b/src/viewpages/whatsnew_0_8/data/images/gmusic-banner.png differ diff --git a/src/viewpages/whatsnew_0_8/data/images/gmusic.png b/src/viewpages/whatsnew_0_8/data/images/gmusic.png new file mode 100644 index 000000000..eebd719c1 Binary files /dev/null and b/src/viewpages/whatsnew_0_8/data/images/gmusic.png differ diff --git a/src/viewpages/whatsnew_0_8/data/images/inbox-screenshot.png b/src/viewpages/whatsnew_0_8/data/images/inbox-screenshot.png new file mode 100644 index 000000000..49fd6507e Binary files /dev/null and b/src/viewpages/whatsnew_0_8/data/images/inbox-screenshot.png differ diff --git a/src/viewpages/whatsnew_0_8/data/images/tomahawk-android.png b/src/viewpages/whatsnew_0_8/data/images/tomahawk-android.png new file mode 100644 index 000000000..9a0fa5284 Binary files /dev/null and b/src/viewpages/whatsnew_0_8/data/images/tomahawk-android.png differ diff --git a/src/viewpages/whatsnew_0_8/data/images/trending.png b/src/viewpages/whatsnew_0_8/data/images/trending.png new file mode 100644 index 000000000..b29525466 Binary files /dev/null and b/src/viewpages/whatsnew_0_8/data/images/trending.png differ diff --git a/src/viewpages/whatsnew_0_8/data/images/universal-link-icon.png b/src/viewpages/whatsnew_0_8/data/images/universal-link-icon.png new file mode 100644 index 000000000..9b955fa46 Binary files /dev/null and b/src/viewpages/whatsnew_0_8/data/images/universal-link-icon.png differ diff --git a/src/viewpages/whatsnew_0_8/data/images/universal-link-network.png b/src/viewpages/whatsnew_0_8/data/images/universal-link-network.png new file mode 100644 index 000000000..f5ba82c50 Binary files /dev/null and b/src/viewpages/whatsnew_0_8/data/images/universal-link-network.png differ diff --git a/src/viewpages/whatsnew_0_8/data/images/whatsnew.png b/src/viewpages/whatsnew_0_8/data/images/whatsnew.png new file mode 100644 index 000000000..2691ee1a5 Binary files /dev/null and b/src/viewpages/whatsnew_0_8/data/images/whatsnew.png differ diff --git a/src/viewpages/whatsnew_0_8/resources.qrc b/src/viewpages/whatsnew_0_8/resources.qrc new file mode 100644 index 000000000..1f14da7f2 --- /dev/null +++ b/src/viewpages/whatsnew_0_8/resources.qrc @@ -0,0 +1,16 @@ + + + data/images/inbox-screenshot.png + data/images/universal-link-icon.png + data/images/universal-link-network.png + data/images/trending.png + data/images/beatsmusic.png + data/images/gmusic.png + data/images/gmusic-banner.png + data/images/design.png + data/images/design-screenshot.png + data/images/android.png + data/images/tomahawk-android.png + data/images/whatsnew.png + +