Re: [virt-manager PATCH 3/3] addhardware: add a tool tip when USB controller already existed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx> writes:

> diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
> index 0678f03..4c1e21c 100644
> --- a/virtManager/addhardware.py
> +++ b/virtManager/addhardware.py
> @@ -869,9 +869,20 @@ class vmmAddHardware(vmmGObjectUI):
>      def populate_controller_model(self, src):
>          ignore = src
>  
> +        def show_tooltip(tooltip):

maybe you can add a "value" parameter here?


> +            vmname = self.vm.get_name()
> +            tooltip = (_("%s already has a USB controller attached.\n"
> +            "Adding more than one USB controller is not supported.\n"
> +            "You can change the USB controller type in the VM details screen.")
> +            % vmname)
> +            model_tooltip.set_visible(True)
> +            model_tooltip.set_tooltip_text(tooltip)
> +
>          controller_type = self.get_config_controller_type()
>          modellist = self.widget("controller-model")
>          modellist.set_sensitive(True)
> +        model_tooltip = self.widget("controller-tooltip")
> +        model_tooltip.set_visible(False)

so that the function can be used instead of these two lines:

show_tooltip(model_tooltip, False)


>  
>          controllers = self.vm.get_controller_devices()
>          if controller_type == VirtualController.TYPE_USB:
> @@ -883,6 +894,7 @@ class vmmAddHardware(vmmGObjectUI):
>                  self._remove_usb_controller = usb_controllers[0]
>                  self.widget("create-finish").set_sensitive(True)
>              else:
> +                show_tooltip(model_tooltip)

and this will become: show_tooltip(model_tooltip, True)

Regards,
Giuseppe

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux