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

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

 



Since the spoke's status is queried even before the refresh method is invoked we
need to populate the store in the initialize method.
---
 pyanaconda/ui/gui/spokes/keyboard.py |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

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")
-- 
1.7.4.4

_______________________________________________
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