[yast-devel] Re: [yast-commit] r66278 - in /branches/SuSE-Code-11-SP2-Branch/pos-installation: ./ package/ src/clients/ src/modules/
![](https://seccdn.libravatar.org/avatar/654c5b4f0d657240edff9440a901839b.jpg?s=120&d=mm&r=g)
Dne 6.10.2011 08:51, jsuchome@svn2.opensuse.org napsal(a):
+ // help text + string help_text = _("<p>FIXME fill this</p>");
Do not forget to fix it ;-)
+ + while (true) + { + ret = (symbol) UI::PollInput(); + if (SCR::Read(.process.running, pid) != true) + { + update_output (); + // explicitely check the process buffer after exit (bnc#488799) + string buf = (string) SCR::Read (.process.read, pid); + string err_buf = (string) SCR::Read (.process.read_stderr, pid); + if (buf != nil && buf != "") + UI::ChangeWidget (`id(`stdout), `LastLine, buf + "\n"); + if (err_buf != nil && err_buf != "") + UI::ChangeWidget (`id(`stderr), `LastLine, err_buf + "\n"); + + integer status = (integer) SCR::Read (.process.status, pid); + y2internal ("exit status of the script: %1", status); + UI::ReplaceWidget (`id (`rp_label), + // text label + `Label (`id (`label), `opt (`boldFont), _("Installation is completed.")) + ); + break; + } + else + { + update_output (); + } + if (ret == `cancel || ret == `abort) + { + SCR::Execute (.process.kill, pid, 15); + UI::ReplaceWidget (`id (`rp_label), + // text label + `Label (`id (`label), `opt (`boldFont), _("Installation has been aborted.")) + ); + break; + } + sleep (100); + } + + SCR::Execute (.process.kill, pid);
It seems that the same (or very similar) code is also in firstboot_slepos_synchronization.ycp file, maybe it could be factored out and shared...
+ while (true) + { + ret = UI::UserInput (); + if (ret == `abort && !Popup::ConfirmAbort (`incomplete)) + { + continue; + } + else + { + break; + } + }
I think this could be rewritten to something like this: do { ret = UI::UserInput(); } while(ret == `abort && !Popup::ConfirmAbort (`incomplete)); -- Ladislav Slezák Appliance department / YaST Developer Lihovarská 1060/12 190 00 Prague 9 / Czech Republic tel: +420 284 028 960 lslezak@suse.com SUSE -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/c6230e4ce683f6f38991d06b0df892bc.jpg?s=120&d=mm&r=g)
Dne Pá 7. října 2011 16:01:25 Ladislav Slezak napsal(a):
Dne 6.10.2011 08:51, jsuchome@svn2.opensuse.org napsal(a):
+ // help text + string help_text = _("<p>FIXME fill this</p>");
Do not forget to fix it ;-)
Yes, sure, others need to fill this (and they know).
+ SCR::Execute (.process.kill, pid);
It seems that the same (or very similar) code is also in firstboot_slepos_synchronization.ycp file, maybe it could be factored out and shared...
Maybe...
+ while (true) + { + ret = UI::UserInput (); + if (ret == `abort && !Popup::ConfirmAbort (`incomplete)) + { + continue; + } + else + { + break; + } + }
I think this could be rewritten to something like this:
do { ret = UI::UserInput(); } while(ret == `abort && !Popup::ConfirmAbort (`incomplete));
Yes, you are right, looks like there was some more there before and than got simplified. I may adapt this in next iteration (which will come soon). j -- Jiri Suchomel SUSE LINUX, s.r.o. e-mail: jsuchome@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Praha 9, Czech Republic http://www.suse.cz -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (2)
-
Jiri Suchomel
-
Ladislav Slezak