ok2cqr / cqrlog

Linux logging program for amateur radio operators
https://www.cqrlog.com
GNU General Public License v2.0
128 stars 55 forks source link

Fix for DXCC Ref edit/save #549

Closed OH1KH closed 11 months ago

OH1KH commented 1 year ago
Once again user request appeared to modify and save DXCC ref.
Decided to look at it.

To my surprise I found that saving user edited DXCC Ref value
was nearly done!
There was just one line missing and it made me think it could be
just a bug from earlier times.
When DXCCRef was selected from list opened from btnDXCCref it was set
to NewQSO, but variable adif's value was forgotten to set.
That's why selected new DXCCRef was never saved.

During testing I found out that edtDXCCRef.ReadOnly that was set
in fNewQSO.lfm was reseted mysteriosly.
Reason was ClearAll procedure that set all readonly values to
false forgetting to set edtDXCCRef back to true.
Later I found two places  more  in source doing the same.

ReadOnly prevents "user defined" DXCCs to be entered. All must come
from the DXCC list (that, I think, is a good thing).

That lead to removing of line that should have been set ChangeDXCC
boolean true if old and new calls were same but old and new adifs
were different.
That is not needed now when typing is disabled, and on the other hand
it never worked as EDITQSO did not set proper adif and old_adif
values at start.
Including that manually entered prefix was never checked to set
corresponding adif integer.

Yet one bug more was found when EDITQSO was saved. Then there were
not ClearAll procedure called leaving some edited qso data to NewQSO
columns.
ClearAll was refused to run "normal" way when callsign column was
cleared and EDITQSO true.
That is because during EDITQSO it can be cleared by user and so would
clear all data during edit.
If EDITQSO is true ClearAll must be called separately at btnSaveClick
procedure.
OH1KH commented 11 months ago

expired