Commit fd8a9517 authored by Yoann Peronneau's avatar Yoann Peronneau

* qt: don't hide the file browser on double click

parent 01c453a9
......@@ -55,7 +55,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
fileTypes.replace(QString(";*"), QString(" *"));
// Make this QFileDialog a child of tempWidget from the ui.
dialogBox = new QFileDialog( ui.tempWidget, NULL,
dialogBox = new FileOpenBox( ui.tempWidget, NULL,
qfu( p_intf->p_libvlc->psz_homedir ), fileTypes );
dialogBox->setFileMode( QFileDialog::ExistingFiles );
/* We don't want to see a grip in the middle of the window, do we? */
......@@ -196,8 +196,8 @@ bool FileOpenPanel::eventFilter(QObject *object, QEvent *event)
{
if ( ( object == dialogBox ) && ( event->type() == QEvent::Hide ) )
{
event->ignore();
return true;
event->ignore();
return true;
}
// standard event processing
else
......
......@@ -28,12 +28,12 @@
#include <vlc/vlc.h>
#include <QWidget>
#include <QString>
#include <QFileDialog>
#include "ui/open_file.h"
#include "ui/open_disk.h"
#include "ui/open_net.h"
#include "ui/open_capture.h"
class QFileDialog;
class QLineEdit;
class OpenPanel: public QWidget
......@@ -55,6 +55,17 @@ signals:
void methodChanged( QString method );
};
class FileOpenBox: public QFileDialog
{
Q_OBJECT;
public:
FileOpenBox( QWidget *parent, const QString &caption,
const QString &directory, const QString &filter ):
QFileDialog( parent, caption, directory, filter ) {}
public slots:
void accept() {}
};
class FileOpenPanel: public OpenPanel
{
Q_OBJECT;
......@@ -66,7 +77,7 @@ public:
private:
Ui::OpenFile ui;
QStringList browse( QString );
QFileDialog *dialogBox;
FileOpenBox *dialogBox;
QLineEdit *lineFileEdit;
bool eventFilter(QObject *, QEvent *);
public slots:
......@@ -75,7 +86,6 @@ private slots:
void browseFile();
void browseFileSub();
void toggleSubtitleFrame();
};
class NetOpenPanel: public OpenPanel
......
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