From 2600c6fbc777b59f6c108521ff4c972ced1ac1e5 Mon Sep 17 00:00:00 2001 From: Eric Goller Date: Fri, 4 May 2018 15:41:25 +0200 Subject: [PATCH] tracking: Make sure facts without category get serialized as ineeded 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 --- hamster_gtk/tracking/screens.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hamster_gtk/tracking/screens.py b/hamster_gtk/tracking/screens.py index 690d97c0..1688e1fe 100644 --- a/hamster_gtk/tracking/screens.py +++ b/hamster_gtk/tracking/screens.py @@ -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 @@ -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