Commit aeb66e2b authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Open. Use a Frame and not a QComboBox for subtitles. (lacks still some...

Qt4 - Open. Use a Frame and not a QComboBox for subtitles. (lacks still some toggle function). Catch event to avoid bug of hidding of QFileDialog.

parent 0ac9553b
...@@ -71,9 +71,16 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -71,9 +71,16 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
/* Change the text that was uncool in the usual box */ /* Change the text that was uncool in the usual box */
listLabel[5]->setText( qtr( "Filter:" ) ); listLabel[5]->setText( qtr( "Filter:" ) );
/* Hacks Continued Catch the close event */
dialogBox->installEventFilter( this );
// Hide the subtitles control by default.
ui.subFrame->hide();
BUTTONACT( ui.subBrowseButton, browseFileSub() ); BUTTONACT( ui.subBrowseButton, browseFileSub() );
BUTTONACT( ui.subCheckBox, updateMRL());
BUTTONACT( ui.subGroupBox, updateMRL());
CONNECT( ui.fileInput, editTextChanged(QString ), this, updateMRL()); CONNECT( ui.fileInput, editTextChanged(QString ), this, updateMRL());
CONNECT( ui.subInput, editTextChanged(QString ), this, updateMRL()); CONNECT( ui.subInput, editTextChanged(QString ), this, updateMRL());
CONNECT( ui.alignSubComboBox, currentIndexChanged(int), this, updateMRL()); CONNECT( ui.alignSubComboBox, currentIndexChanged(int), this, updateMRL());
...@@ -109,7 +116,7 @@ void FileOpenPanel::updateMRL() ...@@ -109,7 +116,7 @@ void FileOpenPanel::updateMRL()
{ {
QString mrl = ui.fileInput->currentText(); QString mrl = ui.fileInput->currentText();
if( ui.subGroupBox->isChecked() ) { if( ui.subCheckBox->isChecked() ) {
mrl.append( " :sub-file=" + ui.subInput->currentText() ); mrl.append( " :sub-file=" + ui.subInput->currentText() );
mrl.append( " :subsdec-align=" + ui.alignSubComboBox->currentText() ); mrl.append( " :subsdec-align=" + ui.alignSubComboBox->currentText() );
mrl.append( " :sub-rel-fontsize=" + ui.sizeSubComboBox->currentText() ); mrl.append( " :sub-rel-fontsize=" + ui.sizeSubComboBox->currentText() );
...@@ -134,6 +141,18 @@ void FileOpenPanel::clear() ...@@ -134,6 +141,18 @@ void FileOpenPanel::clear()
ui.subInput->setEditText( "" ); ui.subInput->setEditText( "" );
} }
bool FileOpenPanel::eventFilter(QObject *object, QEvent *event)
{
printf( "coin\n" );
if ( ( object == dialogBox ) && ( event->type() == QEvent::Hide ) )
{
event->ignore();
return true;
}
// standard event processing
else
return QObject::eventFilter(object, event);
}
/************************************************************************** /**************************************************************************
* Disk open * Disk open
......
...@@ -68,11 +68,13 @@ private: ...@@ -68,11 +68,13 @@ private:
QStringList browse( QString ); QStringList browse( QString );
QFileDialog *dialogBox; QFileDialog *dialogBox;
QLineEdit *lineFileEdit; QLineEdit *lineFileEdit;
bool eventFilter(QObject *, QEvent *);
public slots: public slots:
virtual void updateMRL(); virtual void updateMRL();
private slots: private slots:
void browseFile(); void browseFile();
void browseFileSub(); void browseFileSub();
}; };
class NetOpenPanel: public OpenPanel class NetOpenPanel: public OpenPanel
......
...@@ -161,6 +161,7 @@ void OpenDialog::playOrEnqueue( bool b_enqueue = false ) ...@@ -161,6 +161,7 @@ void OpenDialog::playOrEnqueue( bool b_enqueue = false )
void OpenDialog::toggleAdvancedPanel() void OpenDialog::toggleAdvancedPanel()
{ {
//FIXME does not work under Windows
if (ui.advancedFrame->isVisible()) { if (ui.advancedFrame->isVisible()) {
ui.advancedFrame->hide(); ui.advancedFrame->hide();
setMinimumHeight(1); setMinimumHeight(1);
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>463</width>
<height>210</height> <height>249</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
...@@ -28,24 +28,8 @@ ...@@ -28,24 +28,8 @@
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item row="1" column="0" > <item row="4" column="0" colspan="3" >
<spacer> <widget class="QFrame" name="subFrame" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>3</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0" colspan="3" >
<widget class="QGroupBox" name="subGroupBox" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy>
<hsizetype>1</hsizetype> <hsizetype>1</hsizetype>
...@@ -54,148 +38,195 @@ ...@@ -54,148 +38,195 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="title" > <property name="frameShape" >
<string>Use a subtitles file</string> <enum>QFrame::StyledPanel</enum>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
<bool>false</bool>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="margin" >
<number>6</number> <number>9</number>
</property> </property>
<property name="spacing" > <property name="spacing" >
<number>5</number> <number>6</number>
</property> </property>
<item row="0" column="4" > <item row="1" column="7" >
<widget class="QPushButton" name="subBrowseButton" > <spacer>
<property name="text" > <property name="orientation" >
<string>Browse</string> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeHint" >
<size>
<width>16</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
<item row="0" column="0" colspan="4" > <item row="1" column="0" >
<widget class="QComboBox" name="subInput" > <spacer>
<property name="sizePolicy" > <property name="orientation" >
<sizepolicy> <enum>Qt::Horizontal</enum>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="editable" > <property name="sizeHint" >
<bool>true</bool> <size>
<width>16</width>
<height>20</height>
</size>
</property> </property>
</widget> </spacer>
</item> </item>
<item row="1" column="1" > <item row="1" column="5" colspan="2" >
<widget class="QComboBox" name="sizeSubComboBox" > <widget class="QComboBox" name="alignSubComboBox" >
<property name="minimumSize" > <property name="minimumSize" >
<size> <size>
<width>100</width> <width>80</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="currentIndex" >
<number>0</number>
</property>
<property name="insertPolicy" >
<enum>QComboBox::NoInsert</enum>
</property>
<property name="minimumContentsLength" >
<number>0</number>
</property>
<item> <item>
<property name="text" > <property name="text" >
<string>Very Small</string> <string>Left</string>
</property>
</item>
<item>
<property name="text" >
<string>Small</string>
</property>
</item>
<item>
<property name="text" >
<string>Normal</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text" >
<string>Big</string> <string>Center</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text" >
<string>Very Big</string> <string>Right</string>
</property> </property>
</item> </item>
</widget> </widget>
</item> </item>
<item row="1" column="2" > <item row="1" column="4" >
<widget class="QLabel" name="alignSubLabel" >
<property name="text" >
<string>Alignment:</string>
</property>
<property name="buddy" >
<cstring>alignSubLabel</cstring>
</property>
</widget>
</item>
<item row="1" column="3" >
<spacer> <spacer>
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" >
<size> <size>
<width>40</width> <width>71</width>
<height>20</height> <height>26</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="4" > <item row="1" column="2" >
<widget class="QComboBox" name="alignSubComboBox" > <widget class="QComboBox" name="sizeSubComboBox" >
<property name="minimumSize" > <property name="minimumSize" >
<size> <size>
<width>80</width> <width>100</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="currentIndex" >
<number>0</number>
</property>
<property name="insertPolicy" >
<enum>QComboBox::NoInsert</enum>
</property>
<property name="minimumContentsLength" >
<number>0</number>
</property>
<item> <item>
<property name="text" > <property name="text" >
<string>Left</string> <string>Very Small</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text" >
<string>Center</string> <string>Small</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text" >
<string>Right</string> <string>Normal</string>
</property>
</item>
<item>
<property name="text" >
<string>Big</string>
</property>
</item>
<item>
<property name="text" >
<string>Very Big</string>
</property> </property>
</item> </item>
</widget> </widget>
</item> </item>
<item row="1" column="0" > <item row="1" column="1" >
<widget class="QLabel" name="sizeSubLabel" > <widget class="QLabel" name="sizeSubLabel" >
<property name="text" > <property name="text" >
<string>Size:</string> <string>Size:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="3" > <item row="0" column="0" colspan="6" >
<widget class="QLabel" name="alignSubLabel" > <widget class="QComboBox" name="subInput" >
<property name="text" > <property name="sizePolicy" >
<string>Alignment:</string> <sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="buddy" > <property name="editable" >
<cstring>alignSubLabel</cstring> <bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="6" colspan="2" >
<widget class="QPushButton" name="subBrowseButton" >
<property name="text" >
<string>Browse</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="0" column="1" colspan="2" > <item row="3" column="0" colspan="2" >
<widget class="QWidget" native="1" name="tempWidget" /> <widget class="QCheckBox" name="subCheckBox" >
<property name="text" >
<string>Use a subtitles file</string>
</property>
</widget>
</item>
<item row="2" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>273</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1" >
<widget class="QLabel" name="fileLabel" >
<property name="text" >
<string>File / Directory Names;</string>
</property>
</widget>
</item> </item>
<item row="1" column="2" > <item row="1" column="2" >
<widget class="QComboBox" name="fileInput" > <widget class="QComboBox" name="fileInput" >
...@@ -215,38 +246,34 @@ ...@@ -215,38 +246,34 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1" > <item row="5" column="1" colspan="2" >
<widget class="QLabel" name="fileLabel" >
<property name="text" >
<string>File / Directory Names;</string>
</property>
</widget>
</item>
<item row="2" column="2" >
<spacer> <spacer>
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" > <property name="sizeHint" >
<size> <size>
<width>273</width> <width>200</width>
<height>16</height> <height>2</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="4" column="1" colspan="2" > <item row="0" column="1" colspan="2" >
<widget class="QWidget" native="1" name="tempWidget" />
</item>
<item row="1" column="0" >
<spacer> <spacer>
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" >
<size> <size>
<width>200</width> <width>16</width>
<height>2</height> <height>26</height>
</size> </size>
</property> </property>
</spacer> </spacer>
......
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