Skip to content

Commit

Permalink
Removed all references to attributesEditorExtendedDialogOpened(). Refs
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Nov 29, 2024
1 parent b0bfb6f commit 1c0ffc0
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 32 deletions.
4 changes: 4 additions & 0 deletions src/netedit/dialogs/GNEDemandElementDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <utils/gui/div/GUIDesigns.h>
#include <netedit/GNENet.h>
#include <netedit/GNEViewNet.h>
#include <netedit/GNEViewParent.h>
#include <netedit/GNEApplicationWindow.h>
#include <netedit/GNEUndoList.h>

#include "GNEDemandElementDialog.h"
Expand Down Expand Up @@ -137,6 +139,8 @@ GNEDemandElementDialog::acceptChanges() {
} else {
myEditedDemandElement->getNet()->getViewNet()->getUndoList()->abortLastChangeGroup();
}
// refresh frame
myEditedDemandElement->getNet()->getViewNet()->getViewParent()->getGNEAppWindows()->updateControls();
}


Expand Down
21 changes: 14 additions & 7 deletions src/netedit/frames/GNEAttributesEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand All @@ -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 {
Expand Down Expand Up @@ -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++) {
Expand Down Expand Up @@ -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;
}

Expand Down
6 changes: 0 additions & 6 deletions src/netedit/frames/GNEFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/netedit/frames/GNEFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
13 changes: 0 additions & 13 deletions src/netedit/frames/demand/GNETypeFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}


/****************************************************************************/
3 changes: 0 additions & 3 deletions src/netedit/frames/demand/GNETypeFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1c0ffc0

Please sign in to comment.