[Lazarus] Auto session store etc.

2019-01-04 Thread Florian Klämpfl via lazarus
Is there any possibility that lazarus auto stores the current session 
(project file, source files, session information etc.) every  s?


Background is that I am starting another trial to use linux as desktop 
system but within in a few days I have already lost changes because 
lazarus was just killed on shutdown (well, actually I would prefer to 
have linux just hibernating instead of shutdown, but this is another story).


Furthermore, is there any option to store the green bars which indicate 
changed sources between different runs of lazarus?

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Mattias Gaertner via lazarus
On Fri, 4 Jan 2019 12:08:56 +0100
Florian Klämpfl via lazarus  wrote:

> Is there any possibility that lazarus auto stores the current session 
> (project file, source files, session information etc.) every  s?

No.

A simple save is easy to implement. But there are some cases which
makes it difficult in general:

- If it would trigger a normal "save all" and you have just created
  some new files or are in the middle of a refactoring you will get
  suddenly save and message dialogs. I personally would hate that
  interruption.
- I often open a file, change something and save it as another
  name. An autosave would play havoc here.
- It would be better if the autosave would save the changed files in a
  separate location (e.g. .lazarus/autosave), which can then be
  restored on next start. But that requires some more work.

 
> Background is that I am starting another trial to use linux as
> desktop system but within in a few days I have already lost changes
> because lazarus was just killed on shutdown (well, actually I would
> prefer to have linux just hibernating instead of shutdown, but this
> is another story).
> 
> Furthermore, is there any option to store the green bars which
> indicate changed sources between different runs of lazarus?

Wouldn't that accumulate over time so that everything becomes green?
You need some "reset".

Mattias

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Henry Vermaak via lazarus
On Fri, Jan 04, 2019 at 12:08:56PM +0100, Florian Klämpfl via lazarus wrote:
> Is there any possibility that lazarus auto stores the current session
> (project file, source files, session information etc.) every  s?

At the very least do an emergency save on SIGTERM and provide the option
to restore the session.

Henry
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Florian Klämpfl via lazarus

Am 04.01.19 um 12:43 schrieb Henry Vermaak via lazarus:

On Fri, Jan 04, 2019 at 12:08:56PM +0100, Florian Klämpfl via lazarus wrote:

Is there any possibility that lazarus auto stores the current session
(project file, source files, session information etc.) every  s?


At the very least do an emergency save on SIGTERM and provide the option
to restore the session.


This would be also an option. I don't know how linux desktop programs 
have to behave on shutdown (regular, by the shutdown button in the 
menu), but at least it may not result in a lose of unsaved work.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Michael Van Canneyt via lazarus



On Fri, 4 Jan 2019, Mattias Gaertner via lazarus wrote:


On Fri, 4 Jan 2019 12:08:56 +0100
Florian Klämpfl via lazarus  wrote:

Is there any possibility that lazarus auto stores the current session 
(project file, source files, session information etc.) every  s?


No.

A simple save is easy to implement. But there are some cases which
makes it difficult in general:

- If it would trigger a normal "save all" and you have just created
 some new files or are in the middle of a refactoring you will get
 suddenly save and message dialogs. I personally would hate that
 interruption.
- I often open a file, change something and save it as another
 name. An autosave would play havoc here.
- It would be better if the autosave would save the changed files in a
 separate location (e.g. .lazarus/autosave), which can then be
 restored on next start. But that requires some more work.


Well, to my big relief, I discovered that Atom does this.

It saves files that were opened but never saved. Next time I opened the
project, even the unsaved files were there.

So I am all for this 'more work' :)

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Florian Klämpfl via lazarus

Am 04.01.19 um 12:32 schrieb Mattias Gaertner via lazarus:

On Fri, 4 Jan 2019 12:08:56 +0100
Florian Klämpfl via lazarus  wrote:


Is there any possibility that lazarus auto stores the current session
(project file, source files, session information etc.) every  s?


No.

A simple save is easy to implement. But there are some cases which
makes it difficult in general:

- If it would trigger a normal "save all" and you have just created
   some new files or are in the middle of a refactoring you will get
   suddenly save and message dialogs. I personally would hate that
   interruption.
- I often open a file, change something and save it as another
   name. An autosave would play havoc here.
- It would be better if the autosave would save the changed files in a
   separate location (e.g. .lazarus/autosave), which can then be
   restored on next start. But that requires some more work.


Well, yes. But one cannot have everything ;) I would be happy with a 
primitive solution which prevents losing work.




  

Background is that I am starting another trial to use linux as
desktop system but within in a few days I have already lost changes
because lazarus was just killed on shutdown (well, actually I would
prefer to have linux just hibernating instead of shutdown, but this
is another story).

Furthermore, is there any option to store the green bars which
indicate changed sources between different runs of lazarus?


Wouldn't that accumulate over time so that everything becomes green?
You need some "reset".


By just closing the source code tab?
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Download and Upload in fpweb application

2019-01-04 Thread Rogério Martins via lazarus
Hi

