From ea92ef2be2ebfdbb94be206a0aa82dbf1171154d Mon Sep 17 00:00:00 2001
From: Antoine Cellerier <dionoea@videolan.org>
Date: Sun, 27 Aug 2006 16:07:10 +0000
Subject: [PATCH] Bind simple prefs forms to corresponding simple prefs
 categories

---
 modules/gui/qt4/Modules.am                    |  17 ++-
 .../gui/qt4/components/simple_preferences.cpp |  26 +++-
 modules/gui/qt4/dialogs/prefs_dialog.cpp      |   2 +-
 modules/gui/qt4/ui/sprefs_audio.ui            | 127 +++++++++---------
 modules/gui/qt4/ui/sprefs_playlist.ui         |  18 +--
 modules/gui/qt4/ui/sprefs_subtitles.ui        |  16 +--
 modules/gui/qt4/ui/sprefs_video.ui            |  26 ++--
 7 files changed, 130 insertions(+), 102 deletions(-)

diff --git a/modules/gui/qt4/Modules.am b/modules/gui/qt4/Modules.am
index 84e464316535..6e48ab5ba7d9 100644
--- a/modules/gui/qt4/Modules.am
+++ b/modules/gui/qt4/Modules.am
@@ -12,7 +12,9 @@
 AUTOMAKE_OPTIONS = subdir-objects
 
 TOUI = ui/input_stats ui/main_interface ui/file_open \
-       ui/logindialog ui/inputdialog ui/progressdialog ui/sprefs_trivial
+       ui/logindialog ui/inputdialog ui/progressdialog ui/sprefs_trivial \
+       ui/sprefs_audio ui/sprefs_playlist ui/sprefs_subtitles \
+       ui/sprefs_video
 UIH = $(TOUI:%=%.h)
 
 TOMOC = main_interface \
@@ -138,10 +140,21 @@ EXTRA_DIST += \
 	ui/inputdialog.ui \
 	ui/progressdialog.ui \
 	ui/sprefs_trivial.ui \
+	ui/sprefs_audio.ui \
+	ui/sprefs_video.ui \
+	ui/sprefs_playlist.ui \
+	ui/sprefs_subtitles.ui \
 	pixmaps/advanced.xpm \
 	pixmaps/audio.xpm \
 	pixmaps/codec.xpm \
 	pixmaps/intf.xpm \
 	pixmaps/type_net.xpm \
 	pixmaps/type_playlist.xpm \
-	pixmaps/video.xpm
+	pixmaps/video.xpm \
+	pixmaps/advanced_50x50.xpm \
+	pixmaps/audio_50x50.xpm \
+	pixmaps/input_and_codecs_50x50.xpm \
+	pixmaps/interface_50x50.xpm \
+	pixmaps/playlist_50x50.xpm \
+	pixmaps/subtitles_50x50.xpm \
+	pixmaps/video_50x50.xpm
diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp
index a651e66b25f5..ef663b0d358c 100644
--- a/modules/gui/qt4/components/simple_preferences.cpp
+++ b/modules/gui/qt4/components/simple_preferences.cpp
@@ -41,6 +41,10 @@
 #include "pixmaps/video_50x50.xpm"
 
 #include "ui/sprefs_trivial.h"
+#include "ui/sprefs_audio.h"
+#include "ui/sprefs_video.h"
+#include "ui/sprefs_subtitles.h"
+#include "ui/sprefs_playlist.h"
 
 #define ITEM_HEIGHT 50
 
