Commit 3fd8a72c authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas
Browse files

Merge branch...

Merge branch '66-improvement-factorize-the-code-of-dtkwidgetsparameterfilesave-and-dtkwidgetsparameterfilebrowser' into 'develop'

Resolve "[improvement]factorize the code of dtkWidgetsParameterFileSave and dtkWidgetsParameterFileBrowser"

Closes #66

See merge request !72
parents d0ec1d0b ea90d6b9
Pipeline #186206 passed with stage
in 0 seconds
......@@ -46,6 +46,12 @@
"doc": "It's a button",
"type": "dtk::d_bool"
},
"dir_browse": {
"label": "Open a dir",
"doc": "Open a directory.",
"path": "..",
"type": "dtk::d_path"
},
"file_browse": {
"label": "Open a file",
"doc": "Open a VTK file.",
......@@ -152,7 +158,7 @@
},
"file_save_ro": {
"label": "Save a file (Read Only)",
"doc": "",
"doc": "Save a VTK file.",
"path": ".",
"filters": [
"VTK (*.vtk)",
......
......@@ -156,6 +156,13 @@
"widget_read_only": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterDirBrowse",
"uid": "dir_browse",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterFileBrowse",
......
......@@ -109,7 +109,7 @@ bool dtkWidgetsParameterBrowse::connect(dtkCoreParameter *p)
QObject::connect(d->push_button, &QPushButton::clicked, [=] ()
{
QString v = QFileDialog::getOpenFileName(this, "Open file", m_parameter->dirName(), m_parameter->filters().join(";;"));
QString v = this->browse();
m_parameter->shareValue(QVariant::fromValue(v));
});
......
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