1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 15:29:42 +01:00

Merge pull request #237 from tomahawk-player/whatsnew_0_8

"What's new in 0.8?" page
This commit is contained in:
Uwe L. Korn 2014-07-11 01:00:54 +02:00
commit 08e07b4b2c
36 changed files with 2117 additions and 103 deletions

View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
width="209.9375"
height="209.93625"
id="svg2"
xml:space="preserve"><metadata
id="metadata8"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs6"><clipPath
id="clipPath16"><path
d="m 190.352,296.129 0,-46.533 c 7.015,5.27 15.744,8.394 25.19,8.394 l 0,0 c 23.195,0 41.988,-18.797 41.988,-41.992 l 0,0 c 0,-23.186 -18.793,-41.987 -41.988,-41.987 l 0,0 c -23.19,0 -41.989,18.801 -41.989,41.987 l 0,0 0,72.744 c -25.096,-14.519 -41.985,-41.664 -41.985,-72.744 l 0,0 c 0,-46.373 37.602,-83.973 83.974,-83.973 l 0,0 c 46.38,0 83.976,37.6 83.976,83.973 l 0,0 c 0,46.381 -37.596,83.976 -83.976,83.976 l 0,0 c -8.78,0 -17.242,-1.349 -25.19,-3.845 m 12.595,-65.437 0,-29.394 c 0,-3.475 2.821,-6.296 6.299,-6.296 l 0,0 c 1.404,0 2.703,0.461 3.752,1.24 l 0,0 0,-0.002 20.12,14.619 -0.002,0.002 c 1.605,1.143 2.652,3.016 2.652,5.135 l 0,0 c 0,2.117 -1.047,3.99 -2.652,5.133 l 0,0 0.002,0.002 -20.12,14.619 0,-0.002 c -1.049,0.779 -2.348,1.24 -3.752,1.24 l 0,0 c -3.478,0 -6.299,-2.82 -6.299,-6.296"
id="path18" /></clipPath><linearGradient
x1="0"
y1="0"
x2="1"
y2="0"
id="linearGradient24"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(118.75739,118.75739,118.75739,-118.75739,156.16501,156.62248)"
spreadMethod="pad"><stop
id="stop26"
style="stop-color:#89278e;stop-opacity:1"
offset="0" /><stop
id="stop28"
style="stop-color:#e31837;stop-opacity:1"
offset="1" /></linearGradient></defs><g
transform="matrix(1.25,0,0,-1.25,-164.46,374.9675)"
id="g10"><g
id="g12"><g
clip-path="url(#clipPath16)"
id="g14"><g
id="g20"><g
id="g22"><path
d="m 190.352,296.129 0,-46.533 c 7.015,5.27 15.744,8.394 25.19,8.394 l 0,0 c 23.195,0 41.988,-18.797 41.988,-41.992 l 0,0 c 0,-23.186 -18.793,-41.987 -41.988,-41.987 l 0,0 c -23.19,0 -41.989,18.801 -41.989,41.987 l 0,0 0,72.744 c -25.096,-14.519 -41.985,-41.664 -41.985,-72.744 l 0,0 c 0,-46.373 37.602,-83.973 83.974,-83.973 l 0,0 c 46.38,0 83.976,37.6 83.976,83.973 l 0,0 c 0,46.381 -37.596,83.976 -83.976,83.976 l 0,0 c -8.78,0 -17.242,-1.349 -25.19,-3.845 m 12.595,-65.437 0,-29.394 c 0,-3.475 2.821,-6.296 6.299,-6.296 l 0,0 c 1.404,0 2.703,0.461 3.752,1.24 l 0,0 0,-0.002 20.12,14.619 -0.002,0.002 c 1.605,1.143 2.652,3.016 2.652,5.135 l 0,0 c 0,2.117 -1.047,3.99 -2.652,5.133 l 0,0 0.002,0.002 -20.12,14.619 0,-0.002 c -1.049,0.779 -2.348,1.24 -3.752,1.24 l 0,0 c -3.478,0 -6.299,-2.82 -6.299,-6.296"
id="path30"
style="fill:url(#linearGradient24);stroke:none" /></g></g></g></g></g></svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

