[vlc-devel] commit: Qt: clean and cosmetics (Jean-Baptiste Kempf )

git version control git at videolan.org
Sun Feb 28 23:22:29 CET 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Feb 28 15:00:23 2010 +0100| [92661c0e6635c1d9b6816219faba3f7de3850984] | committer: Jean-Baptiste Kempf 

Qt: clean and cosmetics

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=92661c0e6635c1d9b6816219faba3f7de3850984
---

 modules/gui/qt4/main_interface.cpp |   40 ++++++++++++++++++------------------
 modules/gui/qt4/main_interface.hpp |   27 +++++++++++++++---------
 2 files changed, 37 insertions(+), 30 deletions(-)

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 2617b72..c7f9940 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -83,7 +83,6 @@ static int IntfShowCB( vlc_object_t *p_this, const char *psz_variable,
 MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
 {
     /* Variables initialisation */
-    // need_components_update = false;
     bgWidget             = NULL;
     videoWidget          = NULL;
     playlistWidget       = NULL;
@@ -95,12 +94,12 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     controls             = NULL;
     inputC               = NULL;
 
-    b_hideAfterCreation  = false;
+    b_hideAfterCreation  = false; // --qt-start-minimized
     playlistVisible      = false; // FIXME remove
     input_name           = "";
-
     i_bg_height          = 0;
 
+
     /* Ask for Privacy */
     FirstRun::CheckAndRun( this, p_intf );
 
@@ -116,7 +115,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     setWindowOpacity( var_InheritFloat( p_intf, "qt-opacity" ) );
 
     /* Set The Video In emebedded Mode or not */
-    videoEmbeddedFlag = var_InheritBool( p_intf, "embedded-video" );
+    b_videoEmbedded = var_InheritBool( p_intf, "embedded-video" );
 
     /* Does the interface resize to video size or the opposite */
     b_keep_size = !var_InheritBool( p_intf, "qt-video-autoresize" );
@@ -125,7 +124,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     i_visualmode = var_InheritInteger( p_intf, "qt-display-mode" );
 
     /* Do we want anoying popups or not */
-    notificationEnabled = var_InheritBool( p_intf, "qt-notification" );
+    b_notificationEnabled = var_InheritBool( p_intf, "qt-notification" );
 
     /* Set the other interface settings */
     settings = getSettings();
@@ -343,8 +342,7 @@ MainInterface::~MainInterface()
     settings->setValue( "mainBasedSize", mainBasedSize );
     settings->setValue( "mainVideoSize", mainVideoSize );
 
-    if( bgWidget )
-        settings->setValue( "backgroundSize", bgWidget->size() );
+    settings->setValue( "backgroundSize", bgWidget->size() );
 
     /* Save this size */
     QVLCTools::saveWidgetPosition(settings, this);
@@ -364,6 +362,7 @@ MainInterface::~MainInterface()
  *****************************/
 void MainInterface::recreateToolbars()
 {
+    // FIXME: do the same for the FSC
     //msg_Dbg( p_intf, "Recreating the toolbars" );
     settings->beginGroup( "MainWindow" );
     delete controls;
@@ -406,7 +405,7 @@ void MainInterface::createMainWidget( QSettings *settings )
 
 
     /* And video Outputs */
-    if( videoEmbeddedFlag )
+    if( b_videoEmbedded )
     {
         videoWidget = new VideoWidget( p_intf );
         stackCentralW->insertWidget( VIDEO_TAB, videoWidget );
@@ -784,7 +783,7 @@ void MainInterface::debug()
 {
 #ifdef DEBUG_INTF
     msg_Dbg( p_intf, "Stack Size: %i - %i", stackCentralW->size().height(), size().width() );
-    if( videoEmbeddedFlag )
+    if( b_videoEmbedded )
         msg_Dbg( p_intf, "Stack Size: %i - %i",
                  stackCentralW->widget( VIDEO_TAB )->size().height(),
                  stackCentralW->widget( VIDEO_TAB )->size().width() );
@@ -863,23 +862,24 @@ void MainInterface::destroyPopupMenu()
     QVLCMenu::PopupMenu( p_intf, false );
 }
 
-void MainInterface::toggleFSC()
-{
-   if( !fullscreenControls ) return;
-
-   IMEvent *eShow = new IMEvent( FullscreenControlToggle_Type, 0 );
-   QApplication::postEvent( fullscreenControls, eShow );
-}
-
 void MainInterface::popupMenu( const QPoint &p )
 {
-    /* Ow, that's ugly: don't show the popup menu if cursor over
+    /* FIXME
+     * Ow, that's ugly: don't show the popup menu if cursor over
      * the main menu bar or the status bar */
     if( !childAt( p ) || ( ( childAt( p ) != menuBar() )
                         && ( childAt( p )->parentWidget() != statusBar() ) ) )
         QVLCMenu::PopupMenu( p_intf, true );
 }
 
+void MainInterface::toggleFSC()
+{
+   if( !fullscreenControls ) return;
+
+   IMEvent *eShow = new IMEvent( FullscreenControlToggle_Type, 0 );
+   QApplication::postEvent( fullscreenControls, eShow );
+}
+
 /****************************************************************************
  * Video Handling
  ****************************************************************************/
@@ -901,7 +901,7 @@ private:
 
 /**
  * NOTE:
- * You must note change the state of this object or other Qt4 UI objects,
+ * You must not change the state of this object or other Qt4 UI objects,
  * from the video output thread - only from the Qt4 UI main loop thread.
  * All window provider queries must be handled through signals or events.
  * That's why we have all those emit statements...
@@ -1312,7 +1312,7 @@ void MainInterface::updateSystrayTooltipName( const QString& name )
     else
     {
         sysTray->setToolTip( name );
-        if( notificationEnabled && ( isHidden() || isMinimized() ) )
+        if( b_notificationEnabled && ( isHidden() || isMinimized() ) )
         {
             sysTray->showMessage( qtr( "VLC media player" ), name,
                     QSystemTrayIcon::NoIcon, 3000 );
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index 7fe5caa..a7d8b74 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -92,7 +92,7 @@ public:
 protected:
     void dropEventPlay( QDropEvent *, bool);
 #ifdef WIN32
-    bool winEvent( MSG *, long * );
+    virtual bool winEvent( MSG *, long * );
 #endif
     virtual void dropEvent( QDropEvent *);
     virtual void dragEnterEvent( QDragEnterEvent * );
@@ -105,21 +105,24 @@ protected:
     virtual void resizeEvent( QResizeEvent * event );
 
 private:
+    /* Main Widgets Creation */
     void createMainWidget( QSettings* );
     void createStatusBar();
     void createPlaylist();
 
     /* Systray */
-    void handleSystray();
     void createSystray();
+    void handleSystray();
     void initSystray();
 
+    /* Mess about stackWidget */
     void showTab( int i_tab );
     void restoreStackOldWidget();
     void showVideo() { showTab( VIDEO_TAB ); }
     void showBg() { showTab( BACKG_TAB ); }
     void hideStackWidget() { showTab( HIDDEN_TAB ); }
 
+    /* */
     QSettings           *settings;
 #ifndef HAVE_MAEMO
     QSystemTrayIcon     *sysTray;
@@ -131,6 +134,7 @@ private:
     InputControlsWidget *inputC;
     FullscreenControllerWidget *fullscreenControls;
     QStackedWidget      *stackCentralW;
+
     /* Video */
     VideoWidget         *videoWidget;
 
@@ -151,19 +155,22 @@ private:
     };
     int                  stackCentralOldState;
 
-//    bool                 videoIsActive;       ///< Having a video now / THEMIM->hasV
-    bool                 videoEmbeddedFlag;   ///< Want an external Video Window
+    /* Flags */
+    bool                 b_notificationEnabled; /// Systray Notifications
+    bool                 b_keep_size;         ///< persistent resizeable window
+    bool                 b_videoEmbedded;   ///< Want an external Video Window
+    bool                 b_hideAfterCreation;
+    int                  i_visualmode;        ///< Visual Mode
+
+    /* States */
     bool                 playlistVisible;     ///< Is the playlist visible ?
-    bool                 visualSelectorEnabled;
-    bool                 notificationEnabled; /// Systray Notifications
+//    bool                 videoIsActive;       ///< Having a video now / THEMIM->hasV
+//    bool                 b_visualSelectorEnabled;
+    bool                 b_plDocked;          ///< Is the playlist docked ?
 
-    bool                 b_keep_size;         ///< persistent resizeable window
     QSize                mainBasedSize;       ///< based Wnd (normal mode only)
     QSize                mainVideoSize;       ///< Wnd with video (all modes)
-    int                  i_visualmode;        ///< Visual Mode
-    bool                 b_plDocked;
     int                  i_bg_height;         ///< Save height of bgWidget
-    bool                 b_hideAfterCreation;
 
 #ifdef WIN32
     HIMAGELIST himl;




More information about the vlc-devel mailing list