Commit 4c426b1b authored by Gaute Hope's avatar Gaute Hope

FreeBSD at support range of hour from 0 to 23

parent 79d693bf
......@@ -40,6 +40,11 @@ class AtEditor:
self.scheduler = scheduler
self.template = template
# FreeBSD supports time ranges between 0 and 23:59
if self.scheduler.sysname == 'FreeBSD':
self.HOUR_MAX = 23
else:
self.HOUR_MAX = 24
self.widget = self.xml.get_widget("at_editor")
self.xml.signal_connect("on_at_editor_delete", self.on_button_cancel_clicked)
......@@ -116,7 +121,6 @@ class AtEditor:
self.spin_year.set_range (year, year + 5847) # TODO: Year +5847 compatability
self.timeout_handler_id = gobject.timeout_add(60 * 1000, self.__check_spins__)
def showadd (self, transient):
self.button_save.set_label (gtk.STOCK_ADD)
self.__reset__ ()
......@@ -417,11 +421,11 @@ class AtEditor:
mi, ma = self.spin_hour.get_range ()
if (cyear and cmonth and cday):
if (mi != hour):
self.spin_hour.set_range (hour, 24)
self.spin_hour.set_range (hour, self.HOUR_MAX)
mi = hour
else:
if ((mi != 0) or (ma != 24)):
self.spin_hour.set_range (0, 24)
self.spin_hour.set_range (0, self.HOUR_MAX)
if (mi <= shour <= ma):
self.spin_hour.set_value (shour)
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment