Simplify sound system with pack-based approach

- Remove complex per-event sound enable/disable settings
- Replace dual volume controls with single "Sound Pack Volume"
- Add "None" sound pack option to disable all sounds
- Fix boolean settings parsing in settings dialog
- Update documentation to reflect simplified sound system

Sound system is now intuitive: select a sound pack (or "None")
and set one volume level. Much cleaner than the previous
per-event checkboxes and confusing dual volume controls.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Storm Dragon
2025-07-21 09:17:32 -04:00
parent 3c3b50bdb9
commit ed7de5dafa
5 changed files with 54 additions and 97 deletions

View File

@ -78,42 +78,19 @@ class SettingsDialog(QDialog):
volume_group = QGroupBox("Volume Settings")
volume_layout = QFormLayout(volume_group)
self.master_volume = QSpinBox()
self.master_volume.setRange(0, 100)
self.master_volume.setSuffix("%")
self.master_volume.setAccessibleName("Master Volume")
self.master_volume.setAccessibleDescription("Overall volume for all sounds")
volume_layout.addRow("Master Volume:", self.master_volume)
self.notification_volume = QSpinBox()
self.notification_volume.setRange(0, 100)
self.notification_volume.setSuffix("%")
self.notification_volume.setAccessibleName("Notification Volume")
self.notification_volume.setAccessibleDescription("Volume for notification sounds")
volume_layout.addRow("Notification Volume:", self.notification_volume)
self.sound_pack_volume = QSpinBox()
self.sound_pack_volume.setRange(0, 100)
self.sound_pack_volume.setSuffix("%")
self.sound_pack_volume.setAccessibleName("Sound Pack Volume")
self.sound_pack_volume.setAccessibleDescription("Volume for all sounds from the selected sound pack")
volume_layout.addRow("Sound Pack Volume:", self.sound_pack_volume)
layout.addWidget(volume_group)
# Audio enable/disable options
options_group = QGroupBox("Audio Options")
options_layout = QVBoxLayout(options_group)
self.enable_sounds = QCheckBox("Enable sound effects")
self.enable_sounds.setAccessibleName("Enable Sound Effects")
self.enable_sounds.setAccessibleDescription("Turn sound effects on or off globally")
options_layout.addWidget(self.enable_sounds)
self.enable_post_sounds = QCheckBox("Play sounds for post actions")
self.enable_post_sounds.setAccessibleName("Post Action Sounds")
self.enable_post_sounds.setAccessibleDescription("Play sounds when posting, boosting, or favoriting")
options_layout.addWidget(self.enable_post_sounds)
self.enable_timeline_sounds = QCheckBox("Play sounds for timeline updates")
self.enable_timeline_sounds.setAccessibleName("Timeline Update Sounds")
self.enable_timeline_sounds.setAccessibleDescription("Play sounds when the timeline refreshes")
options_layout.addWidget(self.enable_timeline_sounds)
layout.addWidget(options_group)
# Note about sound pack selection
note_label = QLabel("To disable sounds, select 'None' as the sound pack above.")
note_label.setStyleSheet("font-style: italic; color: #666;")
layout.addWidget(note_label)
layout.addStretch()
self.tabs.addTab(audio_widget, "&Audio")
@ -261,26 +238,22 @@ class SettingsDialog(QDialog):
if index >= 0:
self.sound_pack_combo.setCurrentIndex(index)
self.master_volume.setValue(int(self.settings.get('audio', 'master_volume', 100) or 100))
self.notification_volume.setValue(int(self.settings.get('audio', 'notification_volume', 100) or 100))
self.sound_pack_volume.setValue(int(self.settings.get('audio', 'volume', 100) or 100))
self.enable_sounds.setChecked(bool(self.settings.get('audio', 'enabled', True)))
self.enable_post_sounds.setChecked(bool(self.settings.get('audio', 'post_sounds', True)))
self.enable_timeline_sounds.setChecked(bool(self.settings.get('audio', 'timeline_sounds', True)))
# Desktop notification settings (defaults: DMs, mentions, follows ON; others OFF)
self.enable_desktop_notifications.setChecked(bool(self.settings.get('notifications', 'enabled', True)))
self.notify_direct_messages.setChecked(bool(self.settings.get('notifications', 'direct_messages', True)))
self.notify_mentions.setChecked(bool(self.settings.get('notifications', 'mentions', True)))
self.notify_boosts.setChecked(bool(self.settings.get('notifications', 'boosts', False)))
self.notify_favorites.setChecked(bool(self.settings.get('notifications', 'favorites', False)))
self.notify_follows.setChecked(bool(self.settings.get('notifications', 'follows', True)))
self.notify_timeline_updates.setChecked(bool(self.settings.get('notifications', 'timeline_updates', False)))
self.enable_desktop_notifications.setChecked(self.settings.get_bool('notifications', 'enabled', True))
self.notify_direct_messages.setChecked(self.settings.get_bool('notifications', 'direct_messages', True))
self.notify_mentions.setChecked(self.settings.get_bool('notifications', 'mentions', True))
self.notify_boosts.setChecked(self.settings.get_bool('notifications', 'boosts', False))
self.notify_favorites.setChecked(self.settings.get_bool('notifications', 'favorites', False))
self.notify_follows.setChecked(self.settings.get_bool('notifications', 'follows', True))
self.notify_timeline_updates.setChecked(self.settings.get_bool('notifications', 'timeline_updates', False))
# Accessibility settings
self.page_step_size.setValue(int(self.settings.get('accessibility', 'page_step_size', 5) or 5))
self.verbose_announcements.setChecked(bool(self.settings.get('accessibility', 'verbose_announcements', True)))
self.announce_thread_state.setChecked(bool(self.settings.get('accessibility', 'announce_thread_state', True)))
self.verbose_announcements.setChecked(self.settings.get_bool('accessibility', 'verbose_announcements', True))
self.announce_thread_state.setChecked(self.settings.get_bool('accessibility', 'announce_thread_state', True))
# Timeline settings
self.posts_per_page.setValue(int(self.settings.get('timeline', 'posts_per_page', 40) or 40))
@ -290,12 +263,8 @@ class SettingsDialog(QDialog):
# Audio settings
selected_pack = self.sound_pack_combo.currentData()
self.settings.set('audio', 'sound_pack', selected_pack)
self.settings.set('audio', 'master_volume', self.master_volume.value())
self.settings.set('audio', 'notification_volume', self.notification_volume.value())
self.settings.set('audio', 'volume', self.sound_pack_volume.value())
self.settings.set('audio', 'enabled', self.enable_sounds.isChecked())
self.settings.set('audio', 'post_sounds', self.enable_post_sounds.isChecked())
self.settings.set('audio', 'timeline_sounds', self.enable_timeline_sounds.isChecked())
# Desktop notification settings
self.settings.set('notifications', 'enabled', self.enable_desktop_notifications.isChecked())