Commit 1067b847 authored by Ian Humphrey's avatar Ian Humphrey
Browse files

Updated SetActiveImageListWorkOrder according to WorkOrder redesign. Fixes #4734.

parent 72ea45a0
Loading
Loading
Loading
Loading
+27 −9
Original line number Diff line number Diff line
@@ -83,17 +83,35 @@ namespace Isis {


  /**
   * @brief Attempt to set imageList as active ImageList.
   * @return @b bool True if successful, False otherwise.
   * @description Indicates whether this work order is undoable.
   *
   * @return bool Returns false, indicating that setting the active image list is not undoable.
   */
  bool SetActiveImageListWorkOrder::setupExecution() {
    bool success = WorkOrder::setupExecution();
  bool SetActiveImageListWorkOrder::isUndoable() const {
    return false;
  }

    if (success) {
      project()->setActiveImageList(imageList()->name());

  /**
   * @description Simply calls the parent WorkOrder::setupExecution(). There is nothing specific
   * that this work order needs to set up before execution. This was separated from execute() as
   * part of the WorkOrder redesign.
   *
   * @see WorkOrder::setupExecution()
   *
   * @return bool Returns true if successful (i.e. if the parent call succeeds).
   */
  bool SetActiveImageListWorkOrder::setupExecution() {
    return WorkOrder::setupExecution();
  }

    return success;

  /**
   * @brief Executes this work order.
   *
   * @description Sets the active image list for the project.
   */
  void SetActiveImageListWorkOrder::execute() {
    project()->setActiveImageList(imageList()->name());
  }
}
+7 −2
Original line number Diff line number Diff line
@@ -34,6 +34,9 @@ namespace Isis {
   * @author 2016-06-27 Tracie Sucharski
   *
   * @internal
   *   @history 2017-04-05 Ian Humphrey - Added isUndoable() implementation to indicate that this
   *                           work order is not undoable. Separated setup and execution into
   *                           setupExecution() and execute(). Fixes #4734.
   *
   */

@@ -47,11 +50,13 @@ namespace Isis {
      virtual SetActiveImageListWorkOrder *clone() const;

      virtual bool isExecutable(ImageList *imageList);
      bool setupExecution();
      virtual bool isUndoable() const;

      virtual bool setupExecution();
      virtual void execute();

    private:
      SetActiveImageListWorkOrder &operator=(const SetActiveImageListWorkOrder &rhs);
  };
}
#endif