]> git.sesse.net Git - vlc/commitdiff
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 8576213f5f99ecb23ba192c6b951610ab9015e29..3dee1f76a4ef3f44db78f1cf219b7aacf5fe02ce 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 96ee0236dd65c7f0046c8bb38f8139025627c9f4..7bc7f3ad088a19ae30a7493edbb91a235700a239 100644 (file)
@@ -115,6 +115,7 @@ private:
     Ui::OpenDisk ui;
 public slots:
     virtual void updateMRL() ;
+    virtual void updateButtons() ;
 };
 
 
index d7a72d4fde0a727fd829ee2c6675dca794f8120a..58e83c0d4ef1aba9607eb92d3c4390b4c733e48f 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 37d1db628aefa459b8e07239430e52bfa1bba425..5c9b5b486e9712a92ee59b70181dd95225ea77f6 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 e62c9bd821bac9b60d30e9c47eb26c11280537af..5d1b3bb836e23c8375805148bd5a418e03e0c119 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 5ce7f209870059c7008ef216543cabc357cfd9c1..2bb31f89126c9692f71b07616aa0f543b707948f 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>