Skip to content

Commit d1118cc

Browse files
author
riban
committed
Adds Bluetooth menu info
1 parent d029c31 commit d1118cc

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

icons/bluetooth.png

5.74 KB
Loading

zyngui/zynthian_gui_admin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def fill_list(self):
197197
self.list_data.append((self.show_cv_config, 0, "CV Settings", ["Control Voltage configuration.", None]))
198198
self.list_data.append((self.zyngui.calibrate_touchscreen, 0, "Calibrate Touchscreen", ["Show touchscreen calibration.\nTouch each crosshair until it changes color.\nScreen closes after 15s of inactivity.", None]))
199199
self.list_data.append((self.zyngui.cuia_screen_clean, 0, "Clean Screen", ["10s countdown with no touch trigger. Allows screen to be cleaned without triggering any action.", None]))
200-
self.list_data.append((self.bluetooth, 0, "Bluetooth", ["Scan, enable and configure Bluetooth devices.\n\nMust enable Bluetooth here to access BLE MIDI devices. Also supports HID devices.", None]))
200+
self.list_data.append((self.bluetooth, 0, "Bluetooth", ["Scan, enable and configure Bluetooth devices.\n\nMust enable Bluetooth here to access BLE MIDI devices. Also supports HID devices.", "bluetooth.png"]))
201201

202202
self.list_data.append((None, 0, "> TEST"))
203203
self.list_data.append((self.test_audio, 0, "Test Audio", ["Play an audio track to test audio output.\n\nPress BACK to cancel playback.", "headphones.png"]))

zyngui/zynthian_gui_bluetooth.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from subprocess import Popen, PIPE
3131

3232
# Zynthian specific modules
33-
from zyngui.zynthian_gui_selector import zynthian_gui_selector
33+
from zyngui.zynthian_gui_selector_info import zynthian_gui_selector_info
3434
from zyngui import zynthian_gui_config
3535
import zynconf
3636

@@ -39,7 +39,7 @@
3939
# ------------------------------------------------------------------------------
4040

4141

42-
class zynthian_gui_bluetooth(zynthian_gui_selector):
42+
class zynthian_gui_bluetooth(zynthian_gui_selector_info):
4343

4444
def __init__(self):
4545
self.proc = None
@@ -49,7 +49,7 @@ def __init__(self):
4949
self.ble_controllers = {}
5050
self.ble_devices = {} # Map of BLE devices, indexed by device address
5151
self.pending_actions = [] # List of BLE commands to queue
52-
super().__init__('Bluetooth', True)
52+
super().__init__('Bluetooth')
5353
self.select_path.set("Bluetooth")
5454

5555
def build_view(self):
@@ -73,16 +73,16 @@ def fill_list(self):
7373

7474
if zynthian_gui_config.bluetooth_enabled:
7575
self.list_data.append(
76-
("stop_bluetooth", None, "\u2612 Enable Bluetooth"))
76+
("stop_bluetooth", None, "\u2612 Enable Bluetooth", ["Bluetooth is enabled.\n\nSelect to disable Bluetooth.", "bluetooth.png"]))
7777
if len(self.ble_controllers) == 0:
7878
self.list_data.append(
79-
(None, None, "No Bluetooth controllers detected!"))
79+
(None, None, "No Bluetooth controllers detected!", ["There are not Bluetooth controllers attached to zynthian. You may connect a Bluetooth USB device.", "bluetooth.png"]))
8080
super().fill_list()
8181
return
8282
for ctrl in sorted(self.ble_controllers.keys()):
8383
chk = "\u2612" if self.ble_controllers[ctrl]["enabled"] else "\u2610"
8484
self.list_data.append(
85-
("enable_controller", ctrl, f" {chk} {self.ble_controllers[ctrl]['alias']}"))
85+
("enable_controller", ctrl, f" {chk} {self.ble_controllers[ctrl]['alias']}", ["Enable/disable Bluetooth controller.\n\nOnly enable a single controller. It is advised to use a USB Bluetooth adapter because the Raspberry Pi onboard adapter has poor range.", "bluetooth.png"]))
8686
self.list_data.append((None, None, "Devices"))
8787
for addr, data in self.ble_devices.items():
8888
# [name, paired, trusted, connected, is_midi]
@@ -93,10 +93,10 @@ def fill_list(self):
9393
if data[3]:
9494
title += "\uf293 "
9595
title += data[0]
96-
self.list_data.append((f"BLE:{addr}", addr, title))
96+
self.list_data.append((f"BLE:{addr}", addr, title, ["Enable/disable this USB device.\n\nEnabling a device will pair it with zynthian. This state will be remembered.", "bluetooth.png"]))
9797
else:
9898
self.list_data.append(
99-
("start_bluetooth", None, "\u2610 Enable Bluetooth"))
99+
("start_bluetooth", None, "\u2610 Enable Bluetooth", ["Bluetooth is disabled.\n\nSelect to enable Bluetooth.", "bluetooth.png"]))
100100

101101
super().fill_list()
102102

0 commit comments

Comments
 (0)