Skip to content

Commit da063a8

Browse files
committed
Switch model/com port boxes, fix encoding when saving YAML
1 parent 512ebd8 commit da063a8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

configure.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,16 @@ def __init__(self):
108108
sysmon_label = ttk.Label(self.window, text='Display configuration', font='bold')
109109
sysmon_label.place(x=320, y=190)
110110

111-
self.com_label = ttk.Label(self.window, text='COM port')
112-
self.com_label.place(x=320, y=235)
113-
self.com_cb = ttk.Combobox(self.window, values=get_com_ports(), state='readonly')
114-
self.com_cb.place(x=500, y=230, width=210)
115-
116111
self.model_label = ttk.Label(self.window, text='Smart screen model')
117-
self.model_label.place(x=320, y=275)
112+
self.model_label.place(x=320, y=235)
118113
self.model_cb = ttk.Combobox(self.window, values=list(revision_map.values()), state='readonly')
119114
self.model_cb.bind('<<ComboboxSelected>>', self.on_model_change)
120-
self.model_cb.place(x=500, y=270, width=210)
115+
self.model_cb.place(x=500, y=230, width=210)
116+
117+
self.com_label = ttk.Label(self.window, text='COM port')
118+
self.com_label.place(x=320, y=275)
119+
self.com_cb = ttk.Combobox(self.window, values=get_com_ports(), state='readonly')
120+
self.com_cb.place(x=500, y=270, width=210)
121121

122122
self.orient_label = ttk.Label(self.window, text='Orientation')
123123
self.orient_label.place(x=320, y=315)
@@ -211,7 +211,7 @@ def save_config_values(self):
211211
self.config['display']['DISPLAY_REVERSE'] = [k for k, v in reverse_map.items() if v == self.orient_cb.get()][0]
212212
self.config['display']['BRIGHTNESS'] = int(self.brightness_slider.get())
213213

214-
with open("config.yaml", "w") as file:
214+
with open("config.yaml", "w", encoding='utf-8') as file:
215215
ruamel.yaml.YAML().dump(self.config, file)
216216

217217
def on_theme_change(self, e=None):

0 commit comments

Comments
 (0)