mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-19 16:22:50 +02:00
replaced save as auto rename checkboxes with radiogroup from smace and mg
git-svn-id: trunk@6861 -
This commit is contained in:
parent
1fe900aedb
commit
b0df60b87e
@ -42,7 +42,7 @@ uses
|
|||||||
InputHistory, EditorOptions, Translations;
|
InputHistory, EditorOptions, Translations;
|
||||||
|
|
||||||
const
|
const
|
||||||
EnvOptsVersion: integer = 102;
|
EnvOptsVersion: integer = 103;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -95,6 +95,13 @@ type
|
|||||||
afaIgnore
|
afaIgnore
|
||||||
);
|
);
|
||||||
TAmbigiousFileActions = set of TAmbigiousFileAction;
|
TAmbigiousFileActions = set of TAmbigiousFileAction;
|
||||||
|
|
||||||
|
TCharCaseFileAction = (
|
||||||
|
ccfaAsk,
|
||||||
|
ccfaAutoRename,
|
||||||
|
ccfaIgnore
|
||||||
|
);
|
||||||
|
TCharCaseFileActions = set of TCharCaseFileAction;
|
||||||
|
|
||||||
const
|
const
|
||||||
AmbigiousFileActionNames: array[TAmbigiousFileAction] of string = (
|
AmbigiousFileActionNames: array[TAmbigiousFileAction] of string = (
|
||||||
@ -105,6 +112,11 @@ const
|
|||||||
'Ignore'
|
'Ignore'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CharCaseFileActionNames: array[TCharCaseFileAction] of string = (
|
||||||
|
'Ask',
|
||||||
|
'AutoRename',
|
||||||
|
'Ignore'
|
||||||
|
);
|
||||||
|
|
||||||
{ Environment Options }
|
{ Environment Options }
|
||||||
|
|
||||||
@ -200,10 +212,9 @@ type
|
|||||||
|
|
||||||
// naming conventions
|
// naming conventions
|
||||||
fPascalFileExtension: TPascalExtType;
|
fPascalFileExtension: TPascalExtType;
|
||||||
fPascalFileAutoLowerCase: boolean;
|
fCharcaseFileAction : TCharCaseFileAction;
|
||||||
fPascalFileAskLowerCase: boolean;
|
|
||||||
fAmbigiousFileAction: TAmbigiousFileAction;
|
fAmbigiousFileAction: TAmbigiousFileAction;
|
||||||
|
|
||||||
// language ID (see LazarusTranslations in translations.pas)
|
// language ID (see LazarusTranslations in translations.pas)
|
||||||
fLanguageID: string;
|
fLanguageID: string;
|
||||||
|
|
||||||
@ -363,13 +374,11 @@ type
|
|||||||
// naming conventions
|
// naming conventions
|
||||||
property PascalFileExtension: TPascalExtType read fPascalFileExtension
|
property PascalFileExtension: TPascalExtType read fPascalFileExtension
|
||||||
write fPascalFileExtension;
|
write fPascalFileExtension;
|
||||||
property PascalFileAutoLowerCase: boolean read fPascalFileAutoLowerCase
|
|
||||||
write fPascalFileAutoLowerCase;
|
|
||||||
property PascalFileAskLowerCase: boolean read fPascalFileAskLowerCase
|
|
||||||
write fPascalFileAskLowerCase;
|
|
||||||
property AmbigiousFileAction: TAmbigiousFileAction read fAmbigiousFileAction
|
property AmbigiousFileAction: TAmbigiousFileAction read fAmbigiousFileAction
|
||||||
write fAmbigiousFileAction;
|
write fAmbigiousFileAction;
|
||||||
|
property CharcaseFileAction: TCharCaseFileAction read fCharcaseFileAction
|
||||||
|
write fCharcaseFileAction;
|
||||||
|
|
||||||
// language
|
// language
|
||||||
property LanguageID: string read fLanguageID write fLanguageID;
|
property LanguageID: string read fLanguageID write fLanguageID;
|
||||||
|
|
||||||
@ -510,8 +519,7 @@ type
|
|||||||
|
|
||||||
// naming conventions
|
// naming conventions
|
||||||
PascalFileExtRadiogroup: TRadioGroup;
|
PascalFileExtRadiogroup: TRadioGroup;
|
||||||
PascalFileAutoLowercaseCheckBox: TCheckBox;
|
CharCaseFileActionRadioGroup: TRadioGroup;
|
||||||
PascalFileAskLowercaseCheckBox: TCheckBox;
|
|
||||||
AmbigiousFileActionRadioGroup: TRadioGroup;
|
AmbigiousFileActionRadioGroup: TRadioGroup;
|
||||||
|
|
||||||
// buttons at bottom
|
// buttons at bottom
|
||||||
@ -598,6 +606,7 @@ var
|
|||||||
function DebuggerNameToType(const s: string): TDebuggerType;
|
function DebuggerNameToType(const s: string): TDebuggerType;
|
||||||
function PascalExtToType(const Ext: string): TPascalExtType;
|
function PascalExtToType(const Ext: string): TPascalExtType;
|
||||||
function AmbigiousFileActionNameToType(const Action: string): TAmbigiousFileAction;
|
function AmbigiousFileActionNameToType(const Action: string): TAmbigiousFileAction;
|
||||||
|
function CharCaseFileActionNameToType(const Action: string): TCharCaseFileAction;
|
||||||
|
|
||||||
function CheckFileChanged(const OldFilename, NewFilename: string): boolean;
|
function CheckFileChanged(const OldFilename, NewFilename: string): boolean;
|
||||||
function CheckExecutable(const OldFilename, NewFilename: string;
|
function CheckExecutable(const OldFilename, NewFilename: string;
|
||||||
@ -628,7 +637,7 @@ end;
|
|||||||
function DebuggerNameToType(const s: string): TDebuggerType;
|
function DebuggerNameToType(const s: string): TDebuggerType;
|
||||||
begin
|
begin
|
||||||
for Result:=Low(TDebuggerType) to High(TDebuggerType) do
|
for Result:=Low(TDebuggerType) to High(TDebuggerType) do
|
||||||
if AnsiCompareText(DebuggerName[Result],s)=0 then exit;
|
if CompareText(DebuggerName[Result],s)=0 then exit;
|
||||||
Result:=dtNone;
|
Result:=dtNone;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -644,12 +653,23 @@ function AmbigiousFileActionNameToType(
|
|||||||
const Action: string): TAmbigiousFileAction;
|
const Action: string): TAmbigiousFileAction;
|
||||||
begin
|
begin
|
||||||
for Result:=Low(TAmbigiousFileAction) to High(TAmbigiousFileAction) do begin
|
for Result:=Low(TAmbigiousFileAction) to High(TAmbigiousFileAction) do begin
|
||||||
if AnsiCompareText(AmbigiousFileActionNames[Result],Action)=0 then
|
if CompareText(AmbigiousFileActionNames[Result],Action)=0 then
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
Result:=afaAsk;
|
Result:=afaAsk;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function CharCaseFileActionNameToType(
|
||||||
|
const Action: string): TCharCaseFileAction;
|
||||||
|
begin
|
||||||
|
for Result:=Low(TCharCaseFileAction) to High(TCharCaseFileAction) do begin
|
||||||
|
if CompareText(CharCaseFileActionNames[Result],Action)=0 then
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
Result:=ccfaAutoRename;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function CheckFileChanged(const OldFilename,
|
function CheckFileChanged(const OldFilename,
|
||||||
NewFilename: string): boolean;
|
NewFilename: string): boolean;
|
||||||
begin
|
begin
|
||||||
@ -836,8 +856,7 @@ begin
|
|||||||
|
|
||||||
// naming
|
// naming
|
||||||
fPascalFileExtension:=petPAS;
|
fPascalFileExtension:=petPAS;
|
||||||
fPascalFileAutoLowerCase:=false;
|
fCharcaseFileAction:=ccfaAutoRename;
|
||||||
fPascalFileAskLowerCase:=true;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TEnvironmentOptions.Destroy;
|
destructor TEnvironmentOptions.Destroy;
|
||||||
@ -1108,10 +1127,20 @@ begin
|
|||||||
|
|
||||||
// naming
|
// naming
|
||||||
LoadPascalFileExt(Path+'');
|
LoadPascalFileExt(Path+'');
|
||||||
fPascalFileAutoLowerCase:=XMLConfig.GetValue(
|
|
||||||
Path+'PascalFileAutoLowerCase/Value',false);
|
if FileVersion>=103 then begin
|
||||||
fPascalFileAskLowerCase:=XMLConfig.GetValue(
|
fCharcaseFileAction:=CharCaseFileActionNameToType(XMLConfig.GetValue(
|
||||||
Path+'PascalFileAskLowerCase/Value',true);
|
Path+'CharcaseFileAction/Value',''));
|
||||||
|
end else begin
|
||||||
|
if XMLConfig.GetValue(Path+'PascalFileAskLowerCase/Value',true) then
|
||||||
|
fCharcaseFileAction:=ccfaAsk
|
||||||
|
else if XMLConfig.GetValue(Path+'PascalFileAutoLowerCase/Value',false)
|
||||||
|
then
|
||||||
|
fCharcaseFileAction:=ccfaAutoRename
|
||||||
|
else
|
||||||
|
fCharcaseFileAction:=ccfaIgnore;
|
||||||
|
end;
|
||||||
|
|
||||||
fAmbigiousFileAction:=AmbigiousFileActionNameToType(XMLConfig.GetValue(
|
fAmbigiousFileAction:=AmbigiousFileActionNameToType(XMLConfig.GetValue(
|
||||||
Path+'AmbigiousFileAction/Value',
|
Path+'AmbigiousFileAction/Value',
|
||||||
AmbigiousFileActionNames[fAmbigiousFileAction]));
|
AmbigiousFileActionNames[fAmbigiousFileAction]));
|
||||||
@ -1308,12 +1337,10 @@ begin
|
|||||||
fExternalTools.Save(XMLConfig,Path+'ExternalTools/');
|
fExternalTools.Save(XMLConfig,Path+'ExternalTools/');
|
||||||
|
|
||||||
// naming
|
// naming
|
||||||
XMLConfig.SetDeleteValue(Path+'Naming/PascalFileExtension',
|
XMLConfig.SetDeleteValue( Path+'Naming/PascalFileExtension', PascalExtension[fPascalFileExtension],'.pas');
|
||||||
PascalExtension[fPascalFileExtension],'.pas');
|
|
||||||
XMLConfig.SetDeleteValue(Path+'PascalFileAutoLowerCase/Value',
|
XMLConfig.SetDeleteValue( Path+'CharcaseFileAction/Value', ord(fCharcaseFileAction), ord(ccfaAutoRename));
|
||||||
fPascalFileAutoLowerCase,false);
|
|
||||||
XMLConfig.SetDeleteValue(Path+'PascalFileAskLowerCase/Value',
|
|
||||||
fPascalFileAskLowerCase,true);
|
|
||||||
XMLConfig.SetDeleteValue(Path+'AutoDeleteAmbigiousSources/Value',
|
XMLConfig.SetDeleteValue(Path+'AutoDeleteAmbigiousSources/Value',
|
||||||
AmbigiousFileActionNames[fAmbigiousFileAction],
|
AmbigiousFileActionNames[fAmbigiousFileAction],
|
||||||
AmbigiousFileActionNames[afaAsk]);
|
AmbigiousFileActionNames[afaAsk]);
|
||||||
@ -2667,17 +2694,15 @@ end;
|
|||||||
procedure TEnvironmentOptionsDialog.SetupNamingPage(Page: integer);
|
procedure TEnvironmentOptionsDialog.SetupNamingPage(Page: integer);
|
||||||
var
|
var
|
||||||
pe: TPascalExtType;
|
pe: TPascalExtType;
|
||||||
|
Space: Integer;
|
||||||
begin
|
begin
|
||||||
NoteBook.Page[Page].OnResize:=@OnNamingPageResize;
|
NoteBook.Page[Page].OnResize:=@OnNamingPageResize;
|
||||||
|
Space:=5;
|
||||||
|
|
||||||
PascalFileExtRadiogroup:=TRadioGroup.Create(Self);
|
PascalFileExtRadiogroup:=TRadioGroup.Create(Self);
|
||||||
with PascalFileExtRadiogroup do begin
|
with PascalFileExtRadiogroup do begin
|
||||||
Name:='PascalFileExtRadiogroup';
|
Name:='PascalFileExtRadiogroup';
|
||||||
Left:=5;
|
SetBounds(Space,Space,300,80);
|
||||||
Top:=4;
|
|
||||||
Width:=200;
|
|
||||||
Height:=80;
|
|
||||||
Parent:=NoteBook.Page[Page];
|
|
||||||
Caption:=dlgPasExt;
|
Caption:=dlgPasExt;
|
||||||
with Items do begin
|
with Items do begin
|
||||||
BeginUpdate;
|
BeginUpdate;
|
||||||
@ -2686,39 +2711,32 @@ begin
|
|||||||
Add(PascalExtension[pe]);
|
Add(PascalExtension[pe]);
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Visible:=true;
|
Parent:=NoteBook.Page[Page];
|
||||||
|
AnchorParallel(akRight,Space,Parent);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
PascalFileAutoLowercaseCheckBox:=TCheckBox.Create(Self);
|
CharcaseFileActionRadioGroup:=TRadioGroup.Create(Self);
|
||||||
with PascalFileAutoLowercaseCheckBox do begin
|
with CharcaseFileActionRadioGroup do begin
|
||||||
Name:='PascalFileAutoLowercaseCheckBox';
|
Name:='CharcaseFileActionRadioGroup';
|
||||||
Left:=PascalFileExtRadiogroup.Left;
|
Caption:=dlgCharCaseFileAct;
|
||||||
Top:=PascalFileExtRadiogroup.Top+PascalFileExtRadiogroup.Height+10;
|
with Items do begin
|
||||||
Width:=300;
|
BeginUpdate;
|
||||||
|
Add(dlgEnvAsk);
|
||||||
|
Add(dlgAutoRen);
|
||||||
|
Add(dlgnoAutomaticRenaming);
|
||||||
|
EndUpdate;
|
||||||
|
end;
|
||||||
|
Height:=95;
|
||||||
|
AnchorParallel(akLeft,0,PascalFileExtRadiogroup);
|
||||||
|
AnchorParallel(akRight,0,PascalFileExtRadiogroup);
|
||||||
|
AnchorToNeighbour(akTop,Space,PascalFileExtRadiogroup);
|
||||||
Parent:=NoteBook.Page[Page];
|
Parent:=NoteBook.Page[Page];
|
||||||
Caption:=Format(dlgPasAutoLower,['"','"']);
|
|
||||||
Visible:=true;
|
|
||||||
end;
|
|
||||||
|
|
||||||
PascalFileAskLowercaseCheckBox:=TCheckBox.Create(Self);
|
|
||||||
with PascalFileAskLowercaseCheckBox do begin
|
|
||||||
Name:='PascalFileAskLowercaseCheckBox';
|
|
||||||
Left:=PascalFileAutoLowercaseCheckBox.Left;
|
|
||||||
Top:=PascalFileAutoLowercaseCheckBox.Top+PascalFileAutoLowercaseCheckBox.Height+10;
|
|
||||||
Width:=300;
|
|
||||||
Parent:=NoteBook.Page[Page];
|
|
||||||
Caption:=Format(dlgPasAskLower,['"','"']);
|
|
||||||
Visible:=true;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
AmbigiousFileActionRadioGroup:=TRadioGroup.Create(Self);
|
AmbigiousFileActionRadioGroup:=TRadioGroup.Create(Self);
|
||||||
with AmbigiousFileActionRadioGroup do begin
|
with AmbigiousFileActionRadioGroup do begin
|
||||||
Name:='AmbigiousFileActionRadioGroup';
|
Name := 'AmbigiousFileActionRadioGroup';
|
||||||
Left:=PascalFileAskLowercaseCheckBox.Left;
|
Height:=150;
|
||||||
Top:=PascalFileAskLowercaseCheckBox.Top+PascalFileAskLowercaseCheckBox.Height+15;
|
|
||||||
Width:=200;
|
|
||||||
Height:=130;
|
|
||||||
Parent:=NoteBook.Page[Page];
|
|
||||||
Caption:=dlgAmbigFileAct;
|
Caption:=dlgAmbigFileAct;
|
||||||
with Items do begin
|
with Items do begin
|
||||||
BeginUpdate;
|
BeginUpdate;
|
||||||
@ -2729,7 +2747,10 @@ begin
|
|||||||
Add(dlgIgnoreVerb);
|
Add(dlgIgnoreVerb);
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Visible:=true;
|
Parent:=NoteBook.Page[Page];
|
||||||
|
AnchorParallel(akLeft,0,CharcaseFileActionRadioGroup);
|
||||||
|
AnchorParallel(akRight,0,CharcaseFileActionRadioGroup);
|
||||||
|
AnchorToNeighbour(akTop,Space,CharcaseFileActionRadioGroup);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2998,31 +3019,6 @@ end;
|
|||||||
|
|
||||||
procedure TEnvironmentOptionsDialog.ResizeNamingPage;
|
procedure TEnvironmentOptionsDialog.ResizeNamingPage;
|
||||||
begin
|
begin
|
||||||
with PascalFileExtRadiogroup do begin
|
|
||||||
Left:=5;
|
|
||||||
Top:=4;
|
|
||||||
Width:=200;
|
|
||||||
Height:=80;
|
|
||||||
end;
|
|
||||||
|
|
||||||
with PascalFileAutoLowercaseCheckBox do begin
|
|
||||||
Left:=PascalFileExtRadiogroup.Left;
|
|
||||||
Top:=PascalFileExtRadiogroup.Top+PascalFileExtRadiogroup.Height+10;
|
|
||||||
Width:=300;
|
|
||||||
end;
|
|
||||||
|
|
||||||
with PascalFileAskLowercaseCheckBox do begin
|
|
||||||
Left:=PascalFileAutoLowercaseCheckBox.Left;
|
|
||||||
Top:=PascalFileAutoLowercaseCheckBox.Top+PascalFileAutoLowercaseCheckBox.Height+10;
|
|
||||||
Width:=300;
|
|
||||||
end;
|
|
||||||
|
|
||||||
with AmbigiousFileActionRadioGroup do begin
|
|
||||||
Left:=PascalFileAskLowercaseCheckBox.Left;
|
|
||||||
Top:=PascalFileAskLowercaseCheckBox.Top+PascalFileAskLowercaseCheckBox.Height+15;
|
|
||||||
Width:=200;
|
|
||||||
Height:=130;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TEnvironmentOptionsDialog.EnvironmentOptionsDialogResize(
|
procedure TEnvironmentOptionsDialog.EnvironmentOptionsDialogResize(
|
||||||
@ -3730,9 +3726,9 @@ begin
|
|||||||
for i:=0 to PascalFileExtRadiogroup.Items.Count-1 do
|
for i:=0 to PascalFileExtRadiogroup.Items.Count-1 do
|
||||||
if PascalFileExtRadiogroup.Items[i]=PascalExtension[PascalFileExtension]
|
if PascalFileExtRadiogroup.Items[i]=PascalExtension[PascalFileExtension]
|
||||||
then PascalFileExtRadiogroup.ItemIndex:=i;
|
then PascalFileExtRadiogroup.ItemIndex:=i;
|
||||||
PascalFileAutoLowercaseCheckBox.Checked:=PascalFileAutoLowerCase;
|
|
||||||
PascalFileAskLowercaseCheckBox.Checked:=PascalFileAskLowerCase;
|
CharCaseFileActionRadioGroup.ItemIndex := ord(CharCaseFileAction);
|
||||||
AmbigiousFileActionRadioGroup.ItemIndex:=ord(AmbigiousFileAction);
|
AmbigiousFileActionRadioGroup.ItemIndex := ord(AmbigiousFileAction);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3860,10 +3856,9 @@ begin
|
|||||||
PascalFileExtRadiogroup.Items[PascalFileExtRadiogroup.ItemIndex])
|
PascalFileExtRadiogroup.Items[PascalFileExtRadiogroup.ItemIndex])
|
||||||
else
|
else
|
||||||
PascalFileExtension:=petPAS;
|
PascalFileExtension:=petPAS;
|
||||||
PascalFileAutoLowerCase:=PascalFileAutoLowercaseCheckBox.Checked;
|
|
||||||
PascalFileAskLowerCase:=PascalFileAskLowercaseCheckBox.Checked;
|
CharcaseFileAction := TCharCaseFileAction(CharcaseFileActionRadioGroup.ItemIndex);
|
||||||
AmbigiousFileAction:=
|
AmbigiousFileAction := TAmbigiousFileAction(AmbigiousFileActionRadioGroup.ItemIndex);
|
||||||
TAmbigiousFileAction(AmbigiousFileActionRadioGroup.ItemIndex);
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -709,12 +709,13 @@ resourcestring
|
|||||||
dlgRubberbandSelectsGrandChilds = 'Select grand childs';
|
dlgRubberbandSelectsGrandChilds = 'Select grand childs';
|
||||||
dlgRubberBandGroup='Rubber band';
|
dlgRubberBandGroup='Rubber band';
|
||||||
dlgPasExt = 'Default pascal extension';
|
dlgPasExt = 'Default pascal extension';
|
||||||
dlgPasAutoLower = '%sSave As%s always saves pascal files lowercase';
|
dlgCharCaseFileAct = 'Save As - auto rename pascal files lower case';
|
||||||
dlgPasAskLower = '%sSave As%s asks to save pascal files lowercase';
|
|
||||||
dlgAmbigFileAct = 'Ambigious file action:';
|
dlgAmbigFileAct = 'Ambigious file action:';
|
||||||
dlgEnvAsk = 'Ask';
|
dlgEnvAsk = 'Ask';
|
||||||
dlgAutoDel = 'Auto delete file';
|
dlgAutoDel = 'Auto delete file';
|
||||||
dlgAutoRen = 'Auto rename file';
|
dlgAutoRen = 'Auto rename file lowercase';
|
||||||
|
dlgnoAutomaticRenaming = 'no automatic renaming';
|
||||||
dlgAmbigWarn = 'Warn on compile';
|
dlgAmbigWarn = 'Warn on compile';
|
||||||
dlgIgnoreVerb = 'Ignore';
|
dlgIgnoreVerb = 'Ignore';
|
||||||
dlgBackColor = 'Background color';
|
dlgBackColor = 'Background color';
|
||||||
|
21
ide/main.pp
21
ide/main.pp
@ -3202,14 +3202,15 @@ begin
|
|||||||
RaiseException('');
|
RaiseException('');
|
||||||
end;
|
end;
|
||||||
//debugln('TMainIDE.CreateNewCodeBuffer NewFilename=',NewFilename,' NewUnitName=',NewUnitName);
|
//debugln('TMainIDE.CreateNewCodeBuffer NewFilename=',NewFilename,' NewUnitName=',NewUnitName);
|
||||||
|
|
||||||
if FilenameIsPascalUnit(NewFilename) then begin
|
if FilenameIsPascalUnit(NewFilename) then begin
|
||||||
if NewUnitName='' then
|
if NewUnitName='' then
|
||||||
NewUnitName:=ExtractFileNameOnly(NewFilename);
|
NewUnitName:=ExtractFileNameOnly(NewFilename);
|
||||||
if EnvironmentOptions.PascalFileAutoLowerCase
|
if EnvironmentOptions.CharcaseFileAction in [ccfaAsk, ccfaAutoRename] then
|
||||||
or EnvironmentOptions.PascalFileAskLowerCase then
|
|
||||||
NewFilename:=ExtractFilePath(NewFilename)
|
NewFilename:=ExtractFilePath(NewFilename)
|
||||||
+lowercase(ExtractFileName(NewFilename));
|
+lowercase(ExtractFileName(NewFilename));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
NewCodeBuffer:=CodeToolBoss.CreateFile(NewFilename);
|
NewCodeBuffer:=CodeToolBoss.CreateFile(NewFilename);
|
||||||
if NewCodeBuffer<>nil then
|
if NewCodeBuffer<>nil then
|
||||||
Result:=mrOk
|
Result:=mrOk
|
||||||
@ -3431,19 +3432,21 @@ begin
|
|||||||
if FilenameIsPascalUnit(NewFilename) then begin
|
if FilenameIsPascalUnit(NewFilename) then begin
|
||||||
FileWithoutPath:=ExtractFileName(NewFilename);
|
FileWithoutPath:=ExtractFileName(NewFilename);
|
||||||
// check if file should be auto renamed
|
// check if file should be auto renamed
|
||||||
if EnvironmentOptions.PascalFileAskLowerCase then begin
|
|
||||||
|
|
||||||
|
if EnvironmentOptions.CharcaseFileAction = ccfaAsk then begin
|
||||||
if lowercase(FileWithoutPath)<>FileWithoutPath
|
if lowercase(FileWithoutPath)<>FileWithoutPath
|
||||||
then begin
|
then begin
|
||||||
Result:=MessageDlg(lisRenameFile,
|
Result:=MessageDlg(lisRenameFile,
|
||||||
Format(lisThisLooksLikeAPascalFileFpc10XExpectsPascalFiles, [#13, #13
|
Format(lisThisLooksLikeAPascalFileFpc10XExpectsPascalFiles, [#13, #13]),
|
||||||
]),
|
|
||||||
mtWarning,[mbYes,mbNo],0);
|
mtWarning,[mbYes,mbNo],0);
|
||||||
if Result=mrYes then
|
if Result=mrYes then
|
||||||
NewFileName:=ExtractFilePath(NewFilename)+lowercase(FileWithoutPath);
|
NewFileName:=ExtractFilePath(NewFilename)+lowercase(FileWithoutPath);
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
if EnvironmentOptions.PascalFileAutoLowerCase then
|
|
||||||
|
if EnvironmentOptions.CharcaseFileAction = ccfaAutoRename then
|
||||||
NewFileName:=ExtractFilePath(NewFilename)+lowercase(FileWithoutPath);
|
NewFileName:=ExtractFilePath(NewFilename)+lowercase(FileWithoutPath);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -4401,7 +4404,8 @@ begin
|
|||||||
|
|
||||||
// apply naming conventions
|
// apply naming conventions
|
||||||
NewProgramName:=ExtractFileNameOnly(NewFilename);
|
NewProgramName:=ExtractFileNameOnly(NewFilename);
|
||||||
if EnvironmentOptions.PascalFileAutoLowerCase then
|
|
||||||
|
if EnvironmentOptions.CharcaseFileAction = ccfaAutoRename then
|
||||||
NewFileName:=ExtractFilePath(NewFilename)
|
NewFileName:=ExtractFilePath(NewFilename)
|
||||||
+lowercase(ExtractFileName(NewFilename));
|
+lowercase(ExtractFileName(NewFilename));
|
||||||
|
|
||||||
@ -11418,6 +11422,9 @@ end.
|
|||||||
|
|
||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.850 2005/02/28 17:24:18 mattias
|
||||||
|
replaced save as auto rename checkboxes with radiogroup from smace and mg
|
||||||
|
|
||||||
Revision 1.849 2005/02/28 16:52:24 mattias
|
Revision 1.849 2005/02/28 16:52:24 mattias
|
||||||
TApplication now frees only its components before finalization, not itself
|
TApplication now frees only its components before finalization, not itself
|
||||||
|
|
||||||
|
@ -1676,9 +1676,10 @@ begin
|
|||||||
|
|
||||||
// create filename
|
// create filename
|
||||||
NewFileName:=NewUnitName;
|
NewFileName:=NewUnitName;
|
||||||
if EnvironmentOptions.PascalFileAutoLowerCase
|
|
||||||
or EnvironmentOptions.PascalFileAskLowerCase then
|
if EnvironmentOptions.CharcaseFileAction in [ccfaAsk, ccfaAutoRename] then
|
||||||
NewFileName:=lowercase(NewFileName);
|
NewFileName:=lowercase(NewFileName);
|
||||||
|
|
||||||
// append pascal file extension
|
// append pascal file extension
|
||||||
NewFileName:=NewFileName+
|
NewFileName:=NewFileName+
|
||||||
+EnvironmentOpts.PascalExtension[EnvironmentOptions.PascalFileExtension];
|
+EnvironmentOpts.PascalExtension[EnvironmentOptions.PascalFileExtension];
|
||||||
|
@ -827,19 +827,22 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// apply naming conventions
|
// apply naming conventions
|
||||||
if lowercase(NewPkgName)<>NewPkgName then begin
|
|
||||||
LowerFilename:=ExtractFilePath(NewFilename)
|
if lowercase(NewPkgName) <> NewPkgName then
|
||||||
+lowercase(ExtractFileName(NewFilename));
|
begin
|
||||||
if EnvironmentOptions.PascalFileAskLowerCase then begin
|
LowerFilename:=ExtractFilePath(NewFilename)+lowercase(ExtractFileName(NewFilename));
|
||||||
|
if EnvironmentOptions.CharcaseFileAction = ccfaAsk then
|
||||||
|
begin
|
||||||
if MessageDlg(lisPkgMangRenameFileLowercase,
|
if MessageDlg(lisPkgMangRenameFileLowercase,
|
||||||
Format(lisPkgMangShouldTheFileRenamedLowercaseTo, [#13, '"',
|
Format(lisPkgMangShouldTheFileRenamedLowercaseTo, [#13, '"',
|
||||||
LowerFilename, '"']),
|
LowerFilename, '"']),
|
||||||
mtConfirmation,[mbYes,mbNo],0)=mrYes
|
mtConfirmation,[mbYes,mbNo],0)=mrYes
|
||||||
then
|
then
|
||||||
NewFileName:=LowerFilename;
|
NewFileName:=LowerFilename;
|
||||||
end else begin
|
end
|
||||||
if EnvironmentOptions.PascalFileAutoLowerCase then
|
else
|
||||||
NewFileName:=LowerFilename;
|
begin
|
||||||
|
if EnvironmentOptions.CharcaseFileAction = ccfaAutoRename then NewFileName:=LowerFilename;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user