]> git.sesse.net Git - vlc/commitdiff
Qt: OpenFile: Use QGroupBox for subs.
authorFrancois Cartegnie <fcvlcdev@free.fr>
Tue, 11 Jun 2013 17:49:17 +0000 (19:49 +0200)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Tue, 11 Jun 2013 17:51:05 +0000 (19:51 +0200)
And don't make use of confusing raised QFrame panels.

modules/gui/qt4/components/open_panels.cpp
modules/gui/qt4/components/open_panels.hpp
modules/gui/qt4/ui/open_file.ui

index 0acf518295ffe75b1a4d0517cf02456ec10d6a1d..4c516cdd46d13ff911a74d1361f560e6e23e8ed6 100644 (file)
@@ -107,14 +107,14 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 
     /* Subtitles */
     /* Deactivate the subtitles control by default. */
-    ui.subFrame->setEnabled( false );
+    ui.subGroupBox->setEnabled( false );
 
     /* Connects  */
     BUTTONACT( ui.fileBrowseButton, browseFile() );
     BUTTONACT( ui.removeFileButton, removeFile() );
 
     BUTTONACT( ui.subBrowseButton, browseFileSub() );
-    CONNECT( ui.subCheckBox, toggled( bool ), this, toggleSubtitleFrame( bool ) );
+    CONNECT( ui.subGroupBox, toggled( bool ), this, updateMRL() );
 
     CONNECT( ui.fileListWidg, itemChanged( QListWidgetItem * ), this, updateMRL() );
     CONNECT( ui.subInput, textChanged( const QString& ), this, updateMRL() );
@@ -257,15 +257,6 @@ void FileOpenPanel::browseFileSub()
     updateMRL();
 }
 
-void FileOpenPanel::toggleSubtitleFrame( bool b )
-{
-    ui.subFrame->setEnabled( b );
-
-    /* Update the MRL */
-    updateMRL();
-}
-
-
 /* Update the current MRL */
 void FileOpenPanel::updateMRL()
 {
@@ -287,7 +278,7 @@ void FileOpenPanel::updateMRL()
     }
 
     /* Options */
-    if( ui.subCheckBox->isChecked() &&  !ui.subInput->text().isEmpty() ) {
+    if( ui.subGroupBox->isChecked() &&  !ui.subInput->text().isEmpty() ) {
         mrl.append( " :sub-file=" + colon_escape( ui.subInput->text() ) );
     }
 
@@ -315,7 +306,7 @@ void FileOpenPanel::updateButtons()
 {
     bool b_has_files = ( ui.fileListWidg->count() > 0 );
     ui.removeFileButton->setEnabled( b_has_files );
-    ui.subCheckBox->setEnabled( b_has_files );
+    ui.subGroupBox->setEnabled( b_has_files );
 }
 
 /**************************************************************************
index 48eeb6e534cc4d5b8bab759253c6f3f7484589a8..70082ba40dc065692f0271a831b0ae8e6080dbd0 100644 (file)
@@ -130,7 +130,6 @@ private slots:
     void browseFile();
     void removeFile();
     void updateButtons();
-    void toggleSubtitleFrame( bool );
 };
 
 class NetOpenPanel: public OpenPanel
index df7147d8e9ea1fc09b4935b39c1a17e831556b7c..56a0715d95012f7414b409729a931789e717125d 100644 (file)
    <string>Open File</string>
   </property>
   <layout class="QGridLayout" name="gridLayout">
+   <item row="1" column="0">
+    <widget class="QGroupBox" name="subGroupBox">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="title">
+      <string>Use a sub&amp;title file</string>
+     </property>
+     <property name="checkable">
+      <bool>true</bool>
+     </property>
+     <property name="checked">
+      <bool>false</bool>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_2">
+      <item>
+       <widget class="QLineEdit" name="subInput"/>
+      </item>
+      <item>
+       <widget class="QPushButton" name="subBrowseButton">
+        <property name="minimumSize">
+         <size>
+          <width>100</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="toolTip">
+         <string>Select the subtitle file</string>
+        </property>
+        <property name="text">
+         <string>Browse...</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
    <item row="0" column="0">
     <widget class="QGroupBox" name="tempWidget">
      <property name="toolTip">
      </layout>
     </widget>
    </item>
-   <item row="1" column="0">
-    <widget class="QCheckBox" name="subCheckBox">
-     <property name="enabled">
-      <bool>false</bool>
-     </property>
-     <property name="toolTip">
-      <string>Add a subtitle file</string>
-     </property>
-     <property name="text">
-      <string>Use a sub&amp;title file</string>
-     </property>
-    </widget>
-   </item>
    <item row="2" column="0">
-    <widget class="QFrame" name="subFrame">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="frameShape">
-      <enum>QFrame::StyledPanel</enum>
-     </property>
-     <layout class="QVBoxLayout" name="verticalLayout">
-      <item>
-       <widget class="QWidget" name="widget" native="true">
-        <layout class="QHBoxLayout" name="horizontalLayout">
-         <item>
-          <widget class="QLineEdit" name="subInput"/>
-         </item>
-         <item>
-          <widget class="QPushButton" name="subBrowseButton">
-           <property name="minimumSize">
-            <size>
-             <width>100</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="toolTip">
-            <string>Select the subtitle file</string>
-           </property>
-           <property name="text">
-            <string>Browse...</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="3" column="0">
     <spacer>
      <property name="orientation">
       <enum>Qt::Vertical</enum>
   <tabstop>fileListWidg</tabstop>
   <tabstop>fileBrowseButton</tabstop>
   <tabstop>removeFileButton</tabstop>
-  <tabstop>subCheckBox</tabstop>
  </tabstops>
  <resources/>
  <connections/>