Commit 7b4315f4 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Open Disc Dialog, finish the disc/track-sub/audio handling. Hide,...

Qt4 - Open Disc Dialog, finish the disc/track-sub/audio handling. Hide, rename, show correctly the buttons. Some other ui fixes.
parent ba517150
...@@ -240,14 +240,16 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -240,14 +240,16 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
{ {
ui.setupUi( this ); ui.setupUi( this );
CONNECT( ui.deviceCombo, editTextChanged(QString ), this, updateMRL()); BUTTONACT( ui.dvdRadioButton, updateButtons());
BUTTONACT( ui.dvdRadioButton, updateMRL()); BUTTONACT( ui.vcdRadioButton, updateButtons());
BUTTONACT( ui.vcdRadioButton, updateMRL()); BUTTONACT( ui.audioCDRadioButton, updateButtons());
BUTTONACT( ui.audioCDRadioButton, updateMRL()); BUTTONACT( ui.dvdsimple, updateButtons());
BUTTONACT( ui.dvdsimple, updateMRL());
CONNECT( ui.deviceCombo, editTextChanged(QString ), this, updateMRL());
CONNECT( ui.titleSpin, valueChanged(int), this, updateMRL()); CONNECT( ui.titleSpin, valueChanged(int), this, updateMRL());
CONNECT( ui.chapterSpin, valueChanged(int), this, updateMRL()); CONNECT( ui.chapterSpin, valueChanged(int), this, updateMRL());
CONNECT( ui.audioSpin, valueChanged(int), this, updateMRL());
CONNECT( ui.subtitlesSpin, valueChanged(int), this, updateMRL());
} }
DiscOpenPanel::~DiscOpenPanel() DiscOpenPanel::~DiscOpenPanel()
...@@ -259,6 +261,34 @@ void DiscOpenPanel::clear() ...@@ -259,6 +261,34 @@ void DiscOpenPanel::clear()
ui.chapterSpin->setValue(0); ui.chapterSpin->setValue(0);
} }
void DiscOpenPanel::updateButtons()
{
if ( ui.dvdRadioButton->isChecked() )
{
ui.titleLabel->setText( qtr("Title") );
ui.chapterLabel->show();
ui.chapterSpin->show();
ui.diskOptionBox_2->show();
}
else if ( ui.vcdRadioButton->isChecked() )
{
ui.titleLabel->setText( qtr("Entry") );
ui.chapterLabel->hide();
ui.chapterSpin->hide();
ui.diskOptionBox_2->show();
}
else
{
ui.titleLabel->setText( qtr("Track") );
ui.chapterLabel->hide();
ui.chapterSpin->hide();
ui.diskOptionBox_2->hide();
}
updateMRL();
}
void DiscOpenPanel::updateMRL() void DiscOpenPanel::updateMRL()
{ {
QString mrl = ""; QString mrl = "";
...@@ -290,6 +320,20 @@ void DiscOpenPanel::updateMRL() ...@@ -290,6 +320,20 @@ void DiscOpenPanel::updateMRL()
/* CDDA */ /* CDDA */
} else { } else {
mrl = "cdda://" + ui.deviceCombo->currentText(); mrl = "cdda://" + ui.deviceCombo->currentText();
if( ui.titleSpin->value() > 0 ) {
QString("@%1").arg(ui.titleSpin->value());
}
}
if ( ui.dvdRadioButton->isChecked() || ui.vcdRadioButton->isChecked() )
{
if ( ui.audioSpin->value() >= 0 ) {
mrl += " :audio-track=" + QString("%1").arg(ui.audioSpin->value());
}
if ( ui.subtitlesSpin->value() >= 0 ) {
mrl += " :sub-track=" +
QString("%1").arg(ui.subtitlesSpin->value());
}
} }
emit mrlUpdated(mrl); emit mrlUpdated(mrl);
......
...@@ -115,6 +115,7 @@ private: ...@@ -115,6 +115,7 @@ private:
Ui::OpenDisk ui; Ui::OpenDisk ui;
public slots: public slots:
virtual void updateMRL() ; virtual void updateMRL() ;
virtual void updateButtons() ;
}; };
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>448</width>
<height>300</height> <height>300</height>
</rect> </rect>
</property> </property>
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
</widget> </widget>
</item> </item>
<item row="4" column="1" colspan="5" > <item row="4" column="1" colspan="5" >
<widget class="Line" name="line" > <widget class="Line" name="" >
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
</widget> </widget>
</item> </item>
<item row="1" column="1" colspan="5" > <item row="1" column="1" colspan="5" >
<widget class="Line" name="line_2" > <widget class="Line" name="" >
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
......
...@@ -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>314</width>
<height>165</height> <height>140</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
...@@ -20,45 +20,40 @@ ...@@ -20,45 +20,40 @@
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item row="3" column="1" > <item row="1" column="0" colspan="2" >
<spacer> <widget class="QGroupBox" name="groupBox" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" >
<widget class="QComboBox" name="protocolCombo" />
</item>
<item row="0" column="1" >
<widget class="QLabel" name="label_2" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy>
<hsizetype>5</hsizetype> <hsizetype>3</hsizetype>
<vsizetype>0</vsizetype> <vsizetype>5</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text" > <property name="title" >
<string>Card Selection</string> <string>Card Selection</string>
</property> </property>
</widget> <widget class="QWidget" name="gridLayout" >
</item> <property name="geometry" >
<item row="0" column="0" > <rect>
<widget class="QLabel" name="label" > <x>10</x>
<property name="text" > <y>10</y>
<string>Capture Mode</string> <width>531</width>
<height>41</height>
</rect>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property> </property>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="3" > <item row="2" column="0" colspan="2" >
<widget class="QGroupBox" name="Options" > <widget class="QGroupBox" name="Options" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy>
...@@ -81,6 +76,41 @@ ...@@ -81,6 +76,41 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>Capture Mode</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QComboBox" name="protocolCombo" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>
......
...@@ -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>462</width>
<height>287</height> <height>407</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</widget> </widget>
</item> </item>
<item row="3" column="0" colspan="2" > <item row="3" column="0" colspan="2" >
<widget class="QLabel" name="label" > <widget class="QLabel" name="deviceLabel" >
<property name="text" > <property name="text" >
<string>Disk device</string> <string>Disk device</string>
</property> </property>
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="diskOptionGroupBox" > <widget class="QGroupBox" name="diskOptionBox" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy>
<hsizetype>5</hsizetype> <hsizetype>5</hsizetype>
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
<number>6</number> <number>6</number>
</property> </property>
<item row="1" column="0" > <item row="1" column="0" >
<widget class="QLabel" name="label_3" > <widget class="QLabel" name="chapterLabel" >
<property name="text" > <property name="text" >
<string>Chapter</string> <string>Chapter</string>
</property> </property>
...@@ -191,15 +191,15 @@ ...@@ -191,15 +191,15 @@
<string/> <string/>
</property> </property>
<property name="minimum" > <property name="minimum" >
<number>-1</number> <number>0</number>
</property> </property>
<property name="value" > <property name="value" >
<number>-1</number> <number>0</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="label_2" > <widget class="QLabel" name="titleLabel" >
<property name="text" > <property name="text" >
<string>Title</string> <string>Title</string>
</property> </property>
...@@ -216,6 +216,87 @@ ...@@ -216,6 +216,87 @@
<property name="suffix" > <property name="suffix" >
<string/> <string/>
</property> </property>
<property name="minimum" >
<number>0</number>
</property>
<property name="value" >
<number>0</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="diskOptionBox_2" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string>Audio and Subtitles</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="0" >
<widget class="QLabel" name="audioLabel" >
<property name="text" >
<string>Audio track</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QSpinBox" name="audioSpin" >
<property name="alignment" >
<set>Qt::AlignRight</set>
</property>
<property name="suffix" >
<string/>
</property>
<property name="prefix" >
<string/>
</property>
<property name="maximum" >
<number>7</number>
</property>
<property name="minimum" >
<number>-1</number>
</property>
<property name="value" >
<number>-1</number>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="subtitlesLabel" >
<property name="text" >
<string>Subtitles track</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QSpinBox" name="subtitlesSpin" >
<property name="autoFillBackground" >
<bool>false</bool>
</property>
<property name="alignment" >
<set>Qt::AlignRight</set>
</property>
<property name="suffix" >
<string/>
</property>
<property name="maximum" >
<number>31</number>
</property>
<property name="minimum" > <property name="minimum" >
<number>-1</number> <number>-1</number>
</property> </property>
...@@ -232,10 +313,13 @@ ...@@ -232,10 +313,13 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType" >
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" > <property name="sizeHint" >
<size> <size>
<width>420</width> <width>444</width>
<height>16</height> <height>10</height>
</size> </size>
</property> </property>
</spacer> </spacer>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>420</width> <width>420</width>
<height>205</height> <height>195</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
...@@ -130,10 +130,13 @@ ...@@ -130,10 +130,13 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType" >
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" > <property name="sizeHint" >
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>10</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