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()
{
// FIXME Handle selection of more than one subtitles file
QStringList files = THEDP->showSimpleOpen( qtr("Open subtitles file"),
EXT_FILTER_SUBTITLE );
EXT_FILTER_SUBTITLE,
dialogBox->directory().absolutePath() );
ui.subInput->setEditText( files.join(" ") );
updateMRL();
}
......
/*****************************************************************************
* main_inteface.cpp : Main interface
****************************************************************************
*****************************************************************************
* Copyright (C) 2006 the VideoLAN team
* $Id$
*
......@@ -18,7 +18,8 @@
*
* You should have received a copy of the GNU General Public License
* 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 <QApplication>
......@@ -195,7 +196,8 @@ void DialogsProvider::MLAppendDialog()
}
/**** Simple open ****/
QStringList DialogsProvider::showSimpleOpen( QString help, int filters )
QStringList DialogsProvider::showSimpleOpen( QString help, int filters,
QString path )
{
QString fileTypes = "";
if( filters & EXT_FILTER_MEDIA ) {
......@@ -216,9 +218,8 @@ QStringList DialogsProvider::showSimpleOpen( QString help, int filters )
ADD_FILTER_ALL( fileTypes );
fileTypes.replace(QString(";*"), QString(" *"));
return QFileDialog::getOpenFileNames( NULL,
help.isNull() ?
qfu(I_OP_SEL_FILES ) : help,
qfu( p_intf->p_libvlc->psz_homedir ),
help.isNull() ? qfu(I_OP_SEL_FILES ) : help,
path.isNull() ? qfu( p_intf->p_libvlc->psz_homedir ) : path,
fileTypes );
}
......
......@@ -99,7 +99,8 @@ public:
QStringList showSimpleOpen( QString help = QString(),
int filters = EXT_FILTER_MEDIA |
EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
EXT_FILTER_PLAYLIST );
EXT_FILTER_PLAYLIST,
QString path = QString() );
protected:
friend class QVLCMenu;
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