1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-01 03:40:16 +02:00

Added Select All facility to Spotify Account Config Diaglog to allow easy sync of all playlists.

This commit is contained in:
=
2012-09-30 12:33:56 +01:00
parent 15f6a60e9d
commit 499ab3c458
3 changed files with 26 additions and 4 deletions

View File

@@ -52,6 +52,7 @@ SpotifyAccountConfig::SpotifyAccountConfig( SpotifyAccount *account )
connect( m_ui->usernameEdit, SIGNAL( textEdited( QString ) ), this, SLOT( resetLoginButton() ) ); connect( m_ui->usernameEdit, SIGNAL( textEdited( QString ) ), this, SLOT( resetLoginButton() ) );
connect( m_ui->passwordEdit, 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(); loadFromConfig();
m_playlistsLoading = new AnimatedSpinner( m_ui->playlistList ); 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 void
SpotifyAccountConfig::showLoggedIn() SpotifyAccountConfig::showLoggedIn()
{ {

View File

@@ -70,6 +70,7 @@ protected:
private slots: private slots:
void doLogin(); void doLogin();
void resetLoginButton(); void resetLoginButton();
void selectAllPlaylists();
private: private:
void showLoggedIn(); void showLoggedIn();

View File

@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>375</width> <width>435</width>
<height>417</height> <height>487</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@@ -34,7 +34,7 @@
<string/> <string/>
</property> </property>
<property name="pixmap"> <property name="pixmap">
<pixmap resource="../../../resources.qrc">:/data/images/spotify-logo.png</pixmap> <pixmap resource="../../../../resources.qrc">:/data/images/spotify-logo.png</pixmap>
</property> </property>
<property name="scaledContents"> <property name="scaledContents">
<bool>true</bool> <bool>true</bool>
@@ -135,6 +135,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="selectAllCheckbox">
<property name="text">
<string>Select All</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QListWidget" name="playlistList"/> <widget class="QListWidget" name="playlistList"/>
</item> </item>
@@ -161,7 +168,7 @@
</layout> </layout>
</widget> </widget>
<resources> <resources>
<include location="../../../resources.qrc"/> <include location="../../../../resources.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>