diff --git a/wavexlr/app.py b/wavexlr/app.py index ff8791e..272caf0 100644 --- a/wavexlr/app.py +++ b/wavexlr/app.py @@ -284,7 +284,6 @@ def _update_service_status(self): self.audio_status_icon.set_from_icon_name("emblem-ok-symbolic") self.audio_status_icon.remove_css_class("dim-label") self.audio_status_row.set_subtitle("Audio service running") - self.uninstall_btn.set_visible(True) else: self.audio_status_icon.set_from_icon_name("dialog-warning-symbolic") # Distinguish a service that never came up from one that is not @@ -297,12 +296,19 @@ def _update_service_status(self): else: subtitle = "Audio service not running" self.audio_status_row.set_subtitle(subtitle) - self.uninstall_btn.set_visible(False) + + # Shown whenever there is something to remove, rather than only while + # the service runs. A stopped or failed service is when removing it + # matters most, and the udev rule and the config drop-ins outlive it + # either way. + self.uninstall_btn.set_visible(setup.anything_installed()) def _on_uninstall_clicked(self, btn): dialog = Adw.AlertDialog( heading="Uninstall Capture Fix?", - body="This will remove the audio service and USB permissions.\n\nYou can reinstall them by restarting OpenWave.", + body="This will remove the audio service, the WirePlumber rule, " + "the mix sinks and the USB permissions.\n\nYou can reinstall " + "them by restarting OpenWave.", ) dialog.add_response("cancel", "Cancel") dialog.add_response("uninstall", "Uninstall") diff --git a/wavexlr/setup.py b/wavexlr/setup.py index a6384eb..ad50ccf 100644 --- a/wavexlr/setup.py +++ b/wavexlr/setup.py @@ -87,6 +87,20 @@ def needs_setup(): ) +def anything_installed(): + """Whether any part of the integration is still on disk. + + Not the inverse of needs_setup(): a partial install both needs setup and + has things left to remove. + """ + return ( + udev_installed() + or service_installed() + or wireplumber_installed() + or mixes_installed() + ) + + def install_udev(): """Install udev rules via pkexec.""" rules = "\n".join(UDEV_RULES)