]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs/interaction.cpp
Improve embedded video output
[vlc] / modules / gui / qt4 / dialogs / interaction.cpp
1 /*****************************************************************************
2  * interaction.cpp : Interaction stuff
3  ****************************************************************************
4  * Copyright (C) 2000-2005 the VideoLAN team
5  * $Id: wxwidgets.cpp 15731 2006-05-25 14:43:53Z zorglub $
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/
22
23 #include "dialogs/interaction.hpp"
24 #include <vlc/intf.h>
25
26 InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
27                                       interaction_dialog_t *_p_dialog ) :
28                                         p_intf( _p_intf), p_dialog( _p_dialog )
29 {
30     if( p_dialog->i_flags & DIALOG_YES_NO_CANCEL )
31     {
32         uiOkCancel = new Ui::OKCancelDialog;
33         uiOkCancel->setupUi( this );
34         uiOkCancel->description->setText( p_dialog->psz_description );
35         connect( uiOkCancel->okButton, SIGNAL( clicked() ),
36                  this, SLOT( OK() ) );
37         connect( uiOkCancel->cancelButton, SIGNAL( clicked() ),
38                  this, SLOT( cancel() ) );
39     }
40     else if( p_dialog->i_flags & DIALOG_YES_NO_CANCEL )
41     {
42       
43     }
44     else if( p_dialog->i_flags & DIALOG_LOGIN_PW_OK_CANCEL )
45     {
46
47     }
48     else if( p_dialog->i_flags & DIALOG_USER_PROGRESS )
49     {
50
51     }
52     else if( p_dialog->i_flags & DIALOG_PSZ_INPUT_OK_CANCEL )
53     {
54     }
55     else
56         msg_Err( p_intf, "unknown dialog type" );
57 }
58
59 void InteractionDialog::Update()
60 {
61 }
62
63 InteractionDialog::~InteractionDialog()
64 {
65 }
66
67 void InteractionDialog::OK()
68 {
69     Finish( DIALOG_OK_YES, NULL, NULL );
70 }
71
72 void InteractionDialog::cancel()
73 {
74     Finish( DIALOG_CANCELLED, NULL, NULL );
75 }
76
77 void InteractionDialog::Finish( int i_ret, QString *r1, QString *r2 )
78 {
79    vlc_mutex_lock( &p_dialog->p_interaction->object_lock ); 
80
81    p_dialog->i_status = ANSWERED_DIALOG;
82    p_dialog->i_return = i_ret;
83    hide();
84    vlc_mutex_unlock( &p_dialog->p_interaction->object_lock ); 
85 }