Commit 6711602c authored by Makayla Shepherd's avatar Makayla Shepherd
Browse files

Updated ImageFileListViewWorkOrder according to the WorkOrder redesign.

parent b294ca4a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ namespace Isis {


  /**
   * @desciption This method adds a new CubeDnView to the project's directory and then adds 
   * @description This method adds a new CubeDnView to the project's directory and then adds 
   * currentItem() to that. This method was renamed from syncRedo() to execute() according to 
   * WorkOrder's redesign. 
   */
+30 −15
Original line number Diff line number Diff line
@@ -56,6 +56,28 @@ namespace Isis {
  }
  
  
  /**
   * @description This method returns false because this WorkOrder is not undoable.
   * 
   * @see WorkOrder::isUndoable()
   * 
   * @return bool Returns false because this WorkOrder is not undoable.
   */
  bool ImageFileListViewWorkOrder::isUndoable() const {
    return false;
  }

  
  /**
   * @description This method asks the user what view they want to see their image list in. The user 
   * can select an existing view or they can create a new view. The user's choice is then saved 
   * using setInternalData(). This method was renamed from execute() to setupExecution() according  
   * to the WorkOrder redesign.
   * 
   * @see WorkOrder::setupExecution()
   * 
   * @return @b bool True if WorkOrder::setupExecution() returns true.
   */
  bool ImageFileListViewWorkOrder::setupExecution() {
    bool success = WorkOrder::setupExecution();

@@ -114,7 +136,12 @@ namespace Isis {
  }

  
  void ImageFileListViewWorkOrder::syncRedo() {
  /**
   * @description This method adds a new image file list to the project's directory and then adds 
   * currentItem() to that. This method was renamed from syncRedo() to execute() according to 
   * WorkOrder's redesign. 
   */
  void ImageFileListViewWorkOrder::execute() {
    int viewToUse = internalData().first().toInt();

    ImageFileListWidget *fileListToUse = NULL;
@@ -127,16 +154,4 @@ namespace Isis {

    fileListToUse->addImages(imageList());
  }


  void ImageFileListViewWorkOrder::syncUndo() {
    int viewToUse = internalData().first().toInt();

    if (viewToUse == project()->directory()->imageFileListViews().count() - 1) {
      delete project()->directory()->imageFileListViews().last();
    }
    else {
      qDebug() << "TODO: Undo viewing images in existing view";
    }
  }
}
+7 −2
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ namespace Isis {
   * @author 2012-??-?? ???
   *
   * @internal
   *   @history 2017-04-07 Makayla Shepherd - Removed syncUndo(), added isUndoable(), and renamed 
   *                           syncRedo() to execute() according to the WorkOrder redesign.
   */
  class ImageFileListViewWorkOrder : public WorkOrder {
      Q_OBJECT
@@ -48,11 +50,14 @@ namespace Isis {
      virtual ImageFileListViewWorkOrder *clone() const;

      bool isExecutable(ImageList *images);
      
      bool isUndoable() const;
      
      bool setupExecution();
      void execute();

    protected:
      void syncRedo();
      void syncUndo();
      

    private:
      ImageFileListViewWorkOrder &operator=(const ImageFileListViewWorkOrder &rhs);