* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include <QEvent>
#include <QApplication>
#include <QSignalMapper>
#include <QFileDialog>
-#include <vlc/vlc.h>
+#include <vlc_common.h>
#include "qt4.hpp"
#include "dialogs_provider.hpp"
#include "main_interface.hpp"
#include "menus.hpp"
#include <vlc_intf_strings.h>
+#include "input_manager.hpp"
/* The dialogs */
#include "dialogs/playlist.hpp"
DialogsProvider::~DialogsProvider()
{
+ msg_Dbg( p_intf, "Destroying the Dialog Provider" );
PlaylistDialog::killInstance();
MediaInfoDialog::killInstance();
+ MessagesDialog::killInstance();
+ ExtendedDialog::killInstance();
+ BookmarksDialog::killInstance();
+ HelpDialog::killInstance();
+#ifdef UPDATE_CHECK
+ UpdateDialog::killInstance();
+#endif
+
fixed_timer->stop();
}
void DialogsProvider::quit()
{
- vlc_object_kill( p_intf );
+ vlc_object_kill( p_intf->p_libvlc );
QApplication::closeAllWindows();
QApplication::quit();
}
( i ? PLAYLIST_PREPARSE : 0 ) )
: ( PLAYLIST_APPEND | PLAYLIST_PREPARSE ),
PLAYLIST_END,
- pl ? VLC_TRUE : VLC_FALSE, VLC_FALSE );
+ pl ? true : false, false );
i++;
}
}
**/
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,
0, NULL, -1 );
+ /* FIXME: playlist_AddInput() can fail */
playlist_AddInput( THEPL, p_input,
go ? ( PLAYLIST_APPEND | PLAYLIST_GO ) : PLAYLIST_APPEND,
- PLAYLIST_END, pl, VLC_FALSE );
- input_Read( THEPL, p_input, VLC_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()
if( s->exec() == QDialog::Accepted )
{
- msg_Err( p_intf, "Sout mrl %s", qta( s->getMrl() ) );
+ 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 );
playlist_AddExt( THEPL, qtu( mrl ), "Streaming",
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END,
- -1, &psz_option, 1, VLC_TRUE, VLC_FALSE );
+ -1, &psz_option, 1, true, pl_Unlocked );
}
}
qdialog = (InteractionDialog*)(p_dialog->p_private);
if( qdialog )
qdialog->update();
+ else
+ {
+ /* The INTERACT_NEW message was forgotten
+ so we must create the dialog and update it*/
+ qdialog = new InteractionDialog( p_intf, p_dialog );
+ p_dialog->p_private = (void*)qdialog;
+ if( !(p_dialog->i_status == ANSWERED_DIALOG) )
+ qdialog->show();
+ if( qdialog )
+ qdialog->update();
+ }
break;
case INTERACT_HIDE:
qdialog = (InteractionDialog*)(p_dialog->p_private);
}
}
-void DialogsProvider::switchToSkins()
-{
- var_SetString( p_intf, "intf-switch", "skins2" );
-}
-
-void DialogsProvider::switchToWx()
+void DialogsProvider::loadSubtitlesFile()
{
- var_SetString( p_intf, "intf-switch", "wxwidgets" );
+ 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..." );
}