fixed loading .files

git-svn-id: trunk@2915 -
This commit is contained in:
mattias 2002-08-18 08:56:01 +00:00
parent ae78151563
commit ff42a9048b
3 changed files with 97 additions and 3 deletions

1
.gitattributes vendored
View File

@ -720,6 +720,7 @@ lcl/utrace.pp svneol=native#text/pascal
lcl/vclglobals.pp svneol=native#text/pascal
/localize.sh -text svneol=native#application/x-sh
packager/addfiletoapackagedlg.pas svneol=native#text/pascal
packager/addtopackagedlg.pas svneol=native#text/pascal
packager/basepkgmanager.pas svneol=native#text/pascal
packager/brokendependenciesdlg.pas svneol=native#text/pascal
packager/lazaruspackageintf.pas svneol=native#text/pascal

View File

@ -4115,6 +4115,7 @@ var
NewUnitInfo:TUnitInfo;
NewBuf: TCodeBuffer;
OtherUnitIndex: Integer;
FilenameNoPath: String;
begin
{$IFDEF IDE_VERBOSE}
writeln('');
@ -4124,9 +4125,12 @@ begin
Result:=mrCancel;
AFilename:=TrimFilename(AFilename);
FilenameNoPath:=ExtractFilename(AFilename);
// check to not open directories
if (not (ofRevert in Flags))
and (ExtractFilenameOnly(AFilename)='') then
and ((FilenameNoPath='') or (FilenameNoPath='.') or (FilenameNoPath='..'))
then
exit;
if ([ofAddToRecent,ofRevert,ofVirtualFile]*Flags=[ofAddToRecent])
@ -4146,7 +4150,8 @@ begin
// check for .lpi files
if ([ofRegularFile,ofRevert,ofProjectLoading]*Flags=[]) then begin
if CompareFileExt(AFilename,'.lpi',false)=0 then begin
if (CompareFileExt(AFilename,'.lpi',false)=0)
and (FileExists(AFilename)) then begin
if MessageDlg('Open Project?',
'Open the project '+AFilename+'?'#13
+'Answer No to load it as xml file.',
@ -8111,6 +8116,9 @@ end.
{ =============================================================================
$Log$
Revision 1.506 2003/04/03 15:02:23 mattias
fixed loading .files
Revision 1.505 2003/04/02 17:06:27 mattias
improved deb creation

View File

@ -0,0 +1,85 @@
{ $Id$ }
{
/***************************************************************************
addtopackagedlg.pas
-------------------
***************************************************************************/
***************************************************************************
* *
* This source is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This code is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* A copy of the GNU General Public License is available on the World *
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
* obtain it by writing to the Free Software Foundation, *
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
***************************************************************************
Author: Mattias Gaertner
Abstract:
TAddToPackageDlg is the form for adding files to an open package.
}
unit AddToPackageDlg;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Buttons, StdCtrls, ExtCtrls,
LazarusIDEStrConsts, PackageDefs;
type
TAddToPackageDlg = class(TForm)
NoteBook: TNoteBook;
AddUnitPage: TPage;
NewComponentPage: TPage;
AddUnitFilenameLabel: TLabel;
AddUnitFilenameEdit: TEdit;
AddUnitFileBrowseButton: TButton;
AddUnitButton: TButton;
CancelNewButton: TButton;
AncestorTypeLabel: TLabel;
AncestorComboBox: TComboBox;
ClassNameLabel: TLabel;
ClassNameEdit: TEdit;
PalettePageLabel: TLabel;
PalettePageCombobox: TCombobox;
ComponentUnitLabel: TLabel;
ComponentUnitCombobox: TCombobox;
NewComponentButton: TButton;
CancelNewComponentButton: TButton;
private
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
end;
implementation
{ TAddToPackageDlg }
constructor TAddToPackageDlg.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
end;
destructor TAddToPackageDlg.Destroy;
begin
inherited Destroy;
end;
end.