42
data/images/ipv6-logo.svg Normal file
View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
<g>
<path fill="#00BF38" d="M256.281,498.5c-99.684,0.155-180.9-80.795-181.052-180.481c-0.011-12.94,1.369-25.977,4.141-38.74
c0.162-0.744,0.525-2.327,0.525-2.327c0.146-0.726,0.79-3.644,0.952-4.325c0.141-0.609,24.71-111.25,24.863-111.953
c0.145-0.671,9.343-42.157,9.521-42.917C128.438,57.407,187.299,13.604,255.522,13.5c68.28-0.11,127.296,43.554,140.639,103.936
c0.169,0.688,5.159,22.867,5.328,23.623c0.162,0.669,29.035,128.858,29.035,128.858c0.167,0.758,0.346,1.517,0.498,2.273
l0.947,4.135c0.188,0.815,0.373,1.617,0.545,2.441c2.81,12.735,4.233,25.744,4.256,38.684
C436.928,417.122,355.955,498.364,256.281,498.5z"/>
<path fill="#FFFFFF" d="M255.902,244.089c-40.603,0-73.646,33.052-73.646,73.662c0,40.6,33.044,73.63,73.646,73.63
c40.608,0,73.642-33.03,73.642-73.63C329.544,277.141,296.511,244.089,255.902,244.089z M231.967,259.267
c-3.593,5.248-6.675,11.689-9.101,19.035H206.57C213.243,269.973,221.969,263.356,231.967,259.267z M199.765,288.766h20.26
c-1.617,7.345-2.63,15.323-2.933,23.745h-24.158C193.638,303.999,196.041,295.996,199.765,288.766z M199.765,346.693
c-3.724-7.199-6.127-15.237-6.831-23.715h24.158c0.303,8.413,1.315,16.401,2.933,23.715H199.765z M206.563,357.178h16.303
c2.426,7.354,5.508,13.788,9.101,19.022C221.969,372.089,213.243,365.479,206.563,357.178z M250.674,379.646
c-6.209-2.943-12.272-10.889-16.657-22.468h16.657V379.646z M250.674,346.693h-19.892c-1.744-7.091-2.882-15.056-3.206-23.715
h23.098V346.693z M250.674,312.511h-23.098c0.324-8.666,1.473-16.649,3.206-23.745h19.892V312.511z M250.674,278.302h-16.65
c4.378-11.59,10.447-19.538,16.65-22.48V278.302z M312.029,288.766c3.74,7.23,6.139,15.233,6.831,23.745h-24.174
c-0.282-8.422-1.29-16.4-2.923-23.745H312.029z M305.213,278.302h-16.296c-2.415-7.346-5.491-13.787-9.105-19.035
C289.82,263.356,298.551,269.973,305.213,278.302z M261.143,255.821c6.176,2.942,12.266,10.891,16.634,22.48h-16.634V255.821z
M261.143,288.766h19.854c1.743,7.096,2.896,15.079,3.225,23.745h-23.079V288.766z M261.143,322.979h23.079
c-0.329,8.659-1.481,16.624-3.225,23.715h-19.854V322.979z M261.143,379.646v-22.468h16.65
C273.408,368.757,267.318,376.702,261.143,379.646z M279.812,376.2c3.614-5.234,6.69-11.668,9.105-19.022h16.307
C298.551,365.479,289.82,372.089,279.812,376.2z M312.029,346.693h-20.266c1.633-7.313,2.641-15.302,2.923-23.715h24.174
C318.168,331.456,315.77,339.494,312.029,346.693z"/>
<path fill="#FFFFFF" d="M255.902,173.122c-38.859,0-74.178,15.457-100.187,40.473c9.087-40.607,18.35-82.033,18.554-82.898
c7.048-33,41.371-56.926,81.633-56.926c40.289,0,74.634,24.036,81.709,57.269l5.731,25.62c1.462,6.488,7.897,10.601,14.403,9.115
c6.491-1.446,10.582-7.877,9.127-14.385l-5.706-25.487c-9.402-44.175-53.679-76.249-105.265-76.249
c-51.569,0-95.804,31.976-105.189,75.881c-35.378,158.137-36.002,160.92-36.002,160.92c-0.032,0.17-0.054,0.312-0.075,0.473
c-0.493,2.195-0.92,4.434-1.288,6.687c-0.042,0.277-0.104,0.543-0.157,0.812c-0.362,2.354-0.693,4.717-0.964,7.09
c-0.026,0.22-0.06,0.436-0.075,0.645c-0.255,2.316-0.449,4.66-0.596,7.01c-0.01,0.267-0.043,0.533-0.043,0.801
c-0.146,2.574-0.217,5.149-0.217,7.768c0,79.736,64.863,144.609,144.606,144.609c79.732,0,144.612-64.873,144.612-144.609
C400.515,237.991,335.635,173.122,255.902,173.122z M255.902,438.239c-66.443,0-120.496-54.058-120.496-120.502
c0-2.162,0.055-4.322,0.167-6.465c0.011-0.209,0.05-0.4,0.05-0.588c0.119-1.984,0.271-3.979,0.498-5.963
c0.01-0.119,0.036-0.232,0.036-0.344c0.222-2.049,0.515-4.094,0.85-6.141c0.012-0.146,0.044-0.314,0.082-0.456
c0.32-1.929,0.683-3.88,1.114-5.796c11.833-54.119,60.095-94.748,117.699-94.748c66.451,0,120.498,54.059,120.498,120.5
C376.4,384.182,322.354,438.239,255.902,438.239z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -192,5 +192,7 @@
<file>data/js/cryptojs/tripledes.js</file>
<file>data/js/cryptojs-core.js</file>
<file>data/www/index.html</file>
<file>data/images/beatsmusic.svg</file>
<file>data/images/ipv6-logo.svg</file>
</qresource>
</RCC>

