regular expression option moved to preferences

SQL query fix, code format fixes
This commit is contained in:
Petr Hlozek 2017-04-14 13:27:46 +02:00
parent 71a7fd14f6
commit 6c2d7eba5d
8 changed files with 514 additions and 499 deletions

View File

@ -19,7 +19,7 @@
<AutoIncrementBuild Value="True"/>
<MinorVersionNr Value="3"/>
<RevisionNr Value="1"/>
<BuildNr Value="2139"/>
<BuildNr Value="2140"/>
<StringTable ProductVersion="0.3.1.2026"/>
</VersionInfo>
<BuildModes Count="1">

View File

@ -94,7 +94,7 @@ type
function PfxFromADIF(adif : Word) : String;
function CountryFromADIF(adif : Word) : String;
function GetBandFromFreq(freq : string; kHz : Boolean=false): String;
function IsAlertCall(const call,band,mode : String;rp :boolean) : Boolean;
function IsAlertCall(const call,band,mode : String;RegExp :Boolean) : Boolean;
procedure AddToMarkFile(prefix,call : String;sColor : Integer;Max,lat,long : String);
procedure GetRealCoordinate(lat,long : String; var latitude, longitude: Currency);
@ -1188,16 +1188,16 @@ begin
end
end;
function TdmDXCluster.IsAlertCall(const call,band,mode : String;rp :boolean) : Boolean;
function TdmDXCluster.IsAlertCall(const call,band,mode : String;RegExp :Boolean) : Boolean;
const
C_SEL = 'select * from call_alert where callsign = %s';
C_RGX_SEL ='select * from call_alert where %s regexp callsign';
C_RGX_SEL = 'select * from call_alert where callsign regexp %s';
begin
try
if rp then
if RegExp then
qCallAlert.SQL.Text := Format(C_RGX_SEL,[QuotedStr(call)])
else
qCallAlert.SQL.Text := Format(C_SEL,[QuotedStr(call)]);
else
qCallAlert.SQL.Text := Format(C_SEL,[QuotedStr(call)]);
if dmData.DebugLevel>=1 then Writeln(qCallAlert.SQL.Text);
trCallAlert.StartTransaction;
qCallAlert.Open;

View File

@ -121,7 +121,7 @@ object frmDXCluster: TfrmDXCluster
OnDestroy = FormDestroy
OnKeyUp = FormKeyUp
OnShow = FormShow
LCLVersion = '1.6.4.0'
LCLVersion = '1.6.0.4'
object pgDXCluster: TPageControl
Left = 0
Height = 367
@ -133,8 +133,8 @@ object frmDXCluster: TfrmDXCluster
TabOrder = 0
object tabWeb: TTabSheet
Caption = 'Web'
ClientHeight = 338
ClientWidth = 699
ClientHeight = 336
ClientWidth = 705
object Panel4: TPanel
Left = 0
Height = 36
@ -216,31 +216,31 @@ object frmDXCluster: TfrmDXCluster
end
object tabTelnet: TTabSheet
Caption = 'Telnet'
ClientHeight = 338
ClientWidth = 699
ClientHeight = 336
ClientWidth = 705
object Panel1: TPanel
Left = 0
Height = 34
Top = 304
Width = 699
Top = 302
Width = 705
Align = alBottom
BevelOuter = bvNone
ClientHeight = 34
ClientWidth = 699
ClientWidth = 705
TabOrder = 0
object Label1: TLabel
Left = 6
Height = 15
Height = 17
Top = 11
Width = 71
Width = 74
Caption = 'Command:'
ParentColor = False
end
object edtCommand: TEdit
AnchorSideLeft.Control = Label1
AnchorSideLeft.Side = asrBottom
Left = 79
Height = 32
Left = 82
Height = 27
Top = 3
Width = 266
BorderSpacing.Left = 2
@ -248,12 +248,12 @@ object frmDXCluster: TfrmDXCluster
TabOrder = 0
end
object Button1: TButton
AnchorSideLeft.Control = cbAlertRegExp
AnchorSideLeft.Side = asrBottom
Left = 462
Left = 616
Height = 25
Top = 3
Width = 85
Anchors = [akRight, akBottom]
BorderSpacing.InnerBorder = 4
Caption = 'Help'
OnClick = btnHelpClick
@ -272,41 +272,31 @@ object frmDXCluster: TfrmDXCluster
object tbAlertCalls: TToggleBox
AnchorSideLeft.Control = edtCommand
AnchorSideLeft.Side = asrBottom
Left = 349
Left = 544
Height = 25
Top = 3
Width = 60
Anchors = [akRight, akBottom]
BorderSpacing.Left = 4
BorderSpacing.Right = 4
Caption = 'ACalls'
Caption = 'Alerts'
OnClick = tbAlertCallsClick
TabOrder = 3
end
object cbAlertRegExp: TCheckBox
AnchorSideLeft.Control = tbAlertCalls
AnchorSideLeft.Side = asrBottom
Left = 413
Height = 23
Top = 3
Width = 45
BorderSpacing.Right = 4
Caption = 'Inc'
TabOrder = 4
end
end
object Panel2: TPanel
Left = 0
Height = 30
Top = 0
Width = 699
Width = 705
Align = alTop
BevelOuter = bvNone
ClientHeight = 30
ClientWidth = 699
ClientWidth = 705
TabOrder = 1
object edtTelAddress: TEdit
Left = 8
Height = 32
Height = 27
Top = 1
Width = 189
TabOrder = 0
@ -344,9 +334,9 @@ object frmDXCluster: TfrmDXCluster
end
object pnlTelnet: TPanel
Left = 0
Height = 274
Height = 272
Top = 30
Width = 699
Width = 705
Align = alClient
BevelOuter = bvNone
Color = clWhite

