Commit bc2e3249 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Fix some playlist start showing/non-showing bug.

Still errors present, but too latE.
parent 958d8f0b
...@@ -156,3 +156,15 @@ void PlaylistWidget::dragEnterEvent(QDragEnterEvent *event) ...@@ -156,3 +156,15 @@ void PlaylistWidget::dragEnterEvent(QDragEnterEvent *event)
event->acceptProposedAction(); event->acceptProposedAction();
} }
void PlaylistWidget::closeEvent( QCloseEvent *event )
{
if( THEDP->isDying() )
{
close();
}
else
{
if( p_intf->p_sys->p_mi )
p_intf->p_sys->p_mi->togglePlaylist();
}
}
...@@ -56,8 +56,9 @@ private: ...@@ -56,8 +56,9 @@ private:
QWidget *parent; QWidget *parent;
protected: protected:
intf_thread_t *p_intf; intf_thread_t *p_intf;
void dropEvent( QDropEvent *); virtual void dropEvent( QDropEvent *);
void dragEnterEvent( QDragEnterEvent * ); virtual void dragEnterEvent( QDragEnterEvent * );
virtual void closeEvent( QCloseEvent * );
private slots: private slots:
void setArt( QString ); void setArt( QString );
......
...@@ -57,6 +57,7 @@ DialogsProvider* DialogsProvider::instance = NULL; ...@@ -57,6 +57,7 @@ DialogsProvider* DialogsProvider::instance = NULL;
DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) : DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) :
QObject( NULL ), p_intf( _p_intf ) QObject( NULL ), p_intf( _p_intf )
{ {
b_isDying = false;
fixed_timer = new QTimer( this ); fixed_timer = new QTimer( this );
fixed_timer->start( 150 /* milliseconds */ ); fixed_timer->start( 150 /* milliseconds */ );
...@@ -92,6 +93,7 @@ DialogsProvider::~DialogsProvider() ...@@ -92,6 +93,7 @@ DialogsProvider::~DialogsProvider()
void DialogsProvider::quit() void DialogsProvider::quit()
{ {
b_isDying = true;
vlc_object_kill( p_intf->p_libvlc ); vlc_object_kill( p_intf->p_libvlc );
QApplication::closeAllWindows(); QApplication::closeAllWindows();
QApplication::quit(); QApplication::quit();
......
...@@ -116,6 +116,7 @@ public: ...@@ -116,6 +116,7 @@ public:
EXT_FILTER_VIDEO | EXT_FILTER_AUDIO | EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
EXT_FILTER_PLAYLIST, EXT_FILTER_PLAYLIST,
QString path = QString() ); QString path = QString() );
bool isDying() { return b_isDying; }
protected: protected:
QSignalMapper *menusMapper; QSignalMapper *menusMapper;
QSignalMapper *menusUpdateMapper; QSignalMapper *menusUpdateMapper;
...@@ -127,6 +128,7 @@ private: ...@@ -127,6 +128,7 @@ private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
static DialogsProvider *instance; static DialogsProvider *instance;
void addFromSimple( bool, bool ); void addFromSimple( bool, bool );
bool b_isDying;
public slots: public slots:
void doInteraction( intf_dialog_args_t * ); void doInteraction( intf_dialog_args_t * );
......
...@@ -218,10 +218,12 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -218,10 +218,12 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
QVLCTools::restoreWidgetPosition( settings, this, QSize(380, 60) ); QVLCTools::restoreWidgetPosition( settings, this, QSize(380, 60) );
/* Playlist */ bool b_visible = settings->value( "playlist-visible", 0 ).toInt();
if( settings->value( "playlist-visible", 0 ).toInt() ) togglePlaylist();
settings->endGroup(); settings->endGroup();
/* Playlist */
if( b_visible ) togglePlaylist();
/* Final sizing and showing */ /* Final sizing and showing */
setMinimumWidth( __MAX( controls->sizeHint().width(), setMinimumWidth( __MAX( controls->sizeHint().width(),
menuBar()->sizeHint().width() ) ); menuBar()->sizeHint().width() ) );
...@@ -740,8 +742,10 @@ void MainInterface::togglePlaylist() ...@@ -740,8 +742,10 @@ void MainInterface::togglePlaylist()
{ {
playlistWidget = new PlaylistWidget( p_intf, this ); playlistWidget = new PlaylistWidget( p_intf, this );
i_pl_dock = (pl_dock_e)getSettings() i_pl_dock = PL_UNDOCKED;
->value( "pl-dock-status", PL_UNDOCKED ).toInt(); /* i_pl_dock = (pl_dock_e)getSettings()
->value( "pl-dock-status", PL_UNDOCKED ).toInt(); */
if( i_pl_dock == PL_UNDOCKED ) if( i_pl_dock == PL_UNDOCKED )
{ {
playlistWidget->setWindowFlags( Qt::Window ); playlistWidget->setWindowFlags( Qt::Window );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment