From 1c0ffc0f6ce27c750ca187c49a5a680553a709b3 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Fri, 29 Nov 2024 16:36:40 +0100 Subject: [PATCH] Removed all references to attributesEditorExtendedDialogOpened(). Refs #15776 --- .../dialogs/GNEDemandElementDialog.cpp | 4 ++++ src/netedit/frames/GNEAttributesEditor.cpp | 21 ++++++++++++------- src/netedit/frames/GNEFrame.cpp | 6 ------ src/netedit/frames/GNEFrame.h | 3 --- src/netedit/frames/demand/GNETypeFrame.cpp | 13 ------------ src/netedit/frames/demand/GNETypeFrame.h | 3 --- 6 files changed, 18 insertions(+), 32 deletions(-) diff --git a/src/netedit/dialogs/GNEDemandElementDialog.cpp b/src/netedit/dialogs/GNEDemandElementDialog.cpp index b969b5d2890a..7a8db4a81e17 100644 --- a/src/netedit/dialogs/GNEDemandElementDialog.cpp +++ b/src/netedit/dialogs/GNEDemandElementDialog.cpp @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #include "GNEDemandElementDialog.h" @@ -137,6 +139,8 @@ GNEDemandElementDialog::acceptChanges() { } else { myEditedDemandElement->getNet()->getViewNet()->getUndoList()->abortLastChangeGroup(); } + // refresh frame + myEditedDemandElement->getNet()->getViewNet()->getViewParent()->getGNEAppWindows()->updateControls(); } diff --git a/src/netedit/frames/GNEAttributesEditor.cpp b/src/netedit/frames/GNEAttributesEditor.cpp index 7b8f857f765f..ad4760efffab 100644 --- a/src/netedit/frames/GNEAttributesEditor.cpp +++ b/src/netedit/frames/GNEAttributesEditor.cpp @@ -74,7 +74,7 @@ GNEAttributesEditor::GNEAttributesEditor(GNEFrame* frameParent, const std::strin myFrontButton->hide(); myOpenDialogButton = GUIDesigns::buildFXButton(this, TL("Open element dialog"), "", "", nullptr, this, MID_GNE_ATTRIBUTESEDITOR_DIALOG, GUIDesignButton); myOpenDialogButton->hide(); - myOpenExtendedAttributesButton = GUIDesigns::buildFXButton(this, TL("Open extended attributes"), "", "", nullptr, this, MID_GNE_ATTRIBUTESEDITOR_EXTENDED, GUIDesignButton); + myOpenExtendedAttributesButton = GUIDesigns::buildFXButton(this, TL("Edit extended attributes"), "", "", nullptr, this, MID_GNE_ATTRIBUTESEDITOR_EXTENDED, GUIDesignButton); myOpenExtendedAttributesButton->hide(); // resize myAttributesEditorRows and fill it with attribute rows myAttributesEditorRows.resize(MAX_ATTR); @@ -121,8 +121,8 @@ GNEAttributesEditor::refreshAttributesEditor() { const auto& tagProperty = myEditedACs.front()->getTagProperty(); int itRows = 0; bool showButtons = false; - // check if show netedit attributes - if ((myEditorOptions & EditorOptions::NETEDIT_ATTRIBUTES) != 0) { + // check if show netedit attributes (only for single edited ACs) + if ((myEditedACs.size() == 1) && ((myEditorOptions & EditorOptions::NETEDIT_ATTRIBUTES) != 0)) { // front button if (tagProperty.isDrawable()) { myFrontButton->show(); @@ -142,8 +142,6 @@ GNEAttributesEditor::refreshAttributesEditor() { } // extended attributes dialog if (tagProperty.hasExtendedAttributes()) { - // set icon - myOpenExtendedAttributesButton->setIcon(GUIIconSubSys::getIcon(tagProperty.getGUIIcon())); myOpenExtendedAttributesButton->show(); showButtons = true; } else { @@ -172,6 +170,10 @@ GNEAttributesEditor::refreshAttributesEditor() { itRows++; } } + // show help button + myHelpButton->show(); + } else { + myHelpButton->hide(); } // hide rest of rows before showing table for (int i = itRows; i < MAX_ATTR; i++) { @@ -209,8 +211,13 @@ GNEAttributesEditor::onCmdOpenElementDialog(FXObject*, FXSelector, void*) { long GNEAttributesEditor::onCmdOpenExtendedAttributesDialog(FXObject*, FXSelector, void*) { - // open GNEAttributesCreator extended dialog - myFrameParent->attributesEditorExtendedDialogOpened(); + // obtain edited AC (temporal), until unification of + const auto demandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(myEditedACs.front()->getTagProperty().getTag(), myEditedACs.front()->getID(), false); + // open vehicle type dialog + if (demandElement) { + GNEVehicleTypeDialog(demandElement, true); // NOSONAR, constructor returns after dialog has been closed + refreshAttributesEditor(); + } return 1; } diff --git a/src/netedit/frames/GNEFrame.cpp b/src/netedit/frames/GNEFrame.cpp index be55e6cf1bf9..6e500448ad59 100644 --- a/src/netedit/frames/GNEFrame.cpp +++ b/src/netedit/frames/GNEFrame.cpp @@ -288,12 +288,6 @@ GNEFrame::attributeUpdated(SumoXMLAttr /*attribute*/) { } -void -GNEFrame::attributesEditorExtendedDialogOpened() { - // this function has to be reimplemented in all child frames that uses a GNEAttributesCreator editor with extended attributes -} - - void GNEFrame::selectedOverlappedElement(GNEAttributeCarrier* /* AC */) { // this function has to be reimplemented in all child frames that uses a GNEOverlappedInspection diff --git a/src/netedit/frames/GNEFrame.h b/src/netedit/frames/GNEFrame.h index 8fad942d52ca..ab1e5e24b653 100644 --- a/src/netedit/frames/GNEFrame.h +++ b/src/netedit/frames/GNEFrame.h @@ -99,9 +99,6 @@ class GNEFrame : public FXVerticalFrame { /// @brief function called after set a valid attribute in AttributeCreator/AttributeEditor/ParametersEditor/... virtual void attributeUpdated(SumoXMLAttr attribute); - /// @brief open GNEAttributesCreator extended dialog - virtual void attributesEditorExtendedDialogOpened(); - /// @brief open GNEAttributesCreator extended dialog virtual void selectedOverlappedElement(GNEAttributeCarrier* AC); diff --git a/src/netedit/frames/demand/GNETypeFrame.cpp b/src/netedit/frames/demand/GNETypeFrame.cpp index 44783c4f70df..b2efc6e9e093 100644 --- a/src/netedit/frames/demand/GNETypeFrame.cpp +++ b/src/netedit/frames/demand/GNETypeFrame.cpp @@ -436,17 +436,4 @@ GNETypeFrame::attributeUpdated(SumoXMLAttr /*attribute*/) { myTypeEditor->refreshTypeEditorModule(); } - -void -GNETypeFrame::attributesEditorExtendedDialogOpened() { - // open vehicle type dialog - if (myTypeSelector->getCurrentType()) { - GNEVehicleTypeDialog(myTypeSelector->getCurrentType(), true); // NOSONAR, constructor returns after dialog has been closed - // call "showAttributeEditorModule" to refresh attribute list - myTypeAttributesEditor->showAttributesEditor(myTypeSelector->getCurrentType()); - myParametersEditor->refreshParametersEditor(); - } -} - - /****************************************************************************/ diff --git a/src/netedit/frames/demand/GNETypeFrame.h b/src/netedit/frames/demand/GNETypeFrame.h index a65a3e19c72a..d1662cfb1c45 100644 --- a/src/netedit/frames/demand/GNETypeFrame.h +++ b/src/netedit/frames/demand/GNETypeFrame.h @@ -162,9 +162,6 @@ class GNETypeFrame : public GNEFrame { /// @brief function called after set a valid attribute in AttributeCreator/AttributeEditor/ParametersEditor/... void attributeUpdated(SumoXMLAttr attribute); - /// @brief open GNEAttributesCreator extended dialog (used for editing advance attributes of Vehicle Types) - void attributesEditorExtendedDialogOpened(); - private: /// @brief vehicle type selector TypeSelector* myTypeSelector;