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