Adjust job editing algorithm
ClosedPublic

Authored by TallFurryMan on Jun 27 2018, 8:48 PM.

Details

Summary

Make Scheduler watch job widgets changes properly, so that setDirty is
called appropriately. Move job edition checks before job creation to
simplify the algorithm. Clarify when add button enables.

Fix wrong QT slot connections on QDoubleSpinBox.

Test Plan

Job edition in the Scheduler tab.

Jobs should properly reevaluate as they are edited, as the original
algorithm was intending to. Part of the code I removed during the past
months incorrectly assumed that there was support for canceling changes
made to a SchedulerJob.

If that feature is needed, it is relatively simple to clone a backup of
the SchedulerJob when it is opened for editing, and restore that backup
when clicking on a cancel button. However, said cancel button should not
be at the same location as the job removal button for clarity of interface.

Diff Detail

Repository
R321 KStars
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
TallFurryMan created this revision.Jun 27 2018, 8:48 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptJun 27 2018, 8:48 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
TallFurryMan requested review of this revision.Jun 27 2018, 8:48 PM

Since you're updated Signal/Slots, may I suggest you used Qt5 new way for connection? I've been moving toward this in the code to make sure all is good at compile time. I've been bitten many times when some slots name was wrong and sent me on a goose chase to figure out what was going on. So it's like connect(someObject, &SomeClass::signal, anotherObject, &AnotherObject::function)..

TallFurryMan planned changes to this revision.Jun 29 2018, 7:16 AM

Good idea, looks simple. I'll then extend the changes to other tabs.

Edited to properly connect signals using a type-safe method.

Took me a while to work through the numerous overrides of connect/disconnect, but I got everything under control in the end.

pino added a subscriber: pino.Aug 3 2018, 7:27 AM
pino added inline comments.
kstars/ekos/scheduler/scheduler.cpp
416

Since this is not a game nor an extremely vital warning, please do not abuse the exclamation mark.
i18n("Warning: you cannot ... is more than enough (even for the other additions done by this diff).

Fixed log messages to not include an exclamation mark when not necessary.

Thanks for spotting those Pino.

mutlaqja accepted this revision.Aug 3 2018, 7:35 AM

That's a pretty smart way to do it. Great!

This revision is now accepted and ready to land.Aug 3 2018, 7:35 AM
This revision was automatically updated to reflect the committed changes.