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/streaminfo.hpp"
28 #include <QApplication>
30 DialogsProvider* DialogsProvider::instance = NULL;
32 DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) :
33 QObject( NULL ), p_intf( _p_intf )
35 idle_timer = new QTimer( this );
36 // idle_timer->start( 0 );
38 fixed_timer = new QTimer( this );
39 fixed_timer->start( 100 /* milliseconds */ );
42 DialogsProvider::~DialogsProvider()
46 void DialogsProvider::customEvent( QEvent *event )
48 if( event->type() == DialogEvent_Type )
50 DialogEvent *de = dynamic_cast<DialogEvent*>(event);
51 switch( de->i_dialog )
53 case INTF_DIALOG_FILE:
54 case INTF_DIALOG_DISC:
56 case INTF_DIALOG_CAPTURE:
57 openDialog( de->i_dialog ); break;
58 case INTF_DIALOG_PLAYLIST:
59 playlistDialog(); break;
60 case INTF_DIALOG_MESSAGES:
61 messagesDialog(); break;
62 case INTF_DIALOG_PREFS:
64 case INTF_DIALOG_POPUPMENU:
65 case INTF_DIALOG_AUDIOPOPUPMENU:
66 case INTF_DIALOG_VIDEOPOPUPMENU:
67 case INTF_DIALOG_MISCPOPUPMENU:
68 popupMenu( de->i_dialog ); break;
69 case INTF_DIALOG_FILEINFO:
70 streaminfoDialog(); break;
72 case INTF_DIALOG_INTERACTION:
73 case INTF_DIALOG_BOOKMARKS:
74 case INTF_DIALOG_WIZARD:
76 fprintf( stderr, "Unimplemented dialog\n");
81 void DialogsProvider::playlistDialog()
83 PlaylistDialog::getInstance( p_intf )->toggleVisible();
86 void DialogsProvider::openDialog( int i_dialog )
90 void DialogsProvider::streaminfoDialog()
92 StreamInfoDialog::getInstance( p_intf )->toggleVisible();
95 void DialogsProvider::prefsDialog()
99 void DialogsProvider::messagesDialog()
103 void DialogsProvider::popupMenu( int i_dialog )