]> git.sesse.net Git - vlc/commitdiff
Qt: simple preferences, User Experience improvements.
authorJean-Baptiste Kempf <jb@videolan.org>
Fri, 16 Jan 2009 17:37:56 +0000 (18:37 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 16 Jan 2009 17:45:04 +0000 (18:45 +0100)
- Set buddies where possible.
- Set tooltips on most labels.

modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/ui/sprefs_audio.ui
modules/gui/qt4/ui/sprefs_input.ui
modules/gui/qt4/ui/sprefs_interface.ui
modules/gui/qt4/ui/sprefs_subtitles.ui
modules/gui/qt4/ui/sprefs_video.ui

index d81ec55474c3e6ef9f8a2fc9e879cfb915e76fb7..8b878214a29e480336b4ab443058eaa0fbd0b41e 100644 (file)
@@ -246,7 +246,10 @@ void StringConfigControl::finish()
     text->setText( qfu(p_item->value.psz) );
     text->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
     if( label )
+    {
         label->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
+        label->setBuddy( text );
+    }
 }
 
 /*********** File **************/
@@ -313,7 +316,10 @@ void FileConfigControl::finish()
     text->setText( qfu(p_item->value.psz) );
     text->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
     if( label )
+    {
         label->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
+        label->setBuddy( text );
+    }
 }
 
 /********* String / Directory **********/
@@ -477,7 +483,10 @@ void StringListConfigControl::finish(module_config_t *p_module_config, bool byca
     }
     combo->setToolTip( formatTooltip(qtr(p_module_config->psz_longtext)) );
     if( label )
+    {
         label->setToolTip( formatTooltip(qtr(p_module_config->psz_longtext)) );
+        label->setBuddy( combo );
+    }
 }
 
 QString StringListConfigControl::getValue()
@@ -593,7 +602,10 @@ void ModuleConfigControl::finish( bool bycat )
     module_list_free( p_list );
     combo->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
     if( label )
+    {
         label->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
+        label->setBuddy( combo );
+    }
 }
 
 QString ModuleConfigControl::getValue()
@@ -801,7 +813,10 @@ void IntegerConfigControl::finish()
     spin->setValue( p_item->value.i );
     spin->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
     if( label )
+    {
         label->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
+        label->setBuddy( spin );
+    }
 }
 
 int IntegerConfigControl::getValue()
@@ -846,7 +861,10 @@ IntegerRangeSliderConfigControl::IntegerRangeSliderConfigControl(
     slider->setValue( p_item->value.i );
     slider->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
     if( label )
+    {
         label->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
+        label->setBuddy( slider );
+    }
 }
 
 int IntegerRangeSliderConfigControl::getValue()
@@ -939,7 +957,10 @@ void IntegerListConfigControl::finish(module_config_t *p_module_config, bool byc
     }
     combo->setToolTip( formatTooltip(qtr(p_module_config->psz_longtext)) );
     if( label )
+    {
         label->setToolTip( formatTooltip(qtr(p_module_config->psz_longtext)) );
+        label->setBuddy( combo );
+    }
 }
 
 void IntegerListConfigControl::actionRequested( int i_action )
@@ -1064,7 +1085,10 @@ void FloatConfigControl::finish()
     spin->setValue( (double)p_item->value.f );
     spin->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
     if( label )
+    {
         label->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
+        label->setBuddy( spin );
+    }
 }
 
 float FloatConfigControl::getValue()
index d77d6a183a00911c2a451c3f264d1873ba4c8678..9e41a23db837ea9fb0ffd7f27eeeb05c467dde1d 100644 (file)
@@ -186,11 +186,11 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             CONFIG_GENERIC( "video-on-top", Bool, NULL, alwaysOnTop );
             CONFIG_GENERIC( "video-deco", Bool, NULL, windowDecorations );
             CONFIG_GENERIC( "skip-frames" , Bool, NULL, skipFrames );
-            CONFIG_GENERIC( "vout", Module, NULL, outputModule );
+            CONFIG_GENERIC( "vout", Module, ui.voutLabel, outputModule );
 
 #ifdef WIN32
             CONFIG_GENERIC( "directx-wallpaper" , Bool , NULL, wallpaperMode );
