[Kimchi-devel] [PATCH v2 2/3] Add a check in the UI for the new 'persistent' flag of a VM.

Paulo Ricardo Paz Vital pvital at linux.vnet.ibm.com
Thu Aug 21 20:28:06 UTC 2014


-- 
Reviewed-by: Paulo Vital <pvital at linux.vnet.ibm.com>


On Thu, 2014-08-21 at 15:18 -0500, Christy Perez wrote:
> If the VM is non-persistent, report the danger of using Power Off.
> If the VM is persistent, warn that data may be lost (the current warning).
> 
> Signed-off-by: Christy Perez <christy at linux.vnet.ibm.com>
> ---
>  po/en_US.po                    | 3 +++
>  po/pt_BR.po                    | 3 +++
>  po/zh_CN.po                    | 3 +++
>  ui/js/src/kimchi.guest_main.js | 6 +++++-
>  ui/pages/i18n.json.tmpl        | 1 +
>  5 files changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/po/en_US.po b/po/en_US.po
> index a34da3a..ef4b127 100644
> --- a/po/en_US.po
> +++ b/po/en_US.po
> @@ -1371,6 +1371,9 @@ msgstr ""
>  "This action may produce undesirable results, for example unflushed disk "
>  "cache in the guest. Would you like to continue?"
>  
> +msgid "This VM is not persistent. Power Off will delete it. Continue?"
> +msgstr "This VM is not persistent. Power Off will delete it. Continue?"
> +
>  msgid "Reset Confirmation"
>  msgstr "Reset Confirmation"
>  
> diff --git a/po/pt_BR.po b/po/pt_BR.po
> index 452e778..0edba09 100644
> --- a/po/pt_BR.po
> +++ b/po/pt_BR.po
> @@ -1434,6 +1434,9 @@ msgstr ""
>  "Essa ação pode produzir resultados não desejáveis, como por exemplo cache de "
>  "disco não atualizado no guest. Deseja continuar?"
>  
> +msgid "This VM is not persistent. Power Off will delete it. Continue?"
> +msgstr "A máquina virtual não é persistente. Desligá-la irá removê-la. Deseja continuar?"
> +
>  msgid "Reset Confirmation"
>  msgstr "Confirmação de reinicialização"
>  
> diff --git a/po/zh_CN.po b/po/zh_CN.po
> index 83c7018..5b6ed6e 100644
> --- a/po/zh_CN.po
> +++ b/po/zh_CN.po
> @@ -1318,6 +1318,9 @@ msgid ""
>  "cache in the guest. Would you like to continue?"
>  msgstr "这样做可能导致不良后果,比如客户机磁盘缓存未刷新,确认要继续吗?"
>  
> +msgid "This VM is not persistent. Power Off will destroy it. Continue?"
> +msgstr "This VM is not persistent. Power Off will destroy it. Continue?"
> +
>  msgid "Reset Confirmation"
>  msgstr "重置确认"
>  
> diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js
> index ff6f2e1..ff66744 100644
> --- a/ui/js/src/kimchi.guest_main.js
> +++ b/ui/js/src/kimchi.guest_main.js
> @@ -43,9 +43,13 @@ kimchi.vmpoweroff = function(event) {
>          button.addClass('loading');
>          var vm=button.closest('li[name=guest]');
>          var vm_id=vm.attr("id");
> +        var vmObject=vm.data();
> +        var vm_persistent=vmObject.persistent == true;
> +        var content_msg = vm_persistent ? i18n['KCHVM6003M'] :
> +            i18n['KCHVM6009M'];
>          var settings = {
>              title : i18n['KCHVM6002M'],
> -            content : i18n['KCHVM6003M'],
> +            content : content_msg,
>              confirm : i18n['KCHAPI6002M'],
>              cancel : i18n['KCHAPI6003M']
>          };
> diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl
> index cbcd077..fc5d5e4 100644
> --- a/ui/pages/i18n.json.tmpl
> +++ b/ui/pages/i18n.json.tmpl
> @@ -127,6 +127,7 @@
>      "KCHVM6006M": "$_("Shut Down Confirmation")",
>      "KCHVM6007M": "$_("Note the guest OS may ignore this request. Would you like to continue?")",
>      "KCHVM6008M": "$_("VM Delete Confirmation")",
> +    "KCHVM6009M": "$_("This VM is not persistent. Power Off will delete it. Continue?")",
>  
>      "KCHVMCD6001M": "$_("This CDROM will be detached permanently and you can re-attach it. Continue to detach it?")",
>      "KCHVMCD6002M": "$_("Attach")",




More information about the Kimchi-devel mailing list