void FileOpenPanel::browseFile()
{
QString fileString = "";
- foreach( QString file, dialogBox->selectedFiles() ) {
+ foreach( QString file, dialogBox->selectedFiles() ) {
fileString += "\"" + file + "\" ";
}
ui.fileInput->setEditText( fileString );
void FileOpenPanel::browseFileSub()
{
- ui.subInput->setEditText( browse( qtr("Open subtitles file") ).join(" ") );
+ // FIXME We shouldn't allow the user to select more than one subtitles file
+ QStringList files = THEDP->showSimpleOpen( qtr("Open subtitles file"),
+ false, false, false,
+ true, false );
+ ui.subInput->setEditText( files.join(" ") );
updateMRL();
}
if( pls ) {
ADD_FILTER_PLAYLIST( fileTypes );
}
+ if( subs ) {
+ ADD_FILTER_SUBTITLE( fileTypes );
+ }
ADD_FILTER_ALL( fileTypes );
fileTypes.replace(QString(";*"), QString(" *"));
return QFileDialog::getOpenFileNames( NULL,
help.isNull() ?
qfu(I_OP_SEL_FILES ) : help,
- qfu( p_intf->p_libvlc->psz_homedir ),
+ qfu( p_intf->p_libvlc->psz_homedir ),
fileTypes );
}
string += " ( "; \
string += EXTENSIONS_PLAYLIST; \
string += ");;";
+#define ADD_FILTER_SUBTITLE( string )\
+ string += _("Subtitles Files"); \
+ string += " ( "; \
+ string += EXTENSIONS_SUBTITLE; \
+ string += ");;";
#define ADD_FILTER_ALL( string ) \
string += _("All Files"); \
string += " (*.*)";
QStringList showSimpleOpen( QString help = QString(), bool all = true,
bool video = true, bool audio = true,
- bool subs = true, bool pls = true );
+ bool subs = false, bool pls = true );
protected:
friend class QVLCMenu;
QSignalMapper *menusMapper;