mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
Move implementations to source files in app
This commit is contained in:
25
src/ConfigDelegateBase.cpp
Normal file
25
src/ConfigDelegateBase.cpp
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
Copyright (C) 2011 Leo Franchi <leo.franchi@kdab.com>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ConfigDelegateBase.h"
|
||||||
|
|
||||||
|
|
||||||
|
QList< int >
|
||||||
|
ConfigDelegateBase::extraCheckRoles() const
|
||||||
|
{
|
||||||
|
return QList<int>();
|
||||||
|
}
|
@@ -40,7 +40,7 @@ public:
|
|||||||
// if you want to use a config wrench, you need to have this say where to paint it
|
// if you want to use a config wrench, you need to have this say where to paint it
|
||||||
virtual QRect configRectForIndex( const QStyleOptionViewItem& option, const QModelIndex& idx ) const = 0;
|
virtual QRect configRectForIndex( const QStyleOptionViewItem& option, const QModelIndex& idx ) const = 0;
|
||||||
|
|
||||||
virtual QList<int> extraCheckRoles() const { return QList<int>(); }
|
virtual QList<int> extraCheckRoles() const;
|
||||||
signals:
|
signals:
|
||||||
void configPressed( const QModelIndex& idx );
|
void configPressed( const QModelIndex& idx );
|
||||||
|
|
||||||
|
@@ -266,3 +266,17 @@ SocialWidget::eventFilter( QObject* object, QEvent* event )
|
|||||||
|
|
||||||
return QObject::eventFilter( object, event );
|
return QObject::eventFilter( object, event );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Tomahawk::query_ptr
|
||||||
|
SocialWidget::query() const
|
||||||
|
{
|
||||||
|
return m_query;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QPoint
|
||||||
|
SocialWidget::position() const
|
||||||
|
{
|
||||||
|
return m_position;
|
||||||
|
}
|
||||||
|
@@ -39,10 +39,10 @@ public:
|
|||||||
SocialWidget( QWidget* parent );
|
SocialWidget( QWidget* parent );
|
||||||
~SocialWidget();
|
~SocialWidget();
|
||||||
|
|
||||||
Tomahawk::query_ptr query() const { return m_query; }
|
Tomahawk::query_ptr query() const;
|
||||||
void setQuery( const Tomahawk::query_ptr& query );
|
void setQuery( const Tomahawk::query_ptr& query );
|
||||||
|
|
||||||
QPoint position() const { return m_position; }
|
QPoint position() const;
|
||||||
void setPosition( QPoint position );
|
void setPosition( QPoint position );
|
||||||
|
|
||||||
bool shown() const;
|
bool shown() const;
|
||||||
|
@@ -782,3 +782,17 @@ TomahawkApp::instanceStarted( KDSingleApplicationGuard::Instance instance )
|
|||||||
else
|
else
|
||||||
activate();
|
activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TomahawkWindow*
|
||||||
|
TomahawkApp::mainWindow() const
|
||||||
|
{
|
||||||
|
return m_mainwindow;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
TomahawkApp::isTomahawkLoaded() const
|
||||||
|
{
|
||||||
|
return m_loaded;
|
||||||
|
}
|
||||||
|
@@ -46,7 +46,6 @@ class ScanManager;
|
|||||||
class Servent;
|
class Servent;
|
||||||
class SipHandler;
|
class SipHandler;
|
||||||
class TomahawkSettings;
|
class TomahawkSettings;
|
||||||
class XMPPBot;
|
|
||||||
class AudioControls;
|
class AudioControls;
|
||||||
|
|
||||||
namespace Tomahawk
|
namespace Tomahawk
|
||||||
@@ -87,17 +86,15 @@ public:
|
|||||||
void init();
|
void init();
|
||||||
static TomahawkApp* instance();
|
static TomahawkApp* instance();
|
||||||
|
|
||||||
XMPPBot* xmppBot() { return m_xmppBot.data(); }
|
|
||||||
|
|
||||||
#ifndef ENABLE_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
AudioControls* audioControls();
|
AudioControls* audioControls();
|
||||||
TomahawkWindow* mainWindow() const { return m_mainwindow; }
|
TomahawkWindow* mainWindow() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// PlatformInterface
|
// PlatformInterface
|
||||||
virtual bool loadUrl( const QString& url );
|
virtual bool loadUrl( const QString& url );
|
||||||
|
|
||||||
bool isTomahawkLoaded() const { return m_loaded; }
|
bool isTomahawkLoaded() const;
|
||||||
|
|
||||||
// reimplemented from QApplication/QCoreApplication
|
// reimplemented from QApplication/QCoreApplication
|
||||||
virtual bool notify( QObject* receiver, QEvent* e );
|
virtual bool notify( QObject* receiver, QEvent* e );
|
||||||
@@ -133,7 +130,6 @@ private:
|
|||||||
QWeakPointer<AudioEngine> m_audioEngine;
|
QWeakPointer<AudioEngine> m_audioEngine;
|
||||||
QWeakPointer<Servent> m_servent;
|
QWeakPointer<Servent> m_servent;
|
||||||
QWeakPointer<Tomahawk::InfoSystem::InfoSystem> m_infoSystem;
|
QWeakPointer<Tomahawk::InfoSystem::InfoSystem> m_infoSystem;
|
||||||
QWeakPointer<XMPPBot> m_xmppBot;
|
|
||||||
QWeakPointer<Tomahawk::ShortcutHandler> m_shortcutHandler;
|
QWeakPointer<Tomahawk::ShortcutHandler> m_shortcutHandler;
|
||||||
QWeakPointer< Tomahawk::Accounts::AccountManager > m_accountManager;
|
QWeakPointer< Tomahawk::Accounts::AccountManager > m_accountManager;
|
||||||
bool m_scrubFriendlyName;
|
bool m_scrubFriendlyName;
|
||||||
|
@@ -1318,3 +1318,17 @@ TomahawkWindow::toggleMenuBar() //SLOT
|
|||||||
saveSettings();
|
saveSettings();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
AudioControls*
|
||||||
|
TomahawkWindow::audioControls()
|
||||||
|
{
|
||||||
|
return m_audioControls;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SourceTreeView*
|
||||||
|
TomahawkWindow::sourceTreeView() const
|
||||||
|
{
|
||||||
|
return m_sourcetree;
|
||||||
|
}
|
||||||
|
@@ -76,8 +76,8 @@ public:
|
|||||||
TomahawkWindow( QWidget* parent = 0 );
|
TomahawkWindow( QWidget* parent = 0 );
|
||||||
~TomahawkWindow();
|
~TomahawkWindow();
|
||||||
|
|
||||||
AudioControls* audioControls() { return m_audioControls; }
|
AudioControls* audioControls();
|
||||||
SourceTreeView* sourceTreeView() const { return m_sourcetree; }
|
SourceTreeView* sourceTreeView() const;
|
||||||
|
|
||||||
void setWindowTitle( const QString& title );
|
void setWindowTitle( const QString& title );
|
||||||
|
|
||||||
|
@@ -128,3 +128,17 @@ void AnimationHelper::collapseAnimationFinished()
|
|||||||
{
|
{
|
||||||
emit finished( m_index );
|
emit finished( m_index );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QSize
|
||||||
|
AnimationHelper::originalSize() const
|
||||||
|
{
|
||||||
|
return m_startSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QSize
|
||||||
|
AnimationHelper::size() const
|
||||||
|
{
|
||||||
|
return m_size;
|
||||||
|
}
|
||||||
|
@@ -34,8 +34,8 @@ class AnimationHelper: public QObject
|
|||||||
public:
|
public:
|
||||||
AnimationHelper( const QModelIndex& index, QObject *parent = 0 );
|
AnimationHelper( const QModelIndex& index, QObject *parent = 0 );
|
||||||
|
|
||||||
QSize originalSize() const { return m_startSize; }
|
QSize originalSize() const;
|
||||||
QSize size() const { return m_size; }
|
QSize size() const;
|
||||||
|
|
||||||
bool initialized() const;
|
bool initialized() const;
|
||||||
void initialize( const QSize& startValue, const QSize& endValue, int duration );
|
void initialize( const QSize& startValue, const QSize& endValue, int duration );
|
||||||
|
@@ -674,3 +674,10 @@ SourcesModel::itemToggleExpandRequest( SourceTreeItem *item )
|
|||||||
{
|
{
|
||||||
emit toggleExpandRequest( QPersistentModelIndex( indexFromItem( item ) ) );
|
emit toggleExpandRequest( QPersistentModelIndex( indexFromItem( item ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QList< source_ptr >
|
||||||
|
SourcesModel::sourcesWithViewPage() const
|
||||||
|
{
|
||||||
|
return m_sourcesWithViewPage;
|
||||||
|
}
|
||||||
|
@@ -108,7 +108,7 @@ public:
|
|||||||
|
|
||||||
QModelIndex indexFromItem( SourceTreeItem* item ) const;
|
QModelIndex indexFromItem( SourceTreeItem* item ) const;
|
||||||
|
|
||||||
QList< Tomahawk::source_ptr > sourcesWithViewPage() const { return m_sourcesWithViewPage; }
|
QList< Tomahawk::source_ptr > sourcesWithViewPage() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void loadSources();
|
void loadSources();
|
||||||
|
@@ -378,3 +378,31 @@ CategoryItem::activate()
|
|||||||
{
|
{
|
||||||
emit toggleExpandRequest( this );
|
emit toggleExpandRequest( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString
|
||||||
|
CategoryItem::text() const
|
||||||
|
{
|
||||||
|
switch( m_category )
|
||||||
|
{
|
||||||
|
case SourcesModel::PlaylistsCategory:
|
||||||
|
return tr( "Playlists" );
|
||||||
|
case SourcesModel::StationsCategory:
|
||||||
|
return tr( "Stations" );
|
||||||
|
}
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Qt::ItemFlags
|
||||||
|
CategoryItem::flags() const
|
||||||
|
{
|
||||||
|
return Qt::ItemIsEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SourcesModel::CategoryType
|
||||||
|
CategoryItem::categoryType()
|
||||||
|
{
|
||||||
|
return m_category;
|
||||||
|
}
|
||||||
|
@@ -56,25 +56,16 @@ class CategoryItem : public SourceTreeItem
|
|||||||
public:
|
public:
|
||||||
CategoryItem( SourcesModel* model, SourceTreeItem* parent, SourcesModel::CategoryType category, bool showAddItem );
|
CategoryItem( SourcesModel* model, SourceTreeItem* parent, SourcesModel::CategoryType category, bool showAddItem );
|
||||||
|
|
||||||
virtual QString text() const {
|
virtual QString text() const;
|
||||||
switch( m_category )
|
|
||||||
{
|
|
||||||
case SourcesModel::PlaylistsCategory:
|
|
||||||
return tr( "Playlists" );
|
|
||||||
case SourcesModel::StationsCategory:
|
|
||||||
return tr( "Stations" );
|
|
||||||
}
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
virtual void activate();
|
virtual void activate();
|
||||||
virtual int peerSortValue() const;
|
virtual int peerSortValue() const;
|
||||||
virtual Qt::ItemFlags flags() const { return Qt::ItemIsEnabled; }
|
virtual Qt::ItemFlags flags() const;
|
||||||
|
|
||||||
// inserts an item at the end, but before the category add item
|
// inserts an item at the end, but before the category add item
|
||||||
void insertItem( SourceTreeItem* item );
|
void insertItem( SourceTreeItem* item );
|
||||||
void insertItems( QList< SourceTreeItem* > item );
|
void insertItems( QList< SourceTreeItem* > item );
|
||||||
|
|
||||||
SourcesModel::CategoryType categoryType() { return m_category; }
|
SourcesModel::CategoryType categoryType();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SourcesModel::CategoryType m_category;
|
SourcesModel::CategoryType m_category;
|
||||||
|
@@ -99,3 +99,17 @@ GenericPageItem::isBeingPlayed() const
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
GenericPageItem::peerSortValue() const
|
||||||
|
{
|
||||||
|
return m_sortValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
GenericPageItem::setSortValue(int value)
|
||||||
|
{
|
||||||
|
m_sortValue = value;
|
||||||
|
}
|
||||||
|
@@ -37,11 +37,11 @@ public:
|
|||||||
virtual void activate();
|
virtual void activate();
|
||||||
virtual bool willAcceptDrag( const QMimeData* data ) const;
|
virtual bool willAcceptDrag( const QMimeData* data ) const;
|
||||||
virtual QIcon icon() const;
|
virtual QIcon icon() const;
|
||||||
virtual int peerSortValue() const { return m_sortValue; } // How to sort relative to peers in the tree.
|
virtual int peerSortValue() const; // How to sort relative to peers in the tree.
|
||||||
virtual bool isBeingPlayed() const;
|
virtual bool isBeingPlayed() const;
|
||||||
|
|
||||||
void setText( const QString& text );
|
void setText( const QString& text );
|
||||||
void setSortValue( int value ) { m_sortValue = value; }
|
void setSortValue( int value );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void activated();
|
void activated();
|
||||||
|
@@ -71,3 +71,33 @@ GroupItem::text() const
|
|||||||
{
|
{
|
||||||
return m_text;
|
return m_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
GroupItem::willAcceptDrag(const QMimeData* data) const
|
||||||
|
{
|
||||||
|
Q_UNUSED( data );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QIcon
|
||||||
|
GroupItem::icon() const
|
||||||
|
{
|
||||||
|
return QIcon();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
GroupItem::isBeingPlayed() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
GroupItem::setDefaultExpanded(bool b)
|
||||||
|
{
|
||||||
|
m_defaultExpanded = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -34,12 +34,12 @@ public:
|
|||||||
virtual ~GroupItem();
|
virtual ~GroupItem();
|
||||||
|
|
||||||
virtual QString text() const;
|
virtual QString text() const;
|
||||||
virtual bool willAcceptDrag( const QMimeData* data ) const { Q_UNUSED( data ); return false; }
|
virtual bool willAcceptDrag( const QMimeData* data ) const;
|
||||||
virtual QIcon icon() const { return QIcon(); }
|
virtual QIcon icon() const;
|
||||||
virtual bool isBeingPlayed() const { return false; }
|
virtual bool isBeingPlayed() const;
|
||||||
|
|
||||||
void checkExpandedState();
|
void checkExpandedState();
|
||||||
void setDefaultExpanded( bool b ) { m_defaultExpanded = b; }
|
void setDefaultExpanded( bool b );
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void activate();
|
virtual void activate();
|
||||||
|
@@ -57,6 +57,13 @@ LovedTracksItem::text() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QIcon
|
||||||
|
LovedTracksItem::icon() const
|
||||||
|
{
|
||||||
|
return QIcon( RESPATH "images/loved_playlist.png" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
LovedTracksItem::activate()
|
LovedTracksItem::activate()
|
||||||
{
|
{
|
||||||
@@ -134,10 +141,23 @@ LovedTracksItem::dropMimeData( const QMimeData* data, Qt::DropAction action )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
LovedTracksItem::peerSortValue() const
|
||||||
|
{
|
||||||
|
return m_sortValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
LovedTracksItem::setSortValue(int value)
|
||||||
|
{
|
||||||
|
m_sortValue = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
LovedTracksItem::loveDroppedTracks( QList< Tomahawk::query_ptr > qrys )
|
LovedTracksItem::loveDroppedTracks( QList< Tomahawk::query_ptr > qrys )
|
||||||
{
|
{
|
||||||
foreach( Tomahawk::query_ptr qry, qrys )
|
foreach( Tomahawk::query_ptr qry, qrys )
|
||||||
qry->setLoved( true );
|
qry->setLoved( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -34,15 +34,15 @@ public:
|
|||||||
virtual ~LovedTracksItem();
|
virtual ~LovedTracksItem();
|
||||||
|
|
||||||
virtual QString text() const;
|
virtual QString text() const;
|
||||||
virtual QIcon icon() const { return QIcon( RESPATH "images/loved_playlist.png" ); }
|
virtual QIcon icon() const;
|
||||||
virtual int peerSortValue() const { return m_sortValue; }
|
virtual int peerSortValue() const;
|
||||||
virtual void activate();
|
virtual void activate();
|
||||||
|
|
||||||
virtual bool willAcceptDrag( const QMimeData* data ) const;
|
virtual bool willAcceptDrag( const QMimeData* data ) const;
|
||||||
virtual DropTypes supportedDropTypes( const QMimeData* data ) const;
|
virtual DropTypes supportedDropTypes( const QMimeData* data ) const;
|
||||||
virtual bool dropMimeData( const QMimeData* data, Qt::DropAction action );
|
virtual bool dropMimeData( const QMimeData* data, Qt::DropAction action );
|
||||||
|
|
||||||
void setSortValue( int value ) { m_sortValue = value; }
|
void setSortValue( int value );
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void loveDroppedTracks( QList< Tomahawk::query_ptr > qrys );
|
void loveDroppedTracks( QList< Tomahawk::query_ptr > qrys );
|
||||||
|
@@ -610,3 +610,23 @@ DynamicPlaylistItem::isBeingPlayed() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
PlaylistItem::canSubscribe() const
|
||||||
|
{
|
||||||
|
return m_canSubscribe;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
PlaylistItem::subscribed() const
|
||||||
|
{
|
||||||
|
return m_showSubscribed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QPixmap
|
||||||
|
PlaylistItem::subscribedIcon() const
|
||||||
|
{
|
||||||
|
return m_showSubscribed ? m_subscribedOnIcon : m_subscribedOffIcon;
|
||||||
|
}
|
||||||
|
@@ -43,9 +43,9 @@ public:
|
|||||||
virtual SourceTreeItem* activateCurrent();
|
virtual SourceTreeItem* activateCurrent();
|
||||||
|
|
||||||
// subscription management
|
// subscription management
|
||||||
bool canSubscribe() const { return m_canSubscribe; }
|
bool canSubscribe() const;
|
||||||
bool subscribed() const { return m_showSubscribed; }
|
bool subscribed() const;
|
||||||
QPixmap subscribedIcon() const { return m_showSubscribed ? m_subscribedOnIcon : m_subscribedOffIcon; }
|
QPixmap subscribedIcon() const;
|
||||||
void setSubscribed( bool subscribed );
|
void setSubscribed( bool subscribed );
|
||||||
bool collaborative() const;
|
bool collaborative() const;
|
||||||
|
|
||||||
|
@@ -581,3 +581,31 @@ SourceItem::getRecentPlaysPage() const
|
|||||||
{
|
{
|
||||||
return m_recentPlaysPage;
|
return m_recentPlaysPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CategoryItem*
|
||||||
|
SourceItem::stationsCategory() const
|
||||||
|
{
|
||||||
|
return m_stations;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CategoryItem*
|
||||||
|
SourceItem::playlistsCategory() const
|
||||||
|
{
|
||||||
|
return m_playlists;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SourceItem::setStationsCategory(CategoryItem* item)
|
||||||
|
{
|
||||||
|
m_stations = item;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SourceItem::setPlaylistsCategory(CategoryItem* item)
|
||||||
|
{
|
||||||
|
m_playlists = item;
|
||||||
|
}
|
||||||
|
@@ -48,10 +48,10 @@ public:
|
|||||||
|
|
||||||
Tomahawk::source_ptr source() const;
|
Tomahawk::source_ptr source() const;
|
||||||
|
|
||||||
CategoryItem* stationsCategory() const { return m_stations; }
|
CategoryItem* stationsCategory() const;
|
||||||
CategoryItem* playlistsCategory() const { return m_playlists; }
|
CategoryItem* playlistsCategory() const;
|
||||||
void setStationsCategory( CategoryItem* item ) { m_stations = item; }
|
void setStationsCategory( CategoryItem* item );
|
||||||
void setPlaylistsCategory( CategoryItem* item ) { m_playlists = item; }
|
void setPlaylistsCategory( CategoryItem* item );
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void activate();
|
virtual void activate();
|
||||||
|
@@ -54,3 +54,193 @@ SourceTreeItem::~SourceTreeItem()
|
|||||||
{
|
{
|
||||||
qDeleteAll( m_children );
|
qDeleteAll( m_children );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SourcesModel::RowType
|
||||||
|
SourceTreeItem::type() const
|
||||||
|
{
|
||||||
|
return m_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SourceTreeItem*
|
||||||
|
SourceTreeItem::parent() const
|
||||||
|
{
|
||||||
|
return m_parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SourcesModel*
|
||||||
|
SourceTreeItem::model() const
|
||||||
|
{
|
||||||
|
return m_model;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QList< SourceTreeItem* >
|
||||||
|
SourceTreeItem::children() const
|
||||||
|
{
|
||||||
|
return m_children;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SourceTreeItem::appendChild(SourceTreeItem* item)
|
||||||
|
{
|
||||||
|
m_children.append( item );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SourceTreeItem::insertChild(int index, SourceTreeItem* item)
|
||||||
|
{
|
||||||
|
m_children.insert( index, item );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SourceTreeItem::removeChild(SourceTreeItem* item)
|
||||||
|
{
|
||||||
|
m_children.removeAll( item );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString
|
||||||
|
SourceTreeItem::text() const
|
||||||
|
{
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString
|
||||||
|
SourceTreeItem::tooltip() const
|
||||||
|
{
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Qt::ItemFlags
|
||||||
|
SourceTreeItem::flags() const
|
||||||
|
{
|
||||||
|
return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QIcon
|
||||||
|
SourceTreeItem::icon() const
|
||||||
|
{
|
||||||
|
return QIcon();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
SourceTreeItem::willAcceptDrag(const QMimeData*) const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
SourceTreeItem::dropMimeData(const QMimeData*, Qt::DropAction)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
SourceTreeItem::setData(const QVariant&, bool)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
SourceTreeItem::peerSortValue() const
|
||||||
|
{
|
||||||
|
return m_peerSortValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
SourceTreeItem::IDValue() const
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SourceTreeItem::DropTypes
|
||||||
|
SourceTreeItem::supportedDropTypes(const QMimeData* mimeData) const
|
||||||
|
{
|
||||||
|
Q_UNUSED( mimeData );
|
||||||
|
return DropTypesNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SourceTreeItem::setDropType(SourceTreeItem::DropType type)
|
||||||
|
{
|
||||||
|
m_dropType = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SourceTreeItem::DropType
|
||||||
|
SourceTreeItem::dropType() const
|
||||||
|
{
|
||||||
|
return m_dropType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
SourceTreeItem::isBeingPlayed() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QList< QAction* >
|
||||||
|
SourceTreeItem::customActions() const
|
||||||
|
{
|
||||||
|
return QList< QAction* >();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SourceTreeItem::beginRowsAdded(int from, int to)
|
||||||
|
{
|
||||||
|
emit beginChildRowsAdded( from, to );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SourceTreeItem::endRowsAdded()
|
||||||
|
{
|
||||||
|
emit childRowsAdded();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SourceTreeItem::beginRowsRemoved(int from, int to)
|
||||||
|
{
|
||||||
|
emit beginChildRowsRemoved( from, to );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SourceTreeItem::endRowsRemoved()
|
||||||
|
{
|
||||||
|
emit childRowsRemoved();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SourceTreeItem::setRowType(SourcesModel::RowType t)
|
||||||
|
{
|
||||||
|
m_type = t;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SourceTreeItem::setParentItem(SourceTreeItem* item)
|
||||||
|
{
|
||||||
|
m_parent = item;
|
||||||
|
}
|
||||||
|
@@ -47,36 +47,36 @@ public:
|
|||||||
virtual ~SourceTreeItem();
|
virtual ~SourceTreeItem();
|
||||||
|
|
||||||
// generic info used by the tree model
|
// generic info used by the tree model
|
||||||
SourcesModel::RowType type() const { return m_type; }
|
SourcesModel::RowType type() const;
|
||||||
SourceTreeItem* parent() const { return m_parent; }
|
SourceTreeItem* parent() const;
|
||||||
SourcesModel* model() const { return m_model; }
|
SourcesModel* model() const;
|
||||||
|
|
||||||
QList< SourceTreeItem* > children() const { return m_children; }
|
QList< SourceTreeItem* > children() const;
|
||||||
void appendChild( SourceTreeItem* item ) { m_children.append( item ); }
|
void appendChild( SourceTreeItem* item );
|
||||||
void insertChild( int index, SourceTreeItem* item ) { m_children.insert( index, item ); }
|
void insertChild( int index, SourceTreeItem* item );
|
||||||
void removeChild( SourceTreeItem* item ) { m_children.removeAll( item ); }
|
void removeChild( SourceTreeItem* item );
|
||||||
|
|
||||||
// varies depending on the type of the item
|
// varies depending on the type of the item
|
||||||
virtual QString text() const { return QString(); }
|
virtual QString text() const;
|
||||||
virtual QString tooltip() const { return QString(); }
|
virtual QString tooltip() const;
|
||||||
virtual Qt::ItemFlags flags() const { return Qt::ItemIsSelectable | Qt::ItemIsEnabled; }
|
virtual Qt::ItemFlags flags() const;
|
||||||
virtual QIcon icon() const { return QIcon(); }
|
virtual QIcon icon() const;
|
||||||
virtual bool willAcceptDrag( const QMimeData* ) const { return false; }
|
virtual bool willAcceptDrag( const QMimeData* ) const;
|
||||||
virtual bool dropMimeData( const QMimeData*, Qt::DropAction ) { return false; }
|
virtual bool dropMimeData( const QMimeData*, Qt::DropAction );
|
||||||
virtual bool setData( const QVariant&, bool ) { return false; }
|
virtual bool setData( const QVariant&, bool );
|
||||||
virtual int peerSortValue() const { return m_peerSortValue; } // How to sort relative to peers in the tree.
|
virtual int peerSortValue() const; // How to sort relative to peers in the tree.
|
||||||
virtual int IDValue() const { return 0; }
|
virtual int IDValue() const;
|
||||||
virtual DropTypes supportedDropTypes( const QMimeData* mimeData ) const { Q_UNUSED( mimeData ); return DropTypesNone; }
|
virtual DropTypes supportedDropTypes( const QMimeData* mimeData ) const;
|
||||||
virtual void setDropType( DropType type ) { m_dropType = type; }
|
virtual void setDropType( DropType type );
|
||||||
virtual DropType dropType() const { return m_dropType; }
|
virtual DropType dropType() const;
|
||||||
virtual bool isBeingPlayed() const { return false; }
|
virtual bool isBeingPlayed() const;
|
||||||
virtual QList< QAction* > customActions() const { return QList< QAction* >(); }
|
virtual QList< QAction* > customActions() const;
|
||||||
|
|
||||||
/// don't call me unless you are a sourcetreeitem. i prefer this to making everyone a friend
|
/// don't call me unless you are a sourcetreeitem. i prefer this to making everyone a friend
|
||||||
void beginRowsAdded( int from, int to ) { emit beginChildRowsAdded( from, to ); }
|
void beginRowsAdded( int from, int to );
|
||||||
void endRowsAdded() { emit childRowsAdded(); }
|
void endRowsAdded();
|
||||||
void beginRowsRemoved( int from, int to ) { emit beginChildRowsRemoved( from, to ); }
|
void beginRowsRemoved( int from, int to );
|
||||||
void endRowsRemoved() { emit childRowsRemoved(); }
|
void endRowsRemoved();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void activate() {}
|
virtual void activate() {}
|
||||||
@@ -95,8 +95,8 @@ signals:
|
|||||||
void childRowsRemoved();
|
void childRowsRemoved();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setRowType( SourcesModel::RowType t ) { m_type = t; }
|
void setRowType( SourcesModel::RowType t );
|
||||||
void setParentItem( SourceTreeItem* item ) { m_parent = item; }
|
void setParentItem( SourceTreeItem* item );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SourcesModel::RowType m_type;
|
SourcesModel::RowType m_type;
|
||||||
|
@@ -171,3 +171,24 @@ TemporaryPageItem::linkActionTriggered( QAction* action )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QList< QAction* >
|
||||||
|
TemporaryPageItem::customActions() const
|
||||||
|
{
|
||||||
|
return m_customActions;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ViewPage*
|
||||||
|
TemporaryPageItem::page() const
|
||||||
|
{
|
||||||
|
return m_page;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
TemporaryPageItem::isBeingPlayed() const
|
||||||
|
{
|
||||||
|
return m_page->isBeingPlayed();
|
||||||
|
}
|
||||||
|
@@ -36,10 +36,10 @@ public:
|
|||||||
virtual QIcon icon() const;
|
virtual QIcon icon() const;
|
||||||
virtual int peerSortValue() const;
|
virtual int peerSortValue() const;
|
||||||
virtual int IDValue() const;
|
virtual int IDValue() const;
|
||||||
virtual QList< QAction* > customActions() const { return m_customActions; }
|
virtual QList< QAction* > customActions() const;
|
||||||
|
|
||||||
Tomahawk::ViewPage* page() const { return m_page; }
|
Tomahawk::ViewPage* page() const;
|
||||||
virtual bool isBeingPlayed() const { return m_page->isBeingPlayed(); }
|
virtual bool isBeingPlayed() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void removeFromList();
|
void removeFromList();
|
||||||
|
@@ -34,6 +34,11 @@
|
|||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
|
Api_v1::Api_v1(QxtAbstractWebSessionManager* sm, QObject* parent)
|
||||||
|
: QxtWebSlotService(sm, parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Api_v1::auth_1( QxtWebRequestEvent* event, QString arg )
|
Api_v1::auth_1( QxtWebRequestEvent* event, QString arg )
|
||||||
|
@@ -42,10 +42,7 @@ Q_OBJECT
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Api_v1( QxtAbstractWebSessionManager* sm, QObject* parent = 0 )
|
Api_v1( QxtAbstractWebSessionManager* sm, QObject* parent = 0 );
|
||||||
: QxtWebSlotService( sm, parent )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// authenticating uses /auth_1
|
// authenticating uses /auth_1
|
||||||
|
@@ -50,3 +50,10 @@ ContainedMenuButton::menuHidden()
|
|||||||
{
|
{
|
||||||
setDown( false );
|
setDown( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QMenu*
|
||||||
|
ContainedMenuButton::menu() const
|
||||||
|
{
|
||||||
|
return m_menu;
|
||||||
|
}
|
||||||
|
@@ -34,7 +34,7 @@ public:
|
|||||||
explicit ContainedMenuButton( QWidget *parent = 0 );
|
explicit ContainedMenuButton( QWidget *parent = 0 );
|
||||||
|
|
||||||
void setMenu( QMenu *menu );
|
void setMenu( QMenu *menu );
|
||||||
QMenu *menu() const { return m_menu; }
|
QMenu *menu() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mousePressEvent( QMouseEvent *event );
|
void mousePressEvent( QMouseEvent *event );
|
||||||
|
@@ -45,21 +45,21 @@ public:
|
|||||||
void init();
|
void init();
|
||||||
|
|
||||||
virtual QSize sizeHint() const;
|
virtual QSize sizeHint() const;
|
||||||
virtual QSize minimumSizeHint() const { return sizeHint(); }
|
virtual QSize minimumSizeHint() const;
|
||||||
|
|
||||||
//the back check-state cannot be changed by the user, only programmatically
|
//the back check-state cannot be changed by the user, only programmatically
|
||||||
//to notify that the user-requested operation has completed
|
//to notify that the user-requested operation has completed
|
||||||
void setBackChecked( bool state );
|
void setBackChecked( bool state );
|
||||||
bool backChecked() const;
|
bool backChecked() const;
|
||||||
|
|
||||||
void setKnobX( qreal x ) { m_knobX = x; repaint(); }
|
void setKnobX( qreal x );
|
||||||
qreal knobX() const { return m_knobX; }
|
qreal knobX() const;
|
||||||
|
|
||||||
void setBaseColorTop( const QColor& color ) { m_baseColorTop = color; repaint(); }
|
void setBaseColorTop( const QColor& color );
|
||||||
QColor baseColorTop() const { return m_baseColorTop; }
|
QColor baseColorTop() const;
|
||||||
|
|
||||||
void setBaseColorBottom( const QColor& color ) { m_baseColorBottom = color; }
|
void setBaseColorBottom( const QColor& color );
|
||||||
QColor baseColorBottom() const { return m_baseColorBottom; }
|
QColor baseColorBottom() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent( QPaintEvent* event );
|
void paintEvent( QPaintEvent* event );
|
||||||
|
@@ -32,7 +32,7 @@ class UnstyledFrame : public QWidget
|
|||||||
public:
|
public:
|
||||||
explicit UnstyledFrame( QWidget* parent = 0 );
|
explicit UnstyledFrame( QWidget* parent = 0 );
|
||||||
|
|
||||||
void setFrameColor( const QColor& color ) { m_frameColor = color; repaint(); }
|
void setFrameColor( const QColor& color );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent( QPaintEvent* event );
|
void paintEvent( QPaintEvent* event );
|
||||||
|
Reference in New Issue
Block a user