Re: [Lazarus] Opening non existing files and (not) adding them to the project
On Mon, Jan 18, 2016 at 1:32 PM, Mattias Gaertnerwrote: > It works here on GTK2/Ubuntu. I can choose a non existing file. I guess you mean you can type a name of a non existing file. You cannot choose it because by definition it does not exist. I have Xubuntu 15.10 with XFCE now. Can it make a difference? The window manager of XFCE behaves strangely sometimes. I can test with another distro later. Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Opening non existing files and (not) adding them to the project
Am 18.01.2016 12:11 schrieb "Juha Manninen": > Can you find what revision caused the original problem you described? I'll try to. Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Opening non existing files and (not) adding them to the project
On Mon, 18 Jan 2016 14:58:35 +0200 Juha Manninenwrote: > On Mon, Jan 18, 2016 at 1:32 PM, Mattias Gaertner > wrote: > > It works here on GTK2/Ubuntu. I can choose a non existing file. > > I guess you mean you can type a name of a non existing file. > You cannot choose it because by definition it does not exist. Yes. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Opening non existing files and (not) adding them to the project
On Mon, Jan 18, 2016 at 9:05 AM, Sven Barthwrote: > Don't shock me like that, Juha. > > The IDE actively asks me whether I want to create a new file if I open a non > existing one and it should definitely stay that way. Ok, you and Mattias are right. The OpenDialog in TMainIDE.mnuOpenClicked has no ofFileMustExist flag. I got confused with changes I made for Delphi converter dialogs. Anyway the file open dialogs in GTK2 and QT don't respect the omitted ofFileMustExist flag. They behave like it was set. That is another bug clearly. I got the question about creating a new file only using Windows version of Lazarus. Can you find what revision caused the original problem you described? Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Opening non existing files and (not) adding them to the project
On Mon, 18 Jan 2016 13:11:08 +0200 Juha Manninenwrote: >[...] > Anyway the file open dialogs in GTK2 and QT don't respect the omitted > ofFileMustExist flag. They behave like it was set. That is another bug > clearly. It works here on GTK2/Ubuntu. I can choose a non existing file. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Opening non existing files and (not) adding them to the project
Am 18.01.2016 12:11 schrieb "Juha Manninen": > Can you find what revision caused the original problem you described? Seems like it was more PEBKAC than anything else. The thing is I normally use this when I work with the compiler and there I add my tests to a directory parallel to the project directory. However when I found this "problem" I had a different project in this test directory open (cause I needed to debug it), but I added a test in the same directory. Now while looking for the changed revision I found out that Lazarus applies a heuristic when to add a file to the project. Part of the decisions is the above mentioned difference and it seems to have been like that at least since 1.3 times (that's what I had accessible right now). So there was nothing changed at all and I merely stumbled upon my own stupidity -.- Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Opening non existing files and (not) adding them to the project
Am 17.01.2016 22:35 schrieb "Juha Manninen": > > On Sun, Jan 17, 2016 at 4:30 PM, Sven Barth wrote: > > Back in 1.4.x when I opened a non-existing file and I confirmed that I want > > to have it created the file was not added to project or the project's mainfile. > > [...] > > Now with 1.6RC2 I noticed that such files are added to the uses clause of > > the main program file and the project inspector. > > You cannot open a non-existing file, meaning that you cannot use the > File -> Open dialog for it. There is now a "FileMustExist" or similar > flag. I remember it fixed some bug but don't remember which one. > IMO it is logical because you can by definition only open existing > files. If a file does not exist, you must create it instead. Don't shock me like that, Juha. The IDE actively asks me whether I want to create a new file if I open a non existing one and it should definitely stay that way. Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Opening non existing files and (not) adding them to the project
Am 17.01.2016 20:36 schrieb "ListMember": > > On 2016-01-17 16:30, Sven Barth wrote: >> >> when I opened a non-existing file and I confirmed that I want to have it created the file was not added to project or the project's mainfile. > > > But, isn't this how Delphi has been doing it all these years. > > 1) When you create a new unit, it automatically gets added to the project. > > 2) When you decide to save the project, you're asked whether you want to save the newly added (not saved yet) units. If not, it is removed from the project and you lose its contents. > > 3) If you want to exclude the newly created unit, you remove it from the project. In that case, IDE asks you whether you wish to save that file (or lose it). > > Do you still/really want a 'non-standard' behavior? I don't care what Delphi does. I care about what Lazarus has done for years and what I have relied upon. For me this *is* standard behavior. Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Opening non existing files and (not) adding them to the project
On 1/17/16, Juha Manninenwrote: > You cannot open a non-existing file, meaning that you cannot use the > File -> Open dialog for it. Yes tou can! Lazarus 1.7 r51253 FPC 3.0.0 i386-win32-win32/win64 Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Opening non existing files and (not) adding them to the project
Am 17.01.2016 18:22 schrieb "Bart": > > On 1/17/16, Sven Barth wrote: > > > Is there some option I have missed to change this behavior? Because not > > only meeses this up the compiler project, but CodeTools don't like it as > > well as the files I add this way are usually program files, thus they > > shouldn't be in the uses section anyway. > > Odd. > > ProjectOptions->Miscallaneous-> "Main unit has uses section containing > all units of a project". > Uncheck and save as default compiler options? > > Would have expected that to be a global setting. That solves at least one part of the issue. The new file is however still added to the project which is not good. Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Opening non existing files and (not) adding them to the project
On 2016-01-17 16:30, Sven Barth wrote: when I opened a non-existing file and I confirmed that I want to have it created the file was not added to project or the project's mainfile. But, isn't this how Delphi has been doing it all these years. 1) When you create a new unit, it automatically gets added to the project. 2) When you decide to save the project, you're asked whether you want to save the newly added (not saved yet) units. If not, it is removed from the project and you lose its contents. 3) If you want to exclude the newly created unit, you remove it from the project. In that case, IDE asks you whether you wish to save that file (or lose it). Do you still/really want a 'non-standard' behavior? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Opening non existing files and (not) adding them to the project
On Sun, Jan 17, 2016 at 4:30 PM, Sven Barthwrote: > Back in 1.4.x when I opened a non-existing file and I confirmed that I want > to have it created the file was not added to project or the project's > mainfile. > [...] > Now with 1.6RC2 I noticed that such files are added to the uses clause of > the main program file and the project inspector. You cannot open a non-existing file, meaning that you cannot use the File -> Open dialog for it. There is now a "FileMustExist" or similar flag. I remember it fixed some bug but don't remember which one. IMO it is logical because you can by definition only open existing files. If a file does not exist, you must create it instead. The right fix could be to ask if a newly created file should be added to project which means useless questions for most people. Or, maybe the best way is to create a file somewhere else (editor, file manager, cmd line etc), then open it. Even an empty file can be opened. Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Opening non existing files and (not) adding them to the project
On Sun, 17 Jan 2016 23:34:58 +0200 Juha Manninenwrote: >[...] > You cannot open a non-existing file, meaning that you cannot use the > File -> Open dialog for it. There is now a "FileMustExist" or similar > flag. I remember it fixed some bug but don't remember which one. That would be a regression. It is one of the oldest features of the IDE. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Opening non existing files and (not) adding them to the project
Hello together! Working with 1.6RC2 I noticed a - for me - very serious problem and wonder whether I've missed some option. Back in 1.4.x when I opened a non-existing file and I confirmed that I want to have it created the file was not added to project or the project's mainfile. This is wonderful and I use it to quickly create testcases for the compiler (which don't need their own project and are compiled from the command line or from the compiler running debugged in the IDE anyway). Now with 1.6RC2 I noticed that such files are added to the uses clause of the main program file and the project inspector. Is there some option I have missed to change this behavior? Because not only meeses this up the compiler project, but CodeTools don't like it as well as the files I add this way are usually program files, thus they shouldn't be in the uses section anyway. If there isn't the this should be changed preferably before the release of 1.6 as otherwise that version will be useless for me (or I'll have to patch out that code myself). Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Opening non existing files and (not) adding them to the project
On 1/17/16, Sven Barthwrote: > Is there some option I have missed to change this behavior? Because not > only meeses this up the compiler project, but CodeTools don't like it as > well as the files I add this way are usually program files, thus they > shouldn't be in the uses section anyway. Odd. ProjectOptions->Miscallaneous-> "Main unit has uses section containing all units of a project". Uncheck and save as default compiler options? Would have expected that to be a global setting. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus