mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 18:39:10 +02:00
fixed readonly check and added script to quick create lazarus snapshot
git-svn-id: trunk@2884 -
This commit is contained in:
parent
adb29449ee
commit
fa463fcf07
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -724,5 +724,6 @@ tools/apiwizz/apiwizz.pp svneol=native#text/pascal
|
|||||||
tools/install/create_fpc_export_tgz.sh -text svneol=native#application/x-sh
|
tools/install/create_fpc_export_tgz.sh -text svneol=native#application/x-sh
|
||||||
tools/install/create_fpc_rpm.sh -text svneol=native#application/x-sh
|
tools/install/create_fpc_rpm.sh -text svneol=native#application/x-sh
|
||||||
tools/install/create_fpcsrc-1.1_rpm.sh -text svneol=native#application/x-sh
|
tools/install/create_fpcsrc-1.1_rpm.sh -text svneol=native#application/x-sh
|
||||||
|
tools/install/create_lazarus_tgz_from_local_dir.sh -text svneol=native#application/x-sh
|
||||||
tools/lazarusmake.ini svneol=native#text/plain
|
tools/lazarusmake.ini svneol=native#text/plain
|
||||||
tools/lazres.pp svneol=native#text/pascal
|
tools/lazres.pp svneol=native#text/pascal
|
||||||
|
40
ide/main.pp
40
ide/main.pp
@ -426,7 +426,7 @@ type
|
|||||||
function DoNewProject(NewProjectType:TProjectType):TModalResult;
|
function DoNewProject(NewProjectType:TProjectType):TModalResult;
|
||||||
function DoSaveProject(Flags: TSaveFlags):TModalResult;
|
function DoSaveProject(Flags: TSaveFlags):TModalResult;
|
||||||
function DoCloseProject:TModalResult;
|
function DoCloseProject:TModalResult;
|
||||||
function DoOpenProjectFile(AFileName:string):TModalResult;
|
function DoOpenProjectFile(AFileName:string; Flags: TOpenFlags):TModalResult;
|
||||||
function DoPublishProject(Flags: TSaveFlags;
|
function DoPublishProject(Flags: TSaveFlags;
|
||||||
ShowDialog: boolean):TModalResult;
|
ShowDialog: boolean):TModalResult;
|
||||||
function DoAddActiveUnitToProject: TModalResult;
|
function DoAddActiveUnitToProject: TModalResult;
|
||||||
@ -1224,11 +1224,11 @@ begin
|
|||||||
// load command line project or last project or create a new project
|
// load command line project or last project or create a new project
|
||||||
if (ParamCount>0) and (ParamStr(ParamCount)[1]<>'-')
|
if (ParamCount>0) and (ParamStr(ParamCount)[1]<>'-')
|
||||||
and (ExtractFileExt(ParamStr(ParamCount))='.lpi')
|
and (ExtractFileExt(ParamStr(ParamCount))='.lpi')
|
||||||
and (DoOpenProjectFile(ParamStr(ParamCount))=mrOk) then
|
and (DoOpenProjectFile(ParamStr(ParamCount),[])=mrOk) then
|
||||||
// command line project loaded
|
// command line project loaded
|
||||||
else if (EnvironmentOptions.OpenLastprojectAtStart)
|
else if (EnvironmentOptions.OpenLastprojectAtStart)
|
||||||
and (FileExists(EnvironmentOptions.LastSavedProjectFile))
|
and (FileExists(EnvironmentOptions.LastSavedProjectFile))
|
||||||
and (DoOpenProjectFile(EnvironmentOptions.LastSavedProjectFile)=mrOk) then
|
and (DoOpenProjectFile(EnvironmentOptions.LastSavedProjectFile,[])=mrOk) then
|
||||||
begin
|
begin
|
||||||
// last project loaded
|
// last project loaded
|
||||||
{$IFDEF IDE_DEBUG}
|
{$IFDEF IDE_DEBUG}
|
||||||
@ -1939,11 +1939,7 @@ begin
|
|||||||
if Index<SeparatorIndex then begin
|
if Index<SeparatorIndex then begin
|
||||||
// open recent project
|
// open recent project
|
||||||
AFilename:=EnvironmentOptions.RecentProjectFiles[Index];
|
AFilename:=EnvironmentOptions.RecentProjectFiles[Index];
|
||||||
if DoOpenProjectFile(AFileName)=mrOk then begin
|
DoOpenProjectFile(AFileName,[ofAddToRecent]);
|
||||||
EnvironmentOptions.AddToRecentProjectFiles(AFileName);
|
|
||||||
SetRecentProjectFilesMenu;
|
|
||||||
SaveEnvironment;
|
|
||||||
end;
|
|
||||||
end else begin
|
end else begin
|
||||||
// open recent file
|
// open recent file
|
||||||
dec(Index, SeparatorIndex+1);
|
dec(Index, SeparatorIndex+1);
|
||||||
@ -2114,9 +2110,7 @@ begin
|
|||||||
OpenDialog.Filter := 'Lazarus Project Info (*.lpi)|*.lpi|All Files|*.*';
|
OpenDialog.Filter := 'Lazarus Project Info (*.lpi)|*.lpi|All Files|*.*';
|
||||||
if OpenDialog.Execute then begin
|
if OpenDialog.Execute then begin
|
||||||
AFilename:=ExpandFilename(OpenDialog.Filename);
|
AFilename:=ExpandFilename(OpenDialog.Filename);
|
||||||
if DoOpenProjectFile(AFilename)=mrOk then begin
|
DoOpenProjectFile(AFilename,[ofAddToRecent]);
|
||||||
AddRecentFileToEnvironment(AFilename);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
InputHistories.StoreFileDialogSettings(OpenDialog);
|
InputHistories.StoreFileDialogSettings(OpenDialog);
|
||||||
finally
|
finally
|
||||||
@ -2124,7 +2118,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end else if Sender is TMenuItem then begin
|
end else if Sender is TMenuItem then begin
|
||||||
AFileName:=ExpandFilename(TMenuItem(Sender).Caption);
|
AFileName:=ExpandFilename(TMenuItem(Sender).Caption);
|
||||||
if DoOpenProjectFile(AFilename)=mrOk then begin
|
if DoOpenProjectFile(AFilename,[ofAddToRecent])=mrOk then begin
|
||||||
AddRecentFileToEnvironment(AFilename);
|
AddRecentFileToEnvironment(AFilename);
|
||||||
end else begin
|
end else begin
|
||||||
// open failed
|
// open failed
|
||||||
@ -3158,7 +3152,7 @@ begin
|
|||||||
if ([ofProjectLoading,ofRegularFile]*Flags<>[]) and (ToolStatus=itNone)
|
if ([ofProjectLoading,ofRegularFile]*Flags<>[]) and (ToolStatus=itNone)
|
||||||
and (Ext='.lpi') then begin
|
and (Ext='.lpi') then begin
|
||||||
// this is a project info file -> load whole project
|
// this is a project info file -> load whole project
|
||||||
Result:=DoOpenProjectFile(AFilename);
|
Result:=DoOpenProjectFile(AFilename,[ofAddToRecent]);
|
||||||
Handled:=true;
|
Handled:=true;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -3188,7 +3182,7 @@ begin
|
|||||||
if MessageDlg(ACaption, AText, mtconfirmation,
|
if MessageDlg(ACaption, AText, mtconfirmation,
|
||||||
[mbok, mbcancel], 0)=mrOk then
|
[mbok, mbcancel], 0)=mrOk then
|
||||||
begin
|
begin
|
||||||
Result:=DoOpenProjectFile(LPIFilename);
|
Result:=DoOpenProjectFile(LPIFilename,[]);
|
||||||
Handled:=true;
|
Handled:=true;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -3800,6 +3794,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
GetUnitWithPageIndex(PageIndex,ActiveSrcEdit,ActiveUnitInfo);
|
GetUnitWithPageIndex(PageIndex,ActiveSrcEdit,ActiveUnitInfo);
|
||||||
if ActiveUnitInfo=nil then exit;
|
if ActiveUnitInfo=nil then exit;
|
||||||
|
|
||||||
|
// check if file is writable on disk
|
||||||
|
if not ActiveUnitInfo.IsVirtual then
|
||||||
|
ActiveUnitInfo.FileReadOnly:=not FileIsWritable(ActiveUnitInfo.Filename);
|
||||||
|
|
||||||
// if this file is part of the project and the project is virtual then save
|
// if this file is part of the project and the project is virtual then save
|
||||||
// project first
|
// project first
|
||||||
@ -3999,7 +3997,7 @@ begin
|
|||||||
+'Answer No to load is as xml file.',
|
+'Answer No to load is as xml file.',
|
||||||
mtConfirmation,[mbYes,mbNo],0)=mrYes
|
mtConfirmation,[mbYes,mbNo],0)=mrYes
|
||||||
then begin
|
then begin
|
||||||
Result:=DoOpenProjectFile(AFilename);
|
Result:=DoOpenProjectFile(AFilename,[ofAddToRecent]);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -4601,7 +4599,8 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMainIDE.DoOpenProjectFile(AFileName:string):TModalResult;
|
function TMainIDE.DoOpenProjectFile(AFileName:string;
|
||||||
|
Flags: TOpenFlags):TModalResult;
|
||||||
var Ext,AText,ACaption: string;
|
var Ext,AText,ACaption: string;
|
||||||
LowestEditorIndex,LowestUnitIndex,LastEditorIndex,i: integer;
|
LowestEditorIndex,LowestUnitIndex,LastEditorIndex,i: integer;
|
||||||
NewBuf: TCodeBuffer;
|
NewBuf: TCodeBuffer;
|
||||||
@ -4640,6 +4639,12 @@ begin
|
|||||||
if Result=mrAbort then exit;
|
if Result=mrAbort then exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if ofAddToRecent in Flags then begin
|
||||||
|
EnvironmentOptions.AddToRecentProjectFiles(AFileName);
|
||||||
|
SetRecentProjectFilesMenu;
|
||||||
|
SaveEnvironment;
|
||||||
|
end;
|
||||||
|
|
||||||
// close the old project
|
// close the old project
|
||||||
if SomethingOfProjectIsModified then begin
|
if SomethingOfProjectIsModified then begin
|
||||||
if MessageDlg(lisProjectChanged, Format(lisSaveChangesToProject, [Project1.Title]),
|
if MessageDlg(lisProjectChanged, Format(lisSaveChangesToProject, [Project1.Title]),
|
||||||
@ -7828,6 +7833,9 @@ end.
|
|||||||
|
|
||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.475 2003/03/07 11:41:21 mattias
|
||||||
|
fixed readonly check and added script to quick create lazarus snapshot
|
||||||
|
|
||||||
Revision 1.474 2003/03/06 22:41:33 mattias
|
Revision 1.474 2003/03/06 22:41:33 mattias
|
||||||
open file now asks on .lpi files
|
open file now asks on .lpi files
|
||||||
|
|
||||||
|
45
tools/install/create_lazarus_tgz_from_local_dir.sh
Normal file
45
tools/install/create_lazarus_tgz_from_local_dir.sh
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
set -e
|
||||||
|
|
||||||
|
LazSrcDir=$1
|
||||||
|
OutFile=lazarus-0.8.5-1.tgz
|
||||||
|
|
||||||
|
if [ "x$LazSrcDir" = "x" ]; then
|
||||||
|
echo "Usage: $0 <lazarus_source_directory>"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
if [ ! -d $LazSrcDir/designer ]; then
|
||||||
|
echo "The directory does not look like a lazarus source directory (lazarus/)"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "copy $LazSrcDir to /tmp/lazarus ..."
|
||||||
|
cd /tmp
|
||||||
|
rm -rf /tmp/lazarus
|
||||||
|
cd -
|
||||||
|
cp -a $LazSrcDir /tmp/lazarus
|
||||||
|
|
||||||
|
echo "cleaning up (CVS, ppu, o) ..."
|
||||||
|
cd /tmp/lazarus
|
||||||
|
make cleanall
|
||||||
|
find . -name '*.ppu' -exec rm -rf {} \;
|
||||||
|
find . -name '*.o' -exec rm -rf {} \;
|
||||||
|
find . -name '*.rst' -exec rm -rf {} \;
|
||||||
|
rm -rf tools/install/*.tgz
|
||||||
|
cd -
|
||||||
|
|
||||||
|
# pack
|
||||||
|
echo "packing ..."
|
||||||
|
cd /tmp/
|
||||||
|
tar cvzf lazarus.tgz lazarus
|
||||||
|
cd -
|
||||||
|
mv /tmp/lazarus.tgz $OutFile
|
||||||
|
rm -rf /tmp/lazarus
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "NOTE: DON'T FORGET TO PUT THE $OutFile INTO /usr/src/redhat/SOURCES/"
|
||||||
|
|
||||||
|
# end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user