Skip to content

Commit

Permalink
Correct ardf label and send online all controls (option) (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
sportog authored Sep 9, 2024
1 parent 5613359 commit 7595e21
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
5 changes: 4 additions & 1 deletion languages/ru_RU/LC_MESSAGES/sportorg.po
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ msgid "by scores (rogaine)"
msgstr "по баллам (рогейн)"

msgid "ardf"
msgstr "ADRF"
msgstr "ARDF"

msgid "rogain scores"
msgstr "рогейн (45КП = 4балла, 78КП = 7баллов)"
Expand Down Expand Up @@ -1530,6 +1530,9 @@ msgstr "Первый КП"
msgid "CP increment"
msgstr "Инкремент КП"

msgid "Sending the entire contents of the chip"
msgstr "Отправка всего содержимого чипа"

msgid "Online results sending"
msgstr "Отправка онлайн результатов"

Expand Down
12 changes: 12 additions & 0 deletions sportorg/gui/dialogs/live_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ def init_ui(self):
self.item_live_enabled = QCheckBox(translate('Enabled'))
self.layout.addRow(self.item_live_enabled)

self.item_sending_all_controls = QCheckBox(
translate('Sending the entire contents of the chip')
)
self.item_sending_all_controls.setChecked(True)
self.layout.addRow(self.item_sending_all_controls)

self.item_result_sending = QCheckBox(translate('Online results sending'))
self.item_result_sending.setChecked(True)
self.layout.addRow(self.item_result_sending)
Expand Down Expand Up @@ -128,6 +134,7 @@ def on_cp_sending_state_changed(self):

def on_enable_checkbox_state_changed(self):
state = self.item_live_enabled.isChecked()
self.item_sending_all_controls.setEnabled(state)
self.item_result_sending.setEnabled(state)
self.item_cp_sending.setEnabled(state)
self.online_cp_box.setEnabled(state)
Expand All @@ -151,6 +158,7 @@ def set_values(self):
urls = [url]
live_enabled = obj.get_setting('live_enabled', False)

live_sending_all_controls = obj.get_setting('live_sending_all_controls', False)
live_results_enabled = obj.get_setting('live_results_enabled', True)
live_cp_enabled = obj.get_setting('live_cp_enabled', False)
live_cp_code = obj.get_setting('live_cp_code', '10')
Expand All @@ -160,6 +168,7 @@ def set_values(self):

self.item_url.setText(encode_urls(urls))
self.item_live_enabled.setChecked(live_enabled)
self.item_sending_all_controls.setChecked(live_sending_all_controls)
self.item_result_sending.setChecked(live_results_enabled)
self.item_cp_sending.setChecked(live_cp_enabled)
self.online_cp_from_finish_code.setValue(int(live_cp_code))
Expand All @@ -173,6 +182,9 @@ def apply_changes_impl(self):
obj = race()
obj.set_setting('live_urls', decode_urls(self.item_url.text()))
obj.set_setting('live_enabled', self.item_live_enabled.isChecked())
obj.set_setting(
'live_sending_all_controls', self.item_sending_all_controls.isChecked()
)
obj.set_setting('live_results_enabled', self.item_result_sending.isChecked())
obj.set_setting('live_cp_enabled', self.item_cp_sending.isChecked())
obj.set_setting(
Expand Down
1 change: 0 additions & 1 deletion sportorg/gui/dialogs/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
get_current_race_index,
move_down_race,
move_up_race,
race,
races,
set_current_race_index,
)
Expand Down
5 changes: 4 additions & 1 deletion sportorg/modules/live/orgeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ def _get_person_obj(data, race_data, result=None):
obj['splits'] = []
splits = []
for split in result['splits']:
if split['is_correct']:
if (
split['is_correct']
or race_data['settings']['live_sending_all_controls'] == True
):
splits.append(split)
for i in range(len(splits)):
# fmt: off
Expand Down

0 comments on commit 7595e21

Please sign in to comment.