Mailinglist Archive: yast-devel (78 mails)

< Previous Next >
[yast-devel] Re: [yast-commit] r66278 - in /branches/SuSE-Code-11-SP2-Branch/pos-installation: ./ package/ src/clients/ src/modules/
Dne 6.10.2011 08:51, jsuchome@xxxxxxxxxxxxxxxxx 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@xxxxxxxx
SUSE
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups