(stdscr)
| 479 | |
| 480 | # Add note (curses) |
| 481 | def add_note_curses(stdscr): |
| 482 | try: |
| 483 | notes = load_notes() |
| 484 | name = curses_input(stdscr, 'Note name:') |
| 485 | if name is None or not name.strip(): |
| 486 | return |
| 487 | name = name.strip() |
| 488 | if name in notes: |
| 489 | overwrite = curses_input(stdscr, 'Overwrite existing? (y/N):', 'N') |
| 490 | if not overwrite or overwrite.lower() not in ('y'): |
| 491 | return |
| 492 | new = curses_editor(stdscr, notes.get(name, '')) |
| 493 | if new is None: |
| 494 | return |
| 495 | notes[name] = new |
| 496 | save_notes(notes) |
| 497 | except Exception as e: |
| 498 | log_exception(e) |
| 499 | error_dialog(stdscr, 'Add note error', traceback.format_exc()) |
| 500 | |
| 501 | # Date/time picker |
| 502 | def curses_date_picker(stdscr, initial_dt=None): |
no test coverage detected