/* 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
************/
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
*****************************************************************************/
setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
show(); /* necessary to apply window flags?? */
}
+ if ( event->type() == MainInterfaceClose_Type )
+ {
+ QApplication::closeAllWindows();
+ QApplication::quit();
+ }
}
void MainInterface::keyPressEvent( QKeyEvent *e )
}
else
{
- int canc = vlc_savecancel ();
Init( VLC_OBJECT(p_intf) );
- vlc_restorecancel( canc );
}
}
static QMutex windowLock;
static QWaitCondition windowWait;
+static void ThreadCleanup( void *param)
+{
+ intf_thread_t *p_intf = (intf_thread_t *)param;
+ QEvent *event = new QEvent((QEvent::Type)(MainInterfaceClose_Type) );
+ QApplication::postEvent( p_intf->p_sys->p_mi, event );
+}
+
static void *Init( vlc_object_t *obj )
{
intf_thread_t *p_intf = (intf_thread_t *)obj;
int argc = 1;
int canc = vlc_savecancel ();
+ msg_Dbg( p_intf, "Setting ThreadCleanup");
+ vlc_cleanup_push( ThreadCleanup, (void*)p_intf );
Q_INIT_RESOURCE( vlc );
#if !defined(WIN32) && !defined(__APPLE__)
p_intf->p_sys->psz_filepath = EMPTY_STR( psz_path ) ? config_GetHomeDir()
: psz_path;
+ vlc_restorecancel (canc);
/* Launch */
app->exec();
/* And quit */
+ canc = vlc_savecancel ();
msg_Dbg( p_intf, "Quitting the Qt4 Interface" );
if (miP)
config_PutPsz( p_intf, "qt-filedialog-path", p_intf->p_sys->psz_filepath );
free( psz_path );
vlc_restorecancel (canc);
+ vlc_cleanup_pop();
return NULL;
}
class VideoWidget;
class QSettings;
+
#if defined(Q_WS_WIN)
#include <QApplication>
//static const int PLUndockEvent_Type = QEvent::User + DialogEventType + 2;
//static const int PLDockEvent_Type = QEvent::User + DialogEventType + 3;
static const int SetVideoOnTopEvent_Type = QEvent::User + DialogEventType + 4;
+static const int MainInterfaceClose_Type = QEvent::User + 404;
class DialogEvent : public QEvent
{