From cce7bce9ac10816ef0bf77fdd49cdc707b5e6503 Mon Sep 17 00:00:00 2001 From: Aleksandr Karpov <31531412+alex-karpov@users.noreply.github.com> Date: Tue, 22 Oct 2024 21:45:35 +0700 Subject: [PATCH] feat: self-documented any control as start and finish (#446) --- languages/ru_RU/LC_MESSAGES/sportorg.po | 4 ++-- sportorg/gui/dialogs/timekeeping_properties.py | 8 ++++---- sportorg/models/memory.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/languages/ru_RU/LC_MESSAGES/sportorg.po b/languages/ru_RU/LC_MESSAGES/sportorg.po index 53076b6f..5ed616bd 100644 --- a/languages/ru_RU/LC_MESSAGES/sportorg.po +++ b/languages/ru_RU/LC_MESSAGES/sportorg.po @@ -603,8 +603,8 @@ msgstr "Из протокола" msgid "Start station" msgstr "Стартовая станция" -msgid "Control point" -msgstr "Контрольный пункт" +msgid "Control point (0 – any)" +msgstr "Контрольный пункт (0 – любой)" msgid "Start gate" msgstr "Стартовая калитка" diff --git a/sportorg/gui/dialogs/timekeeping_properties.py b/sportorg/gui/dialogs/timekeeping_properties.py index 1e080ac1..c94548c3 100644 --- a/sportorg/gui/dialogs/timekeeping_properties.py +++ b/sportorg/gui/dialogs/timekeeping_properties.py @@ -162,8 +162,8 @@ def init_ui(self): self.start_layout.addRow(self.item_start_protocol) self.item_start_station = QRadioButton(translate('Start station')) self.start_layout.addRow(self.item_start_station) - self.item_start_cp = QRadioButton(translate('Control point')) - self.item_start_cp_value = AdvSpinBox(maximum=999, max_width=60) + self.item_start_cp = QRadioButton(translate('Control point (0 – any)')) + self.item_start_cp_value = AdvSpinBox(minimum=-1, maximum=999, max_width=60) self.start_layout.addRow(self.item_start_cp, self.item_start_cp_value) self.item_start_gate = QRadioButton(translate('Start gate')) self.item_start_gate.setDisabled(True) @@ -176,8 +176,8 @@ def init_ui(self): self.item_finish_station = QRadioButton(translate('Finish station')) self.finish_layout.addRow(self.item_finish_station) - self.item_finish_cp = QRadioButton(translate('Control point')) - self.item_finish_cp_value = AdvSpinBox(-1, 999, max_width=60) + self.item_finish_cp = QRadioButton(translate('Control point (0 – any)')) + self.item_finish_cp_value = AdvSpinBox(minimum=-1, maximum=999, max_width=60) self.finish_layout.addRow(self.item_finish_cp, self.item_finish_cp_value) self.item_finish_beam = QRadioButton(translate('Light beam')) self.item_finish_beam.setDisabled(True) diff --git a/sportorg/models/memory.py b/sportorg/models/memory.py index db0f3b0d..eaa317e1 100644 --- a/sportorg/models/memory.py +++ b/sportorg/models/memory.py @@ -1011,7 +1011,7 @@ def get_start_time(self): return self.__start_time if len(self.splits): start_cp_number = obj.get_setting('system_start_cp_number', 31) - if start_cp_number == 0: + if start_cp_number in (0, -1): self.__start_time = self.splits[0].time return self.__start_time for split in self.splits: @@ -1034,7 +1034,7 @@ def get_finish_time(self) -> OTime: return self.__finish_time if len(self.splits): finish_cp_number = obj.get_setting('system_finish_cp_number', 90) - if finish_cp_number == -1: + if finish_cp_number in (0, -1): self.__finish_time = self.splits[-1].time return self.__finish_time for split in reversed(self.splits):