Closing program gracefully on receiving signal.

View: New views
3 Messages — Rating Filter:   Alert me  

Closing program gracefully on receiving signal.

by Gunter Schelfhout-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello mailinglist,

Recently I had a spreadsheet open with Kspread when my X-server crashed. No
input from keyboard or mouse was possible.
As mostly always is the case with our stable operating system, the kernel
was doing just fine as I was able to login remotely from another computer.
But even then I was in a lose-lose situation.
I could close Kspread before killing and restarting X, or I could go to
another init-level and go back to level 5.
But either way I would be losing my changes to my opened spreadsheet.

This could be handled better, I'm afraid.

I'm not a developer  but I know a little of system administration to come to
the next proposal, although I don't know if it is correct, doable or even
desirable.

Wouldn't it be a good thing that any program which has an open file in a
dirty state to close gracefully upon receiving a certain and well documented
signal?
Kspread, Kword, Kate, or any other program should then save the file to a
default destination directory and set an option so the program knows upon
next start that there was a saving of the document after receiving a signal
and closing the application. (dirty bit/option)

Perhaps this could be programmed as central and low as possible (maybe
kdeinit?), so that the developer of the application doesn't have to worry
about it.
I know some applications have the autosave option, but even then you would
lose some data and not all applications which have the opportunity to edit
some data have this option.

Greetings,

Gunter Schelfhout

_______________________________________________
kde-quality mailing list
kde-quality@...
https://mail.kde.org/mailman/listinfo/kde-quality

Re: Closing program gracefully on receiving signal.

by Jos Poortvliet-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Nov 28, 2008 at 9:17 PM, Gunter Schelfhout
<gunter.schelfhout@...> wrote:

> Hello mailinglist,
>
> Recently I had a spreadsheet open with Kspread when my X-server crashed. No
> input from keyboard or mouse was possible.
> As mostly always is the case with our stable operating system, the kernel
> was doing just fine as I was able to login remotely from another computer.
> But even then I was in a lose-lose situation.
> I could close Kspread before killing and restarting X, or I could go to
> another init-level and go back to level 5.
> But either way I would be losing my changes to my opened spreadsheet.
>
> This could be handled better, I'm afraid.
>
> I'm not a developer  but I know a little of system administration to come to
> the next proposal, although I don't know if it is correct, doable or even
> desirable.
>
> Wouldn't it be a good thing that any program which has an open file in a
> dirty state to close gracefully upon receiving a certain and well documented
> signal?
> Kspread, Kword, Kate, or any other program should then save the file to a
> default destination directory and set an option so the program knows upon
> next start that there was a saving of the document after receiving a signal
> and closing the application. (dirty bit/option)
>
> Perhaps this could be programmed as central and low as possible (maybe
> kdeinit?), so that the developer of the application doesn't have to worry
> about it.
> I know some applications have the autosave option, but even then you would
> lose some data and not all applications which have the opportunity to edit
> some data have this option.

It should be possible to instruct the application from the commandline
using DBUS to save & quit, at least as long as the file has a name.
Furthermore, KDE applications are slowly gaining crash-recovery
functionality (Konqi has it now) which would help even more. Yeah,
having such functionality kind'of default, in the libraries - sounds
good, but I have no idea if that would be even possible, technically
speaking.

> Greetings,
>
> Gunter Schelfhout
>
> _______________________________________________
> kde-quality mailing list
> kde-quality@...
> https://mail.kde.org/mailman/listinfo/kde-quality
>
_______________________________________________
kde-quality mailing list
kde-quality@...
https://mail.kde.org/mailman/listinfo/kde-quality

Re: Closing program gracefully on receiving signal.

by Bugzilla from illogical1@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Dec 1, 2008 at 11:13 AM, Jos Poortvliet <jospoortvliet@...> wrote:

> On Fri, Nov 28, 2008 at 9:17 PM, Gunter Schelfhout
> <gunter.schelfhout@...> wrote:
>> Hello mailinglist,
>>
>> Recently I had a spreadsheet open with Kspread when my X-server crashed. No
>> input from keyboard or mouse was possible.
>> As mostly always is the case with our stable operating system, the kernel
>> was doing just fine as I was able to login remotely from another computer.
>> But even then I was in a lose-lose situation.
>> I could close Kspread before killing and restarting X, or I could go to
>> another init-level and go back to level 5.
>> But either way I would be losing my changes to my opened spreadsheet.
>>
>> This could be handled better, I'm afraid.
>>
>> I'm not a developer  but I know a little of system administration to come to
>> the next proposal, although I don't know if it is correct, doable or even
>> desirable.
>>
>> Wouldn't it be a good thing that any program which has an open file in a
>> dirty state to close gracefully upon receiving a certain and well documented
>> signal?
>> Kspread, Kword, Kate, or any other program should then save the file to a
>> default destination directory and set an option so the program knows upon
>> next start that there was a saving of the document after receiving a signal
>> and closing the application. (dirty bit/option)
>>
>> Perhaps this could be programmed as central and low as possible (maybe
>> kdeinit?), so that the developer of the application doesn't have to worry
>> about it.
>> I know some applications have the autosave option, but even then you would
>> lose some data and not all applications which have the opportunity to edit
>> some data have this option.
>
> It should be possible to instruct the application from the commandline
> using DBUS to save & quit, at least as long as the file has a name.
> Furthermore, KDE applications are slowly gaining crash-recovery
> functionality (Konqi has it now) which would help even more. Yeah,
> having such functionality kind'of default, in the libraries - sounds
> good, but I have no idea if that would be even possible, technically
> speaking.
Well, technically speaking, anything is possible. But is it feasible?

>
>> Greetings,
>>
>> Gunter Schelfhout
>>
_______________________________________________
kde-quality mailing list
kde-quality@...
https://mail.kde.org/mailman/listinfo/kde-quality