]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs_provider.cpp
Qt: Remove some dialogs_provider.hpp and input_manager.hpp dependencies.
[vlc] / modules / gui / qt4 / dialogs_provider.cpp
1 /*****************************************************************************
2  * dialogs_provider.cpp : Dialog Provider
3  *****************************************************************************
4  * Copyright (C) 2006-2008 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *          Jean-Baptiste Kempf <jb@videolan.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifdef HAVE_CONFIG_H
26 # include "config.h"
27 #endif
28
29 #include <vlc_common.h>
30 #include <vlc_intf_strings.h>
31
32 #include "qt4.hpp"
33 #include "dialogs_provider.hpp"
34 #include "menus.hpp"
35 #include "input_manager.hpp"
36 #include "recents.hpp"
37 #include "util/qvlcapp.hpp"
38
39 /* The dialogs */
40 #include "dialogs/playlist.hpp"
41 #include "dialogs/bookmarks.hpp"
42 #include "dialogs/preferences.hpp"
43 #include "dialogs/mediainfo.hpp"
44 #include "dialogs/messages.hpp"
45 #include "dialogs/extended.hpp"
46 #include "dialogs/vlm.hpp"
47 #include "dialogs/sout.hpp"
48 #include "dialogs/open.hpp"
49 #include "dialogs/help.hpp"
50 #include "dialogs/gototime.hpp"
51 #include "dialogs/podcast_configuration.hpp"
52 #include "dialogs/toolbar.hpp"
53 #include "dialogs/plugins.hpp"
54
55 #include <QEvent>
56 #include <QApplication>
57 #include <QSignalMapper>
58 #include <QFileDialog>
59
60
61 DialogsProvider* DialogsProvider::instance = NULL;
62
63 DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) :
64                                   QObject( NULL ), p_intf( _p_intf )
65 {
66     b_isDying = false;
67
68     /* Various signal mappers for the menus */
69     menusMapper = new QSignalMapper();
70     CONNECT( menusMapper, mapped(QObject *), this, menuAction( QObject *) );
71
72     menusUpdateMapper = new QSignalMapper();
73     CONNECT( menusUpdateMapper, mapped(QObject *),
74              this, menuUpdateAction( QObject *) );
75
76     SDMapper = new QSignalMapper();
77     CONNECT( SDMapper, mapped (QString), this, SDMenuAction( QString ) );
78 }
79
80 DialogsProvider::~DialogsProvider()
81 {
82     msg_Dbg( p_intf, "Destroying the Dialog Provider" );
83     PlaylistDialog::killInstance();
84     MediaInfoDialog::killInstance();
85     MessagesDialog::killInstance();
86     ExtendedDialog::killInstance();
87     BookmarksDialog::killInstance();
88     HelpDialog::killInstance();
89 #ifdef UPDATE_CHECK
90     UpdateDialog::killInstance();
91 #endif
92
93     delete menusMapper;
94     delete menusUpdateMapper;
95     delete SDMapper;
96 }
97
98 void DialogsProvider::quit()
99 {
100     /* Stop the playlist */
101     playlist_Stop( THEPL );
102     b_isDying = true;
103     vlc_object_kill( p_intf->p_libvlc );
104     QApplication::closeAllWindows();
105     QApplication::quit();
106 }
107
108 void DialogsProvider::customEvent( QEvent *event )
109 {
110     if( event->type() == (int)DialogEvent_Type )
111     {
112         DialogEvent *de = static_cast<DialogEvent*>(event);
113         switch( de->i_dialog )
114         {
115         case INTF_DIALOG_FILE_SIMPLE:
116         case INTF_DIALOG_FILE:
117             openDialog(); break;
118         case INTF_DIALOG_FILE_GENERIC:
119             openFileGenericDialog( de->p_arg ); break;
120         case INTF_DIALOG_DISC:
121             openDiscDialog(); break;
122         case INTF_DIALOG_NET:
123             openNetDialog(); break;
124         case INTF_DIALOG_SAT:
125         case INTF_DIALOG_CAPTURE:
126             openCaptureDialog(); break;
127         case INTF_DIALOG_DIRECTORY:
128             PLAppendDir(); break;
129         case INTF_DIALOG_PLAYLIST:
130             playlistDialog(); break;
131         case INTF_DIALOG_MESSAGES:
132             messagesDialog(); break;
133         case INTF_DIALOG_FILEINFO:
134            mediaInfoDialog(); break;
135         case INTF_DIALOG_PREFS:
136            prefsDialog(); break;
137         case INTF_DIALOG_BOOKMARKS:
138            bookmarksDialog(); break;
139         case INTF_DIALOG_EXTENDED:
140            extendedDialog(); break;
141 #ifdef ENABLE_VLM
142         case INTF_DIALOG_VLM:
143            vlmDialog(); break;
144 #endif
145         case INTF_DIALOG_INTERACTION:
146            doInteraction( de->p_arg ); break;
147         case INTF_DIALOG_POPUPMENU:
148            QVLCMenu::PopupMenu( p_intf, (de->i_arg != 0) ); break;
149         case INTF_DIALOG_AUDIOPOPUPMENU:
150            QVLCMenu::AudioPopupMenu( p_intf ); break;
151         case INTF_DIALOG_VIDEOPOPUPMENU:
152            QVLCMenu::VideoPopupMenu( p_intf ); break;
153         case INTF_DIALOG_MISCPOPUPMENU:
154            QVLCMenu::MiscPopupMenu( p_intf ); break;
155         case INTF_DIALOG_WIZARD:
156         case INTF_DIALOG_STREAMWIZARD:
157             openAndStreamingDialogs(); break;
158 #ifdef UPDATE_CHECK
159         case INTF_DIALOG_UPDATEVLC:
160             updateDialog(); break;
161 #endif
162         case INTF_DIALOG_EXIT:
163             quit(); break;
164         default:
165            msg_Warn( p_intf, "unimplemented dialog" );
166         }
167     }
168 }
169
170 /****************************************************************************
171  * Individual simple dialogs
172  ****************************************************************************/
173 void DialogsProvider::playlistDialog()
174 {
175     PlaylistDialog::getInstance( p_intf )->toggleVisible();
176 }
177
178 void DialogsProvider::prefsDialog()
179 {
180     PrefsDialog::getInstance( p_intf )->toggleVisible();
181 }
182
183 void DialogsProvider::extendedDialog()
184 {
185     ExtendedDialog::getInstance( p_intf )->toggleVisible();
186 }
187
188 void DialogsProvider::messagesDialog()
189 {
190     MessagesDialog::getInstance( p_intf )->toggleVisible();
191 }
192
193 void DialogsProvider::gotoTimeDialog()
194 {
195     GotoTimeDialog::getInstance( p_intf )->toggleVisible();
196 }
197
198 #ifdef ENABLE_VLM
199 void DialogsProvider::vlmDialog()
200 {
201     VLMDialog::getInstance( p_intf )->toggleVisible();
202 }
203 #endif
204
205 void DialogsProvider::helpDialog()
206 {
207     HelpDialog::getInstance( p_intf )->toggleVisible();
208 }
209
210 #ifdef UPDATE_CHECK
211 void DialogsProvider::updateDialog()
212 {
213     UpdateDialog::getInstance( p_intf )->toggleVisible();
214 }
215 #endif
216
217 void DialogsProvider::aboutDialog()
218 {
219     AboutDialog::getInstance( p_intf )->toggleVisible();
220 }
221
222 void DialogsProvider::mediaInfoDialog()
223 {
224     MediaInfoDialog::getInstance( p_intf )->toggleVisible();
225 }
226
227 void DialogsProvider::mediaCodecDialog()
228 {
229     MediaInfoDialog::getInstance( p_intf )->showTab( 2 );
230 }
231
232 void DialogsProvider::bookmarksDialog()
233 {
234     BookmarksDialog::getInstance( p_intf )->toggleVisible();
235 }
236
237 void DialogsProvider::podcastConfigureDialog()
238 {
239     PodcastConfigDialog::getInstance( p_intf )->toggleVisible();
240 }
241
242 void DialogsProvider::toolbarDialog()
243 {
244     ToolbarEditDialog::getInstance( p_intf )->toggleVisible();
245 }
246
247 void DialogsProvider::pluginDialog()
248 {
249     PluginDialog *diag = new PluginDialog( p_intf );
250     diag->show();
251 }
252
253 /* Generic open file */
254 void DialogsProvider::openFileGenericDialog( intf_dialog_args_t *p_arg )
255 {
256     if( p_arg == NULL )
257     {
258         msg_Warn( p_intf, "openFileGenericDialog() called with NULL arg" );
259         return;
260     }
261
262     /* Replace the extensions to a Qt format */
263     int i = 0;
264     QString extensions = qfu( p_arg->psz_extensions );
265     while ( ( i = extensions.indexOf( "|", i ) ) != -1 )
266     {
267         if( ( extensions.count( "|" ) % 2 ) == 0 )
268             extensions.replace( i, 1, ");;" );
269         else
270             extensions.replace( i, 1, "(" );
271     }
272     extensions.replace(QString(";*"), QString(" *"));
273     extensions.append( ")" );
274
275     /* Save */
276     if( p_arg->b_save )
277     {
278         QString file = QFileDialog::getSaveFileName( NULL, p_arg->psz_title,
279                             qfu( p_intf->p_sys->psz_filepath ), extensions );
280         if( !file.isEmpty() )
281         {
282             p_arg->i_results = 1;
283             p_arg->psz_results = (char **)malloc( p_arg->i_results * sizeof( char * ) );
284             p_arg->psz_results[0] = strdup( qtu( toNativeSepNoSlash( file ) ) );
285         }
286         else
287             p_arg->i_results = 0;
288     }
289     else /* non-save mode */
290     {
291         QStringList files = QFileDialog::getOpenFileNames( NULL,
292                 p_arg->psz_title, qfu( p_intf->p_sys->psz_filepath ),
293                 extensions );
294         p_arg->i_results = files.count();
295         p_arg->psz_results = (char **)malloc( p_arg->i_results * sizeof( char * ) );
296         i = 0;
297         foreach( QString file, files )
298             p_arg->psz_results[i++] = strdup( qtu( toNativeSepNoSlash( file ) ) );
299     }
300
301     /* Callback */
302     if( p_arg->pf_callback )
303         p_arg->pf_callback( p_arg );
304
305     /* Clean afterwards */
306     if( p_arg->psz_results )
307     {
308         for( i = 0; i < p_arg->i_results; i++ )
309             free( p_arg->psz_results[i] );
310         free( p_arg->psz_results );
311     }
312     free( p_arg->psz_title );
313     free( p_arg->psz_extensions );
314     free( p_arg );
315 }
316 /****************************************************************************
317  * All the open/add stuff
318  * Open Dialog first - Simple Open then
319  ****************************************************************************/
320
321 void DialogsProvider::openDialog( int i_tab )
322 {
323     OpenDialog::getInstance( p_intf->p_sys->p_mi , p_intf )->showTab( i_tab );
324 }
325 void DialogsProvider::openDialog()
326 {
327     openDialog( OPEN_FILE_TAB );
328 }
329 void DialogsProvider::openFileDialog()
330 {
331     openDialog( OPEN_FILE_TAB );
332 }
333 void DialogsProvider::openDiscDialog()
334 {
335     openDialog( OPEN_DISC_TAB );
336 }
337 void DialogsProvider::openNetDialog()
338 {
339     openDialog( OPEN_NETWORK_TAB );
340 }
341 void DialogsProvider::openCaptureDialog()
342 {
343     openDialog( OPEN_CAPTURE_TAB );
344 }
345
346 /* Same as the open one, but force the enqueue */
347 void DialogsProvider::PLAppendDialog()
348 {
349     OpenDialog::getInstance( p_intf->p_sys->p_mi, p_intf, false,
350                              OPEN_AND_ENQUEUE )->showTab( OPEN_FILE_TAB );
351 }
352
353 void DialogsProvider::MLAppendDialog()
354 {
355     OpenDialog::getInstance( p_intf->p_sys->p_mi, p_intf, false,
356                             OPEN_AND_ENQUEUE, false, false )
357                                     ->showTab( OPEN_FILE_TAB );
358 }
359
360 /**
361  * Simple open
362  ***/
363 QStringList DialogsProvider::showSimpleOpen( QString help,
364                                              int filters,
365                                              QString path )
366 {
367     QString fileTypes = "";
368     if( filters & EXT_FILTER_MEDIA ) {
369         ADD_FILTER_MEDIA( fileTypes );
370     }
371     if( filters & EXT_FILTER_VIDEO ) {
372         ADD_FILTER_VIDEO( fileTypes );
373     }
374     if( filters & EXT_FILTER_AUDIO ) {
375         ADD_FILTER_AUDIO( fileTypes );
376     }
377     if( filters & EXT_FILTER_PLAYLIST ) {
378         ADD_FILTER_PLAYLIST( fileTypes );
379     }
380     if( filters & EXT_FILTER_SUBTITLE ) {
381         ADD_FILTER_SUBTITLE( fileTypes );
382     }
383     ADD_FILTER_ALL( fileTypes );
384     fileTypes.replace(QString(";*"), QString(" *"));
385
386     return QFileDialog::getOpenFileNames( NULL,
387         help.isEmpty() ? qtr(I_OP_SEL_FILES ) : help,
388         path.isEmpty() ? qfu( p_intf->p_sys->psz_filepath ) : path,
389         fileTypes );
390 }
391
392 /**
393  * Open a file,
394  * pl helps you to choose from playlist or media library,
395  * go to start or enqueue
396  **/
397 void DialogsProvider::addFromSimple( bool pl, bool go)
398 {
399     QStringList files = DialogsProvider::showSimpleOpen();
400     int i = 0;
401     foreach( QString file, files )
402     {
403         playlist_Add( THEPL, qtu( toNativeSeparators( file ) ), NULL,
404                       go ? ( PLAYLIST_APPEND | ( i ? 0 : PLAYLIST_GO ) |
405                                                ( i ? PLAYLIST_PREPARSE : 0 ) )
406                          : ( PLAYLIST_APPEND | PLAYLIST_PREPARSE ),
407                       PLAYLIST_END,
408                       pl ? true : false, false );
409         RecentsMRL::getInstance( p_intf )->addRecent(
410                 toNativeSeparators( file ) );
411         i++;
412     }
413 }
414
415 void DialogsProvider::simpleOpenDialog()
416 {
417     addFromSimple( true, true ); /* Playlist and Go */
418 }
419
420 void DialogsProvider::simplePLAppendDialog()
421 {
422     addFromSimple( true, false );
423 }
424
425 void DialogsProvider::simpleMLAppendDialog()
426 {
427     addFromSimple( false, false );
428 }
429
430 /* Directory */
431 /**
432  * Open a directory,
433  * pl helps you to choose from playlist or media library,
434  * go to start or enqueue
435  **/
436 static void openDirectory( intf_thread_t *p_intf, bool pl, bool go )
437 {
438     QString dir = QFileDialog::getExistingDirectory( NULL, qtr("Open Directory") );
439
440     if (!dir.isEmpty() )
441     {
442         QString mrl = dir.endsWith( "VIDEO_TS", Qt::CaseInsensitive ) ?
443             "dvd://" : "directory://" + toNativeSeparators( dir );
444         input_item_t *p_input = input_item_NewExt( THEPL, qtu( mrl ),
445                               NULL, 0, NULL, -1 );
446
447         /* FIXME: playlist_AddInput() can fail */
448         playlist_AddInput( THEPL, p_input,
449                        go ? ( PLAYLIST_APPEND | PLAYLIST_GO ) : PLAYLIST_APPEND,
450                        PLAYLIST_END, pl, pl_Unlocked );
451         RecentsMRL::getInstance( p_intf )->addRecent( mrl );
452         if( !go )
453             input_Read( THEPL, p_input, true );
454         vlc_gc_decref( p_input );
455     }
456 }
457
458 void DialogsProvider::PLOpenDir()
459 {
460     openDirectory( p_intf, true, true );
461 }
462
463 void DialogsProvider::PLAppendDir()
464 {
465     openDirectory( p_intf, true, false );
466 }
467
468 void DialogsProvider::MLAppendDir()
469 {
470     openDirectory( p_intf, false , false );
471 }
472
473 /****************
474  * Playlist     *
475  ****************/
476 void DialogsProvider::openAPlaylist()
477 {
478     QStringList files = showSimpleOpen( qtr( "Open playlist..." ),
479                                         EXT_FILTER_PLAYLIST );
480     foreach( QString file, files )
481     {
482         playlist_Import( THEPL, qtu( toNativeSeparators( file ) ) );
483     }
484 }
485
486 void DialogsProvider::saveAPlaylist()
487 {
488     QFileDialog *qfd = new QFileDialog( NULL,
489                                    qtr( "Save playlist as..." ),
490                                    qfu( p_intf->p_sys->psz_filepath ),
491                                    qtr( "XSPF playlist (*.xspf);; " ) +
492                                    qtr( "M3U playlist (*.m3u);; " ) +
493                                    qtr( "HTML playlist (*.html);;" ) +
494                                    qtr( "Any (*.*) " ) );
495     qfd->setFileMode( QFileDialog::AnyFile );
496     qfd->setAcceptMode( QFileDialog::AcceptSave );
497     qfd->setConfirmOverwrite( true );
498
499     if( qfd->exec() == QDialog::Accepted )
500     {
501         if( qfd->selectedFiles().count() > 0 )
502         {
503             static const char psz_xspf[] = "export-xspf",
504                               psz_m3u[] = "export-m3u",
505                               psz_html[] = "export-html";
506             const char *psz_module;
507
508             QString file = qfd->selectedFiles().first();
509             QString filter = qfd->selectedFilter();
510             const char* filt = filter.toAscii();
511
512             if( file.contains( ".xsp" ) || filter.contains( "XSPF" ) )
513             {
514                 psz_module = psz_xspf;
515                 if( !file.contains( ".xsp" ) )
516                     file.append( ".xspf" );
517             }
518             else if( file.contains( ".m3u" )  || filter.contains( "M3U" ) )
519             {
520                 psz_module = psz_m3u;
521                 if( !file.contains( ".m3u" ) )
522                     file.append( ".m3u" );
523             }
524             else if( file.contains(".html" ) || filter.contains( "HTML" ) )
525             {
526                 psz_module = psz_html;
527                 if( !file.contains( "html" ) )
528                     file.append( ".html" );
529             }
530             else
531             {
532                 msg_Err( p_intf, "Impossible to recognise the file type" );
533                 delete qfd;
534                 return;
535             }
536
537             playlist_Export( THEPL, qtu( toNativeSeparators( file ) ),
538                         THEPL->p_local_category, psz_module);
539         }
540     }
541     delete qfd;
542 }
543
544 /****************************************************************************
545  * Sout emulation
546  ****************************************************************************/
547
548 void DialogsProvider::streamingDialog( QWidget *parent, QString mrl,
549                                        bool b_transcode_only )
550 {
551     SoutDialog *s = SoutDialog::getInstance( parent, p_intf, b_transcode_only );
552
553     if( s->exec() == QDialog::Accepted )
554     {
555         msg_Dbg( p_intf, "Sout mrl %s", qta( s->getMrl() ) );
556         /* Just do it */
557         int i_len = strlen( qtu( s->getMrl() ) ) + 10;
558         char *psz_option = (char*)malloc( i_len );
559         snprintf( psz_option, i_len - 1, "%s", qtu( s->getMrl() ) );
560
561         playlist_AddExt( THEPL, qtu( mrl ), "Streaming",
562                          PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END,
563                         -1, &psz_option, 1, true, pl_Unlocked );
564         RecentsMRL::getInstance( p_intf )->addRecent( mrl );
565     }
566 }
567
568 void DialogsProvider::openAndStreamingDialogs()
569 {
570     OpenDialog::getInstance( p_intf->p_sys->p_mi, p_intf, false, OPEN_AND_STREAM )
571                                 ->showTab( OPEN_FILE_TAB );
572 }
573
574 void DialogsProvider::openAndTranscodingDialogs()
575 {
576     OpenDialog::getInstance( p_intf->p_sys->p_mi , p_intf, false, OPEN_AND_SAVE )
577                                 ->showTab( OPEN_FILE_TAB );
578 }
579
580 void DialogsProvider::loadSubtitlesFile()
581 {
582     input_thread_t *p_input = THEMIM->getInput();
583     if( !p_input ) return;
584
585     input_item_t *p_item = input_GetItem( p_input );
586     if( !p_item ) return;
587
588     char *path = input_item_GetURI( p_item );
589     if( !path ) path = strdup( "" );
590
591     char *sep = strrchr( path, DIR_SEP_CHAR );
592     if( sep ) *sep = '\0';
593
594     QStringList qsl = showSimpleOpen( qtr( "Open subtitles..." ),
595                                       EXT_FILTER_SUBTITLE,
596                                       path );
597     free( path );
598     QString qsFile;
599     foreach( qsFile, qsl )
600     {
601         if( input_AddSubtitle( p_input, qtu( toNativeSeparators( qsFile ) ),
602                     true ) )
603             msg_Warn( p_intf, "unable to load subtitles from '%s'",
604                       qtu( qsFile ) );
605     }
606 }
607
608
609 /****************************************************************************
610  * Menus
611  ****************************************************************************/
612
613 void DialogsProvider::menuAction( QObject *data )
614 {
615     QVLCMenu::DoAction( p_intf, data );
616 }
617
618 void DialogsProvider::menuUpdateAction( QObject *data )
619 {
620     MenuFunc *func = qobject_cast<MenuFunc *>(data);
621     assert( func );
622     func->doFunc( p_intf );
623 }
624
625 void DialogsProvider::SDMenuAction( QString data )
626 {
627     char *psz_sd = qtu( data );
628     if( !playlist_IsServicesDiscoveryLoaded( THEPL, psz_sd ) )
629         playlist_ServicesDiscoveryAdd( THEPL, psz_sd );
630     else
631         playlist_ServicesDiscoveryRemove( THEPL, psz_sd );
632 }
633
634 /**
635  * Play the MRL contained in the Recently played menu.
636  **/
637 void DialogsProvider::playMRL( const QString &mrl )
638 {
639     playlist_Add( THEPL, qtu( mrl ) , NULL,
640            PLAYLIST_APPEND | PLAYLIST_GO , PLAYLIST_END, true, false );
641
642     RecentsMRL::getInstance( p_intf )->addRecent( mrl );
643 }
644
645 /*************************************
646  * Interactions
647  *************************************/
648 void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg )
649 {
650     InteractionDialog *qdialog;
651     interaction_dialog_t *p_dialog = p_arg->p_dialog;
652     switch( p_dialog->i_action )
653     {
654     case INTERACT_NEW:
655         qdialog = new InteractionDialog( p_intf, p_dialog );
656         p_dialog->p_private = (void*)qdialog;
657         if( !(p_dialog->i_status == ANSWERED_DIALOG) )
658             qdialog->show();
659         break;
660     case INTERACT_UPDATE:
661         qdialog = (InteractionDialog*)(p_dialog->p_private);
662         if( qdialog )
663             qdialog->update();
664         else
665         {
666             /* The INTERACT_NEW message was forgotten
667                so we must create the dialog and update it*/
668             qdialog = new InteractionDialog( p_intf, p_dialog );
669             p_dialog->p_private = (void*)qdialog;
670             if( !(p_dialog->i_status == ANSWERED_DIALOG) )
671                 qdialog->show();
672             if( qdialog )
673                 qdialog->update();
674         }
675         break;
676     case INTERACT_HIDE:
677         msg_Dbg( p_intf, "Hide the Interaction Dialog" );
678         qdialog = (InteractionDialog*)(p_dialog->p_private);
679         if( qdialog )
680             qdialog->hide();
681         p_dialog->i_status = HIDDEN_DIALOG;
682         break;
683     case INTERACT_DESTROY:
684         msg_Dbg( p_intf, "Destroy the Interaction Dialog" );
685         qdialog = (InteractionDialog*)(p_dialog->p_private);
686         if( !p_dialog->i_flags & DIALOG_NONBLOCKING_ERROR )
687             delete qdialog;
688         p_dialog->i_status = DESTROYED_DIALOG;
689         break;
690     }
691 }
692