Could anyone show exemples of uploading and downloading files in a web
application made with fpweb ( cgi ) ?

Thanks

-- 
The Ubuntu Counter Project - user number # 33192

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Download and Upload in fpweb application

2019-01-04 Thread Michael Van Canneyt via lazarus



On Fri, 4 Jan 2019, Rogério Martins via lazarus wrote:


Hi

Could anyone show exemples of uploading and downloading files in a web
application made with fpweb ( cgi ) ?



see the examples:  packages/fcl-web/examples/ 
example: fptemplate/fileupload/


The code to handle the actual upload is in:
fptemplate/fileupload/webmodule/webmodule.pas

See routine TFPWebModule1.HandleUploadedFiles.

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Giuliano Colla via lazarus

Il 04/01/2019 12:08, Florian Klämpfl via lazarus ha scritto:

Is there any possibility that lazarus auto stores the current session 
(project file, source files, session information etc.) every  s?


Background is that I am starting another trial to use linux as desktop 
system but within in a few days I have already lost changes because 
lazarus was just killed on shutdown (well, actually I would prefer to 
have linux just hibernating instead of shutdown, but this is another 
story).


Furthermore, is there any option to store the green bars which 
indicate changed sources between different runs of lazarus?


I'm using linux as my desktop (and laptop) system since a very long time.
Basically I never use shutdown, except for a kernel or libc update. I 
just leave my desktop linux running, and either suspend or hibernate my 
laptop.
Depending of the combination of your platform, your distro, and the 
Desktop you're using, you may have available both a "suspend to ram" 
(only if it is a laptop with battery) and a "hibernate" (=suspend to 
disk). But you must pick up a good distro, within the distro select a 
stable and tested version (the latest version is always a lottery), and 
select a good Desktop.
Or you may resort to command-line, which is less subject to Desktop 
environment bugs: depending on distro and kernel you may have available 
/pm-suspend/ and /pm-hibernate/ or /systemctl suspend/ and /systemctl 
hibernate. /If it doesn't wake up properly, you may need to google to 
find out the quirks required for your specific hardware.


As far as Lazarus is concerned, everything relevant is saved each time 
you compile (or attempt to compile) your application. Just hit F9 and 
you're done.
You may easily check and tune your behaviour: if, when trying to quit 
Lazarus, a dialogue shows "Save changes to project ?" it means that 
some changes will be lost by a kill, if it doesn't show, it means that 
all relevant changes have already been saved, and that a kill wouldn't 
do any harm.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Graeme Geldenhuys via lazarus
On 04/01/2019 11:59, Michael Van Canneyt via lazarus wrote:
> Well, to my big relief, I discovered that Atom does this.

EditPad Pro and jEdit also does that. Seems it is a more popular feature
than first expected. ;-)


From the book "About Face 3: The Essentials of Interaction Design" (not
a direct quote):

   Editors and most programs shouldn't even need an explicit Save menu
   option. If they auto-save everything - combined with an Undo feature
   - that's all that is needed. Why bother the end-user then with an
   explicit Save. Many mobile apps already implement this behaviour with
   great success.


> So I am all for this 'more work' :)

+1


Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Graeme Geldenhuys via lazarus
On 04/01/2019 11:43, Henry Vermaak via lazarus wrote:
> At the very least do an emergency save on SIGTERM and provide the option
> to restore the session.

That's a very good idea.

Regards,
  Graeme

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Sven Barth via lazarus
Am Fr., 4. Jan. 2019, 13:01 hat Florian Klämpfl via lazarus <
lazarus@lists.lazarus-ide.org> geschrieben:

> >
> >
> >> Background is that I am starting another trial to use linux as
> >> desktop system but within in a few days I have already lost changes
> >> because lazarus was just killed on shutdown (well, actually I would
> >> prefer to have linux just hibernating instead of shutdown, but this
> >> is another story).
> >>
> >> Furthermore, is there any option to store the green bars which
> >> indicate changed sources between different runs of lazarus?
> >
> > Wouldn't that accumulate over time so that everything becomes green?
> > You need some "reset".
>
> By just closing the source code tab?
>

Somehow I have the feeling what you really need is "show changed lines in
regard to version control system" :P (at least that's what I would need...)

Regards,
Sven

>
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Florian Klämpfl via lazarus

Am 04.01.19 um 14:01 schrieb Giuliano Colla via lazarus:
But you must pick up a good distro, within the distro select a 
stable and tested version (the latest version is always a lottery), and 
select a good Desktop.


If there had been one (seems Ubuntu and derivatives removed hibernation 
(!!, remember, we are in 2018, not 1998) in 18.04, I didn't ask about 
this feature.




As far as Lazarus is concerned, everything relevant is saved each time 
you compile (or attempt to compile) your application. Just hit F9 and 
you're done.


Well, when working on the compiler, I often do not compile for hours, 
but meanwhile I found the AutoSave package for Lazarus which prevents at 
least the worst case scenarios.


You may easily check and tune your behaviour: 


It is also about X crashes and so on (and I do not like to adapt my 
behavior :)).

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Michael Van Canneyt via lazarus



