n4af / TR4W

TRLOG 4 Windows free amateur radio logging application
GNU General Public License v3.0
19 stars 6 forks source link

Add code to have user confirm if they are not in the location for the I am in logic. #365

Open ny4i opened 5 years ago

ny4i commented 5 years ago

When a user configures a contest, they are asked if they are in the "home" country or continent of the contest. For example, in ARRL-10, they are asked is they are in North America. In RAC contests, they are asked if they are in Canada. In King of Spain, they are asked if they are in Spain.

It causes some issues if the user selects the wrong item so add some code to confirm if the callsign is in North America for example, but the user does not select I am in North America, pop a dialog to confirm their choice for some error correction.

This is handled in the uNewContest module and involves a checkbox called NC_CHECKBOX_IAMIN . Search on IAMIN to find the places to look.

One thought is to see if we already know the DXCC location of the call (which we must) and perhaps set the home DXCC values for a contest so we know if the box should be checked for that callsign. If not, pop the dialog.

ny4i commented 5 years ago

It appears the I am in logic is relevant to the following contests. This is more limited but the solution should still be general.


case SelectedContest of

              ALRS_UA1DZ_CUP:
                SetCommentAndEnableEditControl(TC_ENTERYOURRDAIDORGRID, icmyState);

              NEWENGLANDQSO:
                SetCommentAndEnableEditControl(TC_NEWENGLANDSTATEABREVIATION, icmyState);

              ARRL10, ARRL160, ARRLDXCW, ARRL_RTTY_ROUNDUP:
                begin
                  SetCommentAndEnableEditControl(TC_ENTERTHEQTHTHATYOUWANTTOSEND, icmyState);
                end;

              CQWWRTTY, CQ160CW, CQ160SSB:
                SetCommentAndEnableEditControl(TC_ENTERSTATEFORUSPROVINCEFORCANADA, icmyState);

              RAC_CANADA_DAY, RAC_CANADA_WINTER:
                SetCommentAndEnableEditControl(TC_ENTERYOURPROVINCEID, icmyState);

              REFSSB, REFCW:
                SetCommentAndEnableEditControl(TC_DEPARTMENT, icmyState);

              UKRAINIAN, RUSSIANDX, UNDX, CIS, RUSSIAN160:
                SetCommentAndEnableEditControl(TC_ENTERYOUROBLASTID, icmyState);

              KINGOFSPAINCW, KINGOFSPAINSSB, UBACW, UBASSB, PACC, ARI_DX, HELVETIA:
                SetCommentAndEnableEditControl(TC_ENTERYOURPROVINCEID, icmyState);

              CQIR, HADX, YUDX: SetCommentAndEnableEditControl(TC_ENTERYOURCOUNTYCODE, icmyState);

              UKEI: SetCommentAndEnableEditControl(TC_EnterYourDistrictCode, icmyState);

              DARC10M, WAG, DARCXMAS: SetCommentAndEnableEditControl(TC_ENTERYOURDOK, icmyState);

              SPDX, OKDX, YODX, RSGB18, LZDX:
                SetCommentAndEnableEditControl(TC_ENTERYOURDISTRICTABBREVIATION, icmyState);

              RDA: SetCommentAndEnableEditControl(TC_ENTERYOURRDAID, icmyState);

              BSCI, IARU:
                SetCommentAndEnableEditControl(nil, icmyState);

              IOTA:
                SetCommentAndEnableEditControl(TC_ENTERYOURIOTAREFERENCEDESIGNATOR, icmyState);

              WWPMC:
                SetCommentAndEnableEditControl(TC_ENTERYOURCITYIDENTIFIER, icmyState);

              TAC, ARKTIKA_SPRING:
                SetCommentAndEnableEditControl(TC_ENTERYOURMEMBERSHIPNUMBER, icmyState);

              JIDXCW, JIDXSSB:
                SetCommentAndEnableEditControl(TC_PREFECTURE, icmyState);