Ignore:
Timestamp:
Aug 13, 2025, 8:24:42 AM (2 months ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
780bfa
Parents:
1c355bf
git-author:
Frederik Heber <frederik.heber@…> (08/13/25 08:17:04)
git-committer:
Frederik Heber <frederik.heber@…> (08/13/25 08:24:42)
Message:

Splits off Undo mark actions.

  • Undo action has again no parameters (which is preferable to use in the GUI).
  • undo-mark is now alled set-undo-mark (with parameter telling whether to set or unset the mark).
  • undo-till-mark is now a separate action.
  • adapted userguide accordingly.
  • TESTS: adapted regression tests.
Location:
src/Actions/CommandAction
Files:
3 added
9 moved

Legend:

Unmodified
Added
Removed
  • src/Actions/CommandAction/RedoAction.cpp

    r1c355bf rbcc29ca  
    4444using namespace MoleCuilder;
    4545
    46 #include "Actions/RedoAction.hpp"
     46#include "Actions/CommandAction/RedoAction.hpp"
    4747
    4848// and construct the stuff
  • src/Actions/CommandAction/SetUndoMarkAction.cpp

    r1c355bf rbcc29ca  
    22 * Project: MoleCuilder
    33 * Description: creates and alters molecular systems
    4  * Copyright (C)  2021 Frederik Heber. All rights reserved.
     4 * Copyright (C)  2025 Frederik Heber. All rights reserved.
    55 *
    66 *
     
    2222
    2323/*
    24  * UndoMarkAction.cpp
     24 * SetUndoMarkAction.cpp
    2525 *
    2626 *  Created on: Apr 06, 2021
     
    3535//#include "CodePatterns/MemDebug.hpp"
    3636
    37 #include "Actions/CommandAction/UndoMarkAction.hpp"
     37#include "Actions/CommandAction/SetUndoMarkAction.hpp"
    3838
    3939#include "Actions/ActionQueue.hpp"
     
    4242
    4343// and construct the stuff
    44 #include "UndoMarkAction.def"
     44#include "SetUndoMarkAction.def"
    4545#include "Action_impl_pre.hpp"
    4646/** =========== define the function ====================== */
    47 ActionState::ptr CommandUndoMarkAction::performCall() {
     47ActionState::ptr CommandSetUndoMarkAction::performCall() {
    4848  // set ActionQueue on to last element (hence skipping all in between)
    4949
     
    5959}
    6060
    61 ActionState::ptr CommandUndoMarkAction::performUndo(ActionState::ptr _state) {
     61ActionState::ptr CommandSetUndoMarkAction::performUndo(ActionState::ptr _state) {
    6262  return Action::success;
    6363}
    6464
    65 ActionState::ptr CommandUndoMarkAction::performRedo(ActionState::ptr _state){
     65ActionState::ptr CommandSetUndoMarkAction::performRedo(ActionState::ptr _state){
    6666  return Action::success;
    6767}
    6868
    69 bool CommandUndoMarkAction::canUndo() {
     69bool CommandSetUndoMarkAction::canUndo() {
    7070  return false;
    7171}
    7272
    73 bool CommandUndoMarkAction::shouldUndo() {
     73bool CommandSetUndoMarkAction::shouldUndo() {
    7474  return false;
    7575}
  • src/Actions/CommandAction/SetUndoMarkAction.def

    r1c355bf rbcc29ca  
    11/*
    2  * UndoMarkAction.def
     2 * SetUndoMarkAction.def
    33 *
    44 *  Created on: Apr 06, 2021
     
    1414// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
    1515#define paramtypes (bool)
    16 #define paramtokens ("undo-mark")
     16#define paramtokens ("set-undo-mark")
    1717#define paramdescriptions ("whether to set (true) the undo mark or reset (false)")
    1818#undef paramdefaults
     
    2727#define MENUNAME "command"
    2828#define MENUPOSITION 8
    29 #define ACTIONNAME UndoMark
    30 #define TOKEN "undo-mark"
     29#define ACTIONNAME SetUndoMark
     30#define TOKEN "set-undo-mark"
    3131
    3232
  • src/Actions/CommandAction/SetUndoMarkAction.hpp

    r1c355bf rbcc29ca  
    11/*
    2  * UndoMarkAction.hpp
     2 * SetUndoMarkAction.hpp
    33 *
    44 *  Created on: Apr 06, 2021
     
    66 */
    77
    8 #ifndef UNDOMARKACTION_HPP_
    9 #define UNDOMARKACTION_HPP_
     8#ifndef SETUNDOMARKACTION_HPP_
     9#define SETUNDOMARKACTION_HPP_
    1010
    1111// include config.h
     
    1717#include "Actions/Action.hpp"
    1818
    19 #include "UndoMarkAction.def"
     19#include "SetUndoMarkAction.def"
    2020#include "Action_impl_header.hpp"
    2121
    22 #endif /* UNDOMARKACTION_HPP_ */
     22#endif /* SETUNDOMARKACTION_HPP_ */
  • src/Actions/CommandAction/UndoAction.cpp

    r1c355bf rbcc29ca  
    4343using namespace MoleCuilder;
    4444
    45 #include "Actions/UndoAction.hpp"
     45#include "Actions/CommandAction/UndoAction.hpp"
    4646
    4747// and construct the stuff
     
    5252ActionState::ptr UndoAction::performCall(){
    5353  // std::cout << "Undo" << std::endl;
    54   if (params.undoTillMark.get())
    55     ActionQueue::getInstance().undoTillMark();
    56   else
    57     ActionQueue::getInstance().undoLast();
     54  ActionQueue::getInstance().undoLast();
    5855  return Action::success;
    5956}
  • src/Actions/CommandAction/UndoAction.def

    r1c355bf rbcc29ca  
    1313// ValueStorage by the token "Z" -> first column: int, Z, "Z"
    1414// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
    15 #define paramtypes (bool)
    16 #define paramtokens ("till-mark")
    17 #define paramdescriptions ("whether to undo just a single step (false) or until a previously set mark (true)")
    18 #define paramdefaults (PARAM_DEFAULT(false))
    19 #define paramreferences (undoTillMark)
    20 #define paramvalids (DummyValidator<bool>())
     15#undef paramtypes
     16#undef paramreferences
     17#undef paramtokens
     18#undef paramdescriptions
     19#undef paramdefaults
    2120
    2221// some defines for all the names, you may use ACTION, STATE and PARAMS
     
    2827
    2928// finally the information stored in the ActionTrait specialization
    30 #define DESCRIPTION "undo last action or until a given mark"
     29#define DESCRIPTION "undo last action"
    3130#undef SHORTFORM
Note: See TracChangeset for help on using the changeset viewer.