videoWidget = NULL;
playlistWidget = NULL;
stackCentralOldWidget= NULL;
-#ifndef HAVE_MAEMO
sysTray = NULL;
-#endif
fullscreenControls = NULL;
cryptedLabel = NULL;
controls = NULL;
#ifdef Q_WS_MAC
setAttribute( Qt::WA_MacBrushedMetal );
#endif
+ setAttribute( Qt::WA_QuitOnClose, false );
/* Is video in embedded in the UI or not */
b_videoEmbedded = var_InheritBool( p_intf, "embedded-video" );
/* Set the other interface settings */
settings = getSettings();
- settings->beginGroup( "MainWindow" );
#ifdef WIN32
/* Volume keys */
#endif
/* */
- b_plDocked = getSettings()->value( "pl-dock-status", true ).toBool();
+ b_plDocked = getSettings()->value( "MainWindow/pl-dock-status", true ).toBool();
- settings->endGroup( );
/**************************
* UI and Widgets design
/************
* Menu Bar *
************/
- QVLCMenu::createMenuBar( this, p_intf );
+ VLCMenuBar::createMenuBar( this, p_intf );
CONNECT( THEMIM->getIM(), voutListChanged( vout_thread_t **, int ),
this, destroyPopupMenu() );
/* Final Sizing, restoration and placement of the interface */
- settings->beginGroup( "MainWindow" );
-
- if( settings->value( "playlist-visible", false ).toBool() )
+ if( settings->value( "MainWindow/playlist-visible", false ).toBool() )
togglePlaylist();
QVLCTools::restoreWidgetPosition( settings, this, QSize(600, 420) );
- settings->endGroup();
b_interfaceFullScreen = isFullScreen();
delete fullscreenControls;
/* Save states */
- settings->beginGroup( "MainWindow" );
+ settings->beginGroup("MainWindow");
settings->setValue( "pl-dock-status", b_plDocked );
/* Save playlist state */
if( playlistWidget )
/* Save the stackCentralW sizes */
settings->setValue( "bgSize", stackWidgetsSizes[bgWidget] );
settings->setValue( "playlistSize", stackWidgetsSizes[playlistWidget] );
+ settings->endGroup();
/* Save this size */
QVLCTools::saveWidgetPosition(settings, this);
- settings->endGroup();
-
/* Save undocked playlist size */
if( playlistWidget && !isPlDocked() )
QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget );
{
bool b_adv = getControlsVisibilityStatus() & CONTROLS_ADVANCED;
- settings->beginGroup( "MainWindow" );
delete controls;
delete inputC;
controls = new ControlsWidget( p_intf, b_adv, this );
inputC = new InputControlsWidget( p_intf, this );
mainLayout->insertWidget( 2, inputC );
- mainLayout->insertWidget( settings->value( "ToolbarPos", 0 ).toInt() ? 0: 3,
+ mainLayout->insertWidget( settings->value( "MainWindow/ToolbarPos", 0 ).toInt() ? 0: 3,
controls );
if( fullscreenControls )
CONNECT( fullscreenControls, keyPressed( QKeyEvent * ),
this, handleKeyPress( QKeyEvent * ) );
}
- settings->endGroup();
}
void MainInterface::reloadPrefs()
}
mainLayout->insertWidget( 1, stackCentralW );
- settings->beginGroup( "MainWindow" );
- stackWidgetsSizes[bgWidget] = settings->value( "bgSize", QSize( 600, 0 ) ).toSize();
+ stackWidgetsSizes[bgWidget] = settings->value( "MainWindow/bgSize", QSize( 600, 0 ) ).toSize();
/* Resize even if no-auto-resize, because we are at creation */
resizeStack( stackWidgetsSizes[bgWidget].width(), stackWidgetsSizes[bgWidget].height() );
/* Create the CONTROLS Widget */
controls = new ControlsWidget( p_intf,
- settings->value( "adv-controls", false ).toBool(), this );
+ settings->value( "MainWindow/adv-controls", false ).toBool(), this );
inputC = new InputControlsWidget( p_intf, this );
mainLayout->insertWidget( 2, inputC );
visualSelector->hide();
#endif
- settings->endGroup();
/* Enable the popup menu in the MI */
main->setContextMenuPolicy( Qt::CustomContextMenu );
inline void MainInterface::initSystray()
{
-#ifndef HAVE_MAEMO
bool b_systrayAvailable = QSystemTrayIcon::isSystemTrayAvailable();
bool b_systrayWanted = var_InheritBool( p_intf, "qt-system-tray" );
if( b_systrayAvailable && b_systrayWanted )
createSystray();
-#endif
}
inline void MainInterface::createStatusBar()
void MainInterface::destroyPopupMenu()
{
- QVLCMenu::PopupMenu( p_intf, false );
+ VLCMenuBar::PopupMenu( p_intf, false );
}
void MainInterface::popupMenu( const QPoint & )
{
- QVLCMenu::PopupMenu( p_intf, true );
+ VLCMenuBar::PopupMenu( p_intf, true );
}
void MainInterface::toggleFSC()
if( stackCentralW->currentWidget() == videoWidget )
restoreStackOldWidget();
- else if( playlistWidget->artContainer->currentWidget() == videoWidget )
+ else if( playlistWidget &&
+ playlistWidget->artContainer->currentWidget() == videoWidget )
{
playlistWidget->artContainer->setCurrentIndex( 0 );
stackCentralW->addWidget( videoWidget );
msg_Dbg( p_intf, "Moving video to correct screen");
move( QPoint( screenres.x(), screenres.y() ) );
}
+
+ /* */
+ if( playlistWidget != NULL && playlistWidget->artContainer->currentWidget() == videoWidget )
+ {
+ showTab( videoWidget );
+ }
+
+ /* */
setMinimalView( true );
setInterfaceFullScreen( true );
}
/*****************************************************************************
* Systray Icon and Systray Menu
*****************************************************************************/
-#ifndef HAVE_MAEMO
/**
* Create a SystemTray icon and a menu that would go with it.
* Connects to a click handler on the icon.
systrayMenu = new QMenu( qtr( "VLC media player" ), this );
systrayMenu->setIcon( iconVLC );
- QVLCMenu::updateSystrayMenu( this, p_intf, true );
+ VLCMenuBar::updateSystrayMenu( this, p_intf, true );
sysTray->show();
CONNECT( sysTray, activated( QSystemTrayIcon::ActivationReason ),
#endif
}
if( sysTray )
- QVLCMenu::updateSystrayMenu( this, p_intf );
+ VLCMenuBar::updateSystrayMenu( this, p_intf );
}
/* First Item of the systray menu */
showNormal();
activateWindow();
- QVLCMenu::updateSystrayMenu( this, p_intf );
+ VLCMenuBar::updateSystrayMenu( this, p_intf );
}
/* First Item of the systray menu */
void MainInterface::hideUpdateSystrayMenu()
{
hide();
- QVLCMenu::updateSystrayMenu( this, p_intf );
+ VLCMenuBar::updateSystrayMenu( this, p_intf );
}
/* Click on systray Icon */
case QSystemTrayIcon::Trigger:
case QSystemTrayIcon::DoubleClick:
#ifdef Q_WS_MAC
- QVLCMenu::updateSystrayMenu( this, p_intf );
+ VLCMenuBar::updateSystrayMenu( this, p_intf );
#else
toggleUpdateSystrayMenu();
#endif
}
}
- QVLCMenu::updateSystrayMenu( this, p_intf );
+ VLCMenuBar::updateSystrayMenu( this, p_intf );
}
/**
sysTray->setToolTip( qtr( "VLC media player" ) );
break;
}
- QVLCMenu::updateSystrayMenu( this, p_intf );
+ VLCMenuBar::updateSystrayMenu( this, p_intf );
}
-#endif
void MainInterface::changeEvent(QEvent *event)
{
void MainInterface::dropEventPlay( QDropEvent *event, bool b_play )
{
- if( event->possibleActions() & Qt::CopyAction )
+ if( event->possibleActions() & ( Qt::CopyAction | Qt::MoveAction ) )
event->setDropAction( Qt::CopyAction );
else
return;
void MainInterface::setBoss()
{
THEMIM->pause();
-#ifndef HAVE_MAEMO
if( sysTray )
{
hide();
}
else
-#endif
{
showMinimized();
}