Commit 87ca8f12 authored by Rajeesh K V's avatar Rajeesh K V Committed by Marvin Scholz

Qt: Enable Stop Time in media convert dialog

Convert/Save dialog has had option to specify 'start time' but
no option for setting 'stop time' in the interface. The backend
'stop-time' option was already present. This patch simply adds
and enables the edit widget for end time in Qt interface.
Signed-off-by: Marvin Scholz's avatarMarvin Scholz <epirat07@gmail.com>
parent 2e078529
...@@ -194,6 +194,7 @@ iOS: ...@@ -194,6 +194,7 @@ iOS:
Qt interface: Qt interface:
* Batch convert support * Batch convert support
* It is now possible to specify 'stop-time' in Convert/Save dialog
Skins2: Skins2:
* Support key accelerators * Support key accelerators
......
...@@ -156,6 +156,7 @@ OpenDialog::OpenDialog( QWidget *parent, ...@@ -156,6 +156,7 @@ OpenDialog::OpenDialog( QWidget *parent,
CONNECT( ui.slaveText, textChanged( const QString& ), this, updateMRL() ); CONNECT( ui.slaveText, textChanged( const QString& ), this, updateMRL() );
CONNECT( ui.cacheSpinBox, valueChanged( int ), this, updateMRL() ); CONNECT( ui.cacheSpinBox, valueChanged( int ), this, updateMRL() );
CONNECT( ui.startTimeTimeEdit, timeChanged ( const QTime& ), this, updateMRL() ); CONNECT( ui.startTimeTimeEdit, timeChanged ( const QTime& ), this, updateMRL() );
CONNECT( ui.stopTimeTimeEdit, timeChanged ( const QTime& ), this, updateMRL() );
BUTTONACT( ui.advancedCheckBox, toggleAdvancedPanel() ); BUTTONACT( ui.advancedCheckBox, toggleAdvancedPanel() );
BUTTONACT( ui.slaveBrowseButton, browseInputSlave() ); BUTTONACT( ui.slaveBrowseButton, browseInputSlave() );
...@@ -179,6 +180,7 @@ OpenDialog::OpenDialog( QWidget *parent, ...@@ -179,6 +180,7 @@ OpenDialog::OpenDialog( QWidget *parent,
/* enforce section due to .ui bug */ /* enforce section due to .ui bug */
ui.startTimeTimeEdit->setCurrentSection( QDateTimeEdit::SecondSection ); ui.startTimeTimeEdit->setCurrentSection( QDateTimeEdit::SecondSection );
ui.stopTimeTimeEdit->setCurrentSection( QDateTimeEdit::SecondSection );
setMinimumSize( sizeHint() ); setMinimumSize( sizeHint() );
setMaximumWidth( 900 ); setMaximumWidth( 900 );
...@@ -427,6 +429,11 @@ void OpenDialog::updateMRL( const QStringList& item, const QString& tempMRL ) ...@@ -427,6 +429,11 @@ void OpenDialog::updateMRL( const QStringList& item, const QString& tempMRL )
updateMRL(); updateMRL();
} }
/* Format the time to milliseconds */
QString TimeToMilliseconds( const QTimeEdit *t ) {
return QString::number( ( t->minimumTime().msecsTo( t->time() ) ) / 1000.0, 'f', 3);
}
/* Update the complete MRL */ /* Update the complete MRL */
void OpenDialog::updateMRL() { void OpenDialog::updateMRL() {
QString mrl = optionsMRL; QString mrl = optionsMRL;
...@@ -436,12 +443,10 @@ void OpenDialog::updateMRL() { ...@@ -436,12 +443,10 @@ void OpenDialog::updateMRL() {
mrl += QString( " :%1=%2" ).arg( storedMethod ). mrl += QString( " :%1=%2" ).arg( storedMethod ).
arg( ui.cacheSpinBox->value() ); arg( ui.cacheSpinBox->value() );
if( ui.startTimeTimeEdit->time() != ui.startTimeTimeEdit->minimumTime() ) { if( ui.startTimeTimeEdit->time() != ui.startTimeTimeEdit->minimumTime() ) {
mrl += QString( " :start-time=%1.%2" ) mrl += " :start-time=" + TimeToMilliseconds( ui.startTimeTimeEdit );
.arg( QString::number( }
ui.startTimeTimeEdit->minimumTime().secsTo( if( ui.stopTimeTimeEdit->time() > ui.startTimeTimeEdit->time() ) {
ui.startTimeTimeEdit->time() mrl += " :stop-time=" + TimeToMilliseconds( ui.stopTimeTimeEdit );
) ) )
.arg( ui.startTimeTimeEdit->time().msec(), 3, 10, QChar('0') );
} }
ui.advancedLineInput->setText( mrl ); ui.advancedLineInput->setText( mrl );
ui.mrlLine->setText( itemsMRL.join( " " ) ); ui.mrlLine->setText( itemsMRL.join( " " ) );
......
...@@ -169,6 +169,19 @@ ...@@ -169,6 +169,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="3">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Stop Time</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>stopTimeTimeEdit</cstring>
</property>
</widget>
</item>
<item row="8" column="0"> <item row="8" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
...@@ -241,6 +254,25 @@ ...@@ -241,6 +254,25 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="4" colspan="2">
<widget class="QTimeEdit" name="stopTimeTimeEdit">
<property name="toolTip">
<string>Change the stop time for the media</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="currentSection">
<enum>QDateTimeEdit::HourSection</enum>
</property>
<property name="displayFormat">
<string>HH'H':mm'm':ss's'.zzz</string>
</property>
<property name="timeSpec">
<enum>Qt::LocalTime</enum>
</property>
</widget>
</item>
<item row="4" column="0" colspan="6"> <item row="4" column="0" colspan="6">
<widget class="QCheckBox" name="slaveCheckbox"> <widget class="QCheckBox" name="slaveCheckbox">
<property name="text"> <property name="text">
...@@ -271,6 +303,7 @@ ...@@ -271,6 +303,7 @@
<tabstop>advancedCheckBox</tabstop> <tabstop>advancedCheckBox</tabstop>
<tabstop>cacheSpinBox</tabstop> <tabstop>cacheSpinBox</tabstop>
<tabstop>startTimeTimeEdit</tabstop> <tabstop>startTimeTimeEdit</tabstop>
<tabstop>stopTimeTimeEdit</tabstop>
<tabstop>slaveCheckbox</tabstop> <tabstop>slaveCheckbox</tabstop>
<tabstop>slaveText</tabstop> <tabstop>slaveText</tabstop>
<tabstop>slaveBrowseButton</tabstop> <tabstop>slaveBrowseButton</tabstop>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment