Compare commits

...

3 Commits

Author SHA1 Message Date
dd647d6963
fix: DbScoreTableModel score committing 2023-10-21 18:59:42 +08:00
7de2eda517
impr: score validation 2023-10-21 18:58:30 +08:00
d918032b9c
impr: log uncaught exceptions 2023-10-21 14:00:27 +08:00
3 changed files with 15 additions and 2 deletions

View File

@ -23,6 +23,19 @@ rootLoggerFormatter = logging.Formatter(
)
def handle_exception(exc_type, exc_value, exc_traceback):
if issubclass(exc_type, KeyboardInterrupt):
sys.__excepthook__(exc_type, exc_value, exc_traceback)
return
rootLogger.critical(
"Uncaught exception", exc_info=(exc_type, exc_value, exc_traceback)
)
sys.excepthook = handle_exception
if __name__ == "__main__":
QCoreApplication.setApplicationName("Arcaea Offline")

View File

@ -131,7 +131,7 @@ class DbScoreTableModel(DbTableModel):
return False
if index.column() == 2 and isinstance(value, Score) and role == self.ScoreRole:
self._db.update_score(self.__items[index.row()][self.IdRole], value)
self._db.update_score(value)
self.syncDb()
return True

View File

@ -302,7 +302,7 @@ class ScoreEditor(Ui_ScoreEditor, QWidget):
if score.score is None:
flags |= ScoreValidateResult.ScoreIncomplete
elif score.pure is None or score.far is None:
elif score.pure is None or score.far is None or score.lost is None:
flags |= ScoreValidateResult.ScoreIncompleteForValidate
elif self.__chart.notes is not None:
score_range = calculate_score_range(