mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 00:11:51 +02:00
Jedi code format: Hide sort uses clauses in options dialog. Issue #40756
This commit is contained in:
parent
d3f0f0ee86
commit
02c21caa95
@ -279,6 +279,7 @@ resourcestring
|
||||
lisTransformShortestToLongest = 'Shortest to longest';
|
||||
lisTransformLongestToShortest = 'Longest to shortest';
|
||||
lisTransformWarningSortUsesClauses = 'WARNING: changing order of uses clauses may break your code.';
|
||||
lisTransformAdvancedSettings = 'Advanced settings';
|
||||
|
||||
//Asm tab
|
||||
lisAsmAsm = 'Asm';
|
||||
|
@ -983,6 +983,10 @@ msgstr ""
|
||||
msgid "Add or Remove &begin and end from single statements"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformadvancedsettings
|
||||
msgid "Advanced settings"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformalphabetic
|
||||
msgid "Alphabetic"
|
||||
msgstr ""
|
||||
|
@ -989,6 +989,10 @@ msgstr "Begin und End zu Einzelanweisungen hinzufügen"
|
||||
msgid "Add or Remove &begin and end from single statements"
|
||||
msgstr "&Begin und End bei Einzelanweisungen hinzufügen/entfernen"
|
||||
|
||||
#: jcfuiconsts.listransformadvancedsettings
|
||||
msgid "Advanced settings"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformalphabetic
|
||||
msgid "Alphabetic"
|
||||
msgstr "Alphabetisch"
|
||||
|
@ -978,6 +978,10 @@ msgstr ""
|
||||
msgid "Add or Remove &begin and end from single statements"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformadvancedsettings
|
||||
msgid "Advanced settings"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformalphabetic
|
||||
msgid "Alphabetic"
|
||||
msgstr ""
|
||||
|
@ -987,6 +987,10 @@ msgstr "Ajouter \"begin\" et \"end\" aux instructions uniques"
|
||||
msgid "Add or Remove &begin and end from single statements"
|
||||
msgstr "Ajouter ou enlèver \"&begin\" et \"end\" des instructions uniques"
|
||||
|
||||
#: jcfuiconsts.listransformadvancedsettings
|
||||
msgid "Advanced settings"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformalphabetic
|
||||
msgid "Alphabetic"
|
||||
msgstr "Alphabétique"
|
||||
|
@ -988,6 +988,10 @@ msgstr "Legyen begin és end a magányos állományok körül"
|
||||
msgid "Add or Remove &begin and end from single statements"
|
||||
msgstr "Legyen vagy ne legyen begin és end a magányos állományok körül"
|
||||
|
||||
#: jcfuiconsts.listransformadvancedsettings
|
||||
msgid "Advanced settings"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformalphabetic
|
||||
msgid "Alphabetic"
|
||||
msgstr "ABC sorrend"
|
||||
|
@ -988,6 +988,10 @@ msgstr "Aggiungi Begin e End a una istruzione singola"
|
||||
msgid "Add or Remove &begin and end from single statements"
|
||||
msgstr "Aggiungi/togli Begin e End da una istruzione singola"
|
||||
|
||||
#: jcfuiconsts.listransformadvancedsettings
|
||||
msgid "Advanced settings"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformalphabetic
|
||||
msgid "Alphabetic"
|
||||
msgstr "Alfabetico"
|
||||
|
@ -987,6 +987,10 @@ msgstr "単一ステートメントに begin と end を付加する"
|
||||
msgid "Add or Remove &begin and end from single statements"
|
||||
msgstr "単一ステートメントに対する begin と end の追加ないし削除(&b)"
|
||||
|
||||
#: jcfuiconsts.listransformadvancedsettings
|
||||
msgid "Advanced settings"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformalphabetic
|
||||
msgid "Alphabetic"
|
||||
msgstr "アルファベット順"
|
||||
|
@ -987,6 +987,10 @@ msgstr "Su „Begin“ ir „End“ apgaubti ir vieną sakinį"
|
||||
msgid "Add or Remove &begin and end from single statements"
|
||||
msgstr "Šalinti vieno &sakinio „Begin“ ir „End“"
|
||||
|
||||
#: jcfuiconsts.listransformadvancedsettings
|
||||
msgid "Advanced settings"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformalphabetic
|
||||
msgid "Alphabetic"
|
||||
msgstr "Abėcėlinis"
|
||||
|
@ -985,6 +985,10 @@ msgstr ""
|
||||
msgid "Add or Remove &begin and end from single statements"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformadvancedsettings
|
||||
msgid "Advanced settings"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformalphabetic
|
||||
msgid "Alphabetic"
|
||||
msgstr ""
|
||||
|
@ -963,6 +963,10 @@ msgstr ""
|
||||
msgid "Add or Remove &begin and end from single statements"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformadvancedsettings
|
||||
msgid "Advanced settings"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformalphabetic
|
||||
msgid "Alphabetic"
|
||||
msgstr ""
|
||||
|
@ -987,6 +987,10 @@ msgstr "Adicionar \"begin\" e \"end\" em declarações únicas"
|
||||
msgid "Add or Remove &begin and end from single statements"
|
||||
msgstr "Adicionar ou Remover \"&begin\" e \"end\" de declarações únicas"
|
||||
|
||||
#: jcfuiconsts.listransformadvancedsettings
|
||||
msgid "Advanced settings"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformalphabetic
|
||||
msgid "Alphabetic"
|
||||
msgstr "Alfabético"
|
||||
|
@ -977,6 +977,10 @@ msgstr "Добавлять begin и end к одиночным оператора
|
||||
msgid "Add or Remove &begin and end from single statements"
|
||||
msgstr "Д&обавление и удаление begin и end одиночных операторов"
|
||||
|
||||
#: jcfuiconsts.listransformadvancedsettings
|
||||
msgid "Advanced settings"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformalphabetic
|
||||
msgid "Alphabetic"
|
||||
msgstr "По алфавиту"
|
||||
|
@ -988,6 +988,10 @@ msgstr "Додавати begin і end до одиничних операторі
|
||||
msgid "Add or Remove &begin and end from single statements"
|
||||
msgstr "Додати або видал&ити begin і end з одиничних операторів"
|
||||
|
||||
#: jcfuiconsts.listransformadvancedsettings
|
||||
msgid "Advanced settings"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformalphabetic
|
||||
msgid "Alphabetic"
|
||||
msgstr "За алфавітом"
|
||||
|
@ -985,6 +985,10 @@ msgstr ""
|
||||
msgid "Add or Remove &begin and end from single statements"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformadvancedsettings
|
||||
msgid "Advanced settings"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.listransformalphabetic
|
||||
msgid "Alphabetic"
|
||||
msgstr ""
|
||||
|
@ -1,9 +1,9 @@
|
||||
object fTransform: TfTransform
|
||||
Left = 0
|
||||
Height = 325
|
||||
Height = 367
|
||||
Top = 0
|
||||
Width = 412
|
||||
ClientHeight = 325
|
||||
ClientHeight = 367
|
||||
ClientWidth = 412
|
||||
TabOrder = 0
|
||||
object cbBlockEndSemicolons: TCheckBox
|
||||
@ -55,7 +55,7 @@ object fTransform: TfTransform
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 176
|
||||
Top = 147
|
||||
Top = 178
|
||||
Width = 169
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
@ -63,6 +63,7 @@ object fTransform: TfTransform
|
||||
ClientHeight = 156
|
||||
ClientWidth = 165
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
object cbSortInterfaceUses: TCheckBox
|
||||
AnchorSideLeft.Control = bgSortUses
|
||||
AnchorSideTop.Control = bgSortUses
|
||||
@ -146,7 +147,7 @@ object fTransform: TfTransform
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 181
|
||||
Height = 126
|
||||
Top = 147
|
||||
Top = 178
|
||||
Width = 225
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoFill = True
|
||||
@ -172,18 +173,34 @@ object fTransform: TfTransform
|
||||
'Longest to shortest'
|
||||
)
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
end
|
||||
object lbWarningSortUsesClauses: TLabel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = cbBlockEndSemicolons
|
||||
AnchorSideTop.Control = btnAdvancedSettings
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 126
|
||||
Top = 157
|
||||
Width = 355
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'WARNING: changing order of uses clauses may break your code.'
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Visible = False
|
||||
end
|
||||
object btnAdvancedSettings: TButton
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = cbBlockEndSemicolons
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 126
|
||||
Width = 123
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Advanced settings'
|
||||
TabOrder = 4
|
||||
OnClick = btnAdvancedSettingsClick
|
||||
end
|
||||
end
|
||||
|
@ -38,6 +38,7 @@ type
|
||||
{ TfTransform }
|
||||
|
||||
TfTransform = class(TAbstractIDEOptionsEditor)
|
||||
btnAdvancedSettings: TButton;
|
||||
cbBlockEndSemicolons: TCheckBox;
|
||||
lbWarningSortUsesClauses: TLabel;
|
||||
rbBeginEnd: TRadioGroup;
|
||||
@ -49,6 +50,8 @@ type
|
||||
rgUsesSortOrder: TRadioGroup;
|
||||
cbNoComments: TCheckBox;
|
||||
cbSortProgramUses: TCheckBox;
|
||||
procedure btnAdvancedSettingsClick(Sender: TObject);
|
||||
procedure ShowAdvancedSettings(AVisible: boolean);
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
|
||||
@ -66,6 +69,19 @@ implementation
|
||||
uses
|
||||
SettingsTypes, JcfSettings, SetTransform, JcfUIConsts, JcfIdeRegister;
|
||||
|
||||
procedure TfTransform.btnAdvancedSettingsClick(Sender: TObject);
|
||||
begin
|
||||
ShowAdvancedSettings(True);
|
||||
btnAdvancedSettings.Enabled := False;
|
||||
end;
|
||||
|
||||
procedure TfTransform.ShowAdvancedSettings(AVisible: boolean);
|
||||
begin
|
||||
lbWarningSortUsesClauses.Visible := AVisible;
|
||||
bgSortUses.Visible := AVisible;
|
||||
rgUsesSortOrder.Visible := AVisible;
|
||||
end;
|
||||
|
||||
constructor TfTransform.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
@ -101,6 +117,15 @@ begin
|
||||
rgUsesSortOrder.Items[2] := lisTransformShortestToLongest;
|
||||
rgUsesSortOrder.Items[3] := lisTransformLongestToShortest;
|
||||
lbWarningSortUsesClauses.Caption := lisTransformWarningSortUsesClauses;
|
||||
btnAdvancedSettings.Caption := lisTransformAdvancedSettings;
|
||||
|
||||
if FormattingSettings.Transform.SortProgramUses or
|
||||
FormattingSettings.Transform.SortInterfaceUses or
|
||||
FormattingSettings.Transform.SortImplementationUses then
|
||||
begin
|
||||
ShowAdvancedSettings(True);
|
||||
btnAdvancedSettings.Enabled := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfTransform.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
|
Loading…
Reference in New Issue
Block a user