mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 00:02:50 +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_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/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 DoSaveProject(Flags: TSaveFlags):TModalResult;
|
||||
function DoCloseProject:TModalResult;
|
||||
function DoOpenProjectFile(AFileName:string):TModalResult;
|
||||
function DoOpenProjectFile(AFileName:string; Flags: TOpenFlags):TModalResult;
|
||||
function DoPublishProject(Flags: TSaveFlags;
|
||||
ShowDialog: boolean):TModalResult;
|
||||
function DoAddActiveUnitToProject: TModalResult;
|
||||
@ -1224,11 +1224,11 @@ begin
|
||||
// load command line project or last project or create a new project
|
||||
if (ParamCount>0) and (ParamStr(ParamCount)[1]<>'-')
|
||||
and (ExtractFileExt(ParamStr(ParamCount))='.lpi')
|
||||
and (DoOpenProjectFile(ParamStr(ParamCount))=mrOk) then
|
||||
and (DoOpenProjectFile(ParamStr(ParamCount),[])=mrOk) then
|
||||
// command line project loaded
|
||||
else if (EnvironmentOptions.OpenLastprojectAtStart)
|
||||
and (FileExists(EnvironmentOptions.LastSavedProjectFile))
|
||||
and (DoOpenProjectFile(EnvironmentOptions.LastSavedProjectFile)=mrOk) then
|
||||
and (DoOpenProjectFile(EnvironmentOptions.LastSavedProjectFile,[])=mrOk) then
|
||||
begin
|
||||
// last project loaded
|
||||
{$IFDEF IDE_DEBUG}
|
||||
@ -1939,11 +1939,7 @@ begin
|
||||
if Index<SeparatorIndex then begin
|
||||
// open recent project
|
||||
AFilename:=EnvironmentOptions.RecentProjectFiles[Index];
|
||||
if DoOpenProjectFile(AFileName)=mrOk then begin
|
||||
EnvironmentOptions.AddToRecentProjectFiles(AFileName);
|
||||
SetRecentProjectFilesMenu;
|
||||
SaveEnvironment;
|
||||
end;
|
||||
DoOpenProjectFile(AFileName,[ofAddToRecent]);
|
||||
end else begin
|
||||
// open recent file
|
||||
dec(Index, SeparatorIndex+1);
|
||||
@ -2114,9 +2110,7 @@ begin
|
||||
OpenDialog.Filter := 'Lazarus Project Info (*.lpi)|*.lpi|All Files|*.*';
|
||||
if OpenDialog.Execute then begin
|
||||
AFilename:=ExpandFilename(OpenDialog.Filename);
|
||||
if DoOpenProjectFile(AFilename)=mrOk then begin
|
||||
AddRecentFileToEnvironment(AFilename);
|
||||
end;
|
||||
DoOpenProjectFile(AFilename,[ofAddToRecent]);
|
||||
end;
|
||||
InputHistories.StoreFileDialogSettings(OpenDialog);
|
||||
finally
|
||||
@ -2124,7 +2118,7 @@ begin
|
||||
end;
|
||||
end else if Sender is TMenuItem then begin
|
||||
AFileName:=ExpandFilename(TMenuItem(Sender).Caption);
|
||||
if DoOpenProjectFile(AFilename)=mrOk then begin
|
||||
if DoOpenProjectFile(AFilename,[ofAddToRecent])=mrOk then begin
|
||||
AddRecentFileToEnvironment(AFilename);
|
||||
end else begin
|
||||
// open failed
|
||||
@ -3158,7 +3152,7 @@ begin
|
||||
if ([ofProjectLoading,ofRegularFile]*Flags<>[]) and (ToolStatus=itNone)
|
||||
and (Ext='.lpi') then begin
|
||||
// this is a project info file -> load whole project
|
||||
Result:=DoOpenProjectFile(AFilename);
|
||||
Result:=DoOpenProjectFile(AFilename,[ofAddToRecent]);
|
||||
Handled:=true;
|
||||
exit;
|
||||
end;
|
||||
@ -3188,7 +3182,7 @@ begin
|
||||
if MessageDlg(ACaption, AText, mtconfirmation,
|
||||
[mbok, mbcancel], 0)=mrOk then
|
||||
begin
|
||||
Result:=DoOpenProjectFile(LPIFilename);
|
||||
Result:=DoOpenProjectFile(LPIFilename,[]);
|
||||
Handled:=true;
|
||||
exit;
|
||||
end;
|
||||
@ -3800,6 +3794,10 @@ begin
|
||||
end;
|
||||
GetUnitWithPageIndex(PageIndex,ActiveSrcEdit,ActiveUnitInfo);
|
||||
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
|
||||
// project first
|
||||
@ -3999,7 +3997,7 @@ begin
|
||||
+'Answer No to load is as xml file.',
|
||||
mtConfirmation,[mbYes,mbNo],0)=mrYes
|
||||
then begin
|
||||
Result:=DoOpenProjectFile(AFilename);
|
||||
Result:=DoOpenProjectFile(AFilename,[ofAddToRecent]);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
@ -4601,7 +4599,8 @@ begin
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function TMainIDE.DoOpenProjectFile(AFileName:string):TModalResult;
|
||||
function TMainIDE.DoOpenProjectFile(AFileName:string;
|
||||
Flags: TOpenFlags):TModalResult;
|
||||
var Ext,AText,ACaption: string;
|
||||
LowestEditorIndex,LowestUnitIndex,LastEditorIndex,i: integer;
|
||||
NewBuf: TCodeBuffer;
|
||||
@ -4640,6 +4639,12 @@ begin
|
||||
if Result=mrAbort then exit;
|
||||
end;
|
||||
|
||||
if ofAddToRecent in Flags then begin
|
||||
EnvironmentOptions.AddToRecentProjectFiles(AFileName);
|
||||
SetRecentProjectFilesMenu;
|
||||
SaveEnvironment;
|
||||
end;
|
||||
|
||||
// close the old project
|
||||
if SomethingOfProjectIsModified then begin
|
||||
if MessageDlg(lisProjectChanged, Format(lisSaveChangesToProject, [Project1.Title]),
|
||||
@ -7828,6 +7833,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$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
|
||||
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