mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 15:39:20 +02:00
readonly flag is now only saved if user set
git-svn-id: trunk@2878 -
This commit is contained in:
parent
3b59085bad
commit
47373ab7da
19
ide/main.pp
19
ide/main.pp
@ -227,6 +227,7 @@ type
|
|||||||
var NewTopLine, NewPageIndex: integer; Action: TJumpHistoryAction);
|
var NewTopLine, NewPageIndex: integer; Action: TJumpHistoryAction);
|
||||||
procedure OnSrcNotebookMovingPage(Sender: TObject;
|
procedure OnSrcNotebookMovingPage(Sender: TObject;
|
||||||
OldPageIndex, NewPageIndex: integer);
|
OldPageIndex, NewPageIndex: integer);
|
||||||
|
procedure OnSrcNotebookReadOnlyChanged(Sender : TObject);
|
||||||
procedure OnSrcNotebookSaveAll(Sender : TObject);
|
procedure OnSrcNotebookSaveAll(Sender : TObject);
|
||||||
procedure OnSrcNotebookShowHintForSource(SrcEdit: TSourceEditor;
|
procedure OnSrcNotebookShowHintForSource(SrcEdit: TSourceEditor;
|
||||||
ClientPos: TPoint; CaretPos: TPoint);
|
ClientPos: TPoint; CaretPos: TPoint);
|
||||||
@ -1130,6 +1131,7 @@ begin
|
|||||||
SourceNotebook.OnOpenClicked := @OnSrcNotebookFileOpen;
|
SourceNotebook.OnOpenClicked := @OnSrcNotebookFileOpen;
|
||||||
SourceNotebook.OnOpenFileAtCursorClicked := @OnSrcNotebookFileOpenAtCursor;
|
SourceNotebook.OnOpenFileAtCursorClicked := @OnSrcNotebookFileOpenAtCursor;
|
||||||
SourceNotebook.OnProcessUserCommand := @OnProcessIDECommand;
|
SourceNotebook.OnProcessUserCommand := @OnProcessIDECommand;
|
||||||
|
SourceNotebook.OnReadOnlyChanged := @OnSrcNotebookReadOnlyChanged;
|
||||||
SourceNotebook.OnSaveClicked := @OnSrcNotebookFileSave;
|
SourceNotebook.OnSaveClicked := @OnSrcNotebookFileSave;
|
||||||
SourceNotebook.OnSaveAsClicked := @OnSrcNotebookFileSaveAs;
|
SourceNotebook.OnSaveAsClicked := @OnSrcNotebookFileSaveAs;
|
||||||
SourceNotebook.OnSaveAllClicked := @OnSrcNotebookSaveAll;
|
SourceNotebook.OnSaveAllClicked := @OnSrcNotebookSaveAll;
|
||||||
@ -3784,7 +3786,6 @@ begin
|
|||||||
UpdateSourceNames;
|
UpdateSourceNames;
|
||||||
|
|
||||||
// if file is readonly then a simple Save is skipped
|
// if file is readonly then a simple Save is skipped
|
||||||
ActiveUnitInfo.ReadOnly:=ActiveSrcEdit.ReadOnly;
|
|
||||||
if (ActiveUnitInfo.ReadOnly) and ([sfSaveToTestDir,sfSaveAs]*Flags=[]) then
|
if (ActiveUnitInfo.ReadOnly) and ([sfSaveToTestDir,sfSaveAs]*Flags=[]) then
|
||||||
begin
|
begin
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
@ -3879,7 +3880,6 @@ begin
|
|||||||
FLastFormActivated:=nil;
|
FLastFormActivated:=nil;
|
||||||
|
|
||||||
// save some meta data of the source
|
// save some meta data of the source
|
||||||
ActiveUnitInfo.ReadOnly:=ActiveSrcEdit.ReadOnly;
|
|
||||||
ActiveUnitInfo.TopLine:=ActiveSrcEdit.EditorComponent.TopLine;
|
ActiveUnitInfo.TopLine:=ActiveSrcEdit.EditorComponent.TopLine;
|
||||||
ActiveUnitInfo.CursorPos:=ActiveSrcEdit.EditorComponent.CaretXY;
|
ActiveUnitInfo.CursorPos:=ActiveSrcEdit.EditorComponent.CaretXY;
|
||||||
|
|
||||||
@ -4021,8 +4021,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// check readonly
|
// check readonly
|
||||||
NewUnitInfo.ReadOnly:=NewUnitInfo.ReadOnly
|
NewUnitInfo.FileReadOnly:=(not FileIsWritable(NewUnitInfo.Filename));
|
||||||
or (not FileIsWritable(NewUnitInfo.Filename));
|
|
||||||
|
|
||||||
{$IFDEF IDE_DEBUG}
|
{$IFDEF IDE_DEBUG}
|
||||||
writeln('[TMainIDE.DoOpenEditorFile] B');
|
writeln('[TMainIDE.DoOpenEditorFile] B');
|
||||||
@ -7259,6 +7258,15 @@ begin
|
|||||||
Project1.MoveEditorIndex(OldPageIndex,NewPageIndex);
|
Project1.MoveEditorIndex(OldPageIndex,NewPageIndex);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainIDE.OnSrcNotebookReadOnlyChanged(Sender: TObject);
|
||||||
|
var
|
||||||
|
ActiveSourceEditor: TSourceEditor;
|
||||||
|
ActiveUnitInfo: TUnitInfo;
|
||||||
|
begin
|
||||||
|
GetCurrentUnit(ActiveSourceEditor,ActiveUnitInfo);
|
||||||
|
ActiveUnitInfo.UserReadOnly:=ActiveSourceEditor.ReadOnly;
|
||||||
|
end;
|
||||||
|
|
||||||
Procedure TMainIDE.OnSrcNotebookViewJumpHistory(Sender : TObject);
|
Procedure TMainIDE.OnSrcNotebookViewJumpHistory(Sender : TObject);
|
||||||
begin
|
begin
|
||||||
// ToDo
|
// ToDo
|
||||||
@ -7762,6 +7770,9 @@ end.
|
|||||||
|
|
||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.469 2003/02/26 12:44:52 mattias
|
||||||
|
readonly flag is now only saved if user set
|
||||||
|
|
||||||
Revision 1.468 2003/02/24 11:51:44 mattias
|
Revision 1.468 2003/02/24 11:51:44 mattias
|
||||||
combobox height can now be set, added OI item height option
|
combobox height can now be set, added OI item height option
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user