1 /*****************************************************************************
2 * main_inteface.cpp : Main interface
3 ****************************************************************************
4 * Copyright (C) 2000-2005 the VideoLAN team
5 * $Id: wxwidgets.cpp 15731 2006-05-25 14:43:53Z zorglub $
7 * Authors: Clément Stenac <zorglub@videolan.org>
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.
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.
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. *****************************************************************************/
23 #include "dialogs_provider.hpp"
26 #include "dialogs/playlist.hpp"
27 #include "dialogs/prefs_dialog.hpp"
28 #include "dialogs/streaminfo.hpp"
29 #include <QApplication>
31 DialogsProvider* DialogsProvider::instance = NULL;
33 DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) :
34 QObject( NULL ), p_intf( _p_intf )
36 idle_timer = new QTimer( this );
37 // idle_timer->start( 0 );
39 fixed_timer = new QTimer( this );
40 fixed_timer->start( 100 /* milliseconds */ );
43 DialogsProvider::~DialogsProvider()
47 void DialogsProvider::customEvent( QEvent *event )
49 if( event->type() == DialogEvent_Type )
51 DialogEvent *de = dynamic_cast<DialogEvent*>(event);
52 switch( de->i_dialog )
54 case INTF_DIALOG_FILE:
55 case INTF_DIALOG_DISC:
57 case INTF_DIALOG_CAPTURE:
58 openDialog( de->i_dialog ); break;
59 case INTF_DIALOG_PLAYLIST:
60 playlistDialog(); break;
61 case INTF_DIALOG_MESSAGES:
62 messagesDialog(); break;
63 case INTF_DIALOG_PREFS:
65 case INTF_DIALOG_POPUPMENU:
66 case INTF_DIALOG_AUDIOPOPUPMENU:
67 case INTF_DIALOG_VIDEOPOPUPMENU:
68 case INTF_DIALOG_MISCPOPUPMENU:
69 popupMenu( de->i_dialog ); break;
70 case INTF_DIALOG_FILEINFO:
71 streaminfoDialog(); break;
73 case INTF_DIALOG_INTERACTION:
74 case INTF_DIALOG_BOOKMARKS:
75 case INTF_DIALOG_WIZARD:
77 fprintf( stderr, "Unimplemented dialog\n");
82 void DialogsProvider::playlistDialog()
84 PlaylistDialog::getInstance( p_intf )->toggleVisible();
87 void DialogsProvider::openDialog( int i_dialog )
91 void DialogsProvider::streaminfoDialog()
93 StreamInfoDialog::getInstance( p_intf )->toggleVisible();
96 void DialogsProvider::prefsDialog()
98 PrefsDialog::getInstance( p_intf )->toggleVisible();
101 void DialogsProvider::messagesDialog()
105 void DialogsProvider::popupMenu( int i_dialog )