From 414f553eb3cd1a0bbc26afc701a6bb5877d1cb57 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Tue, 1 May 2012 21:03:45 -0400 Subject: [PATCH] Re-enable last.fm test login button when changing fields --- src/accounts/lastfm/LastFmConfig.cpp | 11 +++++++++++ src/accounts/lastfm/LastFmConfig.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/src/accounts/lastfm/LastFmConfig.cpp b/src/accounts/lastfm/LastFmConfig.cpp index 3e320898b..d364d7ba4 100644 --- a/src/accounts/lastfm/LastFmConfig.cpp +++ b/src/accounts/lastfm/LastFmConfig.cpp @@ -39,6 +39,9 @@ LastFmConfig::LastFmConfig( LastFmAccount* account ) connect( m_ui->testLogin, SIGNAL( clicked( bool ) ), this, SLOT( testLogin( bool ) ) ); + connect( m_ui->username, SIGNAL( textChanged( QString ) ), this, SLOT( enableButton() ) ); + connect( m_ui->password, SIGNAL( textChanged( QString ) ), this, SLOT( enableButton() ) ); + // #ifdef Q_WS_MAC // FIXME // m_ui->testLogin->setVisible( false ); // #endif @@ -89,6 +92,14 @@ LastFmConfig::testLogin(bool ) } +void +LastFmConfig::enableButton() +{ + m_ui->testLogin->setText( tr( "Test Login" ) ); + m_ui->testLogin->setEnabled( true ); +} + + void LastFmConfig::onLastFmFinished() { diff --git a/src/accounts/lastfm/LastFmConfig.h b/src/accounts/lastfm/LastFmConfig.h index a86d73f0e..f6e0d72be 100644 --- a/src/accounts/lastfm/LastFmConfig.h +++ b/src/accounts/lastfm/LastFmConfig.h @@ -42,6 +42,9 @@ public slots: void testLogin( bool ); void onLastFmFinished(); +private slots: + void enableButton(); + private: LastFmAccount* m_account; Ui_LastFmConfig* m_ui;