Commit a737917d authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: advanced_open: use QTimeEdit instead of QDoubleSpinBox

parent f3426da7
......@@ -157,7 +157,7 @@ OpenDialog::OpenDialog( QWidget *parent,
CONNECT( ui.slaveCheckbox, toggled( bool ), this, updateMRL() );
CONNECT( ui.slaveText, textChanged( const QString& ), this, updateMRL() );
CONNECT( ui.cacheSpinBox, valueChanged( int ), this, updateMRL() );
CONNECT( ui.startTimeDoubleSpinBox, valueChanged( double ), this, updateMRL() );
CONNECT( ui.startTimeTimeEdit, timeChanged ( const QTime& ), this, updateMRL() );
BUTTONACT( ui.advancedCheckBox, toggleAdvancedPanel() );
BUTTONACT( ui.slaveBrowseButton, browseInputSlave() );
......@@ -179,6 +179,9 @@ OpenDialog::OpenDialog( QWidget *parent,
storedMethod = "";
newCachingMethod( "file-caching" );
/* enforce section due to .ui bug */
ui.startTimeTimeEdit->setCurrentSection( QDateTimeEdit::SecondSection );
setMinimumSize( sizeHint() );
setMaximumWidth( 900 );
resize( getSettings()->value( "opendialog-size", QSize( 500, 400 ) ).toSize() );
......@@ -429,8 +432,13 @@ void OpenDialog::updateMRL() {
}
mrl += QString( " :%1=%2" ).arg( storedMethod ).
arg( ui.cacheSpinBox->value() );
if( ui.startTimeDoubleSpinBox->value() ) {
mrl += " :start-time=" + QString::number( ui.startTimeDoubleSpinBox->value() );
if( ui.startTimeTimeEdit->time() != ui.startTimeTimeEdit->minimumTime() ) {
mrl += QString( " :start-time=%1.%2" )
.arg( QString::number(
ui.startTimeTimeEdit->minimumTime().secsTo(
ui.startTimeTimeEdit->time()
) ) )
.arg( ui.startTimeTimeEdit->time().msec(), 3, 10, QChar('0') );
}
ui.advancedLineInput->setText( mrl );
ui.mrlLine->setText( itemsMRL.join( " " ) );
......
......@@ -94,23 +94,10 @@
<string>Start Time</string>
</property>
<property name="buddy">
<cstring>startTimeDoubleSpinBox</cstring>
<cstring>startTimeTimeEdit</cstring>
</property>
</widget>
</item>
<item row="0" column="7">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2" colspan="6">
<widget class="Line" name="line"/>
</item>
......@@ -178,19 +165,22 @@
</property>
</widget>
</item>
<item row="0" column="5" colspan="2">
<widget class="QDoubleSpinBox" name="startTimeDoubleSpinBox">
<item row="0" column="5" colspan="3">
<widget class="QTimeEdit" name="startTimeTimeEdit">
<property name="toolTip">
<string>Change the start time for the media</string>
</property>
<property name="alignment">
<set>Qt::AlignRight</set>
</property>
<property name="suffix">
<string>s</string>
<property name="currentSection">
<enum>QDateTimeEdit::SecondSection</enum>
</property>
<property name="displayFormat">
<string>HH'H':mm'm':ss's'.zzz</string>
</property>
<property name="decimals">
<number>1</number>
<property name="timeSpec">
<enum>Qt::LocalTime</enum>
</property>
</widget>
</item>
......@@ -251,7 +241,7 @@
<tabstop>Tab</tabstop>
<tabstop>advancedCheckBox</tabstop>
<tabstop>cacheSpinBox</tabstop>
<tabstop>startTimeDoubleSpinBox</tabstop>
<tabstop>startTimeTimeEdit</tabstop>
<tabstop>slaveCheckbox</tabstop>
<tabstop>slaveText</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