[Kommander-devel] DCOP quit throws parse error
Eric Laffoon
eric at kdewebdev.org
Thu Mar 2 14:18:49 EST 2006
On Wednesday 01 March 2006 12:47 pm, Eric Laffoon wrote:
> On Wednesday 01 March 2006 6:32 am, Andras Mantia wrote:
> > I suspect some kind of parser error. This one partially works:
> > @exec("dcop @dcopid MainApplication-Interface quit")
> >
> > Partially because "quit" quits the question dialog. I don't know how the
> > message dialogs are implemented, but there seems to be some problem.
> > Try to issue quit in kdcop and you will get the face the same issue.
> >
> > Andras
>
> I'm able to issue the command from a shell with the correct ID and without
> parenthesis. Your solution does not throw an error, but it doesn't close
> the dialog either. The error was ugly, but had a close option. ;-)
>
> What I was saying was if you are inside a function and call close from DCOP
> maybe it is being blocked and the command isn't buffered or something like
> that? Does it commit the close for you?
I have a sort of breakthrough here. The following is the code to put in the
initialization routine of a dialog.
===
@# see if we are running as root and throw dialog if not
@if(@exec(whoami) != "root") then
@switch(
@Message.warning(In order to run this you must run as root - @dcopid -
@parentpid, Need to run as root, Open as root, Run anyway, Cancel))
@# handle dialog ouput
@case(1)
@exec(kdesu kmdr-executor @global(_KDDIR)/@global(_NAME))
@dcop(@dcopid, MainApplication-Interface, "quit()")
@case(2)
@#nothing to do
@case(3)
@exec(dcop kmdr-executor- at parentpid MainApplication-Interface quit)
@end
@endif
===
I realized I had a problem when I thought about what Andras said that the
quit() command closed the messagebox. I opened the dialog and left the
messagebox on top and opened a shell...
dcop | grep kmdr-executor
This returns two pids and interestingly only the dcopid matches. The parent is
wrong. We had this issue before where an interim process was called making
child dialogs and also using Quanta as a parent a real problem. We should
have a working solution for the next version as well as a work around for the
current one. Any ideas? Previously we were passing it to child dialogs as a
global variable IIRC using the dialog command. Obviously that's not so good
if it's not universal.
--
Eric Laffoon
Project Lead - kdewebdev module
More information about the Kommander-devel
mailing list