Commit cdda8bc8 authored by Yoann Peronneau's avatar Yoann Peronneau

* qt: really implement DirectoryConfigControl

parent c61b8e61
...@@ -289,9 +289,12 @@ DirectoryConfigControl::DirectoryConfigControl( vlc_object_t *_p_this, ...@@ -289,9 +289,12 @@ DirectoryConfigControl::DirectoryConfigControl( vlc_object_t *_p_this,
void DirectoryConfigControl::updateField() void DirectoryConfigControl::updateField()
{ {
text->setText( QFileDialog::getOpenFileName( NULL, QString dir = QFileDialog::getExistingDirectory( NULL,
qtr( "Select File" ), qfu( p_this->p_libvlc->psz_homedir ), qtr( "Select Directory" ),
NULL, 0, QFileDialog::ShowDirsOnly ) ); qfu( p_this->p_libvlc->psz_homedir ),
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks );
if( dir.isNull() ) return;
text->setText( dir );
} }
/********* String / choice list **********/ /********* String / choice list **********/
......
...@@ -277,7 +277,6 @@ public slots: ...@@ -277,7 +277,6 @@ public slots:
virtual void updateField(); virtual void updateField();
protected: protected:
void finish(); void finish();
private:
QLineEdit *text; QLineEdit *text;
QLabel *label; QLabel *label;
QPushButton *browse; QPushButton *browse;
...@@ -292,15 +291,8 @@ public: ...@@ -292,15 +291,8 @@ public:
DirectoryConfigControl( vlc_object_t *, module_config_t *, QLabel *, DirectoryConfigControl( vlc_object_t *, module_config_t *, QLabel *,
QLineEdit *, QPushButton *, bool pwd ); QLineEdit *, QPushButton *, bool pwd );
virtual ~DirectoryConfigControl() {}; virtual ~DirectoryConfigControl() {};
virtual QString getValue() { return text->text(); };
virtual void show() { text->show(); label->show(); browse->show(); }
virtual void hide() { text->hide(); label->hide(); browse->hide(); }
public slots: public slots:
virtual void updateField(); virtual void updateField();
private:
QLineEdit *text;
QLabel *label;
QPushButton *browse;
}; };
class ModuleConfigControl : public VStringConfigControl class ModuleConfigControl : public VStringConfigControl
......
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