Skip to content

Commit bef74a5

Browse files
committed
Update configuration wizard to ask for display info before theme selection
1 parent 6c6d75d commit bef74a5

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

configure.py

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
SIZE_8_8_INCH = "8.8\""
6868
SIZE_2_1_INCH = "2.1\""
6969

70-
size_list = (SIZE_3_5_INCH, SIZE_5_INCH, SIZE_8_8_INCH, SIZE_2_1_INCH)
70+
size_list = (SIZE_3_5_INCH, SIZE_5_INCH)
7171

7272
# Maps between config.yaml values and GUI description
7373
# revision_to_model_map = {'A': TURING_MODEL, 'B': XUANFANG_MODEL, 'C': TURING_MODEL, 'SIMU': SIMULATED_MODEL,
@@ -154,75 +154,75 @@ def __init__(self):
154154
self.theme_preview = ttk.Label(self.window)
155155
self.theme_preview.place(x=10, y=10)
156156

157-
sysmon_label = ttk.Label(self.window, text='System Monitor configuration', font='bold')
158-
sysmon_label.place(x=320, y=0)
159-
160-
self.theme_label = ttk.Label(self.window, text='Theme')
161-
self.theme_label.place(x=320, y=35)
162-
self.theme_cb = ttk.Combobox(self.window, state='readonly')
163-
self.theme_cb.place(x=500, y=30, width=250)
164-
self.theme_cb.bind('<<ComboboxSelected>>', self.on_theme_change)
165-
166-
self.hwlib_label = ttk.Label(self.window, text='Hardware monitoring')
167-
self.hwlib_label.place(x=320, y=75)
168-
if sys.platform != "win32":
169-
del hw_lib_map["LHM"] # LHM is for Windows platforms only
170-
self.hwlib_cb = ttk.Combobox(self.window, values=list(hw_lib_map.values()), state='readonly')
171-
self.hwlib_cb.place(x=500, y=70, width=250)
172-
self.hwlib_cb.bind('<<ComboboxSelected>>', self.on_hwlib_change)
173-
174-
self.eth_label = ttk.Label(self.window, text='Ethernet interface')
175-
self.eth_label.place(x=320, y=115)
176-
self.eth_cb = ttk.Combobox(self.window, values=get_net_if(), state='readonly')
177-
self.eth_cb.place(x=500, y=110, width=250)
178-
179-
self.wl_label = ttk.Label(self.window, text='Wi-Fi interface')
180-
self.wl_label.place(x=320, y=155)
181-
self.wl_cb = ttk.Combobox(self.window, values=get_net_if(), state='readonly')
182-
self.wl_cb.place(x=500, y=150, width=250)
183-
184-
self.lhm_admin_warning = ttk.Label(self.window,
185-
text="❌ Restart as admin. or select another Hardware monitoring",
186-
foreground='#f00')
187-
188157
sysmon_label = ttk.Label(self.window, text='Display configuration', font='bold')
189-
sysmon_label.place(x=320, y=220)
158+
sysmon_label.place(x=320, y=0)
190159

191160
self.model_label = ttk.Label(self.window, text='Smart screen model')
192-
self.model_label.place(x=320, y=265)
161+
self.model_label.place(x=320, y=35)
193162
self.model_cb = ttk.Combobox(self.window, values=list(dict.fromkeys((revision_and_size_to_model_map.values()))),
194163
state='readonly')
195164
self.model_cb.bind('<<ComboboxSelected>>', self.on_model_change)
196-
self.model_cb.place(x=500, y=260, width=250)
165+
self.model_cb.place(x=500, y=30, width=250)
197166

198167
self.size_label = ttk.Label(self.window, text='Smart screen size')
199-
self.size_label.place(x=320, y=305)
168+
self.size_label.place(x=320, y=75)
200169
self.size_cb = ttk.Combobox(self.window, values=size_list, state='readonly')
201170
self.size_cb.bind('<<ComboboxSelected>>', self.on_size_change)
202-
self.size_cb.place(x=500, y=300, width=250)
171+
self.size_cb.place(x=500, y=70, width=250)
203172

204173
self.com_label = ttk.Label(self.window, text='COM port')
205-
self.com_label.place(x=320, y=345)
174+
self.com_label.place(x=320, y=115)
206175
self.com_cb = ttk.Combobox(self.window, values=get_com_ports(), state='readonly')
207-
self.com_cb.place(x=500, y=340, width=250)
176+
self.com_cb.place(x=500, y=110, width=250)
208177