On Fri, 4 Jan 2019, Graeme Geldenhuys via lazarus wrote:


On 04/01/2019 11:59, Michael Van Canneyt via lazarus wrote:

Well, to my big relief, I discovered that Atom does this.


EditPad Pro and jEdit also does that. Seems it is a more popular feature
than first expected. ;-)


From the book "About Face 3: The Essentials of Interaction Design" (not
a direct quote):

  Editors and most programs shouldn't even need an explicit Save menu
  option. If they auto-save everything - combined with an Undo feature
  - that's all that is needed. Why bother the end-user then with an
  explicit Save. Many mobile apps already implement this behaviour with
  great success.


I read that too. But here I don't agree 100%.

Of course you need an explicit 'save' for an editor. 
You need to give a name to your file. And what if I want to rename my file ?


Imagine every editor just auto saves under Documents with a GUID as a name.
Or you need to memorize the filesystem iNode of the document.

That would become messy :)

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Florian Klämpfl via lazarus

Am 04.01.19 um 14:26 schrieb Sven Barth via lazarus:
Am Fr., 4. Jan. 2019, 13:01 hat Florian Klämpfl via lazarus 
mailto:lazarus@lists.lazarus-ide.org>> 
geschrieben:


 >
 >
 >> Background is that I am starting another trial to use linux as
 >> desktop system but within in a few days I have already lost changes
 >> because lazarus was just killed on shutdown (well, actually I would
 >> prefer to have linux just hibernating instead of shutdown, but this
 >> is another story).
 >>
 >> Furthermore, is there any option to store the green bars which
 >> indicate changed sources between different runs of lazarus?
 >
 > Wouldn't that accumulate over time so that everything becomes green?
 > You need some "reset".

By just closing the source code tab?


Somehow I have the feeling what you really need is "show changed lines 
in regard to version control system" :P (at least that's what I would 
need...)


Well, yes. But till next christmas it's a long time ;)

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Michael Van Canneyt via lazarus



On Fri, 4 Jan 2019, Florian Klämpfl via lazarus wrote:


Am 04.01.19 um 14:26 schrieb Sven Barth via lazarus:
Am Fr., 4. Jan. 2019, 13:01 hat Florian Klämpfl via lazarus 
mailto:lazarus@lists.lazarus-ide.org>> 
geschrieben:


 >
 >
 >> Background is that I am starting another trial to use linux as
 >> desktop system but within in a few days I have already lost changes
 >> because lazarus was just killed on shutdown (well, actually I would
 >> prefer to have linux just hibernating instead of shutdown, but this
 >> is another story).
 >>
 >> Furthermore, is there any option to store the green bars which
 >> indicate changed sources between different runs of lazarus?
 >
 > Wouldn't that accumulate over time so that everything becomes green?
 > You need some "reset".

By just closing the source code tab?


Somehow I have the feeling what you really need is "show changed lines 
in regard to version control system" :P (at least that's what I would 
need...)


Well, yes. But till next christmas it's a long time ;)


Again something that Atom has :)

In general, the git integration of Atom is the easiest to use that I've seen
yet...

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Marco van de Voort via lazarus

Op 2019-01-04 om 14:05 schreef Graeme Geldenhuys via lazarus:

EditPad Pro and jEdit also does that. Seems it is a more popular feature
than first expected. ;-)


 From the book "About Face 3: The Essentials of Interaction Design" (not
a direct quote):

Editors and most programs shouldn't even need an explicit Save menu
option. If they auto-save everything - combined with an Undo feature
- that's all that is needed. Why bother the end-user then with an
explicit Save. Many mobile apps already implement this behaviour with
great success.


Unfortunately the undo is often only for the session.


--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Giuliano Colla via lazarus

Il 04/01/2019 14:27, Florian Klämpfl via lazarus ha scritto:

If there had been one (seems Ubuntu and derivatives removed 
hibernation (!!, remember, we are in 2018, not 1998) in 18.04, I 
didn't ask about this feature.


With a good distro I didn't mean Ubuntu, which is the opposite of what a 
software developer needs. It is intended for non-technical end users. It 
makes it very easy to get multimedia software, and very hard to 
administer the system, and tune it to your needs. It's the best choice 
for my wife, but my current choice is CentOs. I don't know what will 
happen in future, with IBM having bought Red Hat (for 34 billion $!!!).


However if you want to enable hibernate in Ubuntu 18.04, you may find 
useful help here:

http://ubuntuhandbook.org/index.php/2018/05/add-hibernate-option-ubuntu-18-04/

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread wkitty42--- via lazarus

On 1/4/19 10:33 AM, Marco van de Voort via lazarus wrote:

Unfortunately the undo is often only for the session.


that information can also be saved so that it persists between front-to-back 
sessions... it could also be saved as part of the project data so that it is 
specific to that one project and it's files...


--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list unless*
   *a signed and pre-paid contract is in effect with us.*
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus