mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 21:57:41 +02:00
Allow Metadata editor to edit year.
This commit is contained in:
@@ -90,6 +90,11 @@ MetadataEditor::writeMetadata()
|
|||||||
tag->setTrack( discnumber() );
|
tag->setTrack( discnumber() );
|
||||||
m_result->setDiscNumber( discnumber() );
|
m_result->setDiscNumber( discnumber() );
|
||||||
|
|
||||||
|
if ( year() != m_result->year() ) {
|
||||||
|
tag->setYear( year() );
|
||||||
|
m_result->setYear( year() );
|
||||||
|
}
|
||||||
|
|
||||||
f.save();
|
f.save();
|
||||||
|
|
||||||
QStringList files = QStringList( fileName );
|
QStringList files = QStringList( fileName );
|
||||||
@@ -136,14 +141,14 @@ MetadataEditor::setDuration( unsigned int duration )
|
|||||||
void
|
void
|
||||||
MetadataEditor::setYear( int year )
|
MetadataEditor::setYear( int year )
|
||||||
{
|
{
|
||||||
ui->yearLineEdit->setText( QString( "%1" ).arg( year ) );
|
ui->yearSpinBox->setValue( year );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MetadataEditor::setBitrate( unsigned int bitrate )
|
MetadataEditor::setBitrate( unsigned int bitrate )
|
||||||
{
|
{
|
||||||
ui->bitrateLineEdit->setText( QString( "%1" ).arg( bitrate ) );
|
ui->bitrateSpinBox->setValue( bitrate );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -38,10 +38,13 @@ public:
|
|||||||
MetadataEditor( Tomahawk::result_ptr result, QWidget* parent = 0 );
|
MetadataEditor( Tomahawk::result_ptr result, QWidget* parent = 0 );
|
||||||
~MetadataEditor() {};
|
~MetadataEditor() {};
|
||||||
|
|
||||||
|
protected:
|
||||||
QString title() { return ui->titleLineEdit->text(); }
|
QString title() { return ui->titleLineEdit->text(); }
|
||||||
QString artist() { return ui->artistLineEdit->text(); }
|
QString artist() { return ui->artistLineEdit->text(); }
|
||||||
QString album() { return ui->albumLineEdit->text(); }
|
QString album() { return ui->albumLineEdit->text(); }
|
||||||
int discnumber() { return ui->discNumberSpinBox->value(); }
|
int discnumber() { return ui->discNumberSpinBox->value(); }
|
||||||
|
int year() { return ui->yearSpinBox->value(); }
|
||||||
|
int bitrate() { return ui->bitrateSpinBox->value(); }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void writeMetadata();
|
void writeMetadata();
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>404</width>
|
<width>441</width>
|
||||||
<height>298</height>
|
<height>323</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tabWidgetPage1" native="true">
|
<widget class="QWidget" name="tabWidgetPage1">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Tags</string>
|
<string>Tags</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
@@ -130,6 +130,32 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="17" column="0">
|
||||||
|
<widget class="QLabel" name="label_9">
|
||||||
|
<property name="text">
|
||||||
|
<string>Year:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="17" column="1">
|
||||||
|
<widget class="QSpinBox" name="yearSpinBox">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>76</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="buttonSymbols">
|
||||||
|
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1900</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>2999</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="19" column="0">
|
<item row="19" column="0">
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -138,29 +164,15 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="19" column="1">
|
<item row="19" column="1">
|
||||||
<widget class="QLineEdit" name="bitrateLineEdit">
|
<widget class="QSpinBox" name="bitrateSpinBox">
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="placeholderText">
|
<property name="buttonSymbols">
|
||||||
<string>Bitrate...</string>
|
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="maximum">
|
||||||
</item>
|
<number>999999</number>
|
||||||
<item row="17" column="1">
|
|
||||||
<widget class="QLineEdit" name="yearLineEdit">
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="placeholderText">
|
|
||||||
<string>Year...</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="17" column="0">
|
|
||||||
<widget class="QLabel" name="label_9">
|
|
||||||
<property name="text">
|
|
||||||
<string>Year:</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Reference in New Issue
Block a user