Fixed bug where rig was not initialized at startup if TRXConrol window stayed closed.

Problem was variable "riginuse" that was undefined at opendatabase called initializerig procedure.
This commit is contained in:
OH1KH 2022-12-07 11:01:42 +02:00
parent 4f59d7e6c4
commit 03e196a032
2 changed files with 5 additions and 2 deletions

View File

@ -425,9 +425,9 @@ begin
LoadBandButtons;
dmUtils.LoadWindowPos(frmTRXControl);
cmbRigGetItems(nil);
//These two are needed here othewise rig selector has "None" even if rig is initialized at startup
cmbRig.ItemIndex:=StrToInt(cqrini.ReadString('TRX', 'RigInUse', '1'));
cmbRigCloseUp(nil); //defaults rig 1 in case of undefined
cmbRigChange(nil); //inits rig
old_mode := '';
MemRelated := cqrini.ReadBool('TRX', 'MemModeRelated', False);
gbInfo.Visible := cqrini.ReadBool('TRX', 'MemShowInfo', gbInfo.Visible);
@ -1017,6 +1017,9 @@ procedure TfrmTRXControl.FormCreate(Sender : TObject);
begin
Radio := nil;
AutoMode := True;
//these are needed here otherwise rig init at startup, if TRXControl window stays closed, fails
cmbRig.ItemIndex:=StrToInt(cqrini.ReadString('TRX', 'RigInUse', '1'));
cmbRigCloseUp(nil); //defaults rig 1 in case of undefined
end;
procedure TfrmTRXControl.FormDestroy(Sender : TObject);

View File

@ -21,7 +21,7 @@ const
cRELEAS = 0;
cBUILD = 1;
cBUILD_DATE = '2022-11-28';
cBUILD_DATE = '2022-12-07';
implementation