209178
self.orient_label = ttk.Label(self.window, text='Orientation')
210-
self.orient_label.place(x=320, y=385)
179+
self.orient_label.place(x=320, y=155)
211180
self.orient_cb = ttk.Combobox(self.window, values=list(reverse_map.values()), state='readonly')
212-
self.orient_cb.place(x=500, y=380, width=250)
181+
self.orient_cb.place(x=500, y=150, width=250)
213182

214183
self.brightness_string = StringVar()
215184
self.brightness_label = ttk.Label(self.window, text='Brightness')
216-
self.brightness_label.place(x=320, y=425)
185+
self.brightness_label.place(x=320, y=195)
217186
self.brightness_slider = ttk.Scale(self.window, from_=0, to=100, orient=HORIZONTAL,
218187
command=self.on_brightness_change)
219-
self.brightness_slider.place(x=550, y=420, width=180)
188+
self.brightness_slider.place(x=550, y=195, width=180)
220189
self.brightness_val_label = ttk.Label(self.window, textvariable=self.brightness_string)
221-
self.brightness_val_label.place(x=500, y=425)
190+
self.brightness_val_label.place(x=500, y=195)
222191
self.brightness_warning_label = ttk.Label(self.window,
223192
text="⚠ Turing 3.5\" displays can get hot at high brightness!",
224193
foreground='#ff8c00')
225194

195+
sysmon_label = ttk.Label(self.window, text='System Monitor Configuration', font='bold')
196+
sysmon_label.place(x=320, y=260)
197+
198+
self.theme_label = ttk.Label(self.window, text='Theme')
199+
self.theme_label.place(x=320, y=300)
200+
self.theme_cb = ttk.Combobox(self.window, state='readonly')
201+
self.theme_cb.place(x=500, y=295, width=250)
202+
self.theme_cb.bind('<<ComboboxSelected>>', self.on_theme_change)
203+
204+
self.hwlib_label = ttk.Label(self.window, text='Hardware monitoring')
205+
self.hwlib_label.place(x=320, y=340)
206+
if sys.platform != "win32":
207+
del hw_lib_map["LHM"] # LHM is for Windows platforms only
208+
self.hwlib_cb = ttk.Combobox(self.window, values=list(hw_lib_map.values()), state='readonly')
209+
self.hwlib_cb.place(x=500, y=335, width=250)
210+
self.hwlib_cb.bind('<<ComboboxSelected>>', self.on_hwlib_change)
211+
212+
self.eth_label = ttk.Label(self.window, text='Ethernet interface')
213+
self.eth_label.place(x=320, y=380)
214+
self.eth_cb = ttk.Combobox(self.window, values=get_net_if(), state='readonly')
215+
self.eth_cb.place(x=500, y=375, width=250)
216+
217+
self.wl_label = ttk.Label(self.window, text='Wi-Fi interface')
218+
self.wl_label.place(x=320, y=420)
219+
self.wl_cb = ttk.Combobox(self.window, values=get_net_if(), state='readonly')
220+
self.wl_cb.place(x=500, y=415, width=250)
221+
222+
self.lhm_admin_warning = ttk.Label(self.window,
223+
text="❌ Restart as admin. or select another Hardware monitoring",
224+
foreground='#f00')
225+
226226
self.edit_theme_btn = ttk.Button(self.window, text="Edit theme", command=lambda: self.on_theme_editor_click())
227227
self.edit_theme_btn.place(x=310, y=490, height=50, width=130)
228228

@@ -401,7 +401,7 @@ def on_hwlib_change(self, e=None):
401401
import ctypes
402402
is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0
403403
if (hwlib == "LHM" or hwlib == "AUTO") and not is_admin:
404-
self.lhm_admin_warning.place(x=320, y=190)
404+
self.lhm_admin_warning.place(x=320, y=455)
405405
self.save_run_btn.state(["disabled"])
406406
else:
407407
self.lhm_admin_warning.place_forget()
@@ -410,7 +410,7 @@ def on_hwlib_change(self, e=None):
410410
def show_hide_brightness_warning(self, e=None):
411411
if int(self.brightness_slider.get()) > 50 and self.model_cb.get() == TURING_MODEL and self.size_cb.get() == SIZE_3_5_INCH:
412412
# Show warning for Turing Smart screen 3.5 with high brightness
413-
self.brightness_warning_label.place(x=320, y=460)
413+
self.brightness_warning_label.place(x=320, y=225)
414414
else:
415415
self.brightness_warning_label.place_forget()
416416

0 commit comments

Comments
 (0)