Skip to content

Commit

Permalink
feat: self-documented any control as start and finish (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-karpov authored Oct 22, 2024
1 parent b92bee7 commit cce7bce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions languages/ru_RU/LC_MESSAGES/sportorg.po
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,8 @@ msgstr "Из протокола"
msgid "Start station"
msgstr "Стартовая станция"

msgid "Control point"
msgstr "Контрольный пункт"
msgid "Control point (0 – any)"
msgstr "Контрольный пункт (0 – любой)"

msgid "Start gate"
msgstr "Стартовая калитка"
Expand Down
8 changes: 4 additions & 4 deletions sportorg/gui/dialogs/timekeeping_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions sportorg/models/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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):
Expand Down

0 comments on commit cce7bce

Please sign in to comment.