#include "util/customwidgets.hpp"
#include "dialogs_provider.hpp"
#include "components/interface_widgets.hpp"
+#include "components/controller.hpp"
#include "components/playlist/playlist.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 *
/* END CONNECTS ON IM */
- /** OnTimeOut **/
- /* TODO Remove this function, but so far, there is no choice because there
- is no intf-should-die variable #1365 */
- ON_TIMEOUT( updateOnTimer() );
-
/************
* Callbacks
************/
CONNECT( this, askUpdate(), this, doComponentsUpdate() );
/* Size and placement of interface */
+ settings->beginGroup( "MainWindow" );
QVLCTools::restoreWidgetPosition( settings, this, QSize(380, 60) );
-
bool b_visible = settings->value( "playlist-visible", 0 ).toInt();
settings->endGroup();
{
if( !isDocked() )
QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget );
+
+ delete playlistWidget;
}
settings->beginGroup( "MainWindow" );
mainLayout->setMargin( 0 );
/* Create the CONTROLS Widget */
- bool b_shiny = config_GetInt( p_intf, "qt-blingbling" );
- controls = new ControlsWidget( p_intf, this,
- settings->value( "adv-controls", false ).toBool(),
- b_shiny );
+ controls = new ControlsWidget( p_intf,
+ settings->value( "adv-controls", false ).toBool() );
CONNECT( controls, advancedControlsToggled( bool ),
this, doComponentsUpdate() );
-#ifdef WIN32
- if ( depth() > 8 )
-#endif
- /* Create the FULLSCREEN CONTROLS Widget */
- if( config_GetInt( p_intf, "qt-fs-controller" ) )
- {
- fullscreenControls = new FullscreenControllerWidget( p_intf, this,
- settings->value( "adv-controls", false ).toBool(),
- b_shiny );
- CONNECT( fullscreenControls, advancedControlsToggled( bool ),
- this, doComponentsUpdate() );
- }
-
/* Add the controls Widget to the main Widget */
mainLayout->insertWidget( 0, controls, 0, Qt::AlignBottom );
/* Finish the sizing */
main->updateGeometry();
+
+ getSettings()->endGroup();
+#ifdef WIN32
+ if ( depth() > 8 )
+#endif
+ /* Create the FULLSCREEN CONTROLS Widget */
+ if( config_GetInt( p_intf, "qt-fs-controller" ) )
+ {
+ fullscreenControls = new FullscreenControllerWidget( p_intf );
+ }
}
inline void MainInterface::askForPrivacy()
If no playlist exist, then create one and attach it to the DockPL*/
if( !playlistWidget )
{
- playlistWidget = new PlaylistWidget( p_intf, this );
+ playlistWidget = new PlaylistWidget( p_intf );
i_pl_dock = PL_UNDOCKED;
/* i_pl_dock = (pl_dock_e)getSettings()
{
playlistWidget->setWindowFlags( Qt::Window );
+ /* This will restore the geometry but will not work for position,
+ because of parenting */
QVLCTools::restoreWidgetPosition( p_intf, "Playlist",
playlistWidget, QSize( 600, 300 ) );
}
void MainInterface::toggleAdvanced()
{
controls->toggleAdvanced();
- if( fullscreenControls ) fullscreenControls->toggleAdvanced();
+// if( fullscreenControls ) fullscreenControls->toggleAdvanced();
}
/* Get the visibility status of the controls (hidden or not, advanced or not) */
{
msg_Dbg( p_intf, "Updating the stream status: %i", status );
- /* Forward the status to the controls to toggle Play/Pause */
- controls->setStatus( status );
- controls->updateInput();
-
- if( fullscreenControls )
- {
- fullscreenControls->setStatus( status );
- fullscreenControls->updateInput();
- }
-
speedControl->setEnable( THEMIM->getIM()->hasInput() );
/* And in the systray for the menu */
speedControl->updateControls( rate );
}
-void MainInterface::updateOnTimer()
-{
- /* No event for dying */
- if( !vlc_object_alive( p_intf ) )
- {
- QApplication::closeAllWindows();
- QApplication::quit();
- }
-}
-
/*****************************************************************************
* Systray Icon and Systray Menu
*****************************************************************************/
PLAYLIST_APPEND | (first ? PLAYLIST_GO: 0),
PLAYLIST_END, true, false );
first = false;
+ RecentsMRL::getInstance( p_intf )->addRecent( s );
}
}
event->acceptProposedAction();
/* Show event */
return VLC_SUCCESS;
}
+
+/*****************************************************************************
+ * updateRecentsMenu: event called by RecentsMRL
+ *****************************************************************************/
+
+void MainInterface::updateRecentsMenu()
+{
+ QVLCMenu::updateRecents( p_intf );
+}