Dne 6.10.2011 08:51, [email protected] 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
[email protected]
SUSE
-- 
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]

Reply via email to