From 64ba0b5d7ca14e0ccb4c639281ea347da71487f0 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Sat, 14 Apr 2012 23:49:35 -0400 Subject: [PATCH] fix some UI glitches with spotify playlist list --- src/accounts/spotify/SpotifyAccount.cpp | 1 + src/accounts/spotify/SpotifyAccountConfig.cpp | 17 ++--------------- src/accounts/spotify/SpotifyAccountConfig.ui | 3 +++ 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/accounts/spotify/SpotifyAccount.cpp b/src/accounts/spotify/SpotifyAccount.cpp index ac6a63fa7..2909f831e 100644 --- a/src/accounts/spotify/SpotifyAccount.cpp +++ b/src/accounts/spotify/SpotifyAccount.cpp @@ -374,6 +374,7 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg setCredentials( creds ); sync(); + configurationWidget(); // ensure it's created so we can set the login button if ( m_configWidget.data() ) { const bool success = msg.value( "success" ).toBool(); diff --git a/src/accounts/spotify/SpotifyAccountConfig.cpp b/src/accounts/spotify/SpotifyAccountConfig.cpp index fc06ec71e..4cbbf0369 100644 --- a/src/accounts/spotify/SpotifyAccountConfig.cpp +++ b/src/accounts/spotify/SpotifyAccountConfig.cpp @@ -134,27 +134,12 @@ SpotifyAccountConfig::doLogin() m_playlistsLoading->fadeIn(); emit login( username(), password() ); - - /* - QVariantMap msg; - msg[ "_msgtype" ] = "checkLogin"; - msg[ "username" ] = username(); - msg[ "password" ] = password(); - - m_account->sendMessage( msg, this, "verifyResult" ); - - m_ui->verifyCreds->setText( tr( "Verifying..." ) ); - m_ui->verifyCreds->setEnabled( false ); - - m_resetTimer.start();*/ } void SpotifyAccountConfig::loginResponse( bool success, const QString& msg ) { - m_playlistsLoading->fadeOut(); - if ( success ) { m_ui->loginButton->setText( tr( "Logged in!" ) ); @@ -162,6 +147,8 @@ SpotifyAccountConfig::loginResponse( bool success, const QString& msg ) } else { + setPlaylists( QList< SpotifyPlaylistInfo* >() ); + m_playlistsLoading->fadeOut(); m_ui->loginButton->setText( tr( "Failed: %1" ).arg( msg ) ); m_ui->loginButton->setEnabled( true ); } diff --git a/src/accounts/spotify/SpotifyAccountConfig.ui b/src/accounts/spotify/SpotifyAccountConfig.ui index 3e603368f..95c9ba48e 100644 --- a/src/accounts/spotify/SpotifyAccountConfig.ui +++ b/src/accounts/spotify/SpotifyAccountConfig.ui @@ -20,6 +20,9 @@ Form + + 4 +