View File

@ -33,7 +33,6 @@ type
btnWebConnect: TButton;
Button1: TButton;
Button2: TButton;
cbAlertRegExp: TCheckBox;
dlgDXfnt: TFontDialog;
edtCommand: TEdit;
edtTelAddress: TEdit;
@ -576,13 +575,12 @@ end;
procedure TfrmDXCluster.tbAlertCallsClick(Sender: TObject);
begin
if tbAlertCalls.Checked then
Begin
tbAlertCalls.Font.Color := clGreen;
frmPreferences.btnAlertCallsignsClick(nil);
end
else
tbAlertCalls.Font.Color := clDefault;
begin
tbAlertCalls.Font.Color := clGreen;
frmPreferences.btnAlertCallsignsClick(nil);
end
else
tbAlertCalls.Font.Color := clDefault
end;
procedure TfrmDXCluster.tmrAutoConnectTimer(Sender: TObject);
@ -1118,7 +1116,7 @@ begin
end
end;
if (dmDXCluster.IsAlertCall(call,band,mode,cbAlertRegExp.Checked)) and tbAlertCalls.Checked then
if (dmDXCluster.IsAlertCall(call,band,mode,cqrini.ReadBool('DxCluster', 'AlertRegExp', False))) and tbAlertCalls.Checked then
dmDXCluster.RunCallAlertCmd(call,band,mode,freq);
if dmData.DebugLevel >=1 then

View File

@ -1,45 +1,45 @@
object frmNewCallAlert: TfrmNewCallAlert
Left = 334
Height = 198
Height = 358
Top = 333
Width = 322
Width = 330
BorderStyle = bsDialog
Caption = 'New callsign alert'
ClientHeight = 198
ClientWidth = 322
ClientHeight = 358
ClientWidth = 330
OnCreate = FormCreate
OnShow = FormShow
Position = poOwnerFormCenter
LCLVersion = '1.2.2.0'
LCLVersion = '1.6.0.4'
object Label1: TLabel
Left = 7
Height = 17
Top = 16
Width = 50
Width = 54
Caption = 'Callsign'
ParentColor = False
end
object edtCall: TEdit
Left = 7
Height = 23
Height = 27
Top = 40
Width = 223
CharCase = ecUppercase
TabOrder = 0
end
object Label2: TLabel
Left = 8
Left = 9
Height = 17
Top = 77
Width = 32
Top = 192
Width = 36
Caption = 'Band'
ParentColor = False
end
object Label3: TLabel
Left = 7
Left = 8
Height = 17
Top = 138
Width = 37
Top = 253
Width = 39
Caption = 'Mode'
ParentColor = False
end
@ -63,9 +63,9 @@ object frmNewCallAlert: TfrmNewCallAlert
TabOrder = 4
end
object cmbBand: TComboBox
Left = 7
Height = 23
Top = 102
Left = 8
Height = 29
Top = 217
Width = 223
CharCase = ecUppercase
ItemHeight = 0
@ -73,13 +73,25 @@ object frmNewCallAlert: TfrmNewCallAlert
Text = 'CMBBAND'
end
object cmbMode: TComboBox
Left = 7
Height = 23
Top = 160
Left = 8
Height = 29
Top = 275
Width = 223
CharCase = ecUppercase
ItemHeight = 0
TabOrder = 2
Text = 'CMBMODE'
end
object Memo1: TMemo
Left = 8
Height = 108
Top = 79
Width = 318
Enabled = False
Lines.Strings = (
'if RegExp is checked, you can use regular expressions e.g. IARU$ means all stations with IARU sufix, ^OK1[A..Z][X..Z]$ means only OK1AX, AY, AZ etc.'
)
ReadOnly = True
TabOrder = 5
end
end

View File

@ -21,6 +21,7 @@ type
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Memo1 : TMemo;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);

File diff suppressed because it is too large Load Diff

View File

@ -117,6 +117,7 @@ type
cb125m: TCheckBox;
cb60m: TCheckBox;
cb30cm: TCheckBox;
chkAllowRegExp : TCheckBox;
chkFillAwardField : TCheckBox;
chkUseCallbookZonesEtc : TCheckBox;
chkModeRelatedOnly : TCheckBox;
@ -1290,6 +1291,7 @@ begin
cqrini.WriteBool('DXCluster', 'ConAfterRun', chkConToDXC.Checked);
cqrini.WriteBool('DXCluster','ShowDxcCountry',chkShowDxcCountry.Checked);
cqrini.WriteString('DXCluster','AlertCmd', edtAlertCmd.Text);
cqrini.WriteBool('DxCluster', 'AlertRegExp', chkAllowRegExp.Checked);
cqrini.WriteBool('Fonts', 'UseDefault', chkUseDefaultSEttings.Checked);
cqrini.WriteString('Fonts', 'Buttons', lblbFont.Caption);
@ -2641,6 +2643,7 @@ begin
chkConToDXC.Checked := cqrini.ReadBool('DXCluster', 'ConAfterRun', False);
chkShowDxcCountry.Checked := cqrini.ReadBool('DXCluster','ShowDxcCountry',False);
edtAlertCmd.Text := cqrini.ReadString('DXCluster','AlertCmd','');
chkAllowRegExp.Checked := cqrini.ReadBool('DxCluster', 'AlertRegExp', False);
chkUseDefaultSEttings.Checked := cqrini.ReadBool('Fonts', 'UseDefault', True);
lblbFont.Caption := cqrini.ReadString('Fonts', 'Buttons', 'Sans 10');