mbridak / not1mm

Not1MM != N1MM, An amateur radio contest logger for Linux.
GNU General Public License v3.0
93 stars 20 forks source link

Log window crashes when entering an incorrect number #33

Closed qsantos closed 1 year ago

qsantos commented 1 year ago

Describe the bug When an incorrect number is entered for the frequency in the log window, it crashes, and can never be opened any more, even by restarting not1mm.

To Reproduce Steps to reproduce the behavior:

  1. Ensure there is a log entry
  2. In the menus, click on “Window”, then “Log Window”
  3. Double-click on the frequency for one of the log entries to edit it
  4. Type “123.456.789”
  5. Press return to confirm

Expected behavior Either the input should not be accepted, or it should be saved as-is, with optionally an indication that it is malformed (e.g. red color).

Screenshots

Traceback (most recent call last):
  File "/home/qsantos/.local/pipx/venvs/not1mm/lib/python3.11/site-packages/not1mm/logwindow.py", line 807, in <module>
    window = MainWindow()
             ^^^^^^^^^^^^
  File "/home/qsantos/.local/pipx/venvs/not1mm/lib/python3.11/site-packages/not1mm/logwindow.py", line 145, in __init__
    self.get_log()
  File "/home/qsantos/.local/pipx/venvs/not1mm/lib/python3.11/site-packages/not1mm/logwindow.py", line 487, in get_log
    QtWidgets.QTableWidgetItem(str(round(float(freq), 2))),
                                         ^^^^^^^^^^^
ValueError: could not convert string to float: '123.456.789'

Desktop:

Additional context -

mbridak commented 1 year ago

Thanks for the report. It should be fixed soon.

mbridak commented 1 year ago

fixed with 23.9.3.1

qsantos commented 1 year ago

I confirm that this is fixed. Thanks!