mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
activate current page in the sourcetree if new playlist dialog is cancelled
This commit is contained in:
@@ -78,6 +78,8 @@ CategoryAddItem::activate()
|
|||||||
// create Auto Playlist
|
// create Auto Playlist
|
||||||
QString playlistName = playlistSelectorDlg.playlistName();
|
QString playlistName = playlistSelectorDlg.playlistName();
|
||||||
APP->mainWindow()->createAutomaticPlaylist( playlistName );
|
APP->mainWindow()->createAutomaticPlaylist( playlistName );
|
||||||
|
} else if ( !successfulReturn ) {
|
||||||
|
model()->viewPageActivated( ViewManager::instance()->currentPage() );
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@@ -30,11 +30,13 @@
|
|||||||
|
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
#include <QSize>
|
#include <QSize>
|
||||||
|
#include <widgets/newplaylistwidget.h>
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
SourcesModel::SourcesModel( QObject* parent )
|
SourcesModel::SourcesModel( QObject* parent )
|
||||||
: QAbstractItemModel( parent )
|
: QAbstractItemModel( parent )
|
||||||
|
, m_rootItem( 0 )
|
||||||
, m_viewPageDelayedCacheItem( 0 )
|
, m_viewPageDelayedCacheItem( 0 )
|
||||||
{
|
{
|
||||||
m_rootItem = new SourceTreeItem( this, 0, Invalid );
|
m_rootItem = new SourceTreeItem( this, 0, Invalid );
|
||||||
@@ -389,7 +391,6 @@ SourcesModel::linkSourceItemToPage( SourceTreeItem* item, ViewPage* p )
|
|||||||
m_viewPageDelayedCacheItem = 0;
|
m_viewPageDelayedCacheItem = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SourceTreeItem*
|
SourceTreeItem*
|
||||||
SourcesModel::itemFromIndex( const QModelIndex& idx ) const
|
SourcesModel::itemFromIndex( const QModelIndex& idx ) const
|
||||||
{
|
{
|
||||||
|
@@ -90,16 +90,6 @@ public:
|
|||||||
|
|
||||||
QModelIndex indexFromItem( SourceTreeItem* item ) const;
|
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:
|
public slots:
|
||||||
void loadSources();
|
void loadSources();
|
||||||
|
|
||||||
@@ -108,6 +98,17 @@ public slots:
|
|||||||
void onItemRowsAddedDone();
|
void onItemRowsAddedDone();
|
||||||
void onItemRowsRemovedBegin( int first, int last );
|
void onItemRowsRemovedBegin( int first, int last );
|
||||||
void onItemRowsRemovedDone();
|
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:
|
private:
|
||||||
SourceTreeItem* itemFromIndex( const QModelIndex& idx ) const;
|
SourceTreeItem* itemFromIndex( const QModelIndex& idx ) const;
|
||||||
int rowForItem( SourceTreeItem* item ) const;
|
int rowForItem( SourceTreeItem* item ) const;
|
||||||
|
Reference in New Issue
Block a user