Skip to content

Commit 19739c1

Browse files
committed
Fixed problem opening GNEPythonToolDialog. Refs #16790
1 parent bcd8130 commit 19739c1

File tree

3 files changed

+100
-86
lines changed

3 files changed

+100
-86
lines changed

src/netedit/dialogs/tools/GNEPythonToolDialog.cpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,8 @@ GNEPythonToolDialog::GNEPythonToolDialog(GNEApplicationWindow* applicationWindow
9898
const int maximumHeight = myArgumentFrameLeft->numChildren() * GUIDesignHeight + 120;
9999
// resize
100100
resize(1024, maximumHeight <= 768 ? maximumHeight : 768);
101-
// show dialog
102-
GNEDialog::show(PLACEMENT_SCREEN);
103-
// refresh APP
104-
getApp()->refresh();
101+
// open dialog
102+
openModalDialog();
105103
}
106104

107105

@@ -266,29 +264,29 @@ GNEPythonToolDialog::buildArguments(bool sortByName, bool groupedByCategories) {
266264
argumentFrame = (numInsertedArguments < halfNumArguments) ? myArgumentFrameLeft : myArgumentFrameRight;
267265
// continue depending of type
268266
if (option.second->isInteger()) {
269-
myArguments.push_back(new GNEPythonToolDialogElements::IntArgument(this, argumentFrame, option.first, option.second));
267+
myArguments.push_back(new GNEPythonToolDialogElements::IntArgument(this, myPythonTool, getApplicationWindow(), argumentFrame, option.first, option.second));
270268
} else if (option.second->isFloat()) {
271-
myArguments.push_back(new GNEPythonToolDialogElements::FloatArgument(this, argumentFrame, option.first, option.second));
269+
myArguments.push_back(new GNEPythonToolDialogElements::FloatArgument(this, myPythonTool, getApplicationWindow(), argumentFrame, option.first, option.second));
272270
} else if (option.second->isBool()) {
273-
myArguments.push_back(new GNEPythonToolDialogElements::BoolArgument(this, argumentFrame, option.first, option.second));
271+
myArguments.push_back(new GNEPythonToolDialogElements::BoolArgument(this, myPythonTool, getApplicationWindow(), argumentFrame, option.first, option.second));
274272
} else if (option.second->isFileName()) {
275-
myArguments.push_back(new GNEPythonToolDialogElements::FileNameArgument(this, argumentFrame, option.first, option.second));
273+
myArguments.push_back(new GNEPythonToolDialogElements::FileNameArgument(this, myPythonTool, getApplicationWindow(), argumentFrame, option.first, option.second));
276274
} else if (option.second->isNetwork()) {
277-
myArguments.push_back(new GNEPythonToolDialogElements::NetworkArgument(this, argumentFrame, option.first, option.second));
275+
myArguments.push_back(new GNEPythonToolDialogElements::NetworkArgument(this, myPythonTool, getApplicationWindow(), argumentFrame, option.first, option.second));
278276
} else if (option.second->isAdditional()) {
279-
myArguments.push_back(new GNEPythonToolDialogElements::AdditionalArgument(this, argumentFrame, option.first, option.second));
277+
myArguments.push_back(new GNEPythonToolDialogElements::AdditionalArgument(this, myPythonTool, getApplicationWindow(), argumentFrame, option.first, option.second));
280278
} else if (option.second->isRoute()) {
281-
myArguments.push_back(new GNEPythonToolDialogElements::RouteArgument(this, argumentFrame, option.first, option.second));
279+
myArguments.push_back(new GNEPythonToolDialogElements::RouteArgument(this, myPythonTool, getApplicationWindow(), argumentFrame, option.first, option.second));
282280
} else if (option.second->isData()) {
283-
myArguments.push_back(new GNEPythonToolDialogElements::DataArgument(this, argumentFrame, option.first, option.second));
281+
myArguments.push_back(new GNEPythonToolDialogElements::DataArgument(this, myPythonTool, getApplicationWindow(), argumentFrame, option.first, option.second));
284282
} else if (option.second->isSumoConfig()) {
285-
myArguments.push_back(new GNEPythonToolDialogElements::SumoConfigArgument(this, argumentFrame, option.first, option.second));
283+
myArguments.push_back(new GNEPythonToolDialogElements::SumoConfigArgument(this, myPythonTool, getApplicationWindow(), argumentFrame, option.first, option.second));
286284
} else if (option.second->isEdge()) {
287-
myArguments.push_back(new GNEPythonToolDialogElements::EdgeArgument(this, argumentFrame, option.first, option.second));
285+
myArguments.push_back(new GNEPythonToolDialogElements::EdgeArgument(this, myPythonTool, getApplicationWindow(), argumentFrame, option.first, option.second));
288286
} else if (option.second->isEdgeVector()) {
289-
myArguments.push_back(new GNEPythonToolDialogElements::EdgeVectorArgument(this, argumentFrame, option.first, option.second));
287+
myArguments.push_back(new GNEPythonToolDialogElements::EdgeVectorArgument(this, myPythonTool, getApplicationWindow(), argumentFrame, option.first, option.second));
290288
} else {
291-
myArguments.push_back(new GNEPythonToolDialogElements::StringArgument(this, argumentFrame, option.first, option.second));
289+
myArguments.push_back(new GNEPythonToolDialogElements::StringArgument(this, myPythonTool, getApplicationWindow(), argumentFrame, option.first, option.second));
292290
}
293291
numInsertedArguments++;
294292
}

0 commit comments

Comments
 (0)