Changeset 2129 for trunk/eraser


Ignore:
Timestamp:
5/15/2010 1:22:08 PM (5 years ago)
Author:
lowjoel
Message:
  • Define the behaviour of Run immediately (run now tasks) and Run manually: after a run now task is complete, it is reset to run manually; if a run immediately task is saved to the task list, upon load, it is automatically queued for running.
  • As a result, we don't need to worry about having blank "task status" entries when the task is set to run immediately upon creation. This would revert r1969
Location:
trunk/eraser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.Manager/DirectExecutor.cs

    r2036 r2129  
    323323                    ((RecurringSchedule)task.Schedule).Reschedule(DateTime.Now); 
    324324 
    325                 //If the task is an execute on restart task, it is only run 
    326                 //once and can now be restored to an immediately executed task 
    327                 if (task.Schedule == Schedule.RunOnRestart) 
    328                     task.Schedule = Schedule.RunNow; 
     325                //If the task is an execute on restart task or run immediately task, it is 
     326                //only run once and can now be restored to a manually run task 
     327                if (task.Schedule == Schedule.RunOnRestart || task.Schedule == Schedule.RunNow) 
     328                    task.Schedule = Schedule.RunManually; 
    329329 
    330330                //And the task finished event. 
     
    396396                    list.Insert(index, item); 
    397397 
     398                //Call all the event handlers who registered to be notified of tasks 
     399                //being added. 
     400                Owner.OnTaskAdded(new TaskEventArgs(item)); 
     401 
    398402                //If the task is scheduled to run now, break the waiting thread and 
    399403                //run it immediately 
     
    408412                    Owner.ScheduleTask(item); 
    409413                } 
    410  
    411                 //Call all the event handlers who registered to be notified of tasks 
    412                 //being added. 
    413                 Owner.OnTaskAdded(new TaskEventArgs(item)); 
    414414            } 
    415415 
     
    519519                    { 
    520520                        Owner.OnTaskAdded(new TaskEventArgs(task)); 
    521                         if (task.Schedule is RecurringSchedule) 
     521                        if (task.Schedule == Schedule.RunNow) 
     522                            Owner.QueueTask(task); 
     523                        else if (task.Schedule is RecurringSchedule) 
    522524                            Owner.ScheduleTask(task); 
    523525                    } 
  • trunk/eraser/Eraser/SchedulerPanel.cs

    r2118 r2129  
    9191 
    9292            //Set the next run time of the task 
    93             if (task.Queued) 
     93            if (task.Queued || task.Schedule == Schedule.RunNow) 
    9494            { 
    9595                item.SubItems[1].Text = S._("Queued for execution"); 
    9696                item.SubItems[2].Text = string.Empty; 
    9797            } 
    98             else if (task.Executing && !schedulerProgress.Visible) 
    99                 task_TaskStarted(null, EventArgs.Empty); 
    10098            else if (task.Schedule is RecurringSchedule) 
    10199                item.SubItems[1].Text = ((task.Schedule as RecurringSchedule).NextRun. 
    102100                    ToString("F", CultureInfo.CurrentCulture)); 
    103             else if (task.Schedule == Schedule.RunNow || task.Schedule == Schedule.RunManually) 
     101            else if (task.Schedule == Schedule.RunManually) 
    104102                item.SubItems[1].Text = S._("Not queued"); 
    105103            else 
Note: See TracChangeset for help on using the changeset viewer.