Re: [newui] [PATCH] Initialize and refresh the layoutsStore correctly

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

 



> diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py
> index 943ca60..38fdf14 100644
> --- a/pyanaconda/ui/gui/spokes/keyboard.py
> +++ b/pyanaconda/ui/gui/spokes/keyboard.py
> @@ -161,15 +161,20 @@ class KeyboardSpoke(NormalSpoke):
>                                              self._xkl_wrapper)
>  
>          self._store = self.builder.get_object("addedLayoutStore")
> -        self._addLayout(self._store, "us")
> +        if self.data.keyboard.layouts_list:
> +            for layout in self.data.keyboard.layouts_list:
> +                self._addLayout(self._store, layout)
> +        else:
> +            self._addLayout(self._store, "us")
>  
>      def refresh(self):
>          NormalSpoke.refresh(self)
>  
>          # Clear and repopulate addedLayoutStore with values from self.data
>          self._store.clear()
> -        for layout in self.data.keyboard.layouts_list:
> -            self._addLayout(self._store, layout)
> +        if self.data.keyboard.layouts_list:
> +            for layout in self.data.keyboard.layouts_list:
> +                self._addLayout(self._store, layout)
>  
>          self._upButton = self.builder.get_object("upButton")
>          self._downButton = self.builder.get_object("downButton")

Since you're doing the same thing twice, consider a function to do it.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux