[Lazarus] Default project ?

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Default project ?

Free Pascal - Lazarus mailing list

Hi,

Is there a way to change the default project generated when the IDE starts ?

If you tell the IDE not to reload the last project when starting, it creates
a default GUI application. Since 99,99% of my programs are console programs,
I looked for a setting to change this, but did not find one.

If there is none, is it possible to add such a setting (I imagine yes :)) ?

If so, should I post a feature request ?

Michael.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
On Wed, Nov 18, 2020 at 8:43 AM Michael Van Canneyt via lazarus
<[hidden email]> wrote:

> If you tell the IDE not to reload the last project when starting, it creates
> a default GUI application. Since 99,99% of my programs are console programs,

And it would be nice if you could define default compiler settings for
console programs that differ from those used for GUI applications.
ATM my debug settings for GUI applications depend on the LazUtils
package, so that won't (be default) compile with console programs.

--
Bart
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
On 18.11.2020 09:04, Bart via lazarus wrote:
> On Wed, Nov 18, 2020 at 8:43 AM Michael Van Canneyt via lazarus
> <[hidden email]> wrote:
>
>> If you tell the IDE not to reload the last project when starting, it creates
>> a default GUI application. Since 99,99% of my programs are console programs,
> And it would be nice if you could define default compiler settings for
> console programs that differ from those used for GUI applications.
> ATM my debug settings for GUI applications depend on the LazUtils
> package, so that won't (be default) compile with console programs.

IMO better would be to have compiler settings presets (=named list).
Then, of course, it's easy to implement to be able to pick up the
default settings for each project type from the presets list.

Also, I am bugged by the fact that I cannot delete the (currently
global) default compiler settings that I once set.

Ondrej

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list


On Wed, 18 Nov 2020, Bart via lazarus wrote:

> On Wed, Nov 18, 2020 at 8:43 AM Michael Van Canneyt via lazarus
> <[hidden email]> wrote:
>
>> If you tell the IDE not to reload the last project when starting, it creates
>> a default GUI application. Since 99,99% of my programs are console programs,
>
> And it would be nice if you could define default compiler settings for
> console programs that differ from those used for GUI applications.
> ATM my debug settings for GUI applications depend on the LazUtils
> package, so that won't (be default) compile with console programs.

I'm curious: How can settings depend on a package for your program ?

Michael.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
On Wed, Nov 18, 2020 at 10:07 AM Michael Van Canneyt via lazarus
<[hidden email]> wrote:

> I'm curious: How can settings depend on a package for your program ?

In debug buildmode I have -FaLazLogger,LCLExceptionStacktrace
(compiler options->custom options).

--
Bart
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Wed, 18 Nov 2020 08:43:00 +0100 (CET), Michael Van Canneyt via
lazarus <[hidden email]> wrote:

>Is there a way to change the default project generated when the IDE starts ?

Why is Lazarus creating an empty project on startup in the first
place?

I would like to suggest that they take that default project on startup
away and start Lazarus without a project so the user can decide to
either load an earlier worked on project or create a new project of
the exact kind he wants to work with.

Of course there should be a setting to tell Lazarus to start with the
latest project reloaded, like it does now.

Delphi has a command line option (-np) to not load the latest project
on startup (defaults to load) and when used then it starts without a
loaded project. Why change this behaviour?

Especially since Lazarus crashes greatly if there is a problem with
the last project and then it takes a detective to make it return to
usable again since just restarting causes the same crash to occur
again and again.
Happened to me many times....

Please introduce the command line switch -np like in Delphi or make it
a config item.


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list


On Wed, 18 Nov 2020, Bo Berglund via lazarus wrote:

> On Wed, 18 Nov 2020 08:43:00 +0100 (CET), Michael Van Canneyt via
> lazarus <[hidden email]> wrote:
>
>> Is there a way to change the default project generated when the IDE starts ?
>
> Why is Lazarus creating an empty project on startup in the first
> place?

Because it needs a project. It cannot work without one, so it creates one.

So if the hypothetical option -np would be implemented, you would definitely be
presented with the same 'project wizard' dialog you get when you close the project
with "Project - Close Project".

Michael.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
On Wed, 18 Nov 2020 20:08:14 +0100 (CET), Michael Van Canneyt via
lazarus <[hidden email]> wrote:

