**/
mainBasedSize = settings->value( "mainBasedSize", QSize( 350, 120 ) ).toSize();
mainVideoSize = settings->value( "mainVideoSize", QSize( 400, 300 ) ).toSize();
-
+ settings->endGroup( );
/**************
* Status Bar *
}
/* Playlist */
- int i_plVis = settings->value( "playlist-visible", 0 ).toInt();
-
+ int i_plVis = settings->value( "playlist-visible", false ).toBool();
settings->endGroup();
if( i_plVis ) togglePlaylist();
MainInterface::~MainInterface()
{
/* Unsure we hide the videoWidget before destroying it */
- if( stackCentralOldWidget == playlistWidget )
+ if( stackCentralOldWidget == videoWidget )
showBg();
- /* Save playlist state */
- if( playlistWidget )
- {
- if( !isPlDocked() )
- QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget );
-
- delete playlistWidget;
- }
-
#ifdef WIN32
if( himl )
ImageList_Destroy( himl );
/* Save states */
settings->beginGroup( "MainWindow" );
+
settings->setValue( "pl-dock-status", b_plDocked );
- settings->setValue( "playlist-visible", (int)playlistVisible );
+ /* Save playlist state */
+ if( playlistWidget )
+ {
+ settings->setValue( "playlist-visible",
+ isPlDocked() ?
+ playlistVisible :
+ playlistWidget->isVisible() /* FIXME */ );
+ }
+
settings->setValue( "adv-controls",
getControlsVisibilityStatus() & CONTROLS_ADVANCED );
/* Save this size */
QVLCTools::saveWidgetPosition(settings, this);
+
settings->endGroup();
+ /* Save undocked playlist size */
+ if( playlistWidget && !isPlDocked() )
+ QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget );
+
+ delete playlistWidget;
+
delete statusBar();
/* Unregister callbacks */
delete inputC;
controls = new ControlsWidget( p_intf, false, this ); /* FIXME */
- CONNECT( controls, advancedControlsToggled( bool ),
- this, adaptGeometry() );
- CONNECT( controls, sizeChanged(),
- this, adaptGeometry() );
-
inputC = new InputControlsWidget( p_intf, this );
mainLayout->insertWidget( 2, inputC );
}
mainLayout->insertWidget( 1, stackCentralW );
+ settings->beginGroup( "MainWindow" );
+
/* Create the CONTROLS Widget */
controls = new ControlsWidget( p_intf,
settings->value( "adv-controls", false ).toBool(), this );
- CONNECT( controls, advancedControlsToggled( bool ),
- this, adaptGeometry() );
- CONNECT( controls, sizeChanged(),
- this, adaptGeometry() );
inputC = new InputControlsWidget( p_intf, this );
mainLayout->insertWidget( 2, inputC );
visualSelector->hide();
#endif
- getSettings()->endGroup();
+ settings->endGroup();
/* Enable the popup menu in the MI */
main->setContextMenuPolicy( Qt::CustomContextMenu );
* Handling of sizing of the components
**********************************************************************/
-/* This function is called:
- - Advanced buttons toggled
- - Toolbar geom changed
- */
-void MainInterface::adaptGeometry()
-{
- resize( sizeHint() );
-
-#ifdef DEBUG_INTF
- debug();
-#endif
-}
-
void MainInterface::debug()
{
#ifdef DEBUG_INTF
void MainInterface::destroyPopupMenu()
{
- QVLCMenu::PopupMenu( p_intf, false );
+ QVLCMenu::PopupMenu( p_intf, false, this );
}
void MainInterface::popupMenu( const QPoint &p )
{
- QVLCMenu::PopupMenu( p_intf, true );
+ QVLCMenu::PopupMenu( p_intf, true, this );
}
void MainInterface::toggleFSC()
*p_id = ret;
if( ret ) /* The videoWidget is available */
{
- /* ask videoWidget to show */
- videoWidget->SetSizing( *pi_width, *pi_height );
+ /* Ask videoWidget to resize correctly, if we are in normal mode */
+ if( !isFullScreen() && !isMaximized() )
+ videoWidget->SetSizing( *pi_width, *pi_height );
/* Consider the video active now */
showVideo();
{
videoWidget->release();
- restoreStackOldWidget();
+ if( stackCentralW->currentWidget() == videoWidget )
+ restoreStackOldWidget();
/* We don't want to have a blank video to popup */
stackCentralOldWidget = bgWidget;
{
unsigned int i_width = va_arg( args, unsigned int );
unsigned int i_height = va_arg( args, unsigned int );
+ if( isFullScreen() || isMaximized() )
+ showNormal();
emit askVideoToResize( i_width, i_height );
return VLC_SUCCESS;
}
}
else
{
+ QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget );
playlistWidget->setWindowFlags( Qt::Widget ); // Probably a Qt bug here
// It would be logical that QStackWidget::addWidget reset the flags...
stackCentralW->addWidget( playlistWidget );
- stackCentralW->setCurrentWidget( playlistWidget );
+ showTab( playlistWidget );
}
+ playlistVisible = true;
}
/*