@@ -56,7 +56,8 @@ class BooleanOption(QCheckBox):
5656
5757 def __init__ (self ):
5858 super ().__init__ ()
59- self .stateChanged .connect (lambda : self .valueChanged .emit (self .isChecked ()))
59+ self .stateChanged .connect (
60+ lambda : self .valueChanged .emit (self .isChecked ()))
6061
6162 def setValue (self , value ):
6263 self .setChecked (value )
@@ -83,6 +84,7 @@ def __init__(self):
8384 def setValue (self , value ):
8485 self .setText (value )
8586
87+
8688class ChoiceOption (QComboBox ):
8789
8890 valueChanged = pyqtSignal (str )
@@ -272,7 +274,8 @@ def setValue(self, value):
272274 item .setFlags (item .flags () & ~ Qt .ItemIsEditable )
273275 self .setItem (row , 0 , item )
274276 item = QTableWidgetItem ()
275- item .setFlags ((item .flags () & ~ Qt .ItemIsEditable ) | Qt .ItemIsUserCheckable )
277+ item .setFlags ((item .flags () & ~ Qt .ItemIsEditable )
278+ | Qt .ItemIsUserCheckable )
276279 item .setCheckState (Qt .Checked if choice in value else Qt .Unchecked )
277280 self .setItem (row , 1 , item )
278281 self .resizeColumnsToContents ()
@@ -296,7 +299,7 @@ class BooleanAsDualChoiceOption(ChoiceOption):
296299 valueChanged = pyqtSignal (bool )
297300
298301 def __init__ (self , choice_false , choice_true ):
299- choices = { False : choice_false , True : choice_true }
302+ choices = {False : choice_false , True : choice_true }
300303 super ().__init__ (choices )
301304
302305
@@ -363,10 +366,13 @@ def __init__(self, engine):
363366 (_ ('Machine' ), (
364367 ConfigOption (_ ('Machine:' ), 'machine_type' , partial (ChoiceOption , choices = machines ),
365368 dependents = (
366- ('machine_specific_options' , self ._update_machine_options ),
367- ('system_keymap' , lambda v : self ._update_keymap (machine_type = v )),
368- )),
369- ConfigOption (_ ('Options:' ), 'machine_specific_options' , self ._machine_option ),
369+ ('machine_specific_options' ,
370+ self ._update_machine_options ),
371+ ('system_keymap' , lambda v : self ._update_keymap (
372+ machine_type = v )),
373+ )),
374+ ConfigOption (
375+ _ ('Options:' ), 'machine_specific_options' , self ._machine_option ),
370376 ConfigOption (_ ('Keymap:' ), 'system_keymap' , KeymapOption ),
371377 )),
372378 # i18n: Widget: “ConfigWindow”.
@@ -404,16 +410,15 @@ def __init__(self, engine):
404410 'programs time to process each key press.\n '
405411 'Setting the delay too high will negatively impact the\n '
406412 'performance of key stroke output.' )),
413+ # There are also the rules, model and options, but i don't think they affect the output of alphanumeric characters
407414 ConfigOption (_ ('Keyboard Layout:' ), 'xkb_layout' , StrOption ,
408415 _ ('Set the keyboard layout configured in your system.\n '
409416 'Examples: "us", "gb", "fr", "no"\n '
410417 '\n '
411418 'This only applies when using Linux/BSD and not using X11.\n '
412419 'If you\' re unsure, you probably don\' t need to change it.\n '
413- 'If you need to configure more options about your layout,\n '
414- 'such as setting the variant to a different layout like colemak,\n '
415- 'you can set environment variables starting with XKB_DEFAULT_\n '
416- 'for the RULES, MODEL, VARIANT and OPTIONS' )),
420+ 'If you use a different layout variant, format it as\n '
421+ '"language:layout", for example "us:colemak"' )),
417422 )),
418423 # i18n: Widget: “ConfigWindow”.
419424 (_ ('Plugins' ), (
@@ -432,16 +437,18 @@ def __init__(self, engine):
432437 for plugin in registry .list_plugins ('system' )
433438 }),
434439 dependents = (
435- ('system_keymap' , lambda v : self ._update_keymap (system_name = v )),
436- )),
440+ ('system_keymap' , lambda v : self ._update_keymap (
441+ system_name = v )),
442+ )),
437443 )),
438444 )
439445 # Only keep supported options, to avoid messing with things like
440446 # dictionaries, that are handled by another (possibly concurrent)
441447 # dialog.
442448 self ._supported_options = set ()
443449 for section , option_list in mappings :
444- self ._supported_options .update (option .option_name for option in option_list )
450+ self ._supported_options .update (
451+ option .option_name for option in option_list )
445452 self ._update_config ()
446453 # Create and fill tabs.
447454 option_by_name = {}
@@ -471,7 +478,8 @@ def __init__(self, engine):
471478 for option_name , update_fn in option .dependents
472479 ]
473480 self .buttons .button (QDialogButtonBox .Ok ).clicked .connect (self .on_apply )
474- self .buttons .button (QDialogButtonBox .Apply ).clicked .connect (self .on_apply )
481+ self .buttons .button (
482+ QDialogButtonBox .Apply ).clicked .connect (self .on_apply )
475483 self .tabs .currentWidget ().setFocus ()
476484 self .restore_state ()
477485 self .finished .connect (self .save_state )
0 commit comments