From 499ab3c45863f921162241f4aac41210abfd2545 Mon Sep 17 00:00:00 2001
From: = <=>
Date: Sun, 30 Sep 2012 12:33:56 +0100
Subject: [PATCH 1/2] 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 @@
-
+
From 54fee8ffed6f4765a1823e41fc12002cc644eca9 Mon Sep 17 00:00:00 2001
From: = <=>
Date: Sun, 30 Sep 2012 20:31:22 +0100
Subject: [PATCH 2/2] Select all facility - code review fixes
---
.../accounts/spotify/SpotifyAccountConfig.cpp | 10 +++-------
.../accounts/spotify/SpotifyAccountConfig.ui | 6 +++---
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.cpp b/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.cpp
index 1b7f537cf..09ce54add 100644
--- a/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.cpp
+++ b/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.cpp
@@ -52,7 +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()));
+ connect( m_ui->selectAllCheckbox, SIGNAL( stateChanged( int ) ), this, SLOT( selectAllPlaylists() ) );
loadFromConfig();
m_playlistsLoading = new AnimatedSpinner( m_ui->playlistList );
@@ -203,17 +203,13 @@ 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++)
+ for( int i = 0; i < m_ui->playlistList->count(); i++ )
{
QListWidgetItem* item = m_ui->playlistList->item( i );
- item->setCheckState(m_ui->selectAllCheckbox->checkState());
+ item->setCheckState( m_ui->selectAllCheckbox->checkState() );
}
}
diff --git a/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.ui b/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.ui
index 8f2cadd17..d465487a1 100644
--- a/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.ui
+++ b/src/libtomahawk/accounts/spotify/SpotifyAccountConfig.ui
@@ -6,7 +6,7 @@
0
0
- 435
+ 375
487
@@ -34,7 +34,7 @@
- :/data/images/spotify-logo.png
+ :/data/images/spotify-logo.png
true
@@ -168,7 +168,7 @@
-
+