Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8f4e570

Browse files
committedJun 17, 2025
adding help for the localized window
1 parent d25289c commit 8f4e570

File tree

3 files changed

+42
-13
lines changed

3 files changed

+42
-13
lines changed
 

‎pyradio/config_window.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4499,15 +4499,6 @@ def _read_file_list(self):
44994499

45004500
# Sort and return the list of filenames
45014501
self._files = [['Define New Layout', None, False, None], ['No Layout', None, False, None]] + sorted(filenames)
4502-
# self._files.append(['Item 1', None, False, None])
4503-
# self._files.append(['Item 2', None, False, None])
4504-
# self._files.append(['Item 3', None, False, None])
4505-
# self._files.append(['Item 4', None, False, None])
4506-
# self._files.append(['Item 5', None, False, None])
4507-
# self._files.append(['Item 6', None, False, None])
4508-
# self._files.append(['Item 7', None, False, None])
4509-
# self._files.append(['Item 8', None, False, None])
4510-
# self._files.append(['Item 9', None, False, None])
45114502

45124503
def _read_layout_file(self, index):
45134504
''' read a layout file from disk
@@ -4831,6 +4822,10 @@ def keypress(self, char):
48314822
self._needs_update = False
48324823
self._set_ok_enabled()
48334824

4825+
if self._focus != 1 and (char == kbkey['?'] or \
4826+
check_localized(char, (kbkey['?'], ))):
4827+
return 2
4828+
48344829
if char in (curses.KEY_EXIT, 27, ):
48354830
self._win.nodelay(True)
48364831
char = self._win.getch()

‎pyradio/messages_system.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,6 +1604,40 @@ def set_text(self, parent, *args):
16041604
so you can resolve the issue and try again.
16051605
16061606
'''
1607+
),
1608+
1609+
'M_LOC_HELP': ('Localized Shortcuts Help',
1610+
r'''This window allows you to define or edit a keyboard layout that maps
1611+
your local language characters to their English equivalents.
1612+
1613+
__The purpose of this mapping is to ensure that PyRadio responds
1614+
correctly to keyboard shortcuts even when your system keyboard layout
1615+
is not English. For example, if your layout is Greek and you press
1616+
the key corresponding to '|α|', the program will recognize it as the
1617+
English '|a|' and trigger the appropriate action.
1618+
1619+
To create or edit a layout:
1620+
1621+
__• Select an existing layout to edit (press |{edit}|), or choose "|Define
1622+
____|New Layout|" (or press |{add}|) to create one.
1623+
__• Use the input grid to map each English letter (lowercase and
1624+
____uppercase) to the corresponding character in your local language.
1625+
__• When you type a lowercase character, its uppercase version is
1626+
____auto-filled, but you can change it manually.
1627+
1628+
__The |Display| option affects only the visual ordering of keys in the
1629+
table (e.g., QWERTY, AZERTY) to help you locate them according to
1630+
your physical keyboard. It does |not| affect the functionality or
1631+
saved layout.
1632+
1633+
|Note:|
1634+
__• If you attempt to edit a default layout provided with the
1635+
____program, you will be asked to use a new name.
1636+
__• Your personalized layout will take priority during runtime.
1637+
1638+
To set the default layout to use, just press |space|, |Enter|, |{l}| or
1639+
the |Left Arror| while you are in the "|Available Layouts|" field.
1640+
'''.replace('{add}', chr(kbkey['add'])).replace('{edit}', chr(kbkey['edit'])).replace('{l}', chr(kbkey['l']))
16071641
),
16081642

16091643
'M_LOC_READ_ONLY': ('Read-Only Warning',

‎pyradio/radio.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6802,7 +6802,7 @@ def keypress(self, char):
68026802
self.refreshBody()
68036803
elif ret == 2:
68046804
# display help
6805-
pass
6805+
self._open_simple_message_by_key('M_LOC_HELP')
68066806
elif ret == 3:
68076807
# edit read only
68086808
self._open_simple_message_by_key('M_LOC_READ_ONLY')
@@ -8017,9 +8017,9 @@ def keypress(self, char):
80178017

80188018
elif ret == self.ws.LOCALIZED_CONFIG_MODE:
80198019
''' keyboard localized window '''
8020-
self._print_not_implemented_yet()
8021-
# self.ws.operation_mode = self.ws.LOCALIZED_CONFIG_MODE
8022-
# self._localized_init_config()
8020+
# self._print_not_implemented_yet()
8021+
self.ws.operation_mode = self.ws.LOCALIZED_CONFIG_MODE
8022+
self._localized_init_config()
80238023
return
80248024

80258025
else:

0 commit comments

Comments
 (0)
Please sign in to comment.