]> git.sesse.net Git - vlc/commitdiff
Special Xtophe request ( Bday! ), add a new --no-qt-blingbling option to use native...
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 24 Nov 2007 01:28:44 +0000 (01:28 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 24 Nov 2007 01:28:44 +0000 (01:28 +0000)
Inheritance rules...

modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/qt4.cpp

index d3e17ff0952f6479ebbda9abaf600c287e17ed6b..239cc4e0e99560e6d29902c1615604a6555090df 100644 (file)
@@ -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 ) );
index 7edde5e54aea21d093644124e93c34152d8b8a10..1966717d2c68c61c0eff7bae67e63c6f1895398c 100644 (file)
@@ -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:
index 2bef09d35c6dc191f999853d4b320dd5aad13c55..379887faf5b60f1dc2f5a9088972307c624d9ffd 100644 (file)
@@ -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 */
index d00c4b9f4ffee0863e3fea690aafea729d2118c1..87b0a1bd2fb35fa4b9fca69317387e83bf32167b 100644 (file)
@@ -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,