Browse Source

'/' symbols in task-names are not allowed anymore

Nico Ruhnke 2 years ago
parent
commit
b02184a0d6
1 changed files with 4 additions and 1 deletions
  1. 4 1
      time_recoder/time_recoder_gui/time_recorder_gui_main.py

+ 4 - 1
time_recoder/time_recoder_gui/time_recorder_gui_main.py

@@ -97,11 +97,14 @@ def event_loop(window):
                 print('Please select a Task before stopping the timer')
 
         if add_sub_task_button_is_pushed(event):
-            sub_task_name = window.Element(NEW_TASK_TEXT_KEY).get()
+            sub_task_name = str(window.Element(NEW_TASK_TEXT_KEY).get())
             sub_task_name_already_in_use = sub_task_name in taskHandler.get_task_tree_name_strings(
                 taskHandler.root_task)
+            sub_task_contains_slash = '/' in sub_task_name
             if sub_task_name_already_in_use:
                 print('Error: Task name ' + sub_task_name + ' already used, please enter another one')
+            elif sub_task_contains_slash:
+                print('Error: Task name ' + sub_task_name + " contains a '/' please enter a name without this symbol")
             elif sub_task_name:
                 parent_task_name = window.Element(TASK_TREE_COMBO_NAME).get()
                 if parent_task_name: