mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
Move implementations to source files in app
This commit is contained in:
parent
ecf0e6725d
commit
443d7519ac
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
|
||||
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:
|
||||
void configPressed( const QModelIndex& idx );
|
||||
|
||||
|
@ -266,3 +266,17 @@ SocialWidget::eventFilter( QObject* object, QEvent* 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();
|
||||
|
||||
Tomahawk::query_ptr query() const { return m_query; }
|
||||
Tomahawk::query_ptr query() const;
|
||||
void setQuery( const Tomahawk::query_ptr& query );
|
||||
|
||||
QPoint position() const { return m_position; }
|
||||
QPoint position() const;
|
||||
void setPosition( QPoint position );
|
||||
|
||||
bool shown() const;
|
||||
|
@ -782,3 +782,17 @@ TomahawkApp::instanceStarted( KDSingleApplicationGuard::Instance instance )
|
||||
else
|
||||
activate();
|
||||
}
|
||||
|
||||
|
||||
TomahawkWindow*
|
||||
TomahawkApp::mainWindow() const
|
||||
{
|
||||
return m_mainwindow;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
TomahawkApp::isTomahawkLoaded() const
|
||||
{
|
||||
return m_loaded;
|
||||
}
|
||||
|
@ -46,7 +46,6 @@ class ScanManager;
|
||||
class Servent;
|
||||
class SipHandler;
|
||||
class TomahawkSettings;
|
||||
class XMPPBot;
|
||||
class AudioControls;
|
||||
|
||||
namespace Tomahawk
|
||||
@ -87,17 +86,15 @@ public:
|
||||
void init();
|
||||
static TomahawkApp* instance();
|
||||
|
||||
XMPPBot* xmppBot() { return m_xmppBot.data(); }
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
AudioControls* audioControls();
|
||||
TomahawkWindow* mainWindow() const { return m_mainwindow; }
|
||||
TomahawkWindow* mainWindow() const;
|
||||
#endif
|
||||
|
||||
// PlatformInterface
|
||||
virtual bool loadUrl( const QString& url );
|
||||
|
||||
bool isTomahawkLoaded() const { return m_loaded; }
|
||||
bool isTomahawkLoaded() const;
|
||||
|
||||
// reimplemented from QApplication/QCoreApplication
|
||||
virtual bool notify( QObject* receiver, QEvent* e );
|
||||
@ -133,7 +130,6 @@ private:
|
||||
QWeakPointer<AudioEngine> m_audioEngine;
|
||||
QWeakPointer<Servent> m_servent;
|
||||
QWeakPointer<Tomahawk::InfoSystem::InfoSystem> m_infoSystem;
|
||||
QWeakPointer<XMPPBot> m_xmppBot;
|
||||
QWeakPointer<Tomahawk::ShortcutHandler> m_shortcutHandler;
|
||||
QWeakPointer< Tomahawk::Accounts::AccountManager > m_accountManager;
|
||||
bool m_scrubFriendlyName;
|
||||
|
@ -1318,3 +1318,17 @@ TomahawkWindow::toggleMenuBar() //SLOT
|
||||
saveSettings();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
AudioControls*
|
||||
TomahawkWindow::audioControls()
|
||||
{
|
||||
return m_audioControls;
|
||||
}
|
||||
|
||||
|
||||
SourceTreeView*
|
||||
TomahawkWindow::sourceTreeView() const
|
||||
{
|
||||
return m_sourcetree;
|
||||
}
|
||||
|
@ -76,8 +76,8 @@ public:
|
||||
TomahawkWindow( QWidget* parent = 0 );
|
||||
~TomahawkWindow();
|
||||
|
||||
AudioControls* audioControls() { return m_audioControls; }
|
||||
SourceTreeView* sourceTreeView() const { return m_sourcetree; }
|
||||
AudioControls* audioControls();
|
||||
SourceTreeView* sourceTreeView() const;
|
||||
|
||||
void setWindowTitle( const QString& title );
|
||||
|
||||
|
@ -128,3 +128,17 @@ void AnimationHelper::collapseAnimationFinished()
|
||||
{
|
||||
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:
|
||||
AnimationHelper( const QModelIndex& index, QObject *parent = 0 );
|
||||
|
||||
QSize originalSize() const { return m_startSize; }
|
||||
QSize size() const { return m_size; }
|
||||
QSize originalSize() const;
|
||||
QSize size() const;
|
||||
|
||||
bool initialized() const;
|
||||
void initialize( const QSize& startValue, const QSize& endValue, int duration );
|
||||
|
@ -674,3 +674,10 @@ SourcesModel::itemToggleExpandRequest( SourceTreeItem *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;
|
||||
|
||||
QList< Tomahawk::source_ptr > sourcesWithViewPage() const { return m_sourcesWithViewPage; }
|
||||
QList< Tomahawk::source_ptr > sourcesWithViewPage() const;
|
||||
|
||||
public slots:
|
||||
void loadSources();
|
||||
|
@ -378,3 +378,31 @@ CategoryItem::activate()
|
||||
{
|
||||
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:
|
||||
CategoryItem( SourcesModel* model, SourceTreeItem* parent, SourcesModel::CategoryType category, bool showAddItem );
|
||||
|
||||
virtual QString text() const {
|
||||
switch( m_category )
|
||||
{
|
||||
case SourcesModel::PlaylistsCategory:
|
||||
return tr( "Playlists" );
|
||||
case SourcesModel::StationsCategory:
|
||||
return tr( "Stations" );
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
virtual QString text() const;
|
||||
virtual void activate();
|
||||
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
|
||||
void insertItem( SourceTreeItem* item );
|
||||
void insertItems( QList< SourceTreeItem* > item );
|
||||
|
||||
SourcesModel::CategoryType categoryType() { return m_category; }
|
||||
SourcesModel::CategoryType categoryType();
|
||||
|
||||
private:
|
||||
SourcesModel::CategoryType m_category;
|
||||
|
@ -99,3 +99,17 @@ GenericPageItem::isBeingPlayed() const
|
||||
|
||||
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 bool willAcceptDrag( const QMimeData* data ) 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;
|
||||
|
||||
void setText( const QString& text );
|
||||
void setSortValue( int value ) { m_sortValue = value; }
|
||||
void setSortValue( int value );
|
||||
|
||||
signals:
|
||||
void activated();
|
||||
|
@ -71,3 +71,33 @@ GroupItem::text() const
|
||||
{
|
||||
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 QString text() const;
|
||||
virtual bool willAcceptDrag( const QMimeData* data ) const { Q_UNUSED( data ); return false; }
|
||||
virtual QIcon icon() const { return QIcon(); }
|
||||
virtual bool isBeingPlayed() const { return false; }
|
||||
virtual bool willAcceptDrag( const QMimeData* data ) const;
|
||||
virtual QIcon icon() const;
|
||||
virtual bool isBeingPlayed() const;
|
||||
|
||||
void checkExpandedState();
|
||||
void setDefaultExpanded( bool b ) { m_defaultExpanded = b; }
|
||||
void setDefaultExpanded( bool b );
|
||||
|
||||
public slots:
|
||||
virtual void activate();
|
||||
|
@ -57,6 +57,13 @@ LovedTracksItem::text() const
|
||||
}
|
||||
|
||||
|
||||
QIcon
|
||||
LovedTracksItem::icon() const
|
||||
{
|
||||
return QIcon( RESPATH "images/loved_playlist.png" );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
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
|
||||
LovedTracksItem::loveDroppedTracks( QList< Tomahawk::query_ptr > qrys )
|
||||
{
|
||||
foreach( Tomahawk::query_ptr qry, qrys )
|
||||
qry->setLoved( true );
|
||||
}
|
||||
|
||||
|
@ -34,15 +34,15 @@ public:
|
||||
virtual ~LovedTracksItem();
|
||||
|
||||
virtual QString text() const;
|
||||
virtual QIcon icon() const { return QIcon( RESPATH "images/loved_playlist.png" ); }
|
||||
virtual int peerSortValue() const { return m_sortValue; }
|
||||
virtual QIcon icon() const;
|
||||
virtual int peerSortValue() const;
|
||||
virtual void activate();
|
||||
|
||||
virtual bool willAcceptDrag( const QMimeData* data ) const;
|
||||
virtual DropTypes supportedDropTypes( const QMimeData* data ) const;
|
||||
virtual bool dropMimeData( const QMimeData* data, Qt::DropAction action );
|
||||
|
||||
void setSortValue( int value ) { m_sortValue = value; }
|
||||
void setSortValue( int value );
|
||||
|
||||
private slots:
|
||||
void loveDroppedTracks( QList< Tomahawk::query_ptr > qrys );
|
||||
|
@ -610,3 +610,23 @@ DynamicPlaylistItem::isBeingPlayed() const
|
||||
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();
|
||||
|
||||
// subscription management
|
||||
bool canSubscribe() const { return m_canSubscribe; }
|
||||
bool subscribed() const { return m_showSubscribed; }
|
||||
QPixmap subscribedIcon() const { return m_showSubscribed ? m_subscribedOnIcon : m_subscribedOffIcon; }
|
||||
bool canSubscribe() const;
|
||||
bool subscribed() const;
|
||||
QPixmap subscribedIcon() const;
|
||||
void setSubscribed( bool subscribed );
|
||||
bool collaborative() const;
|
||||
|
||||
|
@ -581,3 +581,31 @@ SourceItem::getRecentPlaysPage() const
|
||||
{
|
||||
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;
|
||||
|
||||
CategoryItem* stationsCategory() const { return m_stations; }
|
||||
CategoryItem* playlistsCategory() const { return m_playlists; }
|
||||
void setStationsCategory( CategoryItem* item ) { m_stations = item; }
|
||||
void setPlaylistsCategory( CategoryItem* item ) { m_playlists = item; }
|
||||
CategoryItem* stationsCategory() const;
|
||||
CategoryItem* playlistsCategory() const;
|
||||
void setStationsCategory( CategoryItem* item );
|
||||
void setPlaylistsCategory( CategoryItem* item );
|
||||
|
||||
public slots:
|
||||
virtual void activate();
|
||||
|
@ -54,3 +54,193 @@ SourceTreeItem::~SourceTreeItem()
|
||||
{
|
||||
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();
|
||||
|
||||
// generic info used by the tree model
|
||||
SourcesModel::RowType type() const { return m_type; }
|
||||
SourceTreeItem* parent() const { return m_parent; }
|
||||
SourcesModel* model() const { return m_model; }
|
||||
SourcesModel::RowType type() const;
|
||||
SourceTreeItem* parent() const;
|
||||
SourcesModel* model() const;
|
||||
|
||||
QList< SourceTreeItem* > children() const { return m_children; }
|
||||
void appendChild( SourceTreeItem* item ) { m_children.append( item ); }
|
||||
void insertChild( int index, SourceTreeItem* item ) { m_children.insert( index, item ); }
|
||||
void removeChild( SourceTreeItem* item ) { m_children.removeAll( item ); }
|
||||
QList< SourceTreeItem* > children() const;
|
||||
void appendChild( SourceTreeItem* item );
|
||||
void insertChild( int index, SourceTreeItem* item );
|
||||
void removeChild( SourceTreeItem* item );
|
||||
|
||||
// varies depending on the type of the item
|
||||
virtual QString text() const { return QString(); }
|
||||
virtual QString tooltip() const { return QString(); }
|
||||
virtual Qt::ItemFlags flags() const { return Qt::ItemIsSelectable | Qt::ItemIsEnabled; }
|
||||
virtual QIcon icon() const { return QIcon(); }
|
||||
virtual bool willAcceptDrag( const QMimeData* ) const { return false; }
|
||||
virtual bool dropMimeData( const QMimeData*, Qt::DropAction ) { return false; }
|
||||
virtual bool setData( const QVariant&, bool ) { return false; }
|
||||
virtual int peerSortValue() const { return m_peerSortValue; } // How to sort relative to peers in the tree.
|
||||
virtual int IDValue() const { return 0; }
|
||||
virtual DropTypes supportedDropTypes( const QMimeData* mimeData ) const { Q_UNUSED( mimeData ); return DropTypesNone; }
|
||||
virtual void setDropType( DropType type ) { m_dropType = type; }
|
||||
virtual DropType dropType() const { return m_dropType; }
|
||||
virtual bool isBeingPlayed() const { return false; }
|
||||
virtual QList< QAction* > customActions() const { return QList< QAction* >(); }
|
||||
virtual QString text() const;
|
||||
virtual QString tooltip() const;
|
||||
virtual Qt::ItemFlags flags() const;
|
||||
virtual QIcon icon() const;
|
||||
virtual bool willAcceptDrag( const QMimeData* ) const;
|
||||
virtual bool dropMimeData( const QMimeData*, Qt::DropAction );
|
||||
virtual bool setData( const QVariant&, bool );
|
||||
virtual int peerSortValue() const; // How to sort relative to peers in the tree.
|
||||
virtual int IDValue() const;
|
||||
virtual DropTypes supportedDropTypes( const QMimeData* mimeData ) const;
|
||||
virtual void setDropType( DropType type );
|
||||
virtual DropType dropType() const;
|
||||
virtual bool isBeingPlayed() const;
|
||||
virtual QList< QAction* > customActions() const;
|
||||
|
||||
/// 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 endRowsAdded() { emit childRowsAdded(); }
|
||||
void beginRowsRemoved( int from, int to ) { emit beginChildRowsRemoved( from, to ); }
|
||||
void endRowsRemoved() { emit childRowsRemoved(); }
|
||||
void beginRowsAdded( int from, int to );
|
||||
void endRowsAdded();
|
||||
void beginRowsRemoved( int from, int to );
|
||||
void endRowsRemoved();
|
||||
|
||||
public slots:
|
||||
virtual void activate() {}
|
||||
@ -95,8 +95,8 @@ signals:
|
||||
void childRowsRemoved();
|
||||
|
||||
protected:
|
||||
void setRowType( SourcesModel::RowType t ) { m_type = t; }
|
||||
void setParentItem( SourceTreeItem* item ) { m_parent = item; }
|
||||
void setRowType( SourcesModel::RowType t );
|
||||
void setParentItem( SourceTreeItem* item );
|
||||
|
||||
private:
|
||||
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 int peerSortValue() 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; }
|
||||
virtual bool isBeingPlayed() const { return m_page->isBeingPlayed(); }
|
||||
Tomahawk::ViewPage* page() const;
|
||||
virtual bool isBeingPlayed() const;
|
||||
|
||||
public slots:
|
||||
void removeFromList();
|
||||
|
@ -34,6 +34,11 @@
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
Api_v1::Api_v1(QxtAbstractWebSessionManager* sm, QObject* parent)
|
||||
: QxtWebSlotService(sm, parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Api_v1::auth_1( QxtWebRequestEvent* event, QString arg )
|
||||
|
@ -42,10 +42,7 @@ Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
Api_v1( QxtAbstractWebSessionManager* sm, QObject* parent = 0 )
|
||||
: QxtWebSlotService( sm, parent )
|
||||
{
|
||||
}
|
||||
Api_v1( QxtAbstractWebSessionManager* sm, QObject* parent = 0 );
|
||||
|
||||
public slots:
|
||||
// authenticating uses /auth_1
|
||||
|
@ -50,3 +50,10 @@ ContainedMenuButton::menuHidden()
|
||||
{
|
||||
setDown( false );
|
||||
}
|
||||
|
||||
|
||||
QMenu*
|
||||
ContainedMenuButton::menu() const
|
||||
{
|
||||
return m_menu;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
explicit ContainedMenuButton( QWidget *parent = 0 );
|
||||
|
||||
void setMenu( QMenu *menu );
|
||||
QMenu *menu() const { return m_menu; }
|
||||
QMenu *menu() const;
|
||||
|
||||
protected:
|
||||
void mousePressEvent( QMouseEvent *event );
|
||||
|
@ -45,21 +45,21 @@ public:
|
||||
void init();
|
||||
|
||||
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
|
||||
//to notify that the user-requested operation has completed
|
||||
void setBackChecked( bool state );
|
||||
bool backChecked() const;
|
||||
|
||||
void setKnobX( qreal x ) { m_knobX = x; repaint(); }
|
||||
qreal knobX() const { return m_knobX; }
|
||||
void setKnobX( qreal x );
|
||||
qreal knobX() const;
|
||||
|
||||
void setBaseColorTop( const QColor& color ) { m_baseColorTop = color; repaint(); }
|
||||
QColor baseColorTop() const { return m_baseColorTop; }
|
||||
void setBaseColorTop( const QColor& color );
|
||||
QColor baseColorTop() const;
|
||||
|
||||
void setBaseColorBottom( const QColor& color ) { m_baseColorBottom = color; }
|
||||
QColor baseColorBottom() const { return m_baseColorBottom; }
|
||||
void setBaseColorBottom( const QColor& color );
|
||||
QColor baseColorBottom() const;
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent* event );
|
||||
|
@ -32,7 +32,7 @@ class UnstyledFrame : public QWidget
|
||||
public:
|
||||
explicit UnstyledFrame( QWidget* parent = 0 );
|
||||
|
||||
void setFrameColor( const QColor& color ) { m_frameColor = color; repaint(); }
|
||||
void setFrameColor( const QColor& color );
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent* event );
|
||||
|
Loading…
x
Reference in New Issue
Block a user