]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/main_interface.cpp
UI: prefix/namespace resources for better maintainability
[vlc] / modules / gui / qt4 / main_interface.cpp
index 7bb39c12796abaad08b199e28a414935e4f6f5b8..75584722405040dbc7fac29d12b56e3c8aba8cf1 100644 (file)
@@ -84,6 +84,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     cryptedLabel         = NULL;
     controls             = NULL;
     inputC               = NULL;
+    b_shouldHide         = false;
 
     bgWasVisible         = false;
     i_bg_height          = 0;
@@ -205,8 +206,6 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
 
     /* END CONNECTS ON IM */
 
-    dialogHandler = new DialogHandler (p_intf);
-
     /************
      * Callbacks
      ************/
@@ -265,7 +264,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     /* Final sizing and showing */
     setMinimumWidth( __MAX( controls->sizeHint().width(),
                             menuBar()->sizeHint().width() ) );
-    show();
+    setVisible( !b_shouldHide );
 
     /* And switch to minimal view if needed
        Must be called after the show() */
@@ -283,8 +282,6 @@ MainInterface::~MainInterface()
 {
     msg_Dbg( p_intf, "Destroying the main interface" );
 
-    delete dialogHandler;
-
     /* Unsure we hide the videoWidget before destroying it */
     if( videoIsActive ) videoWidget->hide();
 
@@ -462,7 +459,7 @@ inline void MainInterface::initSystray()
         if( b_systrayAvailable )
         {
             b_systrayWanted = true;
-            hide();
+            b_shouldHide = true;
         }
         else
             msg_Err( p_intf, "cannot start minimized without system tray bar" );
@@ -964,9 +961,9 @@ void MainInterface::createSystray()
 {
     QIcon iconVLC;
     if( QDate::currentDate().dayOfYear() >= 354 )
-        iconVLC =  QIcon( QPixmap( ":/vlc128-christmas.png" ) );
+        iconVLC =  QIcon( QPixmap( ":/logo/vlc128-christmas.png" ) );
     else
-        iconVLC =  QIcon( QPixmap( ":/vlc128.png" ) );
+        iconVLC =  QIcon( QPixmap( ":/logo/vlc128.png" ) );
     sysTray = new QSystemTrayIcon( iconVLC, this );
     sysTray->setToolTip( qtr( "VLC media player" ));
 
@@ -1178,10 +1175,10 @@ void MainInterface::customEvent( QEvent *event )
     {
         SetVideoOnTopQtEvent* p_event = (SetVideoOnTopQtEvent*)event;
         if( p_event->OnTop() )
-            setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
+            setWindowFlags( windowFlags() | Qt::WindowStaysOnTopHint );
         else
-            setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
-        show(); /* necessary to apply window flags?? */
+            setWindowFlags( windowFlags() & ~Qt::WindowStaysOnTopHint );
+        show(); /* necessary to apply window flags */
     }
 }