Media related items moved to dedicated Media menu. Documentation updated.
This commit is contained in:
@@ -311,11 +311,15 @@ class VoicedMenu:
|
||||
|
||||
# Update the menu with the new service status
|
||||
self.update_service_menu_items()
|
||||
|
||||
|
||||
# Update Bluetooth menu items if Bluetooth service was toggled
|
||||
if friendlyName == "Bluetooth":
|
||||
self.update_bluetooth_menu_items()
|
||||
|
||||
# Update Media menu items if DLNA Server was toggled
|
||||
if friendlyName == "D L N A Server":
|
||||
self.update_media_menu_items()
|
||||
|
||||
# Redraw the menu
|
||||
self.draw_menu()
|
||||
|
||||
@@ -493,14 +497,30 @@ class VoicedMenu:
|
||||
"""Update Bluetooth-related menu items in Accessories section"""
|
||||
if "Accessories" in self.menuSections:
|
||||
# Remove any existing Bluetooth-related items
|
||||
self.menuSections["Accessories"] = [item for item in self.menuSections["Accessories"]
|
||||
self.menuSections["Accessories"] = [item for item in self.menuSections["Accessories"]
|
||||
if "Bluetooth" not in item[0]]
|
||||
|
||||
# Add Bluetooth management item only if Bluetooth is enabled
|
||||
if self.check_service_status('bluetooth.service'):
|
||||
self.add_item("Accessories", "Manage Bluetooth Devices",
|
||||
self.add_item("Accessories", "Manage Bluetooth Devices",
|
||||
"GAME=blueman-manager startx")
|
||||
|
||||
def update_media_menu_items(self):
|
||||
"""Update Media menu items including DLNA server toggle"""
|
||||
if "Media" in self.menuSections:
|
||||
# Remove any existing DLNA-related items
|
||||
self.menuSections["Media"] = [item for item in self.menuSections["Media"]
|
||||
if "D L N A" not in item[0]]
|
||||
|
||||
# Check DLNA server status and add appropriate toggle
|
||||
isActive = self.check_service_status('minidlna.service')
|
||||
if isActive:
|
||||
self.add_item("Media", "Disable D L N A Server",
|
||||
lambda: self.toggle_service('D L N A Server'))
|
||||
else:
|
||||
self.add_item("Media", "Enable D L N A Server",
|
||||
lambda: self.toggle_service('D L N A Server'))
|
||||
|
||||
def scan_documentation_files(self):
|
||||
"""Scan Documents directory for .md files and add them to help menu"""
|
||||
docs_dir = os.path.expanduser("~/Documents")
|
||||
@@ -846,10 +866,13 @@ class VoicedMenu:
|
||||
|
||||
# Update all service menu items based on current status
|
||||
self.update_service_menu_items()
|
||||
|
||||
|
||||
# Update Bluetooth menu items based on current status
|
||||
self.update_bluetooth_menu_items()
|
||||
|
||||
# Update Media menu items based on current status
|
||||
self.update_media_menu_items()
|
||||
|
||||
# Initial draw
|
||||
self.draw_menu()
|
||||
|
||||
@@ -1113,10 +1136,14 @@ if __name__ == "__main__":
|
||||
# Add the IRC help item
|
||||
menu.add_item("Help and Documentation", "Get help on IRC", "GAME=IRC /home/stormux/.clirc")
|
||||
|
||||
# Add media section
|
||||
menu.add_section("Media")
|
||||
menu.add_item("Media", "Music Player", "/usr/local/bin/music_player.py")
|
||||
menu.add_item("Media", "BookStorm", "GAME=BookStorm startx")
|
||||
menu.add_item("Media", "Upload Files", "/home/stormux/.local/upload_server/uploader.py")
|
||||
|
||||
# Add accessories section
|
||||
menu.add_section("Accessories")
|
||||
menu.add_item("Accessories", "BookStorm", "GAME=BookStorm startx")
|
||||
menu.add_item("Accessories", "Music Player", "/usr/local/bin/music_player.py")
|
||||
menu.add_item("Accessories", "Local IP Address", "/usr/local/bin/ip_info.py local")
|
||||
menu.add_item("Accessories", "Remote IP Address", "/usr/local/bin/ip_info.py remote")
|
||||
menu.add_item("Accessories", "Web Browser", "GAME=Brave startx")
|
||||
@@ -1136,7 +1163,6 @@ if __name__ == "__main__":
|
||||
menu.add_item("System", "Set System Speech Settings", "/usr/local/bin/speechd_rate.py")
|
||||
menu.add_item("System", "Set Default Voice", "/usr/local/bin/set-voice.py")
|
||||
menu.add_item("System", "Set Timezone", "GAME='Set Timezone' /home/stormux/.clirc")
|
||||
menu.add_item("System", "Upload Files", "/home/stormux/.local/upload_server/uploader.py")
|
||||
menu.add_item("System", "Download Files", "/home/stormux/.local/download_server.py")
|
||||
menu.add_item("System", "Update System", "sudo /usr/local/bin/live-update.sh")
|
||||
menu.add_item("System", "Restart: Can Take Several Minutes", "sudo reboot")
|
||||
|
||||
Reference in New Issue
Block a user