From eadc598d144c7c4b6c5e7843b10a2b530c9162cb Mon Sep 17 00:00:00 2001 From: Francois Cartegnie Date: Fri, 9 Jul 2010 18:19:13 +0200 Subject: [PATCH] Qt forced default value is different than libvlc's saved --- modules/gui/qt4/components/simple_preferences.cpp | 2 +- modules/gui/qt4/qt4.cpp | 3 +++ modules/gui/qt4/qt4.hpp | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp index 22e1af7421..ee7aedca2c 100644 --- a/modules/gui/qt4/components/simple_preferences.cpp +++ b/modules/gui/qt4/components/simple_preferences.cpp @@ -310,7 +310,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, #undef audioCommon /* Audio Options */ - CONFIG_GENERIC_NO_BOOL( "volume" , IntegerRangeSlider, NULL, + CONFIG_GENERIC_NO_BOOL( "qt-startvolume" , IntegerRangeSlider, NULL, defaultVolume ); CONNECT( ui.defaultVolume, valueChanged( int ), this, updateAudioVolume( int ) ); diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp index 676a82b527..d689c4afac 100644 --- a/modules/gui/qt4/qt4.cpp +++ b/modules/gui/qt4/qt4.cpp @@ -128,6 +128,7 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * ); "software amplification." ) #define SAVEVOL_TEXT N_( "Automatically save the volume on exit" ) +#define STARTVOL_TEXT N_( "Default start volume" ) #define PRIVACY_TEXT N_( "Ask for network policy at start" ) @@ -200,6 +201,8 @@ vlc_module_begin () COMPLETEVOL_LONGTEXT, true ) add_bool( "qt-autosave-volume", false, NULL, SAVEVOL_TEXT, SAVEVOL_TEXT, true ) + add_integer_with_range( "qt-startvolume", QT_VOLUME_DEFAULT, 0, + QT_VOLUME_MAX, NULL, STARTVOL_TEXT, STARTVOL_TEXT, true ) add_bool( "qt-embedded-open", false, NULL, QT_NATIVEOPEN_TEXT, QT_NATIVEOPEN_TEXT, false ) diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp index 8678b792ce..577d43417f 100644 --- a/modules/gui/qt4/qt4.hpp +++ b/modules/gui/qt4/qt4.hpp @@ -32,6 +32,7 @@ #include /* VLC_COMMON_MEMBERS for vlc_interface.h */ #include /* intf_thread_t */ #include /* playlist_t */ +#include /* AOUT_VOLUME_ */ #define QT_NO_CAST_TO_ASCII #include @@ -117,6 +118,9 @@ struct intf_sys_t #define getSettings() p_intf->p_sys->mainSettings +#define QT_VOLUME_DEFAULT AOUT_VOLUME_DEFAULT +#define QT_VOLUME_MAX (AOUT_VOLUME_DEFAULT * 2) + static inline QString QVLCUserDir( vlc_userdir_t type ) { char *dir = config_GetUserDir( type ); -- 2.39.2