Skip to content

Commit

Permalink
Add warnings and volatile flag to settings
Browse files Browse the repository at this point in the history
This adds two functions for settings. A warning message can be added,
which will either always be displayed to the user when they change the
value, or only when they change it away from some default. They are
given the opportunity to cancel the change if the warning makes them
reconsider.

Also, a setting can be marked "volatile" which will cause the settings
tab to be fully reloaded when it has been changed. This resets the
view as well, so it's not ideal, but this can be used when one setting
necessarily impacts another.

Fixes #10695
  • Loading branch information
kk7ds committed Jul 3, 2023
1 parent 885590d commit b257795
Show file tree
Hide file tree
Showing 19 changed files with 505 additions and 121 deletions.
6 changes: 6 additions & 0 deletions chirp/drivers/uvk5.py
Original file line number Diff line number Diff line change
Expand Up @@ -1862,6 +1862,12 @@ def get_settings(self):
val = RadioSettingValueBoolean(self._expanded_limits)
rs = RadioSetting("nolimits", "Limits disabled for modified firmware",
val)
rs.set_warning(_(
'This should only be enabled if you are using modified firmware '
'that supports wider frequency coverage. Enabling this will cause '
'CHIRP not to enforce OEM restrictions and may lead to undefined '
'or unregulated behavior. Use at your own risk!'),
safe_value=False)
roinfo.append(rs)

return top
Expand Down
38 changes: 30 additions & 8 deletions chirp/locale/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CHIRP\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-28 17:09-0700\n"
"POT-Creation-Date: 2023-07-02 14:20-0700\n"
"PO-Revision-Date: 2012-10-02 22:11+0100\n"
"Last-Translator: Benjamin, HB9EUK <hb9euk@hb9d.org>\n"
"Language-Team: German\n"
Expand Down Expand Up @@ -648,7 +648,7 @@ msgstr ""
msgid "Amateur"
msgstr ""

#: ../wxui/common.py:499 ../wxui/common.py:525
#: ../wxui/common.py:531 ../wxui/common.py:557
msgid "An error has occurred"
msgstr "Ein Fehler ist aufgetreten"

Expand Down Expand Up @@ -688,6 +688,12 @@ msgstr ""
msgid "Canada"
msgstr ""

#: ../wxui/common.py:420
msgid ""
"Changing this setting requires refreshing the settings from the image, which "
"will happen now."
msgstr ""

#: ../wxui/memedit.py:1173
#, python-format
msgid ""
Expand Down Expand Up @@ -943,7 +949,7 @@ msgstr ""
msgid "Erased memory %s"
msgstr "Lösche Speicher {loc}"

#: ../wxui/settingsedit.py:114
#: ../wxui/settingsedit.py:116
#, fuzzy
msgid "Error applying settings"
msgstr "Fehler beim Setzen der Speicher"
Expand Down Expand Up @@ -1199,7 +1205,7 @@ msgstr "Frequenz"
msgid "GMRS"
msgstr ""

#: ../wxui/settingsedit.py:54
#: ../wxui/settingsedit.py:55
msgid "Getting settings"
msgstr ""

Expand Down Expand Up @@ -1551,7 +1557,7 @@ msgstr ""
msgid "Pasted memory will overwrite memory %s"
msgstr ""

#: ../wxui/common.py:564
#: ../wxui/common.py:596
#, python-format
msgid "Path %s does not exist"
msgstr ""
Expand Down Expand Up @@ -1666,6 +1672,10 @@ msgstr ""
msgid "RadioReference Canada requires a login before you can query"
msgstr ""

#: ../wxui/common.py:422
msgid "Refresh required"
msgstr ""

#: ../wxui/common.py:310
#, python-format
msgid "Refreshed memory %s"
Expand Down Expand Up @@ -1891,6 +1901,14 @@ msgid ""
"If you can get into it, please check the radio and cable.\n"
msgstr ""

#: ../drivers/uvk5.py:1866
msgid ""
"This should only be enabled if you are using modified firmware that supports "
"wider frequency coverage. Enabling this will cause CHIRP not to enforce OEM "
"restrictions and may lead to undefined or unregulated behavior. Use at your "
"own risk!"
msgstr ""

#: ../wxui/developer.py:484
msgid "This will load a module from a website issue"
msgstr ""
Expand Down Expand Up @@ -1944,7 +1962,7 @@ msgid ""
"model and try again."
msgstr ""

#: ../wxui/common.py:571
#: ../wxui/common.py:603
#, fuzzy, python-format
msgid "Unable to reveal %s on this system"
msgstr "Keine Änderungen bei diesem Modell möglich"
Expand Down Expand Up @@ -1989,12 +2007,12 @@ msgstr ""
msgid "Value does not fit in %i bits"
msgstr ""

#: ../wxui/common.py:422
#: ../wxui/common.py:454
#, python-format
msgid "Value must be at least %.4f"
msgstr ""

#: ../wxui/common.py:426
#: ../wxui/common.py:458
#, python-format
msgid "Value must be at most %.4f"
msgstr ""
Expand All @@ -2017,6 +2035,10 @@ msgstr "Hersteller"
msgid "View"
msgstr "_Ansicht"

#: ../wxui/common.py:406
msgid "WARNING!"
msgstr ""

#: ../wxui/memedit.py:1324
msgid "Warning"
msgstr ""
Expand Down
39 changes: 31 additions & 8 deletions chirp/locale/el.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CHIRP\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-28 17:09-0700\n"
"POT-Creation-Date: 2023-07-02 14:20-0700\n"
"PO-Revision-Date: 2023-02-11 15:12+0200\n"
"Last-Translator: Sokratis Alichanidis <sv2hzs@posteo.net>\n"
"Language-Team: Greek\n"
Expand Down Expand Up @@ -651,7 +651,7 @@ msgstr "Όλοι οι τύποι αρχείων|"
msgid "Amateur"
msgstr "Ραδιοερασιτέχνη"

#: ../wxui/common.py:499 ../wxui/common.py:525
#: ../wxui/common.py:531 ../wxui/common.py:557
msgid "An error has occurred"
msgstr "Παρουσιάστηκε ένα σφάλμα"

Expand Down Expand Up @@ -691,6 +691,12 @@ msgstr "Δημιουργία Περιηγητή Πομποδεκτών"
msgid "Canada"
msgstr "Καναδάς"

#: ../wxui/common.py:420
msgid ""
"Changing this setting requires refreshing the settings from the image, which "
"will happen now."
msgstr ""

#: ../wxui/memedit.py:1173
#, python-format
msgid ""
Expand Down Expand Up @@ -940,7 +946,7 @@ msgstr "Εισάγετε προσαρμοσμένη θύρα:"
msgid "Erased memory %s"
msgstr "Διεγράφη η μνήμη %s"

#: ../wxui/settingsedit.py:114
#: ../wxui/settingsedit.py:116
msgid "Error applying settings"
msgstr "Σφάλμα εφαρμογής ρυθμίσεων"

Expand Down Expand Up @@ -1190,7 +1196,7 @@ msgstr "Συχνότητα"
msgid "GMRS"
msgstr "GMRS"

#: ../wxui/settingsedit.py:54
#: ../wxui/settingsedit.py:55
msgid "Getting settings"
msgstr "Λήψη ρυθμίσεων"

Expand Down Expand Up @@ -1531,7 +1537,7 @@ msgstr ""
msgid "Pasted memory will overwrite memory %s"
msgstr ""

#: ../wxui/common.py:564
#: ../wxui/common.py:596
#, fuzzy, python-format
msgid "Path %s does not exist"
msgstr "Το αρχείο δεν υπάρχει: %s"
Expand Down Expand Up @@ -1645,6 +1651,11 @@ msgstr ""
msgid "RadioReference Canada requires a login before you can query"
msgstr ""

#: ../wxui/common.py:422
#, fuzzy
msgid "Refresh required"
msgstr "Απαιτείται επανεκκίνηση"

#: ../wxui/common.py:310
#, python-format
msgid "Refreshed memory %s"
Expand Down Expand Up @@ -1870,6 +1881,14 @@ msgid ""
"If you can get into it, please check the radio and cable.\n"
msgstr ""

#: ../drivers/uvk5.py:1866
msgid ""
"This should only be enabled if you are using modified firmware that supports "
"wider frequency coverage. Enabling this will cause CHIRP not to enforce OEM "
"restrictions and may lead to undefined or unregulated behavior. Use at your "
"own risk!"
msgstr ""

#: ../wxui/developer.py:484
msgid "This will load a module from a website issue"
msgstr ""
Expand Down Expand Up @@ -1920,7 +1939,7 @@ msgid ""
"model and try again."
msgstr ""

#: ../wxui/common.py:571
#: ../wxui/common.py:603
#, python-format
msgid "Unable to reveal %s on this system"
msgstr ""
Expand Down Expand Up @@ -1964,12 +1983,12 @@ msgstr "Χρήση μεγαλύτερης γραμματοσειράς"
msgid "Value does not fit in %i bits"
msgstr "Η τιμή δεν χωράει σε %i bits"

