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..74c3de421 --- /dev/null +++ b/src/viewpages/whatsnew_0_8/WhatsNewWidget_0_8.ui @@ -0,0 +1,117 @@ + + + WhatsNewWidget_0_8 + + + + 0 + 0 + 965 + 616 + + + + Form + + + + 0 + + + 0 + + + + + + 0 + + + 0 + + + 16 + + + 0 + + + 16 + + + + + 12 + + + 0 + + + 12 + + + 0 + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 4 + + + 8 + + + 4 + + + 8 + + + 4 + + + + + + + + + + + + + + 16777215 + 1 + + + + Qt::Horizontal + + + + + + + + 16777215 + 1 + + + + Qt::Horizontal + + + + + + + + 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..d2d081776 --- /dev/null +++ b/src/viewpages/whatsnew_0_8/WhatsNew_0_8.cpp @@ -0,0 +1,145 @@ +/* === 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 "libtomahawk-widgets/PlaylistDelegate.h" + +#include "ViewManager.h" +#include "SourceList.h" +#include "TomahawkSettings.h" +#include "widgets/RecentPlaylistsModel.h" +#include "widgets/RecentlyPlayedPlaylistsModel.h" +#include "MetaPlaylistInterface.h" +#include "audio/AudioEngine.h" +#include "playlist/AlbumModel.h" +#include "playlist/RecentlyPlayedModel.h" +#include "playlist/dynamic/GeneratorInterface.h" +#include "widgets/OverlayWidget.h" +#include "widgets/BasicHeader.h" +#include "utils/ImageRegistry.h" +#include "utils/AnimatedSpinner.h" +#include "utils/TomahawkStyle.h" +#include "utils/TomahawkUtilsGui.h" +#include "utils/Logger.h" +#include "utils/DpiScaler.h" + +#include +#include + +#define HISTORY_PLAYLIST_ITEMS 10 +#define HISTORY_TRACK_ITEMS 15 + +using namespace Tomahawk; +using namespace Tomahawk::Widgets; + + +WhatsNew_0_8::WhatsNew_0_8( QWidget* 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->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); + 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 ); + } +} + + +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; + } +} + + +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..3caf78b6b --- /dev/null +++ b/src/viewpages/whatsnew_0_8/WhatsNew_0_8.h @@ -0,0 +1,99 @@ +/* === 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 "PlaylistInterface.h" + +#include "Query.h" +#include "Source.h" +#include "ViewPagePlugin.h" +#include "ViewPageLazyLoader.h" + +#include "utils/TomahawkUtilsGui.h" + +#include +#include +#include + +#include "../ViewPageDllMacro.h" + +class AlbumModel; +class RecentlyPlayedModel; +class OverlayWidget; +class BasicHeader; + +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: + 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(); + + virtual const QString defaultName() { return WHATSNEW_0_8_VIEWPAGE_NAME; } + virtual QString title() const { return tr( "What's new in Tomahawk 0.8?" ); } + virtual QString description() const { return tr( "An overview of the changes and additions since 0.7." ); } + virtual const QString pixmapPath() const { return ( RESPATH "images/dashboard.svg" ); } + + virtual int sortValue() { return 1; } + + virtual bool showInfoBar() const { return true; } +}; + + +} // Widgets +} // Tomahawk +#endif // WHATSNEW_0_8_H