@@ -115,19 +119,15 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
     {
         case SPrefsVideo:
         {
-            Ui::SPrefsTrivial ui;
+            Ui::SPrefsVideo ui;
             ui.setupUi( this );
-            module_config_t *p_config =
-                            config_FindConfig( VLC_OBJECT(p_intf), "memcpy" );
-            ConfigControl *control =
-                            new ModuleConfigControl( VLC_OBJECT(p_intf),
-                            p_config, ui.memcpyLabel, ui.memcpyCombo, false );
-            controls.append( control );
             break;
         }
 
         case SPrefsAudio:
         {
+            Ui::SPrefsAudio ui;
+            ui.setupUi( this );
             break;
         }
 
@@ -138,6 +138,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
 
         case SPrefsPlaylist:
         {
+            Ui::SPrefsPlaylist ui;
+            ui.setupUi( this );
             break;
         }
 
@@ -148,11 +150,21 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
 
         case SPrefsSubtitles:
         {
+            Ui::SPrefsSubtitles ui;
+            ui.setupUi( this );
             break;
         }
 
         case SPrefsAdvanced:
         {
+            Ui::SPrefsTrivial ui;
+            ui.setupUi( this );
+            module_config_t *p_config =
+                            config_FindConfig( VLC_OBJECT(p_intf), "memcpy" );
+            ConfigControl *control =
+                            new ModuleConfigControl( VLC_OBJECT(p_intf),
+                            p_config, ui.memcpyLabel, ui.memcpyCombo, false );
+            controls.append( control );
             break;
         }
     }
diff --git a/modules/gui/qt4/dialogs/prefs_dialog.cpp b/modules/gui/qt4/dialogs/prefs_dialog.cpp
index d5505c0a2e5b..373da3ad254d 100644
--- a/modules/gui/qt4/dialogs/prefs_dialog.cpp
+++ b/modules/gui/qt4/dialogs/prefs_dialog.cpp
@@ -56,7 +56,7 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
      small = new QRadioButton( "Basic", types ); tl->addWidget( small );
      all = new QRadioButton( "All", types ); tl->addWidget( all );
      types->setLayout(tl);
-     all->setChecked( true );
+     small->setChecked( true );
 
      adv_chk = new QCheckBox("Advanced options");
 
diff --git a/modules/gui/qt4/ui/sprefs_audio.ui b/modules/gui/qt4/ui/sprefs_audio.ui
index 283dd06a349d..5bcb49be69a7 100644
--- a/modules/gui/qt4/ui/sprefs_audio.ui
+++ b/modules/gui/qt4/ui/sprefs_audio.ui
@@ -2,8 +2,8 @@
  <author></author>
  <comment></comment>
  <exportmacro></exportmacro>
- <class>Form</class>
- <widget class="QWidget" name="Form" >
+ <class>SPrefsAudio</class>
+ <widget class="QWidget" name="SPrefsAudio" >
   <property name="geometry" >
    <rect>
     <x>0</x>
@@ -22,7 +22,7 @@
    <property name="spacing" >
     <number>6</number>
    </property>
-   <item row="9" column="0" colspan="3" >
+   <item row="9" column="0" colspan="2" >
     <widget class="QGroupBox" name="groupBox" >
      <property name="title" >
       <string>Filters</string>
@@ -34,129 +34,132 @@
       <property name="spacing" >
        <number>6</number>
       </property>
+      <item row="1" column="0" colspan="2" >
+       <widget class="QCheckBox" name="headphoneEffect" >
+        <property name="text" >
+         <string>Headphone effect</string>
+        </property>
+       </widget>
+      </item>
       <item row="0" column="2" >
-       <widget class="QComboBox" name="comboBox_5" />
+       <widget class="QComboBox" name="equalizerPreset" />
       </item>
       <item row="0" column="1" >
        <widget class="QLabel" name="label_6" >
+        <property name="layoutDirection" >
+         <enum>Qt::RightToLeft</enum>
+        </property>
         <property name="text" >
          <string>Preset</string>
         </property>
        </widget>
       </item>
-      <item row="3" column="0" >
-       <widget class="QCheckBox" name="checkBox_5" >
+      <item row="0" column="0" >
+       <widget class="QCheckBox" name="equalizer" >
         <property name="text" >
-         <string>Parametric equalizer</string>
+         <string>Equalizer</string>
         </property>
        </widget>
       </item>
-      <item row="2" column="0" >
-       <widget class="QCheckBox" name="checkBox_4" >
+      <item row="2" column="0" colspan="2" >
+       <widget class="QCheckBox" name="volumeNormalizer" >
         <property name="text" >
          <string>Volume normalizer</string>
         </property>
        </widget>
       </item>
-      <item row="1" column="0" >
-       <widget class="QCheckBox" name="checkBox_3" >
+      <item row="3" column="0" colspan="2" >
+       <widget class="QCheckBox" name="parametricEqualizer" >
         <property name="text" >
