mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-22 21:54:00 +02:00
Log in to spotify if the user entered credentials and hit OK without pressing log in
This commit is contained in:
@@ -509,6 +509,12 @@ SpotifyAccount::saveConfig()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sync();
|
sync();
|
||||||
|
|
||||||
|
if ( !m_configWidget.data()->loggedInManually() && !m_configWidget.data()->username().isEmpty() && !m_configWidget.data()->password().isEmpty() )
|
||||||
|
{
|
||||||
|
// If the user never pressed log in, he might have just pressed ok or hit enter. So log in anyway
|
||||||
|
login( m_configWidget.data()->username(), m_configWidget.data()->password() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -34,6 +34,7 @@ SpotifyAccountConfig::SpotifyAccountConfig( SpotifyAccount *account )
|
|||||||
, m_ui( new Ui::SpotifyConfig )
|
, m_ui( new Ui::SpotifyConfig )
|
||||||
, m_account( account )
|
, m_account( account )
|
||||||
, m_playlistsLoading( 0 )
|
, m_playlistsLoading( 0 )
|
||||||
|
, m_loggedInManually( false )
|
||||||
{
|
{
|
||||||
m_ui->setupUi( this );
|
m_ui->setupUi( this );
|
||||||
|
|
||||||
@@ -51,6 +52,7 @@ void
|
|||||||
SpotifyAccountConfig::showEvent( QShowEvent *event )
|
SpotifyAccountConfig::showEvent( QShowEvent *event )
|
||||||
{
|
{
|
||||||
loadFromConfig();
|
loadFromConfig();
|
||||||
|
m_loggedInManually = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -132,6 +134,7 @@ SpotifyAccountConfig::doLogin()
|
|||||||
m_ui->loginButton->setEnabled( false );
|
m_ui->loginButton->setEnabled( false );
|
||||||
|
|
||||||
m_playlistsLoading->fadeIn();
|
m_playlistsLoading->fadeIn();
|
||||||
|
m_loggedInManually = true;
|
||||||
|
|
||||||
emit login( username(), password() );
|
emit login( username(), password() );
|
||||||
}
|
}
|
||||||
|
@@ -56,6 +56,8 @@ public:
|
|||||||
void saveSettings();
|
void saveSettings();
|
||||||
|
|
||||||
void loginResponse( bool success, const QString& msg );
|
void loginResponse( bool success, const QString& msg );
|
||||||
|
|
||||||
|
bool loggedInManually() const { return m_loggedInManually; }
|
||||||
signals:
|
signals:
|
||||||
void login( const QString& username, const QString& pw );
|
void login( const QString& username, const QString& pw );
|
||||||
|
|
||||||
@@ -73,6 +75,7 @@ private:
|
|||||||
Ui::SpotifyConfig* m_ui;
|
Ui::SpotifyConfig* m_ui;
|
||||||
SpotifyAccount* m_account;
|
SpotifyAccount* m_account;
|
||||||
LoadingSpinner* m_playlistsLoading;
|
LoadingSpinner* m_playlistsLoading;
|
||||||
|
bool m_loggedInManually;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user