#include "dialogs/vlm.hpp"
#include "dialogs/sout.hpp"
#include "dialogs/open.hpp"
+#include "dialogs/openurl.hpp"
#include "dialogs/help.hpp"
#include "dialogs/gototime.hpp"
#include "dialogs/podcast_configuration.hpp"
addFromSimple( false, false );
}
+/* Url & Clipboard */
+/**
+ * Open a MRL.
+ * If the clipboard contains URLs, the first is automatically 'preselected'.
+ **/
+void DialogsProvider::openUrlDialog()
+{
+ OpenUrlDialog *oud = OpenUrlDialog::getInstance( p_intf->p_sys->p_mi,
+ p_intf );
+ if( oud->exec() == QDialog::Accepted )
+ {
+ QString url = oud->url();
+ if( !url.isEmpty() )
+ {
+ playlist_Add( THEPL, qtu( toNativeSeparators( url ) ),
+ NULL, !oud->shouldEnqueue() ?
+ ( PLAYLIST_APPEND | PLAYLIST_GO )
+ : ( PLAYLIST_APPEND | PLAYLIST_PREPARSE ),
+ PLAYLIST_END, true, false );
+ RecentsMRL::getInstance( p_intf )->addRecent(
+ toNativeSeparators( url ) );
+ }
+ }
+}
+
/* Directory */
/**
* Open a directory,
{
QString mrl = dir.endsWith( "VIDEO_TS", Qt::CaseInsensitive ) ?
"dvd://" : "directory://" + toNativeSeparators( dir );
- input_item_t *p_input = input_item_NewExt( THEPL, qtu( mrl ),
- NULL, 0, NULL, -1 );
+ input_item_t *p_input = input_item_New( THEPL, qtu( mrl ), NULL );
/* FIXME: playlist_AddInput() can fail */
playlist_AddInput( THEPL, p_input,
QString file = qfd->selectedFiles().first();
QString filter = qfd->selectedFilter();
- const char* filt = filter.toAscii();
if( file.contains( ".xsp" ) || filter.contains( "XSPF" ) )
{
if( s->exec() == QDialog::Accepted )
{
- msg_Dbg( p_intf, "Sout mrl %s", qta( s->getMrl() ) );
- /* Just do it */
- int i_len = strlen( qtu( s->getMrl() ) ) + 10;
- char *psz_option = (char*)malloc( i_len );
- snprintf( psz_option, i_len - 1, "%s", qtu( s->getMrl() ) );
+ const char *psz_option = qtu( s->getMrl() );
+ msg_Dbg( p_intf, "Sout mrl %s", psz_option );
playlist_AddExt( THEPL, qtu( mrl ), "Streaming",
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END,
- -1, &psz_option, 1, true, pl_Unlocked );
+ -1, 1, &psz_option, VLC_INPUT_OPTION_TRUSTED, true, pl_Unlocked );
RecentsMRL::getInstance( p_intf )->addRecent( mrl );
}
}
void DialogsProvider::menuAction( QObject *data )
{
- QVLCMenu::DoAction( p_intf, data );
+ QVLCMenu::DoAction( data );
}
void DialogsProvider::menuUpdateAction( QObject *data )