mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Issue #8: show current highlighter colors as "Current custom settings" preset, in preferences dialog
This commit is contained in:
@ -7,7 +7,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HeidiSQL\n"
|
"Project-Id-Version: HeidiSQL\n"
|
||||||
"POT-Creation-Date: 2012-11-05 21:40\n"
|
"POT-Creation-Date: 2012-11-05 21:40\n"
|
||||||
"PO-Revision-Date: 2018-10-23 21:30+0200\n"
|
"PO-Revision-Date: 2018-11-09 18:40+0100\n"
|
||||||
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
|
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
|
||||||
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n"
|
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@ -6257,3 +6257,6 @@ msgstr "Error: Could not move \"%s\" to \"%s\" (Error: %s)"
|
|||||||
|
|
||||||
msgid "Scaling font size from %d to %d."
|
msgid "Scaling font size from %d to %d."
|
||||||
msgstr "Scaling font size from %d to %d."
|
msgstr "Scaling font size from %d to %d."
|
||||||
|
|
||||||
|
msgid "Current custom settings"
|
||||||
|
msgstr "Current custom settings"
|
||||||
|
@ -810,8 +810,12 @@ object optionsform: Toptionsform
|
|||||||
Width = 284
|
Width = 284
|
||||||
Height = 21
|
Height = 21
|
||||||
Style = csDropDownList
|
Style = csDropDownList
|
||||||
|
ItemIndex = 0
|
||||||
TabOrder = 12
|
TabOrder = 12
|
||||||
|
Text = 'Current custom settings'
|
||||||
OnChange = comboEditorColorsPresetChange
|
OnChange = comboEditorColorsPresetChange
|
||||||
|
Items.Strings = (
|
||||||
|
'Current custom settings')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -744,14 +744,17 @@ procedure Toptionsform.comboEditorColorsPresetChange(Sender: TObject);
|
|||||||
var
|
var
|
||||||
i, j: Integer;
|
i, j: Integer;
|
||||||
Highlighter: TSynSQLSyn;
|
Highlighter: TSynSQLSyn;
|
||||||
|
FoundHighlighter: Boolean;
|
||||||
begin
|
begin
|
||||||
// Color preset selected
|
// Color preset selected
|
||||||
|
FoundHighlighter := False;
|
||||||
for i:=0 to ComponentCount-1 do begin
|
for i:=0 to ComponentCount-1 do begin
|
||||||
if (Components[i] is TSynSQLSyn)
|
if (Components[i] is TSynSQLSyn)
|
||||||
and (Components[i] <> SynMemoSQLSample.Highlighter)
|
and (Components[i] <> SynMemoSQLSample.Highlighter)
|
||||||
then begin
|
then begin
|
||||||
Highlighter := Components[i] as TSynSQLSyn;
|
Highlighter := Components[i] as TSynSQLSyn;
|
||||||
if SynRegExpr.ExecRegExpr('[a-zA-Z]+_'+comboEditorColorsPreset.Text, Highlighter.Name) then begin
|
if SynRegExpr.ExecRegExpr('[a-zA-Z]+_'+comboEditorColorsPreset.Text, Highlighter.Name) then begin
|
||||||
|
FoundHighlighter := True;
|
||||||
for j:=0 to SynSQLSynSQLSample.AttrCount - 1 do begin
|
for j:=0 to SynSQLSynSQLSample.AttrCount - 1 do begin
|
||||||
SynSQLSynSQLSample.Attribute[j].AssignColorAndStyle(Highlighter.Attribute[j]);
|
SynSQLSynSQLSample.Attribute[j].AssignColorAndStyle(Highlighter.Attribute[j]);
|
||||||
end;
|
end;
|
||||||
@ -764,6 +767,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
if not FoundHighlighter then begin
|
||||||
|
// Show current custom settings
|
||||||
|
for i:=0 to SynSQLSynSQLSample.AttrCount - 1 do begin
|
||||||
|
SynSQLSynSQLSample.Attribute[i].AssignColorAndStyle(MainForm.SynSQLSynUsed.Attribute[i]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
Modified(Sender);
|
Modified(Sender);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user