fileTypes.replace(QString(";*"), QString(" *"));
// Make this QFileDialog a child of tempWidget from the ui.
- dialogBox = new QFileDialog( ui.tempWidget, NULL,
+ dialogBox = new QFileDialog( ui.tempWidget, NULL,
qfu( p_intf->p_libvlc->psz_homedir ), fileTypes );
dialogBox->setFileMode( QFileDialog::ExistingFiles );
/* We don't want to see a grip in the middle of the window, do we? */
void FileOpenPanel::browseFileSub()
{
- // FIXME We shouldn't allow the user to select more than one subtitles file
+ // FIXME Handle selection of more than one subtitles file
QStringList files = THEDP->showSimpleOpen( qtr("Open subtitles file"),
- false, false, false,
- true, false );
+ EXT_FILTER_SUBTITLE );
ui.subInput->setEditText( files.join(" ") );
updateMRL();
}
}
/**** Simple open ****/
-
-QStringList DialogsProvider::showSimpleOpen(QString help, bool all,
- bool audio, bool video,
- bool subs, bool pls)
+QStringList DialogsProvider::showSimpleOpen( QString help, int filters )
{
QString fileTypes = "";
- if( all ) {
+ if( filters & EXT_FILTER_MEDIA ) {
ADD_FILTER_MEDIA( fileTypes );
}
- if( video ) {
+ if( filters & EXT_FILTER_VIDEO ) {
ADD_FILTER_VIDEO( fileTypes );
}
- if( audio ) {
+ if( filters & EXT_FILTER_AUDIO ) {
ADD_FILTER_AUDIO( fileTypes );
}
- if( pls ) {
+ if( filters & EXT_FILTER_PLAYLIST ) {
ADD_FILTER_PLAYLIST( fileTypes );
}
- if( subs ) {
+ if( filters & EXT_FILTER_SUBTITLE ) {
ADD_FILTER_SUBTITLE( fileTypes );
}
ADD_FILTER_ALL( fileTypes );
void DialogsProvider::openPlaylist()
{
- QStringList files = showSimpleOpen( qtr( "Open playlist file" ), false,
- false, false, false );
+ QStringList files = showSimpleOpen( qtr( "Open playlist file" ),
+ EXT_FILTER_PLAYLIST );
foreach( QString file, files )
{
playlist_Import( THEPL, qtu(file) );
#include <vlc/vlc.h>
#include <vlc_interface.h>
+#define EXT_FILTER_MEDIA 0x01
+#define EXT_FILTER_VIDEO 0x02
+#define EXT_FILTER_AUDIO 0x04
+#define EXT_FILTER_PLAYLIST 0x08
+#define EXT_FILTER_SUBTITLE 0x10
+
#define ADD_FILTER_MEDIA( string ) \
string += _("Media Files"); \
string += " ( "; \
virtual ~DialogsProvider();
QTimer *fixed_timer;
- QStringList showSimpleOpen( QString help = QString(), bool all = true,
- bool video = true, bool audio = true,
- bool subs = false, bool pls = true );
+ QStringList showSimpleOpen( QString help = QString(),
+ int filters = EXT_FILTER_MEDIA |
+ EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
+ EXT_FILTER_PLAYLIST );
protected:
friend class QVLCMenu;
QSignalMapper *menusMapper;