1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-05 08:32:42 +02:00

activate current page in the sourcetree if new playlist dialog is cancelled

This commit is contained in:
Leo Franchi 2011-05-28 17:10:27 -04:00
parent 9f087b7da3
commit 12ac4079b1
3 changed files with 17 additions and 13 deletions

View File

@ -78,6 +78,8 @@ CategoryAddItem::activate()
// create Auto Playlist
QString playlistName = playlistSelectorDlg.playlistName();
APP->mainWindow()->createAutomaticPlaylist( playlistName );
} else if ( !successfulReturn ) {
model()->viewPageActivated( ViewManager::instance()->currentPage() );
}
break;
@ -233,6 +235,6 @@ CategoryItem::activate()
{
if( m_category == SourcesModel::StationsCategory ) {
// TODO activate stations page
}
}
}

View File

@ -30,11 +30,13 @@
#include <QMimeData>
#include <QSize>
#include <widgets/newplaylistwidget.h>
using namespace Tomahawk;
SourcesModel::SourcesModel( QObject* parent )
: QAbstractItemModel( parent )
, m_rootItem( 0 )
, m_viewPageDelayedCacheItem( 0 )
{
m_rootItem = new SourceTreeItem( this, 0, Invalid );
@ -389,7 +391,6 @@ SourcesModel::linkSourceItemToPage( SourceTreeItem* item, ViewPage* p )
m_viewPageDelayedCacheItem = 0;
}
SourceTreeItem*
SourcesModel::itemFromIndex( const QModelIndex& idx ) const
{

View File

@ -90,16 +90,6 @@ public:
QModelIndex indexFromItem( SourceTreeItem* item ) const;
signals:
void selectRequest( const QModelIndex& idx );
private slots:
void onSourcesAdded( const QList<Tomahawk::source_ptr>& sources );
void onSourceAdded( const Tomahawk::source_ptr& source );
void onSourceRemoved( const Tomahawk::source_ptr& source );
void viewPageActivated( Tomahawk::ViewPage* );
public slots:
void loadSources();
@ -108,6 +98,17 @@ public slots:
void onItemRowsAddedDone();
void onItemRowsRemovedBegin( int first, int last );
void onItemRowsRemovedDone();
void viewPageActivated( Tomahawk::ViewPage* );
signals:
void selectRequest( const QModelIndex& idx );
private slots:
void onSourcesAdded( const QList<Tomahawk::source_ptr>& sources );
void onSourceAdded( const Tomahawk::source_ptr& source );
void onSourceRemoved( const Tomahawk::source_ptr& source );
private:
SourceTreeItem* itemFromIndex( const QModelIndex& idx ) const;
int rowForItem( SourceTreeItem* item ) const;