#: ../wxui/common.py:422
#: ../wxui/common.py:454
#, python-format
msgid "Value must be at least %.4f"
msgstr "Η τιμή πρέπει να είναι τουλάχιστον %.4f"

#: ../wxui/common.py:426
#: ../wxui/common.py:458
#, python-format
msgid "Value must be at most %.4f"
msgstr "Η τιμή πρέπει να είναι το πολύ %.4f"
Expand All @@ -1991,6 +2010,10 @@ msgstr "Προμηθευτής"
msgid "View"
msgstr "Εμφάνιση"

#: ../wxui/common.py:406
msgid "WARNING!"
msgstr ""

#: ../wxui/memedit.py:1324
msgid "Warning"
msgstr "Προειδοποίηση"
Expand Down
38 changes: 30 additions & 8 deletions chirp/locale/en_US.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CHIRP\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-28 17:09-0700\n"
"POT-Creation-Date: 2023-07-02 14:20-0700\n"
"PO-Revision-Date: 2011-11-29 16:07-0800\n"
"Last-Translator: Dan Smith <dan@theine>\n"
"Language-Team: English\n"
Expand Down Expand Up @@ -646,7 +646,7 @@ msgstr ""
msgid "Amateur"
msgstr ""

#: ../wxui/common.py:499 ../wxui/common.py:525
#: ../wxui/common.py:531 ../wxui/common.py:557
msgid "An error has occurred"
msgstr ""

Expand Down Expand Up @@ -686,6 +686,12 @@ msgstr ""
msgid "Canada"
msgstr ""

#: ../wxui/common.py:420
msgid ""
"Changing this setting requires refreshing the settings from the image, which "
"will happen now."
msgstr ""

#: ../wxui/memedit.py:1173
#, python-format
msgid ""
Expand Down Expand Up @@ -937,7 +943,7 @@ msgstr ""
msgid "Erased memory %s"
msgstr "E_xchange"

#: ../wxui/settingsedit.py:114
#: ../wxui/settingsedit.py:116
msgid "Error applying settings"
msgstr ""

Expand Down Expand Up @@ -1189,7 +1195,7 @@ msgstr ""
msgid "GMRS"
msgstr ""

#: ../wxui/settingsedit.py:54
#: ../wxui/settingsedit.py:55
msgid "Getting settings"
msgstr ""

Expand Down Expand Up @@ -1533,7 +1539,7 @@ msgstr ""
msgid "Pasted memory will overwrite memory %s"
msgstr ""

#: ../wxui/common.py:564
#: ../wxui/common.py:596
#, python-format
msgid "Path %s does not exist"
msgstr ""
Expand Down Expand Up @@ -1646,6 +1652,10 @@ msgstr ""
msgid "RadioReference Canada requires a login before you can query"
msgstr ""

#: ../wxui/common.py:422
msgid "Refresh required"
msgstr ""

#: ../wxui/common.py:310
#, python-format
msgid "Refreshed memory %s"
Expand Down Expand Up @@ -1868,6 +1878,14 @@ msgid ""
"If you can get into it, please check the radio and cable.\n"
msgstr ""

#: ../drivers/uvk5.py:1866
msgid ""
"This should only be enabled if you are using modified firmware that supports "
"wider frequency coverage. Enabling this will cause CHIRP not to enforce OEM "
"restrictions and may lead to undefined or unregulated behavior. Use at your "
"own risk!"
msgstr ""

#: ../wxui/developer.py:484
msgid "This will load a module from a website issue"
msgstr ""
Expand Down Expand Up @@ -1918,7 +1936,7 @@ msgid ""
"model and try again."
msgstr ""

#: ../wxui/common.py:571
#: ../wxui/common.py:603
#, python-format
msgid "Unable to reveal %s on this system"
msgstr ""
Expand Down Expand Up @@ -1963,12 +1981,12 @@ msgstr ""
msgid "Value does not fit in %i bits"
msgstr ""

#: ../wxui/common.py:422
#: ../wxui/common.py:454
#, python-format
msgid "Value must be at least %.4f"
msgstr ""

#: ../wxui/common.py:426
#: ../wxui/common.py:458
#, python-format
msgid "Value must be at most %.4f"
msgstr ""
Expand All @@ -1991,6 +2009,10 @@ msgstr ""
msgid "View"
msgstr "_View"

#: ../wxui/common.py:406
msgid "WARNING!"
msgstr ""

#: ../wxui/memedit.py:1324
msgid "Warning"
msgstr ""
Expand Down
Loading

0 comments on commit b257795

Please sign in to comment.