#include "../../../share/vlc32x32-christmas.xpm"
#include <vlc_plugin.h>
+#ifdef WIN32
+ #include <QtPlugin>
+ Q_IMPORT_PLUGIN(qjpeg)
+#endif
+
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
add_integer( "qt-display-mode", QT_NORMAL_MODE, NULL,
QT_MODE_TEXT, QT_MODE_LONGTEXT, false );
- change_integer_list( i_mode_list, psz_mode_list_text, 0 );
+ change_integer_list( i_mode_list, psz_mode_list_text, NULL );
add_bool( "qt-notification", true, NULL, NOTIFICATION_TEXT,
NOTIFICATION_LONGTEXT, false );
set_callbacks( OpenDialogs, Close );
+#if !defined (Q_WS_X11) || HAS_QT43
add_submodule();
set_capability( "vout window", 50 );
set_callbacks( WindowOpen, WindowClose );
+#endif
vlc_module_end();
+#if defined(Q_WS_WIN)
+bool WinQtApp::winEventFilter( MSG *msg, long *result )
+{
+ switch( msg->message )
+ {
+ case 0x0319: /* WM_APPCOMMAND 0x0319 */
+ DefWindowProc( msg->hwnd, msg->message, msg->wParam, msg->lParam );
+ break;
+ }
+ return false;
+}
+#endif /* Q_WS_WIN */
+
/*****************************************************************************
* Module callbacks
*****************************************************************************/
memset( p_intf->p_sys, 0, sizeof( intf_sys_t ) );
p_intf->pf_run = Run;
+ p_intf->p_sys->p_mi = NULL;
/* Access to the playlist */
- p_intf->p_sys->p_playlist = pl_Yield( p_intf );
+ p_intf->p_sys->p_playlist = pl_Hold( p_intf );
/* Listen to the messages */
p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
/* one settings to rule them all */
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
- vlc_object_lock( p_intf );
- p_intf->b_dead = true;
- vlc_object_unlock( p_intf );
-
if( p_intf->p_sys->b_isDialogProvider )
{
- DialogEvent *event = new DialogEvent( INTF_DIALOG_EXIT, 0, NULL );
- QApplication::postEvent( THEDP, static_cast<QEvent*>(event) );
-
+ if( DialogsProvider::isAlive() )
+ {
+ msg_Dbg( p_intf, "Asking the DP to quit nicely" );
+ DialogEvent *event = new DialogEvent( INTF_DIALOG_EXIT, 0, NULL );
+ QApplication::postEvent( THEDP, static_cast<QEvent*>(event) );
+ }
vlc_thread_join( p_intf );
}
msg_Err( p_intf, "failed to create Qt dialogs thread" );
}
else
+ {
+ int canc = vlc_savecancel ();
Init( VLC_OBJECT(p_intf) );
+ vlc_restorecancel( canc );
+ }
}
static QMutex windowLock;
char dummy[] = "";
char *argv[] = { dummy };
int argc = 1;
+ int canc = vlc_savecancel ();
Q_INIT_RESOURCE( vlc );
#endif
/* Start the QApplication here */
+#ifdef WIN32
+ WinQtApp *app = new WinQtApp( argc, argv , true );
+#else
QApplication *app = new QApplication( argc, argv , true );
+#endif
p_intf->p_sys->p_app = app;
p_intf->p_sys->mainSettings = new QSettings(
#endif
QSettings::UserScope, "vlc", "vlc-qt-interface" );
- /* Icon setting
- FIXME: use a bigger icon ? */
+ /* Icon setting */
if( QDate::currentDate().dayOfYear() >= 354 )
app->setWindowIcon( QIcon( QPixmap(vlc_christmas_xpm) ) );
else
/* Retrieve last known path used in file browsing */
char *psz_path = config_GetPsz( p_intf, "qt-filedialog-path" );
- p_intf->p_sys->psz_filepath = EMPTY_STR( psz_path ) ? psz_path
- : config_GetHomeDir();
+ p_intf->p_sys->psz_filepath = EMPTY_STR( psz_path ) ? config_GetHomeDir()
+ : psz_path;
/* Launch */
app->exec();
/* And quit */
+ msg_Dbg( p_intf, "Quitting the Qt4 Interface" );
if (miP)
{
in the MainInputManager */
delete p_intf->p_sys->p_mi;
- /* Destroy then other windows, because some are connected to some slots
- in the MainInputManager */
+ /* Destroy all remaining windows,
+ because some are connected to some slots
+ in the MainInputManager
+ Settings must be destroyed after that.
+ */
DialogsProvider::killInstance();
+ /* Delete the configuration. Application has to be deleted after that. */
+ delete p_intf->p_sys->mainSettings;
+
/* Destroy the MainInputManager */
MainInputManager::killInstance();
- /* Delete the configuration */
- delete p_intf->p_sys->mainSettings;
-
/* Delete the application */
delete app;
/* Save the path */
config_PutPsz( p_intf, "qt-filedialog-path", p_intf->p_sys->psz_filepath );
free( psz_path );
+ vlc_restorecancel (canc);
+ return NULL;
}
/*****************************************************************************