diff --git a/src/libtomahawk/filemetadata/MetadataEditor.cpp b/src/libtomahawk/filemetadata/MetadataEditor.cpp index 00aad4fb7..66ae219b5 100644 --- a/src/libtomahawk/filemetadata/MetadataEditor.cpp +++ b/src/libtomahawk/filemetadata/MetadataEditor.cpp @@ -32,6 +32,7 @@ #include "taglib/fileref.h" #include "filemetadata/taghandlers/tag.h" +#include "utils/TomahawkUtils.h" MetadataEditor::MetadataEditor( Tomahawk::result_ptr result, QWidget *parent ) : QDialog( parent ) @@ -46,8 +47,14 @@ MetadataEditor::MetadataEditor( Tomahawk::result_ptr result, QWidget *parent ) setArtist( result->artist()->name() ); setAlbum( result->album()->name() ); setDiscNumber( result->albumpos() ); + setDuration( result->duration() ); + setYear( result->year() ); setBitrate( result->bitrate() ); + QFileInfo fi( QUrl( m_result->url() ).toLocalFile() ); + setFileName( fi.fileName() ); + setFileSize( TomahawkUtils::filesizeToString( fi.size() ) ); + connect( ui->buttonBox, SIGNAL( accepted() ), SLOT( writeMetadata() ) ); connect( ui->buttonBox, SIGNAL( rejected() ), SLOT( close() ) ); } @@ -119,8 +126,36 @@ MetadataEditor::setDiscNumber( unsigned int num ) } +void +MetadataEditor::setDuration( unsigned int duration ) +{ + ui->durationLineEdit->setText( TomahawkUtils::timeToString( duration ) ); +} + + +void +MetadataEditor::setYear( int year ) +{ + ui->yearLineEdit->setText( QString( "%1" ).arg( year ) ); +} + + void MetadataEditor::setBitrate( unsigned int bitrate ) { - ui->bitrateLabel->setNum( (int) bitrate ); + ui->bitrateLineEdit->setText( QString( "%1" ).arg( bitrate ) ); +} + + +void +MetadataEditor::setFileName( const QString& fn ) +{ + ui->fileNameLineEdit->setText( fn ); +} + + +void +MetadataEditor::setFileSize( const QString& size ) +{ + ui->fileSizeLineEdit->setText( size ); } diff --git a/src/libtomahawk/filemetadata/MetadataEditor.h b/src/libtomahawk/filemetadata/MetadataEditor.h index 9cfdebec4..b41e593f2 100644 --- a/src/libtomahawk/filemetadata/MetadataEditor.h +++ b/src/libtomahawk/filemetadata/MetadataEditor.h @@ -46,12 +46,19 @@ public: private slots: void writeMetadata(); + /* tag attributes */ void setTitle( const QString& title ); void setArtist( const QString& artist ); void setAlbum( const QString& album ); void setDiscNumber( unsigned int num ); + void setDuration( unsigned int duration ); + void setYear( int year ); void setBitrate( unsigned int num ); + /* file attributes */ + void setFileName( const QString& fn ); + void setFileSize( const QString& size ); + private: Ui::MetadataEditor* ui; diff --git a/src/libtomahawk/filemetadata/MetadataEditor.ui b/src/libtomahawk/filemetadata/MetadataEditor.ui index 4a50ed573..89bf978ae 100644 --- a/src/libtomahawk/filemetadata/MetadataEditor.ui +++ b/src/libtomahawk/filemetadata/MetadataEditor.ui @@ -6,8 +6,8 @@ 0 0 - 367 - 223 + 404 + 298 @@ -15,118 +15,201 @@ - + 0 0 - - Tags + + 0 - - false - - - false - - - - - - Title: - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - Title... - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - Artist... - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - Album... - - - - - - - - 0 - 0 - - - - Qt::LeftToRight - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - QAbstractSpinBox::NoButtons - - - 1 - - - - - - - Artist: - - - - - - - Album - - - - - - - Disc Number: - - - - - - - Bitrate: - - - - - - - - - - - + + + Tags + + + + QFormLayout::ExpandingFieldsGrow + + + + + Title: + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + Title... + + + + + + + Artist: + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + Artist... + + + + + + + Album + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + Album... + + + + + + + Disc Number: + + + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + QAbstractSpinBox::NoButtons + + + 1 + + + + + + + Duration: + + + + + + + true + + + 00.00 + + + + + + + Bitrate: + + + + + + + true + + + Bitrate... + + + + + + + true + + + Year... + + + + + + + Year: + + + + + + + + File + + + + + + File Name: + + + + + + + true + + + File Name... + + + + + + + File Size... + + + true + + + File size... + + + + + + + File Size: + + + + +