#include "main_interface.hpp"
#include "menus.hpp"
#include <vlc_intf_strings.h>
+#include "input_manager.hpp"
/* The dialogs */
#include "dialogs/playlist.hpp"
**/
static void openDirectory( intf_thread_t *p_intf, bool pl, bool go )
{
- QString dir = QFileDialog::getExistingDirectory( 0, qtr(I_OP_OPDIR) );
+ QString dir = QFileDialog::getExistingDirectory( 0, qtr("Open Directory") );
if (!dir.isEmpty()) {
input_item_t *p_input = input_ItemNewExt( THEPL,
qtu( "directory://" + dir ), NULL,
/* FIXME: playlist_AddInput() can fail */
playlist_AddInput( THEPL, p_input,
go ? ( PLAYLIST_APPEND | PLAYLIST_GO ) : PLAYLIST_APPEND,
- PLAYLIST_END, pl, false );
- input_Read( THEPL, p_input, false );
+ PLAYLIST_END, pl, pl_Unlocked );
+ /* Why this ?
+ * input_Read( THEPL, p_input, false ); */
vlc_gc_decref( p_input );
}
}
void DialogsProvider::PLAppendDir()
{
- openDirectory( p_intf, true, false );
+ openDirectory( p_intf, true, true );
}
void DialogsProvider::MLAppendDir()
playlist_AddExt( THEPL, qtu( mrl ), "Streaming",
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END,
- -1, &psz_option, 1, true, false );
+ -1, &psz_option, 1, true, pl_Unlocked );
}
}
break;
}
}
+
+void DialogsProvider::loadSubtitlesFile()
+{
+ input_thread_t *p_input = THEMIM->getInput();
+ if( !p_input )
+ return;
+ QString qsFile = QFileDialog::getOpenFileName(
+ NULL,
+ qtr( "Choose subtitles file" ),
+ "",
+ qtr( "Subtitles files (*.cdg *.idx *.srt *.sub *.utf);;"
+ "All files (*)" ) );
+ if( !input_AddSubtitles( p_input, qtu( qsFile ), true ) )
+ msg_Warn( p_intf, "unable to load subtitles file..." );
+}