[master/rhel7] Only run gtk actions in the gtk thread.

David Shea dshea at redhat.com
Wed Feb 26 18:55:52 UTC 2014


Move a couple of things out of the AnaDataTimeThread that don't depend
on anything happening in the rest of the thread. Decorate _set_timezone
so that it can be called from the thread.

Resolves: rhbz#1067405
---
 pyanaconda/ui/gui/spokes/datetime_spoke.py | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
index 2ad9f95..103338c 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.py
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
@@ -395,6 +395,15 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke):
 
         self._regions_zones = timezone.get_all_regions_and_timezones()
 
+        # Set the initial sensitivity of the AM/PM toggle based on the time-type selected
+        self._radioButton24h.emit("toggled")
+
+        if not flags.can_touch_runtime_system("modify system time and date"):
+            self._set_date_time_setting_sensitive(False)
+
+        self._config_dialog = NTPconfigDialog(self.data)
+        self._config_dialog.initialize()
+
         threadMgr.add(AnacondaThread(name=constants.THREAD_DATE_TIME,
                                      target=self._initialize))
 
@@ -424,9 +433,6 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke):
         for city, xlated in sorted(cities, cmp=_compare_cities):
             self.add_to_store_xlated(self._citiesStore, city, xlated)
 
-        if self._radioButton24h.get_active():
-            self._set_amPm_part_sensitive(False)
-
         self._update_datetime_timer_id = None
         if timezone.is_valid_timezone(self.data.timezone.timezone):
             self._set_timezone(self.data.timezone.timezone)
@@ -436,12 +442,6 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke):
             self._set_timezone(DEFAULT_TZ)
             self.data.timezone.timezone = DEFAULT_TZ
 
-        if not flags.can_touch_runtime_system("modify system time and date"):
-            self._set_date_time_setting_sensitive(False)
-
-        self._config_dialog = NTPconfigDialog(self.data)
-        self._config_dialog.initialize()
-
         time_init_thread = threadMgr.get(constants.THREAD_TIME_INIT)
         if time_init_thread is not None:
             hubQ.send_message(self.__class__.__name__,
@@ -531,6 +531,7 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke):
 
         self._ntpSwitch.set_active(ntp_working)
 
+    @gtk_action_nowait
     def _set_timezone(self, timezone):
         """
         Sets timezone to the city/region comboboxes and the timezone map.
-- 
1.8.5.3



More information about the anaconda-patches mailing list