mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 20:50:39 +02:00
IDE: made suggestion of lowercased file name for new forms/units configurable
git-svn-id: trunk@31920 -
This commit is contained in:
parent
65716171bf
commit
1a14549431
@ -310,6 +310,7 @@ type
|
|||||||
fAmbiguousFileAction: TAmbiguousFileAction;
|
fAmbiguousFileAction: TAmbiguousFileAction;
|
||||||
FUnitRenameReferencesAction: TUnitRenameReferencesAction;
|
FUnitRenameReferencesAction: TUnitRenameReferencesAction;
|
||||||
FAskForFilenameOnNewFile: boolean;
|
FAskForFilenameOnNewFile: boolean;
|
||||||
|
FLowercaseDefaultFilename: boolean;
|
||||||
|
|
||||||
// lazdoc
|
// lazdoc
|
||||||
FLazDocPaths: string;
|
FLazDocPaths: string;
|
||||||
@ -554,9 +555,12 @@ type
|
|||||||
property CharcaseFileAction: TCharCaseFileAction read fCharcaseFileAction
|
property CharcaseFileAction: TCharCaseFileAction read fCharcaseFileAction
|
||||||
write fCharcaseFileAction;
|
write fCharcaseFileAction;
|
||||||
property UnitRenameReferencesAction: TUnitRenameReferencesAction
|
property UnitRenameReferencesAction: TUnitRenameReferencesAction
|
||||||
read FUnitRenameReferencesAction write FUnitRenameReferencesAction;
|
read FUnitRenameReferencesAction
|
||||||
|
write FUnitRenameReferencesAction;
|
||||||
property AskForFilenameOnNewFile: boolean read FAskForFilenameOnNewFile
|
property AskForFilenameOnNewFile: boolean read FAskForFilenameOnNewFile
|
||||||
write FAskForFilenameOnNewFile;
|
write FAskForFilenameOnNewFile;
|
||||||
|
property LowercaseDefaultFilename: boolean read FLowercaseDefaultFilename
|
||||||
|
write FLowercaseDefaultFilename;
|
||||||
|
|
||||||
// lazdoc
|
// lazdoc
|
||||||
property LazDocPaths: string read FLazDocPaths write FLazDocPaths;
|
property LazDocPaths: string read FLazDocPaths write FLazDocPaths;
|
||||||
@ -838,6 +842,7 @@ begin
|
|||||||
fCharcaseFileAction:=ccfaAutoRename;
|
fCharcaseFileAction:=ccfaAutoRename;
|
||||||
FUnitRenameReferencesAction:=urraAsk;
|
FUnitRenameReferencesAction:=urraAsk;
|
||||||
FAskForFilenameOnNewFile:=false;
|
FAskForFilenameOnNewFile:=false;
|
||||||
|
FLowercaseDefaultFilename:=true;
|
||||||
|
|
||||||
// lazdoc
|
// lazdoc
|
||||||
FLazDocPaths:=SetDirSeparators(DefaultLazDocPath);
|
FLazDocPaths:=SetDirSeparators(DefaultLazDocPath);
|
||||||
@ -1241,6 +1246,8 @@ begin
|
|||||||
Path+'UnitRenameReferencesAction/Value',UnitRenameReferencesActionNames[urraAsk]));
|
Path+'UnitRenameReferencesAction/Value',UnitRenameReferencesActionNames[urraAsk]));
|
||||||
FAskForFilenameOnNewFile:=XMLConfig.GetValue(
|
FAskForFilenameOnNewFile:=XMLConfig.GetValue(
|
||||||
Path+'AskForFilenameOnNewFile/Value',false);
|
Path+'AskForFilenameOnNewFile/Value',false);
|
||||||
|
FLowercaseDefaultFilename:=XMLConfig.GetValue(
|
||||||
|
Path+'LowercaseDefaultFilename/Value',true);
|
||||||
|
|
||||||
//lazdoc
|
//lazdoc
|
||||||
FLazDocPaths := XMLConfig.GetValue(Path+'LazDoc/Paths', DefaultLazDocPath);
|
FLazDocPaths := XMLConfig.GetValue(Path+'LazDoc/Paths', DefaultLazDocPath);
|
||||||
@ -1556,6 +1563,8 @@ begin
|
|||||||
AmbiguousFileActionNames[afaAsk]);
|
AmbiguousFileActionNames[afaAsk]);
|
||||||
XMLConfig.SetDeleteValue(Path+'AskForFilenameOnNewFile/Value',
|
XMLConfig.SetDeleteValue(Path+'AskForFilenameOnNewFile/Value',
|
||||||
FAskForFilenameOnNewFile,false);
|
FAskForFilenameOnNewFile,false);
|
||||||
|
XMLConfig.SetDeleteValue(Path+'LowercaseDefaultFilename/Value',
|
||||||
|
FLowercaseDefaultFilename,true);
|
||||||
|
|
||||||
// lazdoc
|
// lazdoc
|
||||||
XMLConfig.SetDeleteValue(Path+'LazDoc/Paths',FLazDocPaths,DefaultLazDocPath);
|
XMLConfig.SetDeleteValue(Path+'LazDoc/Paths',FLazDocPaths,DefaultLazDocPath);
|
||||||
|
@ -3,6 +3,7 @@ inherited NamingOptionsFrame: TNamingOptionsFrame
|
|||||||
Width = 507
|
Width = 507
|
||||||
ClientHeight = 367
|
ClientHeight = 367
|
||||||
ClientWidth = 507
|
ClientWidth = 507
|
||||||
|
TabOrder = 0
|
||||||
Visible = False
|
Visible = False
|
||||||
DesignLeft = 353
|
DesignLeft = 353
|
||||||
DesignTop = 291
|
DesignTop = 291
|
||||||
@ -10,7 +11,6 @@ inherited NamingOptionsFrame: TNamingOptionsFrame
|
|||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
AnchorSideTop.Control = Owner
|
AnchorSideTop.Control = Owner
|
||||||
AnchorSideRight.Control = Owner
|
AnchorSideRight.Control = Owner
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 47
|
Height = 47
|
||||||
Top = 0
|
Top = 0
|
||||||
@ -34,7 +34,6 @@ inherited NamingOptionsFrame: TNamingOptionsFrame
|
|||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
AnchorSideTop.Control = CharcaseFileActionRadioGroup
|
AnchorSideTop.Control = CharcaseFileActionRadioGroup
|
||||||
AnchorSideRight.Control = Owner
|
AnchorSideRight.Control = Owner
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 67
|
Height = 67
|
||||||
Top = 53
|
Top = 53
|
||||||
@ -59,7 +58,6 @@ inherited NamingOptionsFrame: TNamingOptionsFrame
|
|||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
AnchorSideTop.Control = AmbiguousFileActionRadioGroup
|
AnchorSideTop.Control = AmbiguousFileActionRadioGroup
|
||||||
AnchorSideRight.Control = Owner
|
AnchorSideRight.Control = Owner
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 58
|
Height = 58
|
||||||
Top = 126
|
Top = 126
|
||||||
@ -114,4 +112,22 @@ inherited NamingOptionsFrame: TNamingOptionsFrame
|
|||||||
Caption = 'AskForFilenameOnNewCheckBox'
|
Caption = 'AskForFilenameOnNewCheckBox'
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
end
|
end
|
||||||
|
object LowercaseDefaultFilenameCheckBox: TCheckBox[5]
|
||||||
|
AnchorSideLeft.Control = AskForFilenameOnNewCheckBox
|
||||||
|
AnchorSideTop.Control = AskForFilenameOnNewCheckBox
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
Left = 6
|
||||||
|
Height = 17
|
||||||
|
Top = 269
|
||||||
|
Width = 193
|
||||||
|
BorderSpacing.Top = 6
|
||||||
|
BorderSpacing.Right = 6
|
||||||
|
BorderSpacing.Bottom = 6
|
||||||
|
Caption = 'LowercaseDefaultFilenameCheckBox'
|
||||||
|
Checked = True
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
|
State = cbChecked
|
||||||
|
TabOrder = 5
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -36,6 +36,7 @@ type
|
|||||||
AmbiguousFileActionRadioGroup: TRadioGroup;
|
AmbiguousFileActionRadioGroup: TRadioGroup;
|
||||||
CharcaseFileActionRadioGroup: TRadioGroup;
|
CharcaseFileActionRadioGroup: TRadioGroup;
|
||||||
AskForFilenameOnNewCheckBox: TCheckBox;
|
AskForFilenameOnNewCheckBox: TCheckBox;
|
||||||
|
LowercaseDefaultFilenameCheckBox: TCheckBox;
|
||||||
PascalFileExtRadiogroup: TRadioGroup;
|
PascalFileExtRadiogroup: TRadioGroup;
|
||||||
UnitReferencesRadioGroup: TRadioGroup;
|
UnitReferencesRadioGroup: TRadioGroup;
|
||||||
private
|
private
|
||||||
@ -118,6 +119,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
AskForFilenameOnNewCheckBox.Caption:=lisAskForFileNameOnNewFile;
|
AskForFilenameOnNewCheckBox.Caption:=lisAskForFileNameOnNewFile;
|
||||||
|
|
||||||
|
LowercaseDefaultFilenameCheckBox.Caption:=
|
||||||
|
lisSuggestDefaultNameOfNewFileInLowercase;
|
||||||
|
LowercaseDefaultFilenameCheckBox.Hint:=
|
||||||
|
lisAlwaysConvertSuggestedDefaultFileNameToLowercase;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TNamingOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
procedure TNamingOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||||
@ -133,7 +139,8 @@ begin
|
|||||||
CharCaseFileActionRadioGroup.ItemIndex := ord(CharCaseFileAction);
|
CharCaseFileActionRadioGroup.ItemIndex := ord(CharCaseFileAction);
|
||||||
AmbiguousFileActionRadioGroup.ItemIndex := ord(AmbiguousFileAction);
|
AmbiguousFileActionRadioGroup.ItemIndex := ord(AmbiguousFileAction);
|
||||||
UnitReferencesRadioGroup.ItemIndex := ord(UnitRenameReferencesAction);
|
UnitReferencesRadioGroup.ItemIndex := ord(UnitRenameReferencesAction);
|
||||||
AskForFilenameOnNewCheckBox.Checked:=AskForFilenameOnNewFile;
|
AskForFilenameOnNewCheckBox.Checked := AskForFilenameOnNewFile;
|
||||||
|
LowercaseDefaultFilenameCheckBox.Checked := LowercaseDefaultFilename;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -148,7 +155,8 @@ begin
|
|||||||
CharcaseFileAction := TCharCaseFileAction(CharcaseFileActionRadioGroup.ItemIndex);
|
CharcaseFileAction := TCharCaseFileAction(CharcaseFileActionRadioGroup.ItemIndex);
|
||||||
AmbiguousFileAction := TAmbiguousFileAction(AmbiguousFileActionRadioGroup.ItemIndex);
|
AmbiguousFileAction := TAmbiguousFileAction(AmbiguousFileActionRadioGroup.ItemIndex);
|
||||||
UnitRenameReferencesAction := TUnitRenameReferencesAction(UnitReferencesRadioGroup.ItemIndex);
|
UnitRenameReferencesAction := TUnitRenameReferencesAction(UnitReferencesRadioGroup.ItemIndex);
|
||||||
AskForFilenameOnNewFile:=AskForFilenameOnNewCheckBox.Checked;
|
AskForFilenameOnNewFile := AskForFilenameOnNewCheckBox.Checked;
|
||||||
|
LowercaseDefaultFilename := LowercaseDefaultFilenameCheckBox.Checked;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -5015,6 +5015,10 @@ resourcestring
|
|||||||
+'must be unique in all components on the form/datamodule.The name is '
|
+'must be unique in all components on the form/datamodule.The name is '
|
||||||
+'compared case insensitive like a normal pascal identifier.';
|
+'compared case insensitive like a normal pascal identifier.';
|
||||||
lisAskForFileNameOnNewFile = 'Ask for file name on new file';
|
lisAskForFileNameOnNewFile = 'Ask for file name on new file';
|
||||||
|
lisSuggestDefaultNameOfNewFileInLowercase = 'Suggest default name of new '
|
||||||
|
+'file in lowercase';
|
||||||
|
lisAlwaysConvertSuggestedDefaultFileNameToLowercase = 'Always convert '
|
||||||
|
+'suggested default file name to lowercase';
|
||||||
lisIndentation = 'Indentation';
|
lisIndentation = 'Indentation';
|
||||||
lisExampleFile = 'Example file:';
|
lisExampleFile = 'Example file:';
|
||||||
lisChooseAPascalFileForIndentationExamples = 'Choose a pascal file for '
|
lisChooseAPascalFileForIndentationExamples = 'Choose a pascal file for '
|
||||||
|
@ -5425,8 +5425,9 @@ begin
|
|||||||
if SaveAsFilename='' then
|
if SaveAsFilename='' then
|
||||||
SaveAsFilename:=lisnoname;
|
SaveAsFilename:=lisnoname;
|
||||||
|
|
||||||
//suggest lowercased name to user in order to avoid asking for lowercase name later
|
//suggest lowercased name if user wants so
|
||||||
SaveAsFilename:=LowerCase(SaveAsFilename);
|
if EnvironmentOptions.LowercaseDefaultFilename = true then
|
||||||
|
SaveAsFilename:=LowerCase(SaveAsFilename);
|
||||||
|
|
||||||
// let user choose a filename
|
// let user choose a filename
|
||||||
SaveDialog:=TSaveDialog.Create(nil);
|
SaveDialog:=TSaveDialog.Create(nil);
|
||||||
|
Loading…
Reference in New Issue
Block a user