Mathias Bauer schrieb:
Hi Andreas,

Andreas Schlüns wrote:

I wrote a little cute java program that is converting documents via OOo.
This conversion machine is running hidden. It will fail, even crash down
if someone uses OOo in foreground and closes the last opened window. For
this reason I registered a TerminateListener that throws a
TerminateVetoException, which prevents my lovely program from crashing.
But this exception even prevents the user to close his visible document(s).

Is there a solution, to use the CloseListener (or any other Listener)
that allows the user to close the visible OOo desktop, but prevents my
hidden document and OOo to close?
No ... currently not (not realy).

Andreas, do you remember what was the reason for the current design
decision to prevent the tasks from being closed just because a
TerminateListener opted against termination?

Yes ... e.g. the QuickStarter wish to disagree with closing of the office ... but not to supress closing of frames. But the (old) Desktop.terminate() API doesnt have an option to differ between these two modes: closing app / closing frames.

So the QuickStarter implementation is well known to the desktop (by checking the implementation name of every terminate listener and using the QuickStarter-TerminateListener object explicitly). But this is more a "workaround" then a solution.


The problem of Tobias lets me think that the current way of doing things
isn't helpful for those who use a termination listener. Or let's put it
the other way around: what kind of evil things would/could happen if we
first closed all tasks and then called queryTermination() as we do for
the Quickstarter?

As I said ... the QuickStarter is used differently to all other terminate listener .-) Of course I can change this behaviour ... but we dont know, which "real" terminate listener whish to have the old behaviour.

By the way ... there is an example, why terminate shouldnt close any document before asking all registered listener:

I know OOo programmer who wrote scripts/addon's, which open several documents at the same time. And they whished to supress closing of this set of documents. But instead of listen for close events on every document/frame ... they decided to listen for terminate events only. So these terminate listener uses the "shortest way" to hinder the office on closing these frames .-)

Yes ... that's wrong - but it's public. An yes: there is no guarantee that these frames wont be closed by other objects (other then the desktop).


Of course we would be at the mercy of the listener that he will
terminate OOo later and so prevent a running OOo instance without any
visual elements that allow to close it. But isn't that the idea behind
the TerminateListener anyway?

I dont like the idea that Desktop.terminate() is used for closing a "visible office" only. Internal it does not differ between hidden and visible documents. Terminate closes it all.

Mathias: Do you realy like to open the "Büchse der Pandora" here .-)


Ciao,
Mathias

Ciao
Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to