-            CONFIG_GENERIC( "directx-device", StringList, NULL,
+            CONFIG_GENERIC( "directx-device", StringList, ui.dxDeviceLabel,
                             dXdisplayDevice );
             CONFIG_GENERIC( "directx-hw-yuv", Bool, NULL, hwYUVBox );
 #else
@@ -198,15 +198,15 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             ui.hwYUVBox->setVisible( false );
 #endif
 
-            CONFIG_GENERIC( "deinterlace-mode", StringList, NULL, deinterlaceBox );
-            CONFIG_GENERIC( "aspect-ratio", String, NULL, arLine );
+            CONFIG_GENERIC( "deinterlace-mode", StringList, ui.deinterLabel, deinterlaceBox );
+            CONFIG_GENERIC( "aspect-ratio", String, ui.arLabel, arLine );
 
-            CONFIG_GENERIC_FILE( "snapshot-path", Directory, NULL,
+            CONFIG_GENERIC_FILE( "snapshot-path", Directory, ui.dirLabel,
                                  ui.snapshotsDirectory, ui.snapshotsDirectoryBrowse );
-            CONFIG_GENERIC( "snapshot-prefix", String, NULL, snapshotsPrefix );
+            CONFIG_GENERIC( "snapshot-prefix", String, ui.prefixLabel, snapshotsPrefix );
             CONFIG_GENERIC( "snapshot-sequential", Bool, NULL,
                             snapshotsSequentialNumbering );
-            CONFIG_GENERIC( "snapshot-format", StringList, NULL,
+            CONFIG_GENERIC( "snapshot-format", StringList, ui.arLabel,
                             snapshotsFormat );
          END_SPREFS_CAT;
 
@@ -254,14 +254,14 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             audioControl( DirectX );
             optionWidgets.append( DirectXControl );
             CONFIG_GENERIC2( "directx-audio-device", IntegerList,
-                    DirectXLabel, DirectXDevice );
+                    ui.DirectXLabel, DirectXDevice );
 #else
             if( module_exists( "alsa" ) )
             {
                 audioControl( alsa );
                 optionWidgets.append( alsaControl );
 
-                CONFIG_GENERIC2( "alsa-audio-device" , StringList , alsaLabel,
+                CONFIG_GENERIC2( "alsa-audio-device" , StringList, NULL,
                                 alsaDevice );
             }
             else
@@ -270,7 +270,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             {
                 audioControl2( OSS );
                 optionWidgets.append( OSSControl );
-                CONFIG_GENERIC_FILE( "oss-audio-device" , File , OSSLabel, OSSDevice,
+                CONFIG_GENERIC_FILE( "oss-audio-device" , File, NULL, OSSDevice,
                                  OSSBrowse );
             }
             else
@@ -283,26 +283,27 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             CONNECT( ui.defaultVolume, valueChanged( int ),
                     this, updateAudioVolume( int ) );
 
-            CONFIG_GENERIC( "audio-language" , String , NULL,
+            CONFIG_GENERIC( "audio-language" , String , ui.langLabel,
                             preferredAudioLanguage );
 
             CONFIG_GENERIC( "spdif", Bool, NULL, spdifBox );
             CONFIG_GENERIC( "qt-autosave-volume", Bool, NULL, saveVolBox );
-            CONFIG_GENERIC( "force-dolby-surround" , IntegerList , NULL,
+            CONFIG_GENERIC( "force-dolby-surround", IntegerList, ui.dolbyLabel,
                             detectionDolby );
 
             CONFIG_GENERIC_NO_BOOL( "norm-max-level" , Float, NULL,
                                     volNormSpin );
-            CONFIG_GENERIC( "audio-visual" , Module , NULL, visualisation);
+            CONFIG_GENERIC( "audio-visual" , Module , ui.visuLabel,
+                            visualisation);
 
             /* Audio Output Specifics */
-            CONFIG_GENERIC( "aout", Module, NULL, outputModule );
+            CONFIG_GENERIC( "aout", Module, ui.outputLabel, outputModule );
 
             CONNECT( ui.outputModule, currentIndexChanged( int ),
                      this, updateAudioOptions( int ) );
 
             /* File output exists on all platforms */
-            CONFIG_GENERIC_FILE( "audiofile-file" , File , ui.fileLabel,
+            CONFIG_GENERIC_FILE( "audiofile-file", File, ui.fileLabel,
                                  ui.fileName, ui.fileBrowseButton );
 
             optionWidgets.append( ui.fileControl );
@@ -326,8 +327,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
                     ui.lastfm->setChecked( true );
                 else
                     ui.lastfm->setChecked( false );
-                CONNECT( ui.lastfm, stateChanged( int ), this ,
-                        lastfm_Changed( int ) );
+                CONNECT( ui.lastfm, stateChanged( int ),
+                         this, lastfm_Changed( int ) );
             }
             else
                 ui.lastfm->hide();
@@ -376,10 +377,12 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
                 free( psz_vcddiscpath );
             }
 
-            CONFIG_GENERIC_NO_BOOL( "server-port", Integer, NULL, UDPPort );
-            CONFIG_GENERIC( "http-proxy", String , NULL, proxy );
-            CONFIG_GENERIC_NO_BOOL( "ffmpeg-pp-q", Integer, NULL, PostProcLevel );
-            CONFIG_GENERIC( "avi-index", IntegerList, NULL, AviRepair );
+            CONFIG_GENERIC_NO_BOOL( "server-port", Integer, ui.portLabel,
+                                    UDPPort );
+            CONFIG_GENERIC( "http-proxy", String , ui.httpProxyLabel, proxy );
+            CONFIG_GENERIC_NO_BOOL( "ffmpeg-pp-q", Integer, ui.ppLabel,
+                                    PostProcLevel );
+            CONFIG_GENERIC( "avi-index", IntegerList, ui.aviLabel, AviRepair );
             CONFIG_GENERIC( "rtsp-tcp", Bool, NULL, RTSP_TCPBox );
 #ifdef WIN32
             CONFIG_GENERIC( "prefer-system-codecs", Bool, NULL, systemCodecBox );
@@ -448,7 +451,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             ui.skinsLabel->setFont( italicFont );
 
 #if defined( WIN32 )
-            CONFIG_GENERIC( "language", StringList, NULL, language );
+            CONFIG_GENERIC( "language", StringList, ui.languageLabel, language );
             BUTTONACT( ui.assoButton, assoDialog() );
 #else
             ui.language->hide();
@@ -471,13 +474,13 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             optionWidgets.append( ui.skins );
             optionWidgets.append( ui.qt4 );
 
-            CONFIG_GENERIC( "qt-display-mode", IntegerList, NULL,
+            CONFIG_GENERIC( "qt-display-mode", IntegerList, ui.displayLabel,
                             displayModeBox );
             CONFIG_GENERIC( "embedded-video", Bool, NULL, embedVideo );
             CONFIG_GENERIC( "qt-fs-controller", Bool, NULL, fsController );
             CONFIG_GENERIC( "qt-system-tray", Bool, NULL, systrayBox );
-            CONFIG_GENERIC_FILE( "skins2-last", File, NULL, ui.fileSkin,
-                    ui.skinBrowse );
+            CONFIG_GENERIC_FILE( "skins2-last", File, ui.skinFileLabel,
+                                 ui.fileSkin, ui.skinBrowse );
 
             CONFIG_GENERIC( "album-art", IntegerList, ui.artFetchLabel,
                                                       artFetcher );
@@ -506,25 +509,30 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
                      ui.recentlyPlayedFilters, setEnabled( bool ) );
             ui.recentlyPlayedFilters->setEnabled( false );
             CONFIG_GENERIC( "qt-recentplay", Bool, NULL, saveRecentlyPlayed );
-            CONFIG_GENERIC( "qt-recentplay-filter", String, NULL,
+            CONFIG_GENERIC( "qt-recentplay-filter", String, ui.filterLabel,
                     recentlyPlayedFilters );
 
         END_SPREFS_CAT;
 
-        START_SPREFS_CAT( Subtitles, qtr("Subtitles & On Screen Display Settings") );
+        START_SPREFS_CAT( Subtitles,
+                            qtr("Subtitles & On Screen Display Settings") );
             CONFIG_GENERIC( "osd", Bool, NULL, OSDBox);
             CONFIG_GENERIC( "video-title-show", Bool, NULL, OSDTitleBox);
 
 
-            CONFIG_GENERIC( "subsdec-encoding", StringList, NULL, encoding );
-            CONFIG_GENERIC( "sub-language", String, NULL, preferredLanguage );
-            CONFIG_GENERIC_FILE( "freetype-font", File, NULL, ui.font,
+            CONFIG_GENERIC( "subsdec-encoding", StringList, ui.encodLabel,
+                            encoding );
+            CONFIG_GENERIC( "sub-language", String, ui.subLangLabel,
+                            preferredLanguage );
+            CONFIG_GENERIC_FILE( "freetype-font", File, ui.fontLabel, ui.font,
                             ui.fontBrowse );
-            CONFIG_GENERIC( "freetype-color", IntegerList, NULL, fontColor );
-            CONFIG_GENERIC( "freetype-rel-fontsize", IntegerList, NULL,
-                            fontSize );
-            CONFIG_GENERIC( "freetype-effect", IntegerList, NULL, effect );
-            CONFIG_GENERIC_NO_BOOL( "sub-margin", Integer, NULL, subsPosition );
+            CONFIG_GENERIC( "freetype-color", IntegerList, ui.fontColorLabel,
+                            fontColor );
+            CONFIG_GENERIC( "freetype-rel-fontsize", IntegerList,
+                            ui.fontSizeLabel, fontSize );
+            CONFIG_GENERIC( "freetype-effect", IntegerList, ui.fontEffectLabel,
+                            effect );
+            CONFIG_GENERIC_NO_BOOL( "sub-margin", Integer, ui.subsPosLabel, subsPosition );
 
         END_SPREFS_CAT;
 
index 6d2a4c65b69522017799ac3fa9c1ee27ef9366ff..7af760a13d7931f969d606172505c6a70ba23788 100644 (file)
@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>541</width>
+    <width>559</width>
     <height>609</height>
    </rect>
   </property>
        </widget>
       </item>
       <item row="2" column="0" >
-       <widget class="QLabel" name="label_8" >
+       <widget class="QLabel" name="dolbyLabel" >
         <property name="text" >
          <string>_("Force detection of Dolby Surround")</string>
         </property>
        </widget>
       </item>
       <item row="3" column="0" >
-       <widget class="QLabel" name="label" >
+       <widget class="QLabel" name="langLabel" >
         <property name="text" >
          <string>_("Preferred audio language")</string>
         </property>
      </property>
      <layout class="QGridLayout" name="outputAudioLayout" >
       <item row="0" column="0" >
-       <widget class="QLabel" name="label_3" >
+       <widget class="QLabel" name="outputLabel" >
         <property name="minimumSize" >
          <size>
           <width>100</width>
        </widget>
       </item>
       <item row="2" column="0" >
-       <widget class="QLabel" name="label_5" >
+       <widget class="QLabel" name="visuLabel" >
         <property name="text" >
          <string>_("Visualization")</string>
         </property>
index fbf1029c2ed201b5bba478af5b301df6bb642a96..3a9bdfbab40a6f72de074e90c5ab8f027ee51365 100644 (file)
@@ -50,7 +50,7 @@
      </property>
      <layout class="QGridLayout" >
       <item row="0" column="0" >
-       <widget class="QLabel" name="label_4" >
+       <widget class="QLabel" name="portLabel" >
         <property name="text" >
          <string>_("Server default port")</string>
         </property>
@@ -76,7 +76,7 @@
        </widget>
       </item>
       <item row="1" column="0" >
-       <widget class="QLabel" name="label_7" >
+       <widget class="QLabel" name="httpProxyLabel" >
         <property name="text" >
          <string>_("HTTP proxy")</string>
         </property>
      </property>
      <layout class="QGridLayout" >
       <item row="0" column="0" >
-       <widget class="QLabel" name="label_5" >
+       <widget class="QLabel" name="ppLabel" >
         <property name="text" >
          <string>_("Post-Processing quality")</string>
         </property>
        </widget>
       </item>
       <item row="1" column="0" >
-       <widget class="QLabel" name="label_6" >
+       <widget class="QLabel" name="aviLabel" >
         <property name="text" >
          <string>_("Repair AVI files")</string>
         </property>
index 8ae62557d800c2ed7dfc672fabba4385108171b7..f1b4058c4b1f7a931448b8ab88ee9d2c9ff5bc94 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>654</width>
-    <height>578</height>
+    <width>693</width>
+    <height>604</height>
    </rect>
   </property>
   <property name="sizePolicy" >
@@ -90,7 +90,7 @@
        </widget>
       </item>
       <item row="1" column="2" >
-       <widget class="QLabel" name="label" >
+       <widget class="QLabel" name="displayLabel" >
         <property name="sizePolicy" >
          <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
           <horstretch>0</horstretch>
        </widget>
       </item>
       <item row="6" column="0" colspan="2" >
-       <widget class="QLabel" name="label_4" >
+       <widget class="QLabel" name="skinFileLabel" >
         <property name="text" >
          <string>_("Skin file")</string>
         </property>
       <item row="2" column="1" colspan="2" >
        <layout class="QHBoxLayout" name="horizontalLayout" >
         <item>
-         <widget class="QLabel" name="label_2" >
+         <widget class="QLabel" name="filterLabel" >
           <property name="text" >
            <string>_("Filter")</string>
           </property>
index 61761fb0fa35998f97af385ee271577359267bd7..3c154cde05546611fd46a839a59e8cb05a9e67f4 100644 (file)
@@ -6,7 +6,7 @@
     <x>0</x>
     <y>0</y>
     <width>434</width>
-    <height>441</height>
+    <height>442</height>
    </rect>
   </property>
   <property name="windowTitle" >
@@ -52,7 +52,7 @@
      </property>
      <layout class="QGridLayout" >
       <item row="0" column="0" >
-       <widget class="QLabel" name="label" >
+       <widget class="QLabel" name="subLangLabel" >
         <property name="text" >
          <string>_("Preferred subtitles language")</string>
         </property>
@@ -72,7 +72,7 @@
        <widget class="QLineEdit" name="preferredLanguage" />
       </item>
       <item row="1" column="0" >
-       <widget class="QLabel" name="label_2" >
+       <widget class="QLabel" name="encodLabel" >
         <property name="text" >
          <string>_("Default encoding")</string>
         </property>
@@ -94,7 +94,7 @@
        <widget class="QComboBox" name="effect" />
       </item>
       <item row="3" column="0" >
-       <widget class="QLabel" name="label_6" >
+       <widget class="QLabel" name="fontEffectLabel" >
         <property name="text" >
          <string>_("Effect")</string>
         </property>
        <widget class="QComboBox" name="fontColor" />
       </item>
       <item row="2" column="0" >
-       <widget class="QLabel" name="label_4" >
+       <widget class="QLabel" name="fontColorLabel" >
         <property name="text" >
          <string>_("Font color")</string>
         </property>
        <widget class="QComboBox" name="fontSize" />
       </item>
       <item row="1" column="0" >
-       <widget class="QLabel" name="label_3" >
+       <widget class="QLabel" name="fontSizeLabel" >
         <property name="text" >
          <string>_("Font size")</string>
         </property>
        <widget class="QLineEdit" name="font" />
       </item>
       <item row="0" column="0" >
-       <widget class="QLabel" name="label_5" >
+       <widget class="QLabel" name="fontLabel" >
         <property name="text" >
          <string>_("Font")</string>
         </property>
        </widget>
       </item>
       <item row="4" column="0" >
-       <widget class="QLabel" name="label_7" >
+       <widget class="QLabel" name="subsPosLabel" >
         <property name="text" >
          <string>_("Force subtitle position")</string>
         </property>
index bf727aa3c9050982b9c81be49f6b5b5cc71e842b..b942d8af16ef3253642fa4b4f895e2cf01e540c9 100644 (file)
@@ -70,7 +70,7 @@
        <widget class="QComboBox" name="outputModule" />
       </item>
       <item row="3" column="0" >
-       <widget class="QLabel" name="label_4" >
+       <widget class="QLabel" name="voutLabel" >
         <property name="text" >
          <string>_("Output")</string>
         </property>
        <widget class="QComboBox" name="dXdisplayDevice" />
       </item>
       <item row="1" column="0" >
-       <widget class="QLabel" name="label_5" >
+       <widget class="QLabel" name="dxDeviceLabel" >
         <property name="text" >
          <string>_("Display device")</string>
         </property>
        <widget class="QComboBox" name="deinterlaceBox" />
       </item>
       <item row="0" column="0" >
-       <widget class="QLabel" name="label_6" >
+       <widget class="QLabel" name="deinterLabel" >
         <property name="text" >
          <string>_("Deinterlacing Mode")</string>
         </property>
        </widget>
       </item>
       <item row="1" column="0" >
-       <widget class="QLabel" name="label_7" >
+       <widget class="QLabel" name="arLabel" >
         <property name="text" >
          <string>_("Force Aspect Ratio")</string>
         </property>
        </widget>
       </item>
       <item row="0" column="0" >
-       <widget class="QLabel" name="label" >
+       <widget class="QLabel" name="dirLabel" >
         <property name="text" >
          <string>_("Directory")</string>
         </property>
        </widget>
       </item>
       <item row="1" column="0" >
-       <widget class="QLabel" name="label_2" >
+       <widget class="QLabel" name="prefixLabel" >
         <property name="text" >
          <string>_("Prefix")</string>
         </property>
        </widget>
       </item>
       <item row="2" column="0" >
-       <widget class="QLabel" name="label_3" >
+       <widget class="QLabel" name="formatLabel" >
         <property name="text" >
          <string>_("Format")</string>
         </property>