Skip to content

Commit cce7898

Browse files
committed
python: Add links to online info
Signed-off-by: Daniel Schaefer <[email protected]>
1 parent ca29198 commit cce7898

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

python/inputmodule/gui/__init__.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import os
2-
import threading
3-
import sys
42
import platform
3+
import sys
4+
import threading
5+
import webbrowser
6+
57
import tkinter as tk
68
from tkinter import ttk, messagebox
79

@@ -80,6 +82,21 @@ def run_gui(devices):
8082
checkbox.pack(anchor="w")
8183
device_checkboxes[dev.name] = (checkbox_var, checkbox)
8284

85+
# Online Info
86+
info_frame = ttk.LabelFrame(tab1, text="Online Info", style="TLabelframe")
87+
info_frame.pack(fill="x", padx=10, pady=5)
88+
infos = {
89+
"Web Interface": "https://ledmatrix.frame.work",
90+
"Latest Releases": "https://github.com/FrameworkComputer/inputmodule-rs/releases",
91+
"Hardware Info": "https://github.com/FrameworkComputer/InputModules",
92+
}
93+
for (i, (text, url)) in enumerate(infos.items()):
94+
# Organize in columns of three
95+
row = int(i / 3)
96+
column = i % 3
97+
btn = ttk.Button(info_frame, text=text, command=lambda url=url: webbrowser.open(url), style="TButton")
98+
btn.grid(row=row, column=column)
99+
83100
# Brightness Slider
84101
brightness_frame = ttk.LabelFrame(tab1, text="Brightness", style="TLabelframe")
85102
brightness_frame.pack(fill="x", padx=10, pady=5)

0 commit comments

Comments
 (0)