Commit 3eb22f94 authored by CABEL Tristan's avatar CABEL Tristan

bugfix filebrowse multiple filters

parent ba9b0229
......@@ -127,15 +127,13 @@ void setup(dtkApplication *application)
bg->setPixmap(QPixmap(QString(":/main_%1.jpg").arg((count++ % 5) + 1)));
});
// dtkWidgetsParameterMenuBarGenerator menubar_generator_1(":parameters_nature_1.json", ":parameters_definition_1.json");
// dtkWidgetsParameterMenuBarGenerator menubar_generator_2(":parameters_nature_2.json", ":parameters_definition_2.json");
dtkWidgetsParameterMenuBarGenerator menubar_generator_1(":parameters_menu.json", ":parameters_definition.json");
application->window()->menubar()->addMenu(menu_1);
application->window()->menubar()->addMenu(menu_2);
application->window()->menubar()->addMenu(menu_3);
// menubar_generator_1.populate(application->window()->menubar());
// menubar_generator_2.populate(application->window()->menubar());
menubar_generator_1.populate(application->window()->menubar());
application->window()->populate();
......
......@@ -7,10 +7,7 @@
<file>main_4.jpg</file>
<file>main_5.jpg</file>
<file>parameters_nature_1.json</file>
<file>parameters_nature_2.json</file>
<file>parameters_definition_1.json</file>
<file>parameters_definition_2.json</file>
<file>parameters_definition.json</file>
<file>parameters_menu.json</file>
</qresource>
</RCC>
{
"contents": {
"res": {
"doc": "documentation",
"type": "dtk::d_bool",
"value": false,
"label": "res"
},
"dif": {
"doc": "documentation",
"type": "dtk::d_bool",
"value": false,
"label": "dif"
},
"prec": {
"type": "dtk::d_real",
"doc": "documentation",
"label": "prec",
"min": -1.0,
"value": 5.0,
"max": 7.0,
"decimals": 5
},
"hyp": {
"min": 0,
"doc": "documentation",
"value": 2,
"label": "hyp",
"max": 5,
"type": "dtk::d_int"
},
"inf": {
"doc": "documentation",
"type": "dtk::d_bool",
"value": false,
"label": "inf"
},
"wind": {
"doc": "documentation",
"type": "dtk::d_bool",
"value": false,
"label": "wind"
},
"open": {
"label": "open",
"doc": "Open a VTK file.",
"path": ".",
"filters": [
"VTK (*.vtk)",
"VTI (*.vti)",
"VTU (*.vtu)",
"VTP (*.vtp)"
],
"type": "dtk::d_path"
}
}
}
{
"contents":
{
"prec": {"label": "prec", "doc": "documentation", "value": 5.0, "min": -1.0, "max": 7.0, "decimals": 5},
"hyp": {"label": "hyp", "doc": "documentation", "value": 2, "min": 0, "max": 5},
"dif": {"label": "dif", "doc": "documentation", "value": false},
"res": {"label": "res", "doc": "documentation", "value": false},
"inf": {"label": "inf", "doc": "documentation", "value": false},
"wind": {"label": "wind", "doc": "documentation", "value": false}
}
}
{
"contents":
{
"param": {"label": "param", "doc": "documentation", "value": false}
}
}
{
"contents": [
{
"group": {
"contents": [
{
"parameter": {
"uid": "open",
"widget": "dtkWidgetsParameterFileBrowse",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterDoubleSpinBox",
"uid": "prec",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterIntSpinBox",
"uid": "hyp",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterBoolCheckBox",
"uid": "dif",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterBoolCheckBox",
"uid": "res",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterDoubleSpinBox",
"uid": "prec",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterBoolCheckBox",
"uid": "inf",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterBoolCheckBox",
"uid": "wind",
"advanced": false
}
},
{
"group": {
"contents": [
{
"parameter": {
"widget": "dtkWidgetsParameterDoubleSpinBox",
"uid": "prec",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterIntSpinBox",
"uid": "hyp",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterBoolCheckBox",
"uid": "dif",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterBoolCheckBox",
"uid": "res",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterDoubleSpinBox",
"uid": "prec",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterBoolCheckBox",
"uid": "inf",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterBoolCheckBox",
"uid": "wind",
"advanced": false
}
}
],
"uid": "Model parameters 1.1",
"advanced": false,
"icon": "paw"
}
}
],
"uid": "Model parameters 1",
"advanced": false,
"icon": "cogs"
}
},
{
"group": {
"contents": [
{
"parameter": {
"widget": "dtkWidgetsParameterDoubleSpinBox",
"uid": "prec",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterIntSpinBox",
"uid": "hyp",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterBoolCheckBox",
"uid": "dif",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterBoolCheckBox",
"uid": "res",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterDoubleSpinBox",
"uid": "prec",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterBoolCheckBox",
"uid": "inf",
"advanced": false
}
},
{
"parameter": {
"widget": "dtkWidgetsParameterBoolCheckBox",
"uid": "wind",
"advanced": false
}
}
],
"uid": "Model parameters 2",
"advanced": false,
"icon": "paw"
}
}
]
}
{
"contents": [{
"group":
{
"uid" : "Model parameters 1",
"icon": "cogs",
"advanced": false,
"contents": [
{"parameter": {"uid": "prec", "type": "dtk::d_real", "widget": "dtkWidgetsParameterDoubleSpinBox", "advanced": false}},
{"parameter": {"uid": "hyp", "type": "dtk::d_int", "widget": "dtkWidgetsParameterIntSpinBox", "advanced": false}},
{"parameter": {"uid": "dif", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}},
{"parameter": {"uid": "res", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}},
{"parameter": {"uid": "prec", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}},
{"parameter": {"uid": "inf", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}},
{"parameter": {"uid": "wind", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}},
{"group":
{
"uid" : "Model parameters 1.1",
"icon": "paw",
"advanced": false,
"contents": [
{"parameter": {"uid": "prec", "type": "dtk::d_real", "widget": "dtkWidgetsParameterDoubleSpinBox", "advanced": false}},
{"parameter": {"uid": "hyp", "type": "dtk::d_int", "widget": "dtkWidgetsParameterIntSpinBox", "advanced": false}},
{"parameter": {"uid": "dif", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}},
{"parameter": {"uid": "res", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}},
{"parameter": {"uid": "prec", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}},
{"parameter": {"uid": "inf", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}},
{"parameter": {"uid": "wind", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}}
]
}
}
]
}},{
"group":
{
"uid" : "Model parameters 2",
"icon": "paw",
"advanced": false,
"contents": [
{"parameter": {"uid": "prec", "type": "dtk::d_real", "widget": "dtkWidgetsParameterDoubleSpinBox", "advanced": false}},
{"parameter": {"uid": "hyp", "type": "dtk::d_int", "widget": "dtkWidgetsParameterIntSpinBox", "advanced": false}},
{"parameter": {"uid": "dif", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}},
{"parameter": {"uid": "res", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}},
{"parameter": {"uid": "prec", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}},
{"parameter": {"uid": "inf", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}},
{"parameter": {"uid": "wind", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}}
]
}
}]
}
{
"contents": [{
"group":
{
"uid" : "Model parameters 3",
"icon": "cogs",
"advanced": false,
"contents": [
{"parameter": {"uid": "param", "type": "dtk::d_bool", "widget": "dtkWidgetsParameterBoolCheckBox", "advanced": false}}
]
}
}]
}
......@@ -73,7 +73,7 @@ bool dtkWidgetsParameterFileBrowse::connect(dtkCoreParameter *p)
QObject::connect(d->push_button, &QPushButton::clicked, [=] ()
{
m_parameter->setValue(QFileDialog::getOpenFileName(this, "Open file", m_parameter->dirName(), m_parameter->filters().join("; ")));
m_parameter->setValue(QFileDialog::getOpenFileName(this, "Open file", m_parameter->dirName(), m_parameter->filters().join(";;")));
});
return true;
......
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