View File

@ -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

View File

@ -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<PlaylistUpdaterInterface*> updaters() const { return QList<PlaylistUpdaterInterface*>(); }

View File

@ -0,0 +1,78 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2014, Uwe L. Korn <uwelk@xhochy.com>
*
* 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 "ClickableLabel.h"
#include <QApplication>
#include <QMouseEvent>
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 );
}
}
}

View File

@ -0,0 +1,57 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2014, Uwe L. Korn <uwelk@xhochy.com>
*
* 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/>.
*/
#pragma once
#ifndef CLICKABLELABEL_H
#define CLICKABLELABEL_H
#include <QLabel>
#include <QTime>
#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

View File

@ -18,9 +18,7 @@
#include "HeaderLabel.h"
#include <QApplication>
#include <QPainter>
#include <QMouseEvent>
#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 */ )
{

View File

@ -19,16 +19,14 @@
#ifndef HEADERLABEL_H
#define HEADERLABEL_H
#include <QLabel>
#include <QTime>
#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

View File

@ -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 );

View File

@ -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 );

View File

@ -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
{

View File

@ -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 );

View File

@ -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();
}

View File

@ -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;

View File

@ -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 );
}

View File

@ -46,12 +46,8 @@ public:
public slots:
void removeFromList();
signals:
bool removed();
private slots:
void linkActionTriggered( QAction* );
void pageDestroyed();
private:
Tomahawk::ViewPage* m_page;

View File

@ -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; }
};

View File

@ -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

View File

@ -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
)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,306 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2014, Uwe L. Korn <uwelk@xhochy.com>
*
* 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 "WhatsNew_0_8.h"
#include "ui_WhatsNewWidget_0_8.h"
#include "utils/ImageRegistry.h"
#include "utils/TomahawkStyle.h"
#include <QLayout>
#include <QScrollArea>
#include <QStackedWidget>
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 )

View File

@ -0,0 +1,101 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2014, Uwe L. Korn <uwelk@xhochy.com>
*
* 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 WHATSNEW_0_8_H
#define WHATSNEW_0_8_H
#include "ViewPagePlugin.h"
#include "ViewPageLazyLoader.h"
#include <QWidget>
#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

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,16 @@
<RCC>
<qresource prefix="/whatsnew_0_8">
<file>data/images/inbox-screenshot.png</file>
<file>data/images/universal-link-icon.png</file>
<file>data/images/universal-link-network.png</file>
<file>data/images/trending.png</file>
<file>data/images/beatsmusic.png</file>
<file>data/images/gmusic.png</file>
<file>data/images/gmusic-banner.png</file>
<file>data/images/design.png</file>
<file>data/images/design-screenshot.png</file>
<file>data/images/android.png</file>
<file>data/images/tomahawk-android.png</file>
<file>data/images/whatsnew.png</file>
</qresource>
</RCC>