Skip to content

Commit

Permalink
tracking: Improve categoryless fact serialization
Browse files Browse the repository at this point in the history
When serializing facts for the 'continue tracking' functionality, we
need to make sure that the 'uncategorized' placeholder is omitted,
otherwise a category of that name would be created!

Ref.: #136
  • Loading branch information
elbenfreund committed May 4, 2018
1 parent 2177d68 commit 4b2819b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hamster_gtk/tracking/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def add_row_widgets(row_index, activity):
"""
def get_label(activity):
"""Label representing the activity/category combination."""
label = Gtk.Label(helpers.serialize_activity(activity))
label = Gtk.Label(helpers.serialize_activity(activity, none_category=''))
label.set_halign(Gtk.Align.START)
return label

Expand All @@ -335,14 +335,14 @@ def get_copy_button(activity):
actually starting the tracking.
"""
button = Gtk.Button('Copy')
activity = helpers.serialize_activity(activity)
activity = helpers.serialize_activity(activity, none_category='')
button.connect('clicked', self._on_copy_button, activity)
return button

def get_start_button(activity):
"""A button that will start a new ongoing fact based on that activity."""
button = Gtk.Button('Start')
activity = helpers.serialize_activity(activity)
activity = helpers.serialize_activity(activity, none_category='')
button.connect('clicked', self._on_start_button, activity)
return button

Expand Down

0 comments on commit 4b2819b

Please sign in to comment.