b_hideAfterCreation = false; // --qt-start-minimized
playlistVisible = false;
input_name = "";
+ b_interfaceFullScreen= false;
/* Ask for Privacy */
settings->endGroup( );
- /**************
- * Status Bar *
- **************/
- createStatusBar();
+ /*********************************
+ * Create the Systray Management *
+ *********************************/
+ initSystray();
/**************************
* UI and Widgets design
this, destroyPopupMenu() );
createMainWidget( settings );
- /*********************************
- * Create the Systray Management *
- *********************************/
- initSystray();
+
+ /**************
+ * Status Bar *
+ **************/
+ createStatusBar();
+ setStatusBarVisibility( getSettings()->value( "MainWindow/status-bar-visible", false ).toBool() );
/********************
* Input Manager *
/* VideoWidget connects for asynchronous calls */
b_videoFullScreen = false;
- b_videoOnTop = false;
connect( this, SIGNAL(askGetVideo(WId*,int*,int*,unsigned*,unsigned *)),
this, SLOT(getVideoSlot(WId*,int*,int*,unsigned*,unsigned*)),
Qt::BlockingQueuedConnection );
/**** FINAL SIZING and placement of interface */
settings->beginGroup( "MainWindow" );
- QVLCTools::restoreWidgetPosition( settings, this, QSize(400, 100) );
+ QVLCTools::restoreWidgetPosition( settings, this, QSize(600, 420) );
settings->endGroup();
b_interfaceFullScreen = isFullScreen();
settings->setValue( "adv-controls",
getControlsVisibilityStatus() & CONTROLS_ADVANCED );
+ settings->setValue( "status-bar-visible", b_statusbarVisible );
/* Save the stackCentralW sizes */
settings->setValue( "bgSize", stackWidgetsSizes[bgWidget] );
mainLayout->insertWidget( 1, stackCentralW );
settings->beginGroup( "MainWindow" );
- stackWidgetsSizes[bgWidget] = settings->value( "bgSize", QSize( 400, 0 ) ).toSize();
+ stackWidgetsSizes[bgWidget] = settings->value( "bgSize", QSize( 600, 0 ) ).toSize();
/* Resize even if no-auto-resize, because we are at creation */
resizeStack( stackWidgetsSizes[bgWidget].width(), stackWidgetsSizes[bgWidget].height() );
QVLCMenu::PopupMenu( p_intf, false );
}
-void MainInterface::popupMenu( const QPoint &p )
+void MainInterface::popupMenu( const QPoint & )
{
QVLCMenu::PopupMenu( p_intf, true );
}
{
if( !fullscreenControls ) return;
- IMEvent *eShow = new IMEvent( FullscreenControlToggle_Type, 0 );
+ IMEvent *eShow = new IMEvent( FullscreenControlToggle_Type );
QApplication::postEvent( fullscreenControls, eShow );
}
void MainInterface::getVideoSlot( WId *p_id, int *pi_x, int *pi_y,
unsigned *pi_width, unsigned *pi_height )
{
+ /* Hidden or minimized, activate */
+ if( isHidden() || isMinimized() )
+ toggleUpdateSystrayMenu();
+
/* Request the videoWidget */
WId ret = videoWidget->request( pi_x, pi_y,
pi_width, pi_height, !b_autoresize );
* Emit askVideoOnTop() to invoke this from other thread. */
void MainInterface::setVideoOnTop( bool on_top )
{
- b_videoOnTop = on_top;
-
Qt::WindowFlags oldflags = windowFlags(), newflags;
- if( b_videoOnTop )
+ if( on_top )
newflags = oldflags | Qt::WindowStaysOnTopHint;
else
newflags = oldflags & ~Qt::WindowStaysOnTopHint;
+ if( newflags != oldflags && !b_videoFullScreen )
- if( newflags != oldflags )
{
setWindowFlags( newflags );
show(); /* necessary to apply window flags */
if( b_plDocked )
{
stackCentralW->addWidget( playlistWidget );
- stackWidgetsSizes[playlistWidget] = settings->value( "playlistSize", QSize( 500, 250 ) ).toSize();
+ stackWidgetsSizes[playlistWidget] = settings->value( "playlistSize", QSize( 600, 300 ) ).toSize();
}
else
{
{
menuBar()->setVisible( !b_minimal );
controls->setVisible( !b_minimal );
- statusBar()->setVisible( !b_minimal );
+ statusBar()->setVisible( !b_minimal && b_statusbarVisible );
inputC->setVisible( !b_minimal );
}
+ CONTROLS_ADVANCED * controls->b_advancedVisible );
}
+void MainInterface::setStatusBarVisibility( bool b_visible )
+{
+ statusBar()->setVisible( b_visible );
+ b_statusbarVisible = b_visible;
+ if( controls ) controls->setGripVisible( !b_statusbarVisible );
+}
+
#if 0
void MainInterface::visual()
{
sysTray->show();
CONNECT( sysTray, activated( QSystemTrayIcon::ActivationReason ),
- this, handleSystrayClick( QSystemTrayIcon::ActivationReason ) );
+ this, handleSystrayClick( QSystemTrayIcon::ActivationReason ) );
}
/**
void MainInterface::closeEvent( QCloseEvent *e )
{
- e->ignore(); /* Do not quit */
// hide();
emit askToQuit(); /* ask THEDP to quit, so we have a unique method */
+ /* Accept session quit. Otherwise we break the desktop mamager. */
+ e->accept();
}
void MainInterface::setInterfaceFullScreen( bool fs )
static int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param )
{
+ VLC_UNUSED( p_this ); VLC_UNUSED( psz_variable ); VLC_UNUSED( old_val );
+
intf_thread_t *p_intf = (intf_thread_t *)param;
if( p_intf->pf_show_dialog )
static int IntfShowCB( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param )
{
+ VLC_UNUSED( p_this ); VLC_UNUSED( psz_variable ); VLC_UNUSED( old_val );
+ VLC_UNUSED( new_val );
+
intf_thread_t *p_intf = (intf_thread_t *)param;
p_intf->p_sys->p_mi->toggleFSC();