[virt-tools-list] Resize bugfix

Cole Robinson crobinso at redhat.com
Fri Feb 28 17:59:08 UTC 2014


On 02/28/2014 12:44 PM, Maros Zatko wrote:
>>From c6cf843389d9a9e49494756d3448b3cd9ae42191 Mon Sep 17 00:00:00 2001
> From: Maros Zatko <mzatko at redhat.com>
> Date: Thu, 27 Feb 2014 16:14:55 +0100
> Subject: [PATCH 1/3] vmmConsolePages: toggle visibilities on page change
>


Patches in general look fine. Some comments on #1 and #2 below.

To get proper threading and to ease review, I'd recommend doing:

git format-patch -3 --cover-letter
<edit patch 0000>
git send-email *.patch

> ---
>  virtManager/console.py | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/virtManager/console.py b/virtManager/console.py
> index 6ac8abc..b42925c 100644
> --- a/virtManager/console.py
> +++ b/virtManager/console.py
> @@ -1281,6 +1281,7 @@ class vmmConsolePages(vmmGObjectUI):
>  
>      def activate_auth_page(self, withPassword=True, withUsername=False):
>          (pw, username) = self.config.get_console_password(self.vm)
> +
>          self.widget("details-menu-vm-screenshot").set_sensitive(False)
>          self.widget("details-menu-usb-redirection").set_sensitive(False)
>  

Spurious whitespace change, please drop this.

> @@ -1319,8 +1320,16 @@ class vmmConsolePages(vmmGObjectUI):
>              self.widget("details-menu-usb-redirection").set_sensitive(True)
>              return
>  
> -    def page_changed(self, ignore1=None, ignore2=None, ignore3=None):
> +    def page_changed(self, ignore1=None, ignore2=None, newpage=None):
>          pagenum = self.widget("console-pages").get_current_page()
> +
> +        for i in range(self.widget("console-pages").get_n_pages()):
> +          w = self.widget("console-pages").get_nth_page(i)
> +          if i == newpage:
> +            w.set_visible(True)
> +          else:
> +            w.set_visible(False)
> +
>          if pagenum < CONSOLE_PAGE_OFFSET:
>              self.last_gfx_page = pagenum
>          self.set_allow_fullscreen()

Can be simplified as

w.set_visible(i == newpage)

Same with patch #2

Thanks,
Cole




More information about the virt-tools-list mailing list