Skip to content

Commit

Permalink
Moved and renamed checkbox for allow undo-redo. Addendum to #15668
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Nov 6, 2024
1 parent 6bdd235 commit e3a66d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/netedit/GNEApplicationWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2359,7 +2359,7 @@ GNEApplicationWindow::onCmdToggleComputeNetworkData(FXObject*, FXSelector, void*

long
GNEApplicationWindow::onCmdToggleUndoRedo(FXObject*, FXSelector, void*) {
if (myProcessingMenuCommands.menuCheckAllowUndoRedo->getCheck() == TRUE) {
if (myEditMenuCommands.menuCheckAllowUndoRedo->getCheck() == TRUE) {
myAllowUndoRedo = true;
return getApp()->reg().writeBoolEntry("NETEDIT", "AllowUndoRedo", true);
} else {
Expand Down
14 changes: 6 additions & 8 deletions src/netedit/GNEApplicationWindowHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ GNEApplicationWindowHelper::FileMenuCommands::buildFileMenuCommands(FXMenuPane*
// add checkBox for quick load
new FXMenuSeparator(fileMenu);
menuCheckAllowUndoRedoLoading = GUIDesigns::buildFXMenuCheckboxIcon(fileMenu,
TL("Quick load (No undo)"), "", "",
TL("Allow undoing element loading"), "", TL("Allow to undo loading of elements (Slow if a lot of elements are loaded)"),
GUIIconSubSys::getIcon(GUIIcon::UNDOLIST), myGNEApp, MID_GNE_TOGGLE_UNDOREDO_LOADING);
// set default value
menuCheckAllowUndoRedoLoading->setCheck(myGNEApp->getApp()->reg().readBoolEntry("NETEDIT", "AllowUndoRedoLoading", true));
Expand Down Expand Up @@ -1280,6 +1280,11 @@ GNEApplicationWindowHelper::EditMenuCommands::buildUndoRedoMenuCommands(FXMenuPa
openUndolistDialog = GUIDesigns::buildFXMenuCommandShortcut(editMenu,
TL("Show undo/redo history"), "", TL("Open undo/redo history dialog."),
GUIIconSubSys::getIcon(GUIIcon::UNDOLIST), myGNEApp, MID_GNE_UNDOLISTDIALOG);
// add checkBox for recomputing in data mode
menuCheckAllowUndoRedo = GUIDesigns::buildFXMenuCheckboxIcon(editMenu,
TL("Allow undo-redo"), "", "",
GUIIconSubSys::getIcon(GUIIcon::UNDOLIST), myGNEApp, MID_GNE_TOGGLE_UNDOREDO);
menuCheckAllowUndoRedo->setCheck(myGNEApp->getApp()->reg().readBoolEntry("NETEDIT", "AllowUndoRedo", true));
}


Expand Down Expand Up @@ -1857,13 +1862,8 @@ GNEApplicationWindowHelper::ProcessingMenuCommands::buildProcessingMenuCommands(
menuCheckRecomputeDataMode = GUIDesigns::buildFXMenuCheckboxIcon(processingMenu,
TL("Recompute Network in Data Mode"), "", "",
GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDATA), myGNEApp, MID_GNE_TOGGLE_COMPUTE_NETWORK_DATA);
// add checkBox for recomputing in data mode
menuCheckAllowUndoRedo = GUIDesigns::buildFXMenuCheckboxIcon(processingMenu,
TL("Allow undo-redo"), "", "",
GUIIconSubSys::getIcon(GUIIcon::UNDOLIST), myGNEApp, MID_GNE_TOGGLE_UNDOREDO);
// set default value
menuCheckRecomputeDataMode->setCheck(myGNEApp->getApp()->reg().readBoolEntry("NETEDIT", "RecomputeData", true));
menuCheckAllowUndoRedo->setCheck(myGNEApp->getApp()->reg().readBoolEntry("NETEDIT", "AllowUndoRedo", true));
// build demand processing menu commands
computeDemand = GUIDesigns::buildFXMenuCommandShortcut(processingMenu,
TL("Compute demand"), "F5", TL("Computes demand elements."),
Expand Down Expand Up @@ -1905,7 +1905,6 @@ GNEApplicationWindowHelper::ProcessingMenuCommands::showNetworkProcessingMenuCom
clearInvalidCrossings->enable();
mySeparatorCheckBox->enable();
menuCheckRecomputeDataMode->enable();
menuCheckAllowUndoRedo->enable();
// now show it
computeNetwork->show();
computeNetworkVolatile->show();
Expand All @@ -1914,7 +1913,6 @@ GNEApplicationWindowHelper::ProcessingMenuCommands::showNetworkProcessingMenuCom
clearInvalidCrossings->show();
mySeparatorCheckBox->show();
menuCheckRecomputeDataMode->show();
menuCheckAllowUndoRedo->show();
}


Expand Down
6 changes: 3 additions & 3 deletions src/netedit/GNEApplicationWindowHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,9 @@ struct GNEApplicationWindowHelper {
/// @brief FXMenuCommand for open undolist dialog
FXMenuCommand* openUndolistDialog = nullptr;

/// @brief checkBox for allow undo-redo
MFXMenuCheckIcon* menuCheckAllowUndoRedo = nullptr;

/// @brief network view options
NetworkViewOptions networkViewOptions;

Expand Down Expand Up @@ -921,9 +924,6 @@ struct GNEApplicationWindowHelper {
/// @brief checkBox for recomputing when changing data mode
MFXMenuCheckIcon* menuCheckRecomputeDataMode = nullptr;

/// @brief checkBox for allow undo-redo
MFXMenuCheckIcon* menuCheckAllowUndoRedo = nullptr;

/// @}

/// @name Processing FXMenuCommands for Demand mode
Expand Down

0 comments on commit e3a66d5

Please sign in to comment.