Merge pull request #237 from tomahawk-player/whatsnew_0_8
"What's new in 0.8?" page
@@ -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
|
||||
|
@@ -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*>(); }
|
||||
|
78
src/libtomahawk/widgets/ClickableLabel.cpp
Normal 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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
57
src/libtomahawk/widgets/ClickableLabel.h
Normal 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
|
@@ -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 */ )
|
||||
{
|
||||
|
@@ -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
|
||||
|
@@ -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 );
|
||||
|
||||
|
@@ -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 );
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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 );
|
||||
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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 );
|
||||
}
|
||||
|
@@ -46,12 +46,8 @@ public:
|
||||
public slots:
|
||||
void removeFromList();
|
||||
|
||||
signals:
|
||||
bool removed();
|
||||
|
||||
private slots:
|
||||
void linkActionTriggered( QAction* );
|
||||
void pageDestroyed();
|
||||
|
||||
private:
|
||||
Tomahawk::ViewPage* m_page;
|
||||
|
@@ -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; }
|
||||
};
|
||||
|
@@ -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
|
||||
|
10
src/viewpages/whatsnew_0_8/CMakeLists.txt
Normal 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
|
||||
)
|
1388
src/viewpages/whatsnew_0_8/WhatsNewWidget_0_8.ui
Normal file
306
src/viewpages/whatsnew_0_8/WhatsNew_0_8.cpp
Normal 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 )
|
101
src/viewpages/whatsnew_0_8/WhatsNew_0_8.h
Normal 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
|
BIN
src/viewpages/whatsnew_0_8/data/images/android.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
src/viewpages/whatsnew_0_8/data/images/beatsmusic.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
src/viewpages/whatsnew_0_8/data/images/design-screenshot.png
Normal file
After Width: | Height: | Size: 164 KiB |
BIN
src/viewpages/whatsnew_0_8/data/images/design.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
src/viewpages/whatsnew_0_8/data/images/gmusic-banner.png
Normal file
After Width: | Height: | Size: 138 KiB |
BIN
src/viewpages/whatsnew_0_8/data/images/gmusic.png
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
src/viewpages/whatsnew_0_8/data/images/inbox-screenshot.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
src/viewpages/whatsnew_0_8/data/images/tomahawk-android.png
Normal file
After Width: | Height: | Size: 116 KiB |
BIN
src/viewpages/whatsnew_0_8/data/images/trending.png
Normal file
After Width: | Height: | Size: 124 KiB |
BIN
src/viewpages/whatsnew_0_8/data/images/universal-link-icon.png
Normal file
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 41 KiB |
BIN
src/viewpages/whatsnew_0_8/data/images/whatsnew.png
Normal file
After Width: | Height: | Size: 15 KiB |
16
src/viewpages/whatsnew_0_8/resources.qrc
Normal 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>
|