X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fmain_interface.cpp;h=de9f8e2f1e32bbf860c3ee2095a2bd277871c31b;hb=080cb247d4e4e6ac9b379293f24006e21c303821;hp=5f1b85d687f48c7a2e9174d0cf0c42e9c65377d0;hpb=d25a2799056baced5ac78178714c992d35eb9102;p=vlc diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp index 5f1b85d687..de9f8e2f1e 100644 --- a/modules/gui/qt4/main_interface.cpp +++ b/modules/gui/qt4/main_interface.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -163,9 +164,13 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) speedLabel->setFrameStyle( QFrame::Sunken | QFrame::Panel ); nameLabel->setFrameStyle( QFrame::Sunken | QFrame::StyledPanel); + pgBar = new QProgressBar; + pgBar->hide(); + /* and adding those */ statusBar()->addWidget( nameLabel, 8 ); statusBar()->addPermanentWidget( speedLabel, 0 ); + statusBar()->addPermanentWidget( pgBar, 0 ); statusBar()->addPermanentWidget( timeLabel, 0 ); /* timeLabel behaviour: @@ -288,7 +293,15 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) move( settings->value( "pos", QPoint( 0, 0 ) ).toPoint() ); - resize( settings->value( "size", QSize( 350, 60 ) ).toSize() ); + QSize newSize = settings->value( "size", QSize( 350, 60 ) ).toSize(); + if( newSize.isValid() ) + { + resize( newSize ); + } + else + { + msg_Warn( p_intf, "Invalid size in constructor" ); + } int tgPlay = settings->value( "playlist-visible", 0 ).toInt(); settings->endGroup(); @@ -304,6 +317,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) MainInterface::~MainInterface() { + msg_Dbg( p_intf, "Destroying the main interface" ); + if( playlistWidget ) playlistWidget->savingSettings( settings ); if( ExtendedDialog::exists() ) ExtendedDialog::getInstance( p_intf )->savingSettings(); @@ -337,6 +352,7 @@ MainInterface::~MainInterface() p_intf->pf_request_window = NULL; p_intf->pf_release_window = NULL; p_intf->pf_control_window = NULL; + p_intf->p_sys->p_mi = NULL; } /***************************** @@ -531,9 +547,11 @@ void MainInterface::debug() QSize MainInterface::sizeHint() const { int nwidth = controls->sizeHint().width(); - int nheight = controls->size().height() - + menuBar()->size().height() - + statusBar()->size().height(); + int nheight = controls->isVisible() ? + controls->size().height() + + menuBar()->size().height() + + statusBar()->size().height() + : 0 ; msg_Dbg( p_intf, "1 %i %i", nheight, nwidth ); if( VISIBLE( bgWidget ) ) @@ -551,7 +569,7 @@ QSize MainInterface::sizeHint() const if( !dockPL->isFloating() && dockPL->isVisible() && dockPL->widget() ) { nheight += dockPL->size().height(); - nwidth = MAX( nwidth, dockPL->size().width() ); + nwidth = __MAX( nwidth, dockPL->size().width() ); msg_Dbg( p_intf, "3 %i %i", nheight, nwidth ); } msg_Dbg( p_intf, "4 %i %i", nheight, nwidth ); @@ -731,8 +749,11 @@ void MainInterface::togglePlaylist() settings->endGroup(); settings->beginGroup( "playlist" ); dockPL->move( settings->value( "pos", QPoint( 0,0 ) ).toPoint() ); - dockPL->resize( settings->value( "size", QSize( 400, 300 ) ).toSize() ); + QSize newSize = settings->value( "size", QSize( 400, 300 ) ).toSize(); + if( newSize.isValid() ) + dockPL->resize( newSize ); settings->endGroup(); + dockPL->show(); playlistVisible = true; } @@ -757,7 +778,7 @@ void MainInterface::toggleMinimalView() TOGGLEV( menuBar() ); TOGGLEV( controls ); TOGGLEV( statusBar() ); - updateGeometry(); + doComponentsUpdate(); } /* Video widget cannot do this synchronously as it runs in another thread */ @@ -869,8 +890,6 @@ void MainInterface::updateOnTimer() need_components_update = false; } #endif - - controls->updateOnTimer(); } /*****************************************************************************