Commit 61417af6 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: simple preferences, User Experience improvements.

- Set buddies where possible.
- Set tooltips on most labels.
parent 23f5a2f2
......@@ -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()
......
......@@ -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;
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>541</width>
<width>559</width>
<height>609</height>
</rect>
</property>
......@@ -108,7 +108,7 @@
</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>
......@@ -137,7 +137,7 @@
</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>
......@@ -175,7 +175,7 @@
</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>
......@@ -268,7 +268,7 @@
</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>
......
......@@ -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>
......@@ -120,7 +120,7 @@
</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>
......@@ -146,7 +146,7 @@
</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>
......
......@@ -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>
......@@ -175,7 +175,7 @@
</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>
......@@ -306,7 +306,7 @@
<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>
......
......@@ -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>
......@@ -107,7 +107,7 @@
<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>
......@@ -120,7 +120,7 @@
<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>
......@@ -140,7 +140,7 @@
<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>
......@@ -166,7 +166,7 @@
</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>
......
......@@ -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>
......@@ -125,7 +125,7 @@
<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>
......@@ -154,14 +154,14 @@
<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>
......@@ -196,7 +196,7 @@
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<widget class="QLabel" name="dirLabel" >
<property name="text" >
<string>_("Directory")</string>
</property>
......@@ -206,7 +206,7 @@
</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>
......@@ -223,7 +223,7 @@
</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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment