Commit 885113ae authored by Yoann Peronneau's avatar Yoann Peronneau

* Use subtitles file extension filter for the "Open subtitles file" dialog.

parent 43caf180
......@@ -111,7 +111,7 @@ QStringList FileOpenPanel::browse(QString help)
void FileOpenPanel::browseFile()
{
QString fileString = "";
foreach( QString file, dialogBox->selectedFiles() ) {
foreach( QString file, dialogBox->selectedFiles() ) {
fileString += "\"" + file + "\" ";
}
ui.fileInput->setEditText( fileString );
......@@ -120,7 +120,11 @@ void FileOpenPanel::browseFile()
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();
}
......
......@@ -213,12 +213,15 @@ QStringList DialogsProvider::showSimpleOpen(QString help, bool all,
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 );
}
......
......@@ -53,6 +53,11 @@
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 += " (*.*)";
......@@ -87,7 +92,7 @@ public:
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment