On 05/22/2012 03:49 AM, Michal Privoznik wrote:
On 18.05.2012 19:27, Eric Blake wrote:
> On 05/18/2012 06:48 AM, Michal Privoznik wrote:
>> If users *-edit but make a mistake in XML all changes are
>> permanently lost. However, if virsh is not running within
>> a script we can as user if he wants to re-edit the file
>
>
> [1] ...you are blindly calling it from all platforms here. You need to
> fix mingw compilation.
Okay, on mingw I've make vshAskReedit function return always 0.
Makes sense - if we don't know how to ask the question, then it is the
same as if we asked the question and the answer was successfully 'no'.
> /* TRANSLATORS: For now, we aren't using LC_MESSAGES, and
the user
> choices really are limited to just 'y' and 'n'. */
> vshPrintf(ctl, "\r%s", _("Failed. Try again..."));
Well, if I take into account your last e-mail, how should this message
look like? I mean - how offer users 3 choices with intuitive names hence
shortcuts?
Failed. [R]eedit/[S]tart over again/[Q]uit?
Eww. That does raise an interesting question. Maybe it's better to make
it a two part question:
1. Simultaneous external edit detected. Continue your edit [y/n]?
and if yes,
2. Discard local edits by reloading external state [y/n]?
or something along those lines, where we can at a minimum reuse our
yes/no parsing (and thus have only one place that needs to learn I18N in
the future).
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org