#include "main_interface.hpp"
#include "input_manager.hpp"
#include "util/qvlcframe.hpp"
+#include "util/qvlcapp.hpp"
#include "util/customwidgets.hpp"
#include "dialogs_provider.hpp"
#include "components/interface_widgets.hpp"
#include "dialogs/extended.hpp"
#include "dialogs/playlist.hpp"
#include "menus.hpp"
+#include "recents.hpp"
#include <QMenuBar>
#include <QCloseEvent>
* Menu Bar and Status Bar
**************************/
QVLCMenu::createMenuBar( this, p_intf, visualSelectorEnabled );
+
/* StatusBar Creation */
createStatusBar();
+ /* Recents menu updates */
+ CONNECT( RecentsMRL::getInstance( p_intf ), updated(),
+ this, updateRecentsMenu() );
/********************
* Input Manager *
**************************/
/* Connect the input manager to the GUI elements it manages */
- /* It is also connected to the control->slider, see the ControlsWidget */
- /* Change the SpeedRate in the Status */
+ /* Change the SpeedRate in the Status Bar */
CONNECT( THEMIM->getIM(), rateChanged( int ), this, setRate( int ) );
/**
/* VideoWidget connects to avoid different threads speaking to each other */
- CONNECT( this, askReleaseVideo( void * ),
- this, releaseVideoSlot( void * ) );
+ CONNECT( this, askReleaseVideo( void ),
+ this, releaseVideoSlot( void ) );
if( videoWidget )
CONNECT( this, askVideoToResize( unsigned int, unsigned int ),
videoWidget, SetSizing( unsigned int, unsigned int ) );
/* Create the CONTROLS Widget */
controls = new ControlsWidget( p_intf,
- settings->value( "adv-controls", false ).toBool() );
+ settings->value( "adv-controls", false ).toBool(), this );
CONNECT( controls, advancedControlsToggled( bool ),
this, doComponentsUpdate() );
+ InputControlsWidget *inputC = new InputControlsWidget( p_intf, this );
/* Add the controls Widget to the main Widget */
mainLayout->insertWidget( 0, controls, 0, Qt::AlignBottom );
+ mainLayout->insertWidget( 0, inputC, 0, Qt::AlignBottom );
/* Create the Speed Control Widget */
speedControl = new SpeedControlWidget( p_intf );
}
/* Call from the WindowClose function */
-void MainInterface::releaseVideo( void *p_win )
+void MainInterface::releaseVideo( void )
{
if( fullscreenControls ) fullscreenControls->detachVout();
- if( p_win )
- emit askReleaseVideo( p_win );
+ emit askReleaseVideo( );
}
/* Function that is CONNECTED to the previous emit */
-void MainInterface::releaseVideoSlot( void *p_win )
+void MainInterface::releaseVideoSlot( void )
{
- videoWidget->release( p_win );
+ videoWidget->release( );
if( bgWasVisible )
{
if( i_visualmode != QT_ALWAYS_VIDEO_MODE &&
i_visualmode != QT_MINIMAL_MODE )
{ /* NORMAL MODE then */
- if( videoWidget->isHidden() ) emit askBgWidgetToToggle();
+ if( !videoWidget || videoWidget->isHidden() ) emit askBgWidgetToToggle();
else
{
/* If video is visible, then toggle the status of bgWidget */
/* Visible */
#ifdef WIN32
/* check if any visible window is above vlc in the z-order,
- * but ignore the ones always on top */
+ * but ignore the ones always on top
+ * and the ones which can't be activated */
WINDOWINFO wi;
HWND hwnd;
wi.cbSize = sizeof( WINDOWINFO );
for( hwnd = GetNextWindow( internalWinId(), GW_HWNDPREV );
- hwnd && !IsWindowVisible( hwnd );
+ hwnd && ( !IsWindowVisible( hwnd ) ||
+ ( GetWindowInfo( hwnd, &wi ) &&
+ (wi.dwExStyle&WS_EX_NOACTIVATE) ) );
hwnd = GetNextWindow( hwnd, GW_HWNDPREV ) );
if( !hwnd || !GetWindowInfo( hwnd, &wi ) ||
(wi.dwExStyle&WS_EX_TOPMOST) )
{
if( THEMIM->getIM()->hasInput() )
{
- if( input_AddSubtitles( THEMIM->getInput(),
+ if( !input_AddSubtitle( THEMIM->getInput(),
qtu( toNativeSeparators(
mimeData->urls()[0].toLocalFile() ) ),
true ) )
PLAYLIST_APPEND | (first ? PLAYLIST_GO: 0),
PLAYLIST_END, true, false );
first = false;
+ RecentsMRL::getInstance( p_intf )->addRecent( s );
}
}
event->acceptProposedAction();
}
#endif
/*else */
- if ( event->type() == SetVideoOnTopEvent_Type )
+ if ( event->type() == (int)SetVideoOnTopEvent_Type )
{
SetVideoOnTopQtEvent* p_event = (SetVideoOnTopQtEvent*)event;
if( p_event->OnTop() )
setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
show(); /* necessary to apply window flags?? */
}
- if ( event->type() == MainInterfaceClose_Type )
- {
- QApplication::closeAllWindows();
- QApplication::quit();
- }
}
void MainInterface::keyPressEvent( QKeyEvent *e )
/* Show event */
return VLC_SUCCESS;
}
+
+/*****************************************************************************
+ * updateRecentsMenu: event called by RecentsMRL
+ *****************************************************************************/
+
+void MainInterface::updateRecentsMenu()
+{
+ QVLCMenu::updateRecents( p_intf );
+}