>
>
>On Wed, 18 Nov 2020, Bo Berglund via lazarus wrote:
>
>> On Wed, 18 Nov 2020 08:43:00 +0100 (CET), Michael Van Canneyt via
>> lazarus <[hidden email]> wrote:
>>
>>> Is there a way to change the default project generated when the IDE starts ?
>>
>> Why is Lazarus creating an empty project on startup in the first
>> place?
>
>Because it needs a project. It cannot work without one, so it creates one.
>
>So if the hypothetical option -np would be implemented, you would definitely be
>presented with the same 'project wizard' dialog you get when you close the project
>with "Project - Close Project".
>

OK, so if the last project opened is seriously flawed (for this
Lazarus) and crashes Lazarus, how can one ever remedy that?

In my case it has happened when I open an existing project in a new
Lazarus installation without realizing that not all packages have been
installed into Lazarus.
Then it crashes and now I have no way to start Lazarus without it also
opening the project that causes the crash. Eternal loop...

So I cannot even get the access needed to install the needed
package(s) (in this case it would be a package that requires a Lazarus
rebuild)...

It makes no sense to me to not at least (with a start argument?) be
able to start Lazarus with a default project rather than the last
loaded project which always crashes Lazarus.


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list


On Wed, 18 Nov 2020, Bo Berglund via lazarus wrote:

>>
>> Because it needs a project. It cannot work without one, so it creates one.
>>
>> So if the hypothetical option -np would be implemented, you would definitely be
>> presented with the same 'project wizard' dialog you get when you close the project
>> with "Project - Close Project".
>>
>
> OK, so if the last project opened is seriously flawed (for this
> Lazarus) and crashes Lazarus, how can one ever remedy that?

At this moment not without changing the config files manually, I think.

But you could have a command-line option that allows to start Lazarus simply
with an empty project instead of the last one.

And that 'empty project' is what I want to have configurable... :-)

Michael.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
On Wed, 18 Nov 2020 21:19:00 +0100 (CET), Michael Van Canneyt via
lazarus <[hidden email]> wrote:

>
>
>On Wed, 18 Nov 2020, Bo Berglund via lazarus wrote:
>
>>>
>>> Because it needs a project. It cannot work without one, so it creates one.
>>>
>>> So if the hypothetical option -np would be implemented, you would definitely be
>>> presented with the same 'project wizard' dialog you get when you close the project
>>> with "Project - Close Project".
>>>
>>
>> OK, so if the last project opened is seriously flawed (for this
>> Lazarus) and crashes Lazarus, how can one ever remedy that?
>
>At this moment not without changing the config files manually, I think.
>
>But you could have a command-line option that allows to start Lazarus simply
>with an empty project instead of the last one.
>
>And that 'empty project' is what I want to have configurable... :-)
>

So, what is that command-line option then?

Do I first need to create an empty project, which can be thrown at
Lazarus on startup?
Or is there a command line option like Delphi's -np also for Lazarus
that I have missed?

I pretty often install Lazarus/Fpc on new devices (often Raspberry Pi
units) so I will now and then hit this problem if I forget to
reconfigure base Lazarus with the packages I usually need.


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
Am 18.11.20 um 21:31 schrieb Bo Berglund via lazarus:

> Especially since Lazarus crashes greatly if there is a problem with
> the last project and then it takes a detective to make it return to
> usable again since just restarting causes the same crash to occur
> again and again.
> Happened to me many times.....


Use your filemanager to open the last working(!!) *.lpi ... rightclick
... open with ...


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Wed, 18 Nov 2020 20:43:33 +0100
Bo Berglund via lazarus <[hidden email]> wrote:

>[...]
> OK, so if the last project opened is seriously flawed (for this
> Lazarus) and crashes Lazarus, how can one ever remedy that?
>
> In my case it has happened when I open an existing project in a new
> Lazarus installation without realizing that not all packages have been
> installed into Lazarus.
> Then it crashes and now I have no way to start Lazarus without it also
> opening the project that causes the crash. Eternal loop...

That's strange, because Lazarus has a startprotocol. If the last
project crashed the IDE, next time it will ask if it should open the
project.

How do you start Lazarus?

Mattias
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Wed, 18 Nov 2020 21:31:44 +0100
Bo Berglund via lazarus <[hidden email]> wrote:

