1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 16:29:43 +01:00

* Show current import date.

This commit is contained in:
Christian Muehlhaeuser 2012-05-22 12:01:03 +02:00
parent 2558202a52
commit 5b2a5b76a4
2 changed files with 11 additions and 3 deletions

View File

@ -35,6 +35,7 @@ LastFmConfig::LastFmConfig( LastFmAccount* account )
: QWidget( 0 )
, m_account( account )
, m_page( 1 )
, m_lastTimeStamp( 0 )
{
m_ui = new Ui_LastFmConfig;
m_ui->setupUi( this );
@ -108,7 +109,13 @@ LastFmConfig::enableButton()
void
LastFmConfig::loadHistory()
{
m_ui->importHistory->setText( tr( "Importing History..." ) );
if ( m_lastTimeStamp )
{
m_ui->importHistory->setText( tr( "Importing %1", "e.g. Importing 2012/01/01" ).arg( QDateTime::fromTime_t( m_lastTimeStamp ).toString( "MMMM d yyyy" ) ) );
}
else
m_ui->importHistory->setText( tr( "Importing History..." ) );
m_ui->importHistory->setEnabled( false );
m_ui->progressBar->show();
@ -132,9 +139,9 @@ LastFmConfig::onHistoryLoaded()
{
// tDebug() << "Found:" << e["artist"].text() << e["name"].text() << e["date"].attribute( "uts" ).toUInt();
Tomahawk::query_ptr query = Query::get( e["artist"].text(), e["name"].text(), QString(), QString(), false );
uint timeStamp = e["date"].attribute( "uts" ).toUInt();
m_lastTimeStamp = e["date"].attribute( "uts" ).toUInt();
DatabaseCommand_LogPlayback* cmd = new DatabaseCommand_LogPlayback( query, DatabaseCommand_LogPlayback::Finished, timeStamp );
DatabaseCommand_LogPlayback* cmd = new DatabaseCommand_LogPlayback( query, DatabaseCommand_LogPlayback::Finished, m_lastTimeStamp );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
}

View File

@ -54,6 +54,7 @@ private:
Ui_LastFmConfig* m_ui;
unsigned int m_page;
unsigned int m_lastTimeStamp;
};
}