From quanta Mon Oct 10 21:18:15 2005 From: Sasha Andric Date: Mon, 10 Oct 2005 21:18:15 +0000 To: quanta Subject: Re: [Quanta] quata and php actions Message-Id: <200510101818.15321.sasha () goldnet ! ca> X-MARC-Message: https://marc.info/?l=quanta&m=112897914305126 Sorry, > if ($d && trim(`dcop $d Quanta focus`) == 'true' ){ does not work all the time > if ($d && trim(`dcop $d Quanta isActiveWindow`) == 'true' ){ does work just fine - so far. Sasha On October 10, 2005 04:36 pm, Sasha Andric wrote: > Some of my php files are automatically encoded when they are saved. These > actions are scripted in php. Someone might find this useful. > > // this will find currently active/focused instance of quanta > $dcopid = ''; > $dcopids = trim(`dcop | grep quanta`); > $dcopids = explode ("\n" , $dcopids) ; > foreach ($dcopids as $d ) { > $d = trim($d); > if ($d && trim(`dcop $d Quanta focus`) == 'true' ){ > $dcopid = $d ; > break; > } > } > > // this is how to print error message so it returns to quanta > // and pop up messages dock > if ($err) { > $fp = fopen("php://stderr", "w"); > if ($fp) { > fputs($fp, "$err\n"); > fclose($fp); > } > exit (1); > } > _______________________________________________ > Quanta mailing list > Quanta@mail.kde.org > https://mail.kde.org/mailman/listinfo/quanta _______________________________________________ Quanta mailing list Quanta@mail.kde.org https://mail.kde.org/mailman/listinfo/quanta