Ignore:
Timestamp:
2009-07-30T08:40:34+02:00 (15 years ago)
Author:
jttt
Message:

Fix #3130

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/progress/AbstractProgressMonitor.java

    r1812 r1872  
    1919        String extraText;
    2020        Boolean intermediate;
     21
     22        boolean finishRequested;
    2123    }
    2224
     
    8688
    8789            if (state == State.IN_SUBTASK) {
    88                 // Make sure the subtask didn't start yet (once task start it must be finished)
    89                 boolean broken = currentChild.state != State.INIT;
    90                 for (Request request:requests) {
    91                     broken = broken | request.originator.state != State.INIT;
    92                 }
    93                 if (broken) {
    94                     throw new ProgressException("Cannot call finishTask when there are unfinished tasks");
    95                 } else {
    96                     state = State.IN_TASK;
    97                 }
    98             }
    99 
    100             checkState(State.IN_TASK);
    101             state = State.FINISHED;
    102             doFinishTask();
     90                requestedState.finishRequested = true;
     91            } else {
     92                checkState(State.IN_TASK);
     93                state = State.FINISHED;
     94                doFinishTask();
     95            }
    10396        }
    10497    }
     
    282275
    283276    private void applyThisRequest(Request request) {
    284         if (request.customText != null) {
    285             this.customText = request.customText;
    286         }
    287 
    288         if (request.title != null) {
    289             this.taskTitle = request.title;
    290         }
    291 
    292         if (request.intermediate != null) {
    293             this.intermediateTask = request.intermediate;
    294         }
    295 
    296         if (request.extraText != null) {
    297             this.extraText = request.extraText;
    298         }
    299 
    300         resetState();
     277        if (request.finishRequested) {
     278            finishTask();
     279        } else {
     280            if (request.customText != null) {
     281                this.customText = request.customText;
     282            }
     283
     284            if (request.title != null) {
     285                this.taskTitle = request.title;
     286            }
     287
     288            if (request.intermediate != null) {
     289                this.intermediateTask = request.intermediate;
     290            }
     291
     292            if (request.extraText != null) {
     293                this.extraText = request.extraText;
     294            }
     295
     296            resetState();
     297        }
    301298    }
    302299
Note: See TracChangeset for help on using the changeset viewer.