Commit dfcf367f authored by Yoann Peronneau's avatar Yoann Peronneau

* open dialog: look for subtitles in the same directory as the movie

parent 96f22ac4
...@@ -122,7 +122,8 @@ void FileOpenPanel::browseFileSub() ...@@ -122,7 +122,8 @@ void FileOpenPanel::browseFileSub()
{ {
// FIXME Handle selection of more than one subtitles file // FIXME Handle selection of more than one subtitles file
QStringList files = THEDP->showSimpleOpen( qtr("Open subtitles file"), QStringList files = THEDP->showSimpleOpen( qtr("Open subtitles file"),
EXT_FILTER_SUBTITLE ); EXT_FILTER_SUBTITLE,
dialogBox->directory().absolutePath() );
ui.subInput->setEditText( files.join(" ") ); ui.subInput->setEditText( files.join(" ") );
updateMRL(); updateMRL();
} }
......
/***************************************************************************** /*****************************************************************************
* main_inteface.cpp : Main interface * main_inteface.cpp : Main interface
**************************************************************************** *****************************************************************************
* Copyright (C) 2006 the VideoLAN team * Copyright (C) 2006 the VideoLAN team
* $Id$ * $Id$
* *
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QEvent> #include <QEvent>
#include <QApplication> #include <QApplication>
...@@ -44,7 +45,7 @@ ...@@ -44,7 +45,7 @@
DialogsProvider* DialogsProvider::instance = NULL; DialogsProvider* DialogsProvider::instance = NULL;
DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) : DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) :
QObject( NULL ), p_intf( _p_intf ) QObject( NULL ), p_intf( _p_intf )
{ {
fixed_timer = new QTimer( this ); fixed_timer = new QTimer( this );
fixed_timer->start( 150 /* milliseconds */ ); fixed_timer->start( 150 /* milliseconds */ );
...@@ -195,7 +196,8 @@ void DialogsProvider::MLAppendDialog() ...@@ -195,7 +196,8 @@ void DialogsProvider::MLAppendDialog()
} }
/**** Simple open ****/ /**** Simple open ****/
QStringList DialogsProvider::showSimpleOpen( QString help, int filters ) QStringList DialogsProvider::showSimpleOpen( QString help, int filters,
QString path )
{ {
QString fileTypes = ""; QString fileTypes = "";
if( filters & EXT_FILTER_MEDIA ) { if( filters & EXT_FILTER_MEDIA ) {
...@@ -216,10 +218,9 @@ QStringList DialogsProvider::showSimpleOpen( QString help, int filters ) ...@@ -216,10 +218,9 @@ QStringList DialogsProvider::showSimpleOpen( QString help, int filters )
ADD_FILTER_ALL( fileTypes ); ADD_FILTER_ALL( fileTypes );
fileTypes.replace(QString(";*"), QString(" *")); fileTypes.replace(QString(";*"), QString(" *"));
return QFileDialog::getOpenFileNames( NULL, return QFileDialog::getOpenFileNames( NULL,
help.isNull() ? help.isNull() ? qfu(I_OP_SEL_FILES ) : help,
qfu(I_OP_SEL_FILES ) : help, path.isNull() ? qfu( p_intf->p_libvlc->psz_homedir ) : path,
qfu( p_intf->p_libvlc->psz_homedir ), fileTypes );
fileTypes );
} }
void DialogsProvider::addFromSimple( bool pl, bool go) void DialogsProvider::addFromSimple( bool pl, bool go)
......
...@@ -99,7 +99,8 @@ public: ...@@ -99,7 +99,8 @@ public:
QStringList showSimpleOpen( QString help = QString(), QStringList showSimpleOpen( QString help = QString(),
int filters = EXT_FILTER_MEDIA | int filters = EXT_FILTER_MEDIA |
EXT_FILTER_VIDEO | EXT_FILTER_AUDIO | EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
EXT_FILTER_PLAYLIST ); EXT_FILTER_PLAYLIST,
QString path = QString() );
protected: protected:
friend class QVLCMenu; friend class QVLCMenu;
QSignalMapper *menusMapper; 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