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

Re: [virt-tools-list] [PATCH 2 of 2] details: add gfx passwdValidTo



On 01/07/2011 02:53 PM, Marc-André Lureau wrote:
> # HG changeset patch
> # User Marc-André Lureau <marcandre lureau redhat com>
> # Date 1294427299 -3600
> # Node ID 3f68216b36c4da99e288c75929d20f05e316bddb
> # Parent  34ba155f908fd3fa666935fdd4a0e931c53b963b
> details: add gfx passwdValidTo
> 

I know we had talked about this briefly before, but I think it would be nice
if we moved this and password under an 'Authentication' expander.

Additionally an either example label (see vcpu pinning) or icon w/ tooltip
(see overview->security) showing the expected format for this field would be
helpful.

Thanks,
Cole

> diff -r 34ba155f908f -r 3f68216b36c4 src/virtManager/details.py
> --- a/src/virtManager/details.py	Fri Jan 07 15:14:33 2011 +0100
> +++ b/src/virtManager/details.py	Fri Jan 07 20:08:19 2011 +0100
> @@ -377,6 +377,7 @@
>  
>              "on_vnc_keymap_combo_changed": self.config_enable_apply,
>              "on_vnc_password_changed": self.config_enable_apply,
> +            "on_password_validto_changed": self.config_enable_apply,
>  
>              "on_sound_model_combo_changed": self.config_enable_apply,
>  
> @@ -1705,14 +1706,21 @@
>      # Graphics options
>      def config_graphics_apply(self, dev_id_info):
>          passwd = self.window.get_widget("gfx-password").get_text() or None
> +        passwdValidTo = self.window.get_widget("gfx-password-validto").get_text() or None
> +        if passwdValidTo == "never":
> +            passwdValidTo = None
>          keymap = self.get_combo_label_value("gfx-keymap")
>  
>          return self._change_config_helper([self.vm.define_graphics_password,
> +                                           self.vm.define_graphics_password_valid_to,
>                                             self.vm.define_graphics_keymap],
>                                            [(dev_id_info, passwd),
> +                                           (dev_id_info, passwdValidTo),
>                                             (dev_id_info, keymap)],
> -                                          [self.vm.hotplug_graphics_password],
> -                                          [(dev_id_info, passwd)])
> +                                          [self.vm.hotplug_graphics_password,
> +                                           self.vm.hotplug_graphics_password_valid_to],
> +                                          [(dev_id_info, passwd),
> +                                           (dev_id_info, passwdValidTo)])
>  
>  
>      # Video options
> @@ -2265,8 +2273,10 @@
>              address = (gfx.listen or "127.0.0.1")
>              keymap  = (gfx.keymap or None)
>              passwd  = gfx.passwd or ""
> +            passwdValidTo  = gfx.passwdValidTo or "never"
>  
>              show_text("password", passwd)
> +            show_text("password-validto", passwdValidTo)
>              show_text("port", port)
>              show_text("address", address)
>  
> diff -r 34ba155f908f -r 3f68216b36c4 src/virtManager/domain.py
> --- a/src/virtManager/domain.py	Fri Jan 07 15:14:33 2011 +0100
> +++ b/src/virtManager/domain.py	Fri Jan 07 20:08:19 2011 +0100
> @@ -209,6 +209,8 @@
>  
>      def hotplug_graphics_password(self, devobj, newval):
>          raise NotImplementedError()
> +    def hotplug_graphics_password_valid_to(self, devobj, newval):
> +        raise NotImplementedError()
>      def hotplug_storage_media(self, devobj, newpath):
>          raise NotImplementedError()
>      def hotplug_vcpus(self, vcpus):
> @@ -407,6 +409,10 @@
>          def change(editdev):
>              editdev.passwd = newval or None
>          return self._redefine_device(change, devobj)
> +    def define_graphics_password_valid_to(self, devobj, newval):
> +        def change(editdev):
> +            editdev.passwdValidTo = newval or None
> +        return self._redefine_device(change, devobj)
>      def define_graphics_keymap(self, devobj, newval):
>          def change(editdev):
>              editdev.keymap = newval
> @@ -1210,6 +1216,10 @@
>          devobj.passwd = newval or None
>          self.update_device(devobj)
>  
> +    def hotplug_graphics_password_valid_to(self, devobj, newval):
> +        devobj.passwdValidTo = newval or None
> +        self.update_device(devobj)
> +
>      ####################
>      # End internal API #
>      ####################
> @@ -1531,6 +1541,8 @@
>          return
>      def hotplug_graphics_password(self, devobj, newval):
>          return
> +    def hotplug_graphics_password_valid_to(self, devobj, newval):
> +        return
>      def hotplug_storage_media(self, devobj, newpath):
>          return
>      def hotplug_vcpus(self, vcpus):
> diff -r 34ba155f908f -r 3f68216b36c4 src/vmm-details.glade
> --- a/src/vmm-details.glade	Fri Jan 07 15:14:33 2011 +0100
> +++ b/src/vmm-details.glade	Fri Jan 07 20:08:19 2011 +0100
> @@ -4005,7 +4005,7 @@
>                                            <widget class="GtkTable" id="graphics-table">
>                                              <property name="visible">True</property>
>                                              <property name="border_width">3</property>
> -                                            <property name="n_rows">8</property>
> +                                            <property name="n_rows">9</property>
>                                              <property name="n_columns">2</property>
>                                              <property name="column_spacing">8</property>
>                                              <child>
> @@ -4094,8 +4094,8 @@
>                                                  <property name="mnemonic_widget">gfx-keymap-combo</property>
>                                                </widget>
>                                                <packing>
> -                                                <property name="top_attach">7</property>
> -                                                <property name="bottom_attach">8</property>
> +                                                <property name="top_attach">8</property>
> +                                                <property name="bottom_attach">9</property>
>                                                  <property name="x_options">GTK_FILL</property>
>                                                  <property name="y_options"></property>
>                                                </packing>
> @@ -4126,8 +4126,8 @@
>                                                <packing>
>                                                  <property name="left_attach">1</property>
>                                                  <property name="right_attach">2</property>
> -                                                <property name="top_attach">7</property>
> -                                                <property name="bottom_attach">8</property>
> +                                                <property name="top_attach">8</property>
> +                                                <property name="bottom_attach">9</property>
>                                                  <property name="x_options">GTK_FILL</property>
>                                                  <property name="y_options"></property>
>                                                </packing>
> @@ -4255,6 +4255,38 @@
>                                                  <property name="x_options">GTK_FILL</property>
>                                                </packing>
>                                              </child>
> +                                            <child>
> +                                              <widget class="GtkLabel" id="gfx-password-validto-title">
> +                                                <property name="visible">True</property>
> +                                                <property name="xalign">1</property>
> +                                                <property name="yalign">0</property>
> +                                                <property name="ypad">7</property>
> +                                                <property name="label" translatable="yes">_Password expires:</property>
> +                                                <property name="use_underline">True</property>
> +                                              </widget>
> +                                              <packing>
> +                                                <property name="top_attach">7</property>
> +                                                <property name="bottom_attach">8</property>
> +                                                <property name="x_options">GTK_FILL</property>
> +                                                <property name="y_options"></property>
> +                                              </packing>
> +                                            </child>
> +                                            <child>
> +                                              <widget class="GtkEntry" id="gfx-password-validto">
> +                                                <property name="visible">True</property>
> +                                                <property name="can_focus">True</property>
> +                                                <property name="visibility">True</property>
> +                                                <property name="invisible_char">â—�</property>
> +                                                <signal name="changed" handler="on_password_validto_changed"/>
> +                                              </widget>
> +                                              <packing>
> +                                                <property name="left_attach">1</property>
> +                                                <property name="right_attach">2</property>
> +                                                <property name="top_attach">7</property>
> +                                                <property name="bottom_attach">8</property>
> +                                                <property name="x_options">GTK_FILL</property>
> +                                              </packing>
> +                                            </child>
>                                            </widget>
>                                          </child>
>                                        </widget>
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list redhat com
> https://www.redhat.com/mailman/listinfo/virt-tools-list


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