From 499ab3c45863f921162241f4aac41210abfd2545 Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 30 Sep 2012 12:33:56 +0100 Subject: [PATCH] Added Select All facility to Spotify Account Config Diaglog to allow easy sync of all playlists. --- .../accounts/spotify/SpotifyAccountConfig.cpp | 14 ++++++++++++++ .../accounts/spotify/SpotifyAccountConfig.h | 1 + .../accounts/spotify/SpotifyAccountConfig.ui | 15 +++++++++++---- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.cpp b/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.cpp index 6a902d609..1b7f537cf 100644 --- a/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.cpp +++ b/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.cpp @@ -52,6 +52,7 @@ SpotifyAccountConfig::SpotifyAccountConfig( SpotifyAccount *account ) connect( m_ui->usernameEdit, SIGNAL( textEdited( QString ) ), this, SLOT( resetLoginButton() ) ); connect( m_ui->passwordEdit, SIGNAL( textEdited( QString ) ), this, SLOT( resetLoginButton() ) ); + connect( m_ui->selectAllCheckbox, SIGNAL( stateChanged( int ) ), this, SLOT( selectAllPlaylists())); loadFromConfig(); m_playlistsLoading = new AnimatedSpinner( m_ui->playlistList ); @@ -203,6 +204,19 @@ SpotifyAccountConfig::loginResponse( bool success, const QString& msg, const QSt } + +void +SpotifyAccountConfig::selectAllPlaylists() +{ + qDebug() << Q_FUNC_INFO << "Setting playlists to sync"; + + for(int i = 0; i < m_ui->playlistList->count(); i++) + { + QListWidgetItem* item = m_ui->playlistList->item( i ); + item->setCheckState(m_ui->selectAllCheckbox->checkState()); + } +} + void SpotifyAccountConfig::showLoggedIn() { diff --git a/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.h b/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.h index 712e139ad..1080d2a70 100644 --- a/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.h +++ b/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.h @@ -70,6 +70,7 @@ protected: private slots: void doLogin(); void resetLoginButton(); + void selectAllPlaylists(); private: void showLoggedIn(); diff --git a/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.ui b/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.ui index 60edc4ebd..8f2cadd17 100644 --- a/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.ui +++ b/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.ui @@ -6,8 +6,8 @@ 0 0 - 375 - 417 + 435 + 487 @@ -34,7 +34,7 @@ - :/data/images/spotify-logo.png + :/data/images/spotify-logo.png true @@ -135,6 +135,13 @@ + + + + Select All + + + @@ -161,7 +168,7 @@ - +