Commit 7bb4a6ef authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 : Simple Preferences. Add a slider widget to pref_widget, because it is nicer than a QSpinBox.

Could you look please on that commit cause I don't understand if it is the good way to do it (I guess not) and why do I had to add this 'bool' to the methods.

zorglub, dionoea? 
parent e87abf62
......@@ -43,6 +43,7 @@
#include <QComboBox>
#include <QGridLayout>
#include <QPushButton>
#include <QSlider>
#include <vlc_keys.h>
......@@ -547,6 +548,29 @@ void IntegerRangeConfigControl::finish()
spin->setMinimum( p_item->min.i );
}
IntegerRangeSliderConfigControl::IntegerRangeSliderConfigControl(
vlc_object_t *_p_this,
module_config_t *_p_item,
QLabel *_label, QSlider *_slider,
bool *_bool ) :
VIntConfigControl( _p_this, _p_item )
{
slider = _slider;
label = _label;
slider->setMaximum( p_item->max.i );
slider->setMinimum( p_item->min.i );
slider->setValue( p_item->value.i );
slider->setToolTip( qfu(p_item->psz_longtext) );
if( label )
label->setToolTip( qfu(p_item->psz_longtext) );
}
int IntegerRangeSliderConfigControl::getValue()
{
return slider->value();
}
/********* Integer / choice list **********/
IntegerListConfigControl::IntegerListConfigControl( vlc_object_t *_p_this,
module_config_t *_p_item, QWidget *_parent, bool bycat,
......
......@@ -101,6 +101,8 @@ public:
QGridLayout *, int& );
IntegerConfigControl( vlc_object_t *, module_config_t *,
QLabel*, QSpinBox* );
IntegerConfigControl( vlc_object_t *, module_config_t *,
QLabel*, QSlider* );
virtual ~IntegerConfigControl() {};
virtual int getValue();
virtual void show() { spin->show(); label->show(); }
......@@ -108,7 +110,6 @@ public:
protected:
QSpinBox *spin;
private:
QLabel *label;
void finish();
......@@ -125,6 +126,20 @@ private:
void finish();
};
class IntegerRangeSliderConfigControl : public VIntConfigControl
{
public:
IntegerRangeSliderConfigControl( vlc_object_t *, module_config_t *,
QLabel *, QSlider *, bool * );
virtual ~IntegerRangeSliderConfigControl() {};
virtual int getValue();
protected:
QSlider *slider;
private:
QLabel *label;
void finish();
};
class IntegerListConfigControl : public VIntConfigControl
{
public:
......
......@@ -136,7 +136,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#ifdef WIN32
CONFIG_GENERIC( "directx-wallpaper" , Bool , NULL, wallpaperMode );
CONFIG_GENERIC( "directx-device", String, NULL, dXdisplayDevice );
// CONFIG_GENERIC( "directx-device", String, NULL, dXdisplayDevice );
#endif
CONFIG_GENERIC( "snapshot-path", String, NULL,
......@@ -161,7 +161,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#endif
CONFIG_GENERIC( "audio", Bool, NULL, enableAudio );
/* CONFIG_GENERIC( "volume" , RangedInt, NULL, defaultVolume );*/ //FIXME Why ?
CONFIG_GENERIC( "volume" , IntegerRangeSlider, NULL, defaultVolume );
/* CONFIG_GENERIC( "audio-language" , String , NULL,
preferredAudioLanguage ); */ //FIXME WHy ?
CONFIG_GENERIC( "spdif" , Bool , NULL, spdifBox );
......@@ -173,8 +174,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
/* CONFIG_GENERIC( "alsadev" , String , NULL, alsaDevice );*/
CONFIG_GENERIC( "dspdev" , String , NULL, OSSDevice );//FIXME File
#else
CONFIG_GENERIC( "directx-audio-device" , Integer, NULL,
DirectXDevice );
/* CONFIG_GENERIC( "directx-audio-device" , Integer, NULL,
DirectXDevice );*/
#endif
CONFIG_GENERIC( "audiofile-file" , String , NULL, FileName ); //Fixme File
......
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