|
21 | 21 |
|
22 | 22 | import os |
23 | 23 | import subprocess |
| 24 | +import sys |
24 | 25 | import tkinter.ttk as ttk |
25 | 26 | from tkinter import * |
26 | 27 |
|
@@ -68,7 +69,7 @@ class TuringConfigWindow: |
68 | 69 | def __init__(self): |
69 | 70 | self.window = Tk() |
70 | 71 | self.window.title('Turing System Monitor configuration') |
71 | | - self.window.geometry("730x480") |
| 72 | + self.window.geometry("730x510") |
72 | 73 | self.window.iconphoto(True, PhotoImage(file="res/icons/monitor-icon-17865/64.png")) |
73 | 74 | # When window gets focus again, reload theme preview in case it has been updated by theme editor |
74 | 75 | self.window.bind("<FocusIn>", self.on_theme_change) |
@@ -105,44 +106,47 @@ def __init__(self): |
105 | 106 | self.wl_cb = ttk.Combobox(self.window, values=get_net_if(), state='readonly') |
106 | 107 | self.wl_cb.place(x=500, y=150, width=210) |
107 | 108 |
|
| 109 | + self.lhm_admin_warning = ttk.Label(self.window, text="Admin rights needed, or select another Hardware monitoring", foreground='#00f') |
| 110 | + self.lhm_admin_warning.place(x=320, y=190) |
| 111 | + |
108 | 112 | sysmon_label = ttk.Label(self.window, text='Display configuration', font='bold') |
109 | | - sysmon_label.place(x=320, y=190) |
| 113 | + sysmon_label.place(x=320, y=220) |
110 | 114 |
|
111 | 115 | self.model_label = ttk.Label(self.window, text='Smart screen model') |
112 | | - self.model_label.place(x=320, y=235) |
| 116 | + self.model_label.place(x=320, y=265) |
113 | 117 | self.model_cb = ttk.Combobox(self.window, values=list(revision_map.values()), state='readonly') |
114 | 118 | self.model_cb.bind('<<ComboboxSelected>>', self.on_model_change) |
115 | | - self.model_cb.place(x=500, y=230, width=210) |
| 119 | + self.model_cb.place(x=500, y=260, width=210) |
116 | 120 |
|
117 | 121 | self.com_label = ttk.Label(self.window, text='COM port') |
118 | | - self.com_label.place(x=320, y=275) |
| 122 | + self.com_label.place(x=320, y=305) |
119 | 123 | self.com_cb = ttk.Combobox(self.window, values=get_com_ports(), state='readonly') |
120 | | - self.com_cb.place(x=500, y=270, width=210) |
| 124 | + self.com_cb.place(x=500, y=300, width=210) |
121 | 125 |
|
122 | 126 | self.orient_label = ttk.Label(self.window, text='Orientation') |
123 | | - self.orient_label.place(x=320, y=315) |
| 127 | + self.orient_label.place(x=320, y=345) |
124 | 128 | self.orient_cb = ttk.Combobox(self.window, values=list(reverse_map.values()), state='readonly') |
125 | | - self.orient_cb.place(x=500, y=310, width=210) |
| 129 | + self.orient_cb.place(x=500, y=340, width=210) |
126 | 130 |
|
127 | 131 | self.brightness_string = StringVar() |
128 | 132 | self.brightness_label = ttk.Label(self.window, text='Brightness') |
129 | | - self.brightness_label.place(x=320, y=355) |
| 133 | + self.brightness_label.place(x=320, y=385) |
130 | 134 | self.brightness_slider = ttk.Scale(self.window, from_=0, to=100, orient=HORIZONTAL, |
131 | 135 | command=self.on_brightness_change) |
132 | | - self.brightness_slider.place(x=550, y=350, width=160) |
| 136 | + self.brightness_slider.place(x=550, y=380, width=160) |
133 | 137 | self.brightness_val_label = ttk.Label(self.window, textvariable=self.brightness_string) |
134 | | - self.brightness_val_label.place(x=500, y=355) |
| 138 | + self.brightness_val_label.place(x=500, y=385) |
135 | 139 | self.brightness_warning_label = ttk.Label(self.window, text="⚠ Turing / rev. A displays can get hot at high brightness!", foreground='#f00') |
136 | | - self.brightness_warning_label.place(x=320, y=390) |
| 140 | + self.brightness_warning_label.place(x=320, y=420) |
137 | 141 |
|
138 | 142 | self.edit_theme_btn = ttk.Button(self.window, text="Edit theme", command=lambda: self.on_theme_editor_click()) |
139 | | - self.edit_theme_btn.place(x=310, y=420, height=50, width=130) |
| 143 | + self.edit_theme_btn.place(x=310, y=450, height=50, width=130) |
140 | 144 |
|
141 | 145 | self.save_btn = ttk.Button(self.window, text="Save settings", command=lambda: self.on_save_click()) |
142 | | - self.save_btn.place(x=450, y=420, height=50, width=130) |
| 146 | + self.save_btn.place(x=450, y=450, height=50, width=130) |
143 | 147 |
|
144 | 148 | self.save_run_btn = ttk.Button(self.window, text="Save and run", command=lambda: self.on_saverun_click()) |
145 | | - self.save_run_btn.place(x=590, y=420, height=50, width=130) |
| 149 | + self.save_run_btn.place(x=590, y=450, height=50, width=130) |
146 | 150 |
|
147 | 151 | self.config = None |
148 | 152 | self.load_config_values() |
@@ -254,10 +258,17 @@ def on_hwlib_change(self, e=None): |
254 | 258 | self.eth_cb.configure(state="readonly", foreground="#000") |
255 | 259 | self.wl_cb.configure(state="readonly", foreground="#000") |
256 | 260 |
|
| 261 | + if hwlib == "LHM": |
| 262 | + self.lhm_admin_warning.place(x=320, y=190) |
| 263 | + elif hwlib == "AUTO" and sys.platform == "win32": |
| 264 | + self.lhm_admin_warning.place(x=320, y=190) |
| 265 | + else: |
| 266 | + self.lhm_admin_warning.place_forget() |
| 267 | + |
257 | 268 | def show_hide_brightness_warning(self, e=None): |
258 | 269 | if int(self.brightness_slider.get()) > 50 and [k for k, v in revision_map.items() if v == self.model_cb.get()][0] == "A": |
259 | 270 | # Show warning for Turing Smart screen with high brightness |
260 | | - self.brightness_warning_label.place(x=320, y=390) |
| 271 | + self.brightness_warning_label.place(x=320, y=420) |
261 | 272 | else: |
262 | 273 | self.brightness_warning_label.place_forget() |
263 | 274 |
|
|
0 commit comments