mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 15:59:42 +01:00
* Fixed TWK-379: Properly parent 'Export Playlist' dialog and store/restore last used path.
This commit is contained in:
parent
694787c8d6
commit
b1224c0a2b
@ -863,6 +863,20 @@ TomahawkSettings::setScriptDefaultPath( const QString& path )
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
TomahawkSettings::playlistDefaultPath() const
|
||||
{
|
||||
return value( "playlists/defaultpath", QDir::homePath() ).toString();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkSettings::setPlaylistDefaultPath( const QString& path )
|
||||
{
|
||||
setValue( "playlists/defaultpath", path );
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
TomahawkSettings::nowPlayingEnabled() const
|
||||
{
|
||||
|
@ -184,8 +184,11 @@ public:
|
||||
QStringList enabledScriptResolvers() const;
|
||||
void setEnabledScriptResolvers( const QStringList& resolvers );
|
||||
|
||||
// Default paths
|
||||
QString scriptDefaultPath() const;
|
||||
void setScriptDefaultPath( const QString& path );
|
||||
QString playlistDefaultPath() const;
|
||||
void setPlaylistDefaultPath( const QString& path );
|
||||
|
||||
// Now-Playing Settings
|
||||
// For now, just Adium. Soon, the world!
|
||||
|
@ -258,7 +258,8 @@ SourceTreeView::deletePlaylist( const QModelIndex& idxIn )
|
||||
PlaylistItem* item = itemFromIndex< PlaylistItem >( idx );
|
||||
playlist_ptr playlist = item->playlist();
|
||||
Playlist::remove( playlist );
|
||||
} else if( type == SourcesModel::AutomaticPlaylist || type == SourcesModel::Station )
|
||||
}
|
||||
else if( type == SourcesModel::AutomaticPlaylist || type == SourcesModel::Station )
|
||||
{
|
||||
DynamicPlaylistItem* item = itemFromIndex< DynamicPlaylistItem >( idx );
|
||||
dynplaylist_ptr playlist = item->dynPlaylist();
|
||||
@ -280,13 +281,20 @@ SourceTreeView::copyPlaylistLink()
|
||||
DynamicPlaylistItem* item = itemFromIndex< DynamicPlaylistItem >( m_contextMenuIndex );
|
||||
dynplaylist_ptr playlist = item->dynPlaylist();
|
||||
GlobalActionManager::instance()->copyPlaylistToClipboard( playlist );
|
||||
} else if ( type == SourcesModel::StaticPlaylist )
|
||||
}
|
||||
else if ( type == SourcesModel::StaticPlaylist )
|
||||
{
|
||||
PlaylistItem* item = itemFromIndex< PlaylistItem >( m_contextMenuIndex );
|
||||
playlist_ptr playlist = item->playlist();
|
||||
|
||||
QString filename = QFileDialog::getSaveFileName( this, tr( "Save XSPF" ), QDir::homePath(), tr( "Playlists (*.xspf)" ) );
|
||||
GlobalActionManager::instance()->savePlaylistToFile( playlist, filename );
|
||||
QString filename = QFileDialog::getSaveFileName( TomahawkUtils::tomahawkWindow(), tr( "Save XSPF" ),
|
||||
TomahawkSettings::instance()->playlistDefaultPath(), tr( "Playlists (*.xspf)" ) );
|
||||
if ( !filename.isEmpty() )
|
||||
{
|
||||
QFileInfo playlistAbsoluteFilePath = filename;
|
||||
TomahawkSettings::instance()->setPlaylistDefaultPath( playlistAbsoluteFilePath.absolutePath() );
|
||||
GlobalActionManager::instance()->savePlaylistToFile( playlist, filename );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user