feat(tray): remove Start on Login and About from the tray menu (#905)

* feat(tray): remove Start on Login and About from the tray menu

Both entries already live in Settings: the autostart switch is in the
general page and About is a dedicated sidebar page, so the tray items
are redundant. View Logs stays.

Removes the Start on Login checkbox item along with its
_update_autostart_checkbox/_on_autostart_toggled wiring and the now
unused _add_menu_checkbox helper, plus the About item and
_on_about_clicked. _show_settings_page("about") stays for the Update
Available item. autostart_manager is untouched since Settings uses it.

Fixes #654

* fix(settings): sync autostart switch with the real desktop entry

The tray's removed _update_autostart_checkbox also reconciled
general.autostart with the actual login desktop entry at startup. Move
that check into the settings load so the Start on Login switch still
reflects reality when the entry changes outside the app.

---------

Co-authored-by: Jatin K Malik <jatinkrmalik@gmail.com>
This commit is contained in:
devin-ai-integration[bot]
2026-10-07 17:12:01 -07:00
committed by GitHub
co-authored by Jatin K Malik
parent 26c4f9052b
commit 6a6cc93919
4 changed files with 19 additions and 74 deletions
+9 -9
View File
@@ -280,8 +280,8 @@ class TestTrayIndicator(unittest.TestCase):
mock_dialog_instance.present_with_time.assert_called_once()
mock_dialog_instance.navigate_to_page.assert_not_called()
def test_about_reuses_open_settings_dialog(self):
"""About focuses the existing Settings window and switches to the About page."""
def test_update_available_reuses_open_settings_dialog(self):
"""Update Available focuses the existing Settings window on the About page."""
import vocalinux.ui.tray_indicator as tray_module
mock_dialog_instance = MagicMock()
@@ -289,7 +289,7 @@ class TestTrayIndicator(unittest.TestCase):
with patch.object(tray_module, "SettingsDialog", mock_dialog_class):
self.tray_indicator._on_settings_clicked(None)
self.tray_indicator._on_about_clicked(None)
self.tray_indicator._on_update_available_clicked(None)
mock_dialog_class.assert_called_once()
mock_dialog_instance.navigate_to_page.assert_called_once_with("about")
@@ -312,13 +312,13 @@ class TestTrayIndicator(unittest.TestCase):
second_dialog.show.assert_called_once()
first_dialog.present_with_time.assert_not_called()
def test_about_dialog(self):
"""Test About opens Settings focused on the About page."""
def test_update_available_opens_about_page(self):
"""Test Update Available opens Settings focused on the About page."""
with patch("vocalinux.ui.tray_indicator.SettingsDialog") as mock_dialog_class:
mock_dialog_instance = MagicMock()
mock_dialog_class.return_value = mock_dialog_instance
self.tray_indicator._on_about_clicked(None)
self.tray_indicator._on_update_available_clicked(None)
mock_dialog_class.assert_called_once()
kwargs = mock_dialog_class.call_args.kwargs
@@ -661,13 +661,13 @@ class TestTrayIndicator(unittest.TestCase):
self.tray_indicator.run()
mock_quit.assert_called_once()
def test_about_opens_settings_without_raising(self):
"""Test About menu item opens settings even if dialog construction is mocked."""
def test_update_available_opens_settings_without_raising(self):
"""Test Update Available opens settings even if dialog construction is mocked."""
with patch("vocalinux.ui.tray_indicator.SettingsDialog") as mock_dialog_class:
mock_dialog_instance = MagicMock()
mock_dialog_class.return_value = mock_dialog_instance
self.tray_indicator._on_about_clicked(None)
self.tray_indicator._on_update_available_clicked(None)
mock_dialog_instance.connect.assert_called()
mock_dialog_instance.show.assert_called_once()
-1
View File
@@ -112,7 +112,6 @@ class TestTrayIndicatorInitialization(unittest.TestCase):
assert indicator.text_injector == mock_text_injector
assert indicator.config_manager == mock_config_inst
assert indicator.shortcut_manager == mock_keyboard_inst
assert indicator._syncing_autostart_menu is False
# Verify that idle_add was called to initialize the indicator
mock_glib.idle_add.assert_called()