Commit ec79b5c8 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Special Xtophe request ( Bday! ), add a new --no-qt-blingbling option to use native widgets...

Inheritance rules...
parent cfd3161d
......@@ -325,7 +325,9 @@ void AdvControlsWidget::AtoBLoop( float f_pos, int i_time, int i_length )
/*****************************
* DA Control Widget !
*****************************/
ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
bool b_advControls,
bool b_shiny ) :
QFrame( NULL ), p_intf( _p_i )
{
controlLayout = new QGridLayout( this );
......@@ -495,16 +497,25 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
volMuteLabel->installEventFilter( hVolLabel );
controlLayout->addWidget( volMuteLabel, 3, 15 );
volumeSlider = new SoundSlider( this,
if( b_shiny )
{
volumeSlider = new SoundSlider( this,
config_GetInt( p_intf, "volume-step" ),
config_GetInt( p_intf, "qt-volume-complete" ) );
}
else
{
volumeSlider = new QSlider( this );
volumeSlider->setOrientation( Qt::Horizontal );
}
volumeSlider->setMaximumSize( QSize( 200, 40 ) );
volumeSlider->setMinimumSize( QSize( 80, 20 ) );
volumeSlider->setFocusPolicy( Qt::NoFocus );
controlLayout->addWidget( volumeSlider, 3, 16, 1, 2 );
/* Set the volume from the config */
volumeSlider->setValue( (config_GetInt( p_intf, "volume" ) )* VOLUME_MAX / (AOUT_VOLUME_MAX/2) );
volumeSlider->setValue( ( config_GetInt( p_intf, "volume" ) ) *
VOLUME_MAX / (AOUT_VOLUME_MAX/2) );
/* Volume control connection */
CONNECT( volumeSlider, valueChanged( int ), this, updateVolume( int ) );
......
......@@ -141,16 +141,17 @@ class QSlider;
class QGridLayout;
class VolumeClickHandler;
class SoundSlider;
class QAbstractSlider;
class ControlsWidget : public QFrame
{
Q_OBJECT
public:
ControlsWidget( intf_thread_t *, bool );
/* p_intf, advanced control visible or not, blingbling or not */
ControlsWidget( intf_thread_t *, bool, bool );
virtual ~ControlsWidget();
QPushButton *playlistButton;
SoundSlider *volumeSlider;
void setStatus( int );
void enableInput( bool );
void enableVideo( bool );
......@@ -170,6 +171,7 @@ private:
QPushButton *slowerButton, *fasterButton;
AdvControlsWidget *advControls;
QLabel *volMuteLabel;
QAbstractSlider *volumeSlider;
bool b_advancedVisible;
private slots:
......
......@@ -323,8 +323,10 @@ void MainInterface::handleMainUi( QSettings *settings )
mainLayout->setMargin( 0 );
/* Create the CONTROLS Widget */
bool b_shiny = config_GetInt( p_intf, "qt-blingbling" );
controls = new ControlsWidget( p_intf,
settings->value( "adv-controls", false ).toBool() );
settings->value( "adv-controls", false ).toBool(),
b_shiny );
/* Configure the Controls, the playlist button doesn't trigger THEDP
but the toggle from this MainInterface */
......
......@@ -98,13 +98,15 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * );
#define UPDATER_TEXT N_("Activate the new updates notification")
#define UPDATER_LONGTEXT N_("Activate the automatic notification of new " \
"versions of the software. It runs once a week." )
#define COMPLETEVOL_TEXT N_("Allow the volume to be set to 400%" )
#define COMPLETEVOL_LONGTEXT N_("Allow the volume to have range from 0% to " \
"400%, instead of 0% to 200%. This option " \
"can distort the audio, since it uses " \
"software amplification.")
#define BLING_TEXT N_("Use non native buttons and volume slider")
vlc_module_begin();
set_shortname( (char *)"Qt" );
set_description( (char*)_("Qt interface") );
......@@ -120,6 +122,11 @@ vlc_module_begin();
set_description( "Dialogs provider" );
set_capability( "dialogs provider", 51 );
add_bool( "qt-notification", VLC_TRUE, NULL, NOTIFICATION_TEXT,
NOTIFICATION_LONGTEXT, VLC_FALSE );
add_float_with_range( "qt-opacity", 1., 0.1, 1., NULL, OPACITY_TEXT,
OPACITY_LONGTEXT, VLC_FALSE );
add_bool( "qt-always-video", VLC_FALSE, NULL, ALWAYS_VIDEO_TEXT,
ALWAYS_VIDEO_LONGTEXT, VLC_TRUE );
add_bool( "qt-system-tray", VLC_TRUE, NULL, SYSTRAY_TEXT,
......@@ -129,20 +136,18 @@ vlc_module_begin();
add_bool( "qt-minimal-view", VLC_FALSE, NULL, MINIMAL_TEXT,
MINIMAL_TEXT, VLC_TRUE );
add_bool( "qt-volume-complete", VLC_FALSE, NULL, COMPLETEVOL_TEXT,
COMPLETEVOL_LONGTEXT, VLC_TRUE);
add_bool( "qt-name-in-title", VLC_TRUE, NULL, TITLE_TEXT,
TITLE_LONGTEXT, VLC_FALSE );
add_bool( "qt-blingbling", VLC_TRUE, NULL, BLING_TEXT,
BLING_TEXT, VLC_FALSE );
add_bool( "qt-volume-complete", VLC_FALSE, NULL, COMPLETEVOL_TEXT,
COMPLETEVOL_LONGTEXT, VLC_TRUE);
add_string( "qt-filedialog-path", NULL, NULL, FILEDIALOG_PATH_TEXT,
FILEDIALOG_PATH_TEXT, VLC_TRUE);
change_autosave();
change_internal();
add_bool( "qt-notification", VLC_TRUE, NULL, NOTIFICATION_TEXT,
NOTIFICATION_LONGTEXT, VLC_FALSE );
add_float_with_range( "qt-opacity", 1., 0.1, 1., NULL, OPACITY_TEXT,
OPACITY_LONGTEXT, VLC_FALSE );
add_bool( "qt-adv-options", VLC_FALSE, NULL, ADVANCED_OPTIONS_TEXT,
ADVANCED_OPTIONS_LONGTEXT, VLC_TRUE );
add_bool( "qt-advanced-pref", VLC_FALSE, NULL, ADVANCED_PREFS_TEXT,
......
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