Skip to content

Commit

Permalink
fixed zero leading in calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
lapisdecor committed Feb 25, 2017
1 parent 565afa5 commit aa4dce3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions alarmdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def __init__(self, parent):
self.minutes_field = Gtk.SpinButton()
self.hours_field.set_adjustment(hour_adjustment)
self.minutes_field.set_adjustment(minute_adjustment)
self.hours_field.connect('output', self.show_leading_zeros)
self.minutes_field.connect('output', self.show_leading_zeros)

# creates a : separator between the two SpinButtons
time_sep_label = Gtk.Label()
Expand All @@ -44,5 +46,10 @@ def __init__(self, parent):

self.show_all()

def show_leading_zeros(self, spin_button):
adjustement = spin_button.get_adjustment()
spin_button.set_text('{:02d}'.format(int(adjustement.get_value())))
return True

#def get_alarm():
# return self.alarm_time
1 change: 0 additions & 1 deletion bzoing.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def monitor():
n = 0
waiting_list = []
# TODO load the postphoned alarms from file and put them on list_of_alarms
# TODO if day has changed get from the waiting_list and put on the list_of_alarms
while True:
# get the new items in list_of_alarms
# and start threads for them
Expand Down
2 changes: 1 addition & 1 deletion tasklistwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, task_list):

for each_task in self.this_list:
# creates one Gtk.Label for each item in the list_of_tasks
list_of_gtk_labels.append(Gtk.Label(each_task.get_task_desc()))
list_of_gtk_labels.append(Gtk.Label(each_task.get_task_desc() + " - " + str(each_task.get_alarm())))

for label in list_of_gtk_labels:
box.pack_start(label, 0, 0, 2)
Expand Down
1 change: 1 addition & 0 deletions taskwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def button_alarm_clicked(self, button):
Creates the Alarm Dialog and stores the date and the time
in the TaskWindow object
"""
#TODO must allways input a description ?
my_alarm = alarmdialog.AlarmDialog(self)
response = my_alarm.run()
if response == Gtk.ResponseType.OK:
Expand Down

0 comments on commit aa4dce3

Please sign in to comment.