Google
  Web www.spinics.net

[PATCH 14/14] Add 24-hour/AMPM RadioButtons functionality

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


---
 pyanaconda/ui/gui/spokes/datetime_spoke.py |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
index 546ceba..b66a282 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.py
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
@@ -99,6 +99,10 @@ class DatetimeSpoke(NormalSpoke):
         self._citiesSort.set_sort_column_id(0, 0) #column 0, Ascending
 
         self._mod_hours = 13 #TODO: change on timeformat RB change
+        self._radioButton24h = self.builder.get_object("timeFormatRB")
+        if self._radioButton24h.get_active():
+            self._set_amPm_part_sensitive(False)
+
         self._tzmap.set_timezone("Europe/Prague")
 
     @property
@@ -153,6 +157,14 @@ class DatetimeSpoke(NormalSpoke):
 
         return city in self._regions_zones[region]
 
+    def _set_amPm_part_sensitive(self, sensitive):
+        amPmUp = self.builder.get_object("amPmUpButton")
+        amPmDown = self.builder.get_object("amPmDownButton")
+        amPmLabel = self.builder.get_object("amPmLabel")
+
+        for widget in (amPmUp, amPmDown, amPmLabel):
+            widget.set_sensitive(sensitive)
+
     def on_up_hours_clicked(self, *args):
         hours_label = self.builder.get_object("hoursLabel")
         hours = int(hours_label.get_text())
@@ -248,5 +260,10 @@ class DatetimeSpoke(NormalSpoke):
 
             itr = self._citiesSort.iter_next(itr)
 
-    def on_timeformat_changed(self, *args):
-        pass
+    def on_timeformat_changed(self, button24h, *args):
+        #connected to 24-hour radio button
+        if button24h.get_active():
+            self._set_amPm_part_sensitive(False)
+        else:
+            self._set_amPm_part_sensitive(True)
+
-- 
1.7.4.4

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


[Home]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Red Hat 9 Bible]     [Fedora Bible]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

Powered by Linux

Google
  Web www.spinics.net