>[...]
> So, what is that command-line option then?

lazarus.exe -h


> Do I first need to create an empty project, which can be thrown at
> Lazarus on startup?
> Or is there a command line option like Delphi's -np also for Lazarus
> that I have missed?

--skip-last-project

 
Mattias
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Wed, 18 Nov 2020 22:41:13 +0100, Mattias Gaertner via lazarus
<[hidden email]> wrote:

>That's strange, because Lazarus has a startprotocol. If the last
>project crashed the IDE, next time it will ask if it should open the
>project.
>
>How do you start Lazarus?
>
I have desktop files in:
~/.local/share/applications/

These typically contains this (for the latest version I have), notice
that my newsreader is autowrapping the Exec line:

File lazarus_2.0.10.desktop:

[Desktop Entry]
Comment=Lazarus IDE 2.0.10
Terminal=false
Name=Lazarus 2.0.10
Exec=/home/pi/dev/lazarus/2.0.10/startlazarus
--pcp=/home/pi/.lazarus_2.0.10 %f
Type=Application
Icon=/home/pi/dev/lazarus/2.0.10/images/ide_icon48x48.png
Categories=Application;IDE;Development;GTK;GUIDesigner;Programming;
NoDisplay=false
Keywords=editor;Pascal;IDE;FreePascal;fpc;Design;Designer;



--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 18/11/2020 19:51, Bo Berglund via lazarus wrote:
> Especially since Lazarus crashes greatly if there is a problem with
> the last project and then it takes a detective to make it return to
> usable again since just restarting causes the same crash to occur
> again and again.
> Happened to me many times....
>

Lazarus is supposed to detect, if it crashed during the last startup
while opening the project. And at least in the few cases where I had
such crashes, the next start of the IDE has always prompt me, if I want
to open that project, or start with an empty one.

So if the repeated crash happens to you, then you are hitting 2 bugs at
once. And it would be really good if they could be reported in a
reproducible manner.

Btw, as a workaround (just thinking about): Move the project to a
different folder (just to start the IDE). If it can not be found, it can
not be opened, it can not crash.
=> Of course that does not solve the problem that eventually you do want
to open the project. But that is also not remedied by the IDE starting
with no project at all ( -np ).
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Wed, 18 Nov 2020 22:42:36 +0100, Mattias Gaertner via lazarus
<[hidden email]> wrote:

>> Or is there a command line option like Delphi's -np also for Lazarus
>> that I have missed?
>
>--skip-last-project

Perfect, that is what I would need then!
Starts Lazarus with an empty default project.
Almost the same as Delphi's -np given that Lazarus needs a project to
work.

Then Project/Open Recent Project to select what if anything I need to
re-open.

Follow-up:
Is there a way to configure the number of projects saved to this list?
Right now it seems to only hold 5 projects...


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
On Thu, 19 Nov 2020 08:14:44 +0100, Bo Berglund via lazarus
<[hidden email]> wrote:

>Follow-up:
>Is there a way to configure the number of projects saved to this list?
>Right now it seems to only hold 5 projects...

Of course:
Tools/Options/Environment/Files

Sorry for that question.

--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
Can we now get back to the original question this thread was about?

--
Bart
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Wed, Nov 18, 2020 at 8:51 PM Bo Berglund via lazarus <[hidden email]> wrote:
Especially since Lazarus crashes greatly if there is a problem with
the last project ...

Report all such crashes please. Test with Lazarus trunk and include a minimal test project to reproduce.

Juha


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default project ?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Thu, 19 Nov 2020 12:17:11 +0100, Bart via lazarus
<[hidden email]> wrote:

>Can we now get back to the original question this thread was about?
>

I agree that it would be nice to have a setting in Lazarus to define
*what type of project* it will autogenerate in absence of a previous
project to load.

But it is not that difficult really to configure Lazarus to not load
the previous project and then when the default pops up go to
Project/New... and select the wanted type.
So a setting for "Default project type" might help...

The issue here might be to avoid loading a massive project
un-necessarily when one wants to start a new project.

If the checkbox at
Tools/Options/Environment/Open_Last_Project_And_Packages_At_Start

is unchecked it acts the same as if the start command contains the
argument --skip-last-project, so it is easier to manage this way.


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
12