Commit 2e8db6a0 authored by Jean-Philippe Andre's avatar Jean-Philippe Andre Committed by Christophe Mutricy

Qt: use showSimpleOpen to open subtitles files while playing This handles...

Qt: use showSimpleOpen to open subtitles files while playing This handles multiple files selection The dialog opens the folder containing current input
Signed-off-by: default avatarChristophe Mutricy <xtophe@videolan.org>
parent f7534de3
...@@ -601,12 +601,24 @@ void DialogsProvider::loadSubtitlesFile() ...@@ -601,12 +601,24 @@ void DialogsProvider::loadSubtitlesFile()
input_thread_t *p_input = THEMIM->getInput(); input_thread_t *p_input = THEMIM->getInput();
if( !p_input ) if( !p_input )
return; return;
QString qsFile = QFileDialog::getOpenFileName( input_item_t *p_item = input_GetItem( p_input );
NULL, if( !p_item )
qtr( "Choose subtitles file" ), return;
"", char *path = input_item_GetURI( p_item );
qtr( "Subtitles files (*.cdg *.idx *.srt *.sub *.utf);;" if( !path )
"All files (*)" ) ); path = strdup( "" );
if( !input_AddSubtitles( p_input, qtu( qsFile ), true ) ) char *sep = strrchr( path, DIR_SEP_CHAR );
msg_Warn( p_intf, "unable to load subtitles file..." ); if( sep )
*sep = '\0';
QStringList qsl = showSimpleOpen( qtr( "Open subtitles file" ),
EXT_FILTER_SUBTITLE,
path );
free( path );
QString qsFile;
foreach( qsFile, qsl )
{
if( !input_AddSubtitles( p_input, qtu( qsFile ), true ) )
msg_Warn( p_intf, "unable to load subtitles from '%s'",
qtu( qsFile ) );
}
} }
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