-         <string>Headphone effect</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="0" >
-       <widget class="QCheckBox" name="checkBox_2" >
-        <property name="text" >
-         <string>Equalizer</string>
+         <string>Parametric equalizer</string>
         </property>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
-   <item row="8" column="0" >
-    <widget class="QLabel" name="label_5" >
+   <item row="0" column="0" >
+    <widget class="QCheckBox" name="enableAudio" >
      <property name="text" >
-      <string>Visualisation</string>
+      <string>Enable audio</string>
      </property>
-    </widget>
-   </item>
-   <item row="8" column="2" >
-    <widget class="QComboBox" name="comboBox_4" />
-   </item>
-   <item row="7" column="0" colspan="3" >
-    <widget class="Line" name="line_3" >
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
+     <property name="checked" >
+      <bool>true</bool>
      </property>
     </widget>
    </item>
-   <item row="4" column="0" colspan="3" >
-    <widget class="Line" name="line_2" >
+   <item row="1" column="0" colspan="2" >
+    <widget class="Line" name="line" >
      <property name="orientation" >
       <enum>Qt::Horizontal</enum>
      </property>
     </widget>
    </item>
-   <item row="6" column="2" >
-    <widget class="QComboBox" name="comboBox_3" />
-   </item>
-   <item row="6" column="0" >
-    <widget class="QLabel" name="label_4" >
+   <item row="2" column="0" >
+    <widget class="QLabel" name="label" >
      <property name="text" >
-      <string>Output device</string>
+      <string>Prefered audio language</string>
      </property>
     </widget>
    </item>
-   <item row="5" column="2" >
-    <widget class="QComboBox" name="comboBox_2" />
+   <item row="2" column="1" >
+    <widget class="QComboBox" name="preferedAudioLanguage" />
    </item>
-   <item row="5" column="0" colspan="2" >
-    <widget class="QLabel" name="label_3" >
+   <item row="3" column="0" >
+    <widget class="QLabel" name="label_2" >
      <property name="text" >
-      <string>Output module</string>
+      <string>Default volume</string>
      </property>
     </widget>
    </item>
-   <item row="3" column="2" >
-    <widget class="QSlider" name="horizontalSlider" >
+   <item row="3" column="1" >
+    <widget class="QSlider" name="defaultVolume" >
      <property name="orientation" >
       <enum>Qt::Horizontal</enum>
      </property>
     </widget>
    </item>
-   <item row="3" column="0" >
-    <widget class="QLabel" name="label_2" >
+   <item row="5" column="0" >
+    <widget class="QLabel" name="label_3" >
      <property name="text" >
-      <string>Default volume</string>
+      <string>Output module</string>
      </property>
     </widget>
    </item>
-   <item row="2" column="2" >
-    <widget class="QComboBox" name="comboBox" />
+   <item row="5" column="1" >
+    <widget class="QComboBox" name="outputModule" />
    </item>
-   <item row="2" column="0" colspan="2" >
-    <widget class="QLabel" name="label" >
+   <item row="6" column="0" >
+    <widget class="QLabel" name="label_4" >
      <property name="text" >
-      <string>Prefered audio language</string>
+      <string>Output device</string>
      </property>
     </widget>
    </item>
-   <item row="1" column="0" colspan="3" >
-    <widget class="Line" name="line" >
+   <item row="6" column="1" >
+    <widget class="QComboBox" name="outputDevice" />
+   </item>
+   <item row="4" column="0" colspan="2" >
+    <widget class="Line" name="line_2" >
      <property name="orientation" >
       <enum>Qt::Horizontal</enum>
      </property>
     </widget>
    </item>
-   <item row="0" column="0" >
-    <widget class="QCheckBox" name="checkBox" >
-     <property name="text" >
-      <string>Enable audio</string>
+   <item row="7" column="0" colspan="2" >
+    <widget class="Line" name="line_3" >
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
      </property>
-     <property name="checked" >
-      <bool>true</bool>
+    </widget>
+   </item>
+   <item row="8" column="1" >
+    <widget class="QComboBox" name="visualisation" />
+   </item>
+   <item row="8" column="0" >
+    <widget class="QLabel" name="label_5" >
+     <property name="text" >
+      <string>Visualisation</string>
      </property>
     </widget>
    </item>
diff --git a/modules/gui/qt4/ui/sprefs_playlist.ui b/modules/gui/qt4/ui/sprefs_playlist.ui
index 544293693585..b96b077c7c5a 100644
--- a/modules/gui/qt4/ui/sprefs_playlist.ui
+++ b/modules/gui/qt4/ui/sprefs_playlist.ui
@@ -2,8 +2,8 @@
  <author></author>
  <comment></comment>
  <exportmacro></exportmacro>
- <class>Form</class>
- <widget class="QWidget" name="Form" >
+ <class>SPrefsPlaylist</class>
+ <widget class="QWidget" name="SPrefsPlaylist" >
   <property name="geometry" >
    <rect>
     <x>0</x>
@@ -35,7 +35,7 @@
        <number>6</number>
       </property>
       <item>
-       <widget class="QCheckBox" name="checkBox" >
+       <widget class="QCheckBox" name="playFilesRandomlyForEver" >
         <property name="toolTip" >
          <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;/p>&lt;/body>&lt;/html></string>
         </property>
@@ -45,21 +45,21 @@
        </widget>
       </item>
       <item>
-       <widget class="QCheckBox" name="checkBox_2" >
+       <widget class="QCheckBox" name="repeatAll" >
         <property name="text" >
          <string>Repeat all</string>
         </property>
        </widget>
       </item>
       <item>
-       <widget class="QCheckBox" name="checkBox_3" >
+       <widget class="QCheckBox" name="repeatCurrentItem" >
         <property name="text" >
          <string>Repeat current item</string>
         </property>
        </widget>
       </item>
       <item>
-       <widget class="QCheckBox" name="checkBox_4" >
+       <widget class="QCheckBox" name="playAndStop" >
         <property name="text" >
          <string>Play and stop</string>
         </property>
@@ -91,14 +91,14 @@
        </widget>
       </item>
       <item row="1" column="1" >
-       <widget class="QLineEdit" name="lineEdit" >
+       <widget class="QLineEdit" name="defaultPlaylist" >
         <property name="enabled" >
          <bool>false</bool>
         </property>
        </widget>
       </item>
       <item row="1" column="2" >
-       <widget class="QPushButton" name="pushButton" >
+       <widget class="QPushButton" name="defaultPlaylistBrowse" >
         <property name="enabled" >
          <bool>false</bool>
         </property>
@@ -108,7 +108,7 @@
        </widget>
       </item>
       <item row="0" column="0" colspan="2" >
-       <widget class="QCheckBox" name="checkBox_5" >
+       <widget class="QCheckBox" name="rememberPlaylist" >
         <property name="text" >
          <string>Remember playlist</string>
         </property>
diff --git a/modules/gui/qt4/ui/sprefs_subtitles.ui b/modules/gui/qt4/ui/sprefs_subtitles.ui
index 9fad1dcfb43f..625ad484a184 100644
--- a/modules/gui/qt4/ui/sprefs_subtitles.ui
+++ b/modules/gui/qt4/ui/sprefs_subtitles.ui
@@ -2,8 +2,8 @@
  <author></author>
  <comment></comment>
  <exportmacro></exportmacro>
- <class>Form</class>
- <widget class="QWidget" name="Form" >
+ <class>SPrefsSubtitles</class>
+ <widget class="QWidget" name="SPrefsSubtitles" >
   <property name="geometry" >
    <rect>
     <x>0</x>
@@ -49,20 +49,20 @@
        <number>6</number>
       </property>
       <item row="0" column="1" >
-       <widget class="QLineEdit" name="lineEdit" />
+       <widget class="QLineEdit" name="font" />
       </item>
       <item row="1" column="1" colspan="2" >
-       <widget class="QComboBox" name="comboBox_3" />
+       <widget class="QComboBox" name="fontSize" />
       </item>
       <item row="0" column="2" >
-       <widget class="QPushButton" name="pushButton" >
+       <widget class="QPushButton" name="fontBrowse" >
         <property name="text" >
          <string>Browse</string>
         </property>
        </widget>
       </item>
       <item row="2" column="1" colspan="2" >
-       <widget class="QComboBox" name="comboBox_4" />
+       <widget class="QComboBox" name="fontColor" />
       </item>
       <item row="2" column="0" >
        <widget class="QLabel" name="label_4" >
@@ -89,10 +89,10 @@
     </widget>
    </item>
    <item row="0" column="1" >
-    <widget class="QComboBox" name="comboBox" />
+    <widget class="QComboBox" name="preferedLanguage" />
    </item>
    <item row="1" column="1" >
-    <widget class="QComboBox" name="comboBox_2" />
+    <widget class="QComboBox" name="encoding" />
    </item>
    <item row="3" column="0" colspan="2" >
     <spacer>
diff --git a/modules/gui/qt4/ui/sprefs_video.ui b/modules/gui/qt4/ui/sprefs_video.ui
index f267206e75e7..609e07021f18 100644
--- a/modules/gui/qt4/ui/sprefs_video.ui
+++ b/modules/gui/qt4/ui/sprefs_video.ui
@@ -2,8 +2,8 @@
  <author></author>
  <comment></comment>
  <exportmacro></exportmacro>
- <class>Form</class>
- <widget class="QWidget" name="Form" >
+ <class>SPrefsVideo</class>
+ <widget class="QWidget" name="SPrefsVideo" >
   <property name="geometry" >
    <rect>
     <x>0</x>
@@ -35,10 +35,10 @@
        <number>6</number>
       </property>
       <item row="0" column="1" colspan="2" >
-       <widget class="QLineEdit" name="lineEdit" />
+       <widget class="QLineEdit" name="snapshotsDirectory" />
       </item>
       <item row="0" column="3" >
-       <widget class="QPushButton" name="pushButton" >
+       <widget class="QPushButton" name="snapshotsDirectoryBrowse" >
         <property name="text" >
          <string>Browse</string>
         </property>
@@ -59,7 +59,7 @@
        </widget>
       </item>
       <item row="1" column="1" >
-       <widget class="QLineEdit" name="lineEdit_2" />
+       <widget class="QLineEdit" name="snapshotsPrefix" />
       </item>
       <item row="2" column="0" >
        <widget class="QLabel" name="label_3" >
@@ -70,10 +70,10 @@
        </widget>
       </item>
       <item row="2" column="1" colspan="3" >
-       <widget class="QComboBox" name="comboBox" />
+       <widget class="QComboBox" name="snapshotsFormat" />
       </item>
       <item row="1" column="2" colspan="2" >
-       <widget class="QCheckBox" name="checkBox_5" >
+       <widget class="QCheckBox" name="snapshotsSequentialNumbering" >
         <property name="text" >
          <string>Sequential numbering</string>
         </property>
@@ -95,7 +95,7 @@
        <number>6</number>
       </property>
       <item row="2" column="1" colspan="2" >
-       <widget class="QComboBox" name="comboBox_2" />
+       <widget class="QComboBox" name="outputModule" />
       </item>
       <item row="2" column="0" >
        <widget class="QLabel" name="label_4" >
@@ -105,28 +105,28 @@
        </widget>
       </item>
       <item row="0" column="0" colspan="2" >
-       <widget class="QCheckBox" name="checkBox_2" >
+       <widget class="QCheckBox" name="fullscreen" >
         <property name="text" >
          <string>Fullscreen</string>
         </property>
        </widget>
       </item>
       <item row="1" column="2" >
-       <widget class="QCheckBox" name="checkBox_6" >
+       <widget class="QCheckBox" name="windowDecorations" >
         <property name="text" >
          <string>Window decorations</string>
         </property>
        </widget>
       </item>
       <item row="1" column="0" colspan="2" >
-       <widget class="QCheckBox" name="checkBox_4" >
+       <widget class="QCheckBox" name="alwaysOnTop" >
         <property name="text" >
          <string>Always on top</string>
         </property>
        </widget>
       </item>
       <item row="0" column="2" >
-       <widget class="QCheckBox" name="checkBox_3" >
+       <widget class="QCheckBox" name="overlay" >
         <property name="text" >
          <string>Overlay video output</string>
         </property>
@@ -136,7 +136,7 @@
     </widget>
    </item>
    <item row="0" column="0" >
-    <widget class="QCheckBox" name="checkBox" >
+    <widget class="QCheckBox" name="enableVideo" >
      <property name="text" >
       <string>Enable video</string>
      </property>
-- 
GitLab