Qt4 - Open Disc Dialog, finish the disc/track-sub/audio handling. Hide, rename, show...
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 10 May 2007 23:10:55 +0000 (23:10 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 10 May 2007 23:10:55 +0000 (23:10 +0000)
modules/gui/qt4/components/open.cpp
modules/gui/qt4/components/open.hpp
modules/gui/qt4/ui/open.ui
modules/gui/qt4/ui/open_capture.ui
modules/gui/qt4/ui/open_disk.ui
modules/gui/qt4/ui/open_net.ui

index 8576213..3dee1f7 100644 (file)
@@ -240,14 +240,16 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 {
     ui.setupUi( this );
 
-    CONNECT( ui.deviceCombo, editTextChanged(QString ), this, updateMRL());
-    BUTTONACT( ui.dvdRadioButton, updateMRL());
-    BUTTONACT( ui.vcdRadioButton, updateMRL());
-    BUTTONACT( ui.audioCDRadioButton, updateMRL());
-    BUTTONACT( ui.dvdsimple,  updateMRL());
+    BUTTONACT( ui.dvdRadioButton, updateButtons());
+    BUTTONACT( ui.vcdRadioButton, updateButtons());
+    BUTTONACT( ui.audioCDRadioButton, updateButtons());
+    BUTTONACT( ui.dvdsimple,  updateButtons());
 
+    CONNECT( ui.deviceCombo, editTextChanged(QString ), this, updateMRL());
     CONNECT( ui.titleSpin, 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()
@@ -259,6 +261,34 @@ void DiscOpenPanel::clear()
     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()
 {
     QString mrl = "";
@@ -290,6 +320,20 @@ void DiscOpenPanel::updateMRL()
     /* CDDA */
     } else {
         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);
index 96ee023..7bc7f3a 100644 (file)
@@ -115,6 +115,7 @@ private:
     Ui::OpenDisk ui;
 public slots:
     virtual void updateMRL() ;
+    virtual void updateButtons() ;
 };
 
 
index d7a72d4..58e83c0 100644 (file)
@@ -9,7 +9,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>400</width>
+    <width>448</width>
     <height>300</height>
    </rect>
   </property>
        </widget>
       </item>
       <item row="4" column="1" colspan="5" >
-       <widget class="Line" name="line" >
+       <widget class="Line" name="" >
         <property name="orientation" >
          <enum>Qt::Horizontal</enum>
         </property>
        </widget>
       </item>
       <item row="1" column="1" colspan="5" >
-       <widget class="Line" name="line_2" >
+       <widget class="Line" name="" >
         <property name="orientation" >
          <enum>Qt::Horizontal</enum>
         </property>
index 37d1db6..5c9b5b4 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>400</width>
-    <height>165</height>
+    <width>314</width>
+    <height>140</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <property name="spacing" >
     <number>6</number>
    </property>
-   <item row="3" column="1" >
-    <spacer>
-     <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" >
+   <item row="1" column="0" colspan="2" >
+    <widget class="QGroupBox" name="groupBox" >
      <property name="sizePolicy" >
       <sizepolicy>
-       <hsizetype>5</hsizetype>
-       <vsizetype>0</vsizetype>
+       <hsizetype>3</hsizetype>
+       <vsizetype>5</vsizetype>
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
-     <property name="text" >
+     <property name="title" >
       <string>Card Selection</string>
      </property>
+     <widget class="QWidget" name="gridLayout" >
+      <property name="geometry" >
+       <rect>
+        <x>10</x>
+        <y>10</y>
+        <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>
+      </layout>
+     </widget>
     </widget>
    </item>
-   <item row="0" column="0" >
-    <widget class="QLabel" name="label" >
-     <property name="text" >
-      <string>Capture Mode</string>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="0" colspan="3" >
+   <item row="2" column="0" colspan="2" >
     <widget class="QGroupBox" name="Options" >
      <property name="sizePolicy" >
       <sizepolicy>
      </layout>
     </widget>
    </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>
  </widget>
  <resources/>
index e62c9bd..5d1b3bb 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>400</width>
-    <height>287</height>
+    <width>462</width>
+    <height>407</height>
    </rect>
   </property>
   <property name="windowTitle" >
@@ -73,7 +73,7 @@
        </widget>
       </item>
       <item row="3" column="0" colspan="2" >
-       <widget class="QLabel" name="label" >
+       <widget class="QLabel" name="deviceLabel" >
         <property name="text" >
          <string>Disk device</string>
         </property>
     </widget>
    </item>
    <item>
-    <widget class="QGroupBox" name="diskOptionGroupBox" >
+    <widget class="QGroupBox" name="diskOptionBox" >
      <property name="sizePolicy" >
       <sizepolicy>
        <hsizetype>5</hsizetype>
        <number>6</number>
       </property>
       <item row="1" column="0" >
-       <widget class="QLabel" name="label_3" >
+       <widget class="QLabel" name="chapterLabel" >
         <property name="text" >
          <string>Chapter</string>
         </property>
          <string/>
         </property>
         <property name="minimum" >
-         <number>-1</number>
+         <number>0</number>
         </property>
         <property name="value" >
-         <number>-1</number>
+         <number>0</number>
         </property>
        </widget>
       </item>
       <item row="0" column="0" >
-       <widget class="QLabel" name="label_2" >
+       <widget class="QLabel" name="titleLabel" >
         <property name="text" >
          <string>Title</string>
         </property>
         <property name="suffix" >
          <string/>
         </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" >
          <number>-1</number>
         </property>
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
      </property>
+     <property name="sizeType" >
+      <enum>QSizePolicy::MinimumExpanding</enum>
+     </property>
      <property name="sizeHint" >
       <size>
-       <width>420</width>
-       <height>16</height>
+       <width>444</width>
+       <height>10</height>
       </size>
      </property>
     </spacer>
index 5ce7f20..2bb31f8 100644 (file)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>420</width>
-    <height>205</height>
+    <height>195</height>
    </rect>
   </property>
   <property name="windowTitle" >
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
      </property>
+     <property name="sizeType" >
+      <enum>QSizePolicy::MinimumExpanding</enum>
+     </property>
      <property name="sizeHint" >
       <size>
        <width>20</width>
-       <height>40</height>
+       <height>10</height>
       </size>
      </property>
     </spacer>