Rework of job start behaviour. With new field for forcing enqueue, start or delay.
ClosedPublic

Authored by abika on Dec 6 2016, 9:03 PM.

Details

Summary

Ready for land.

See commits.

Diff Detail

Repository
R167 Krusader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
abika updated this revision to Diff 8825.Dec 6 2016, 9:03 PM
abika retitled this revision from to Rework of job start behaviour. With new field for forcing enqueue, start or delay..
abika updated this object.
abika added a reviewer: Krusader.
martinkostolny accepted this revision.Dec 7 2016, 4:51 PM
martinkostolny added a reviewer: martinkostolny.
martinkostolny added a subscriber: martinkostolny.

I like it, thanks! The start mode enum makes the code more understandable.

Problem: Jobs created with "F2 Queue" are not started in queue (if queue mode is off)

I may be wrong but I believe this can be resolved by storing the startMode in the KrJob itself and then rely on it in JobMan::slotTerminated(KrJob *krJob) method.

This revision is now accepted and ready to land.Dec 7 2016, 4:51 PM
abika updated this revision to Diff 10251.Jan 16 2017, 6:00 PM
abika edited edge metadata.
  • Dialogs: merged "delay" checkbox with "reverser queue" button in copy/move dialogs

This look nice, almost perfect :)).

Please see my comment inside JobMan::slotTerminated method.

I can see we probably still misunderstand each other a little, so I try to write down several use-cases I believe we are trying to achieve:

  1. I want only one job at a time -> turn on queue mode ...OK
  2. I want to pile up one or more jobs but start them later -> turn on queue mode and keep pressing F2 ...OK
  3. I want everything in parallel -> queue mode off ...OK
  4. I want everything in parallel, but for some chosen jobs I want to start them paused and run them manually later ,,,OK (personally I think this will hardly be used)
  5. I want everything in parallel, but for some chosen jobs I want to start performing them one by one (e.g. copying to remote server)
    • this could be achieved by:
      • a) always starting queued job when last running job finished, regardless of queueMode (see my code comment above)
      • b) or better keeping 2 "_jobs" collections instead of one, where the second one (e.g. "_queuedJobs") would contain only tasks to run one by one (to virtually mimic previous QueueManager) -> this would of course complicate the code a bit

Admittedly the fifth use-case is what I was used to before. But if I'm the only one, I definitely don't want to stand in your way and I'm open to new ways of managing such use cases! :)

krusader/JobMan/jobman.cpp
327–328

If you remove _queueMode from the conditional, I'll be totally happy with this whole patch!

abika updated this revision to Diff 11558.Feb 20 2017, 5:33 PM
  • Dialogs: merged "delay" checkbox with "reverser queue" button in copy/move dialogs
  • JobMan: improved coding style and documentation
  • JobMan: run next job not started yet even if queue mode is off
abika added a comment.Feb 20 2017, 5:38 PM

Ok, coming back to this. I needed some time to re-think it.

Please see my comment inside JobMan::slotTerminated method.

You're right, with the current F2 options this is the best way now and there is no direct misbehaviour.

It makes not much sense if only we two discuss this. And until a release with the new job manager is published we probably won't get more opinions.

It could also endlessly be extended: with two lists (like you said) or even more user created queues + a dialog for creating/saving/renaming queues + categories (running/paused/finished/...) for each queue; end so on...

With this last change I consider this "good enough" for now and we can wait until somebody complains:)

abika edited the summary of this revision. (Show Details)Feb 20 2017, 5:40 PM
abika requested review of this revision.Feb 20 2017, 5:43 PM
abika edited edge metadata.
martinkostolny accepted this revision.Feb 21 2017, 12:18 AM

This is perfect, thanks!

It makes not much sense if only we two discuss this.

I was thinking the same thing. :)

It could also endlessly be extended (...)
With this last change I consider this "good enough" for now and we can wait until somebody complains:)

Agreed, lets see what the "world" says.

This revision is now accepted and ready to land.Feb 21 2017, 12:18 AM
Closed by commit R167:cc9333193c1e: Merge branch 'my-job_start_state' (authored by Alexander Bikadorov <alex.bikadorov@kdemail.net>). · Explain WhyFeb 21 2017, 9:44 PM
This revision was automatically updated to reflect the committed changes.