feat: system tray improvements (routing preset selector, grouped server list, active route title fix)#1577
Merged
Mahdi-zarei merged 3 commits intoJun 25, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a “Select Routing” submenu to the system tray context menu so users can switch routing profiles directly from the tray, updating current_route_id, persisting it, and (if a profile is running) restarting the currently-started profile to apply the change.
Changes:
- Add a tray submenu that is dynamically populated with routing profiles on open.
- Persist selected routing profile (
current_route_id) and re-apply it to the running session by restarting the started profile.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…oute name dynamically
Comment on lines
+2005
to
+2008
| if (!isTray) tt << QString(NKR_VERSION); | ||
| if (!Configs::dataManager->settingsRepo->active_routing.isEmpty() && Configs::dataManager->settingsRepo->active_routing != "Default") { | ||
| tt << "[" + Configs::dataManager->settingsRepo->active_routing + "]"; | ||
| auto route = Configs::dataManager->routesRepo->GetRouteProfile(Configs::dataManager->settingsRepo->current_route_id); | ||
| if (route && route->name != "Default") { | ||
| tt << "[" + route->name + "]"; |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/ui/mainwindow.cpp:639
trayServerMenu->clear()removes/deletes actions, but it does not reliably delete previously created childQMenusubmenus. Since thisaboutToShowhandler creates newQMenu(groupTitle, trayServerMenu)instances on every open, the old submenus can accumulate (memory growth + stale signal connections). Delete existing direct-child submenus before clearing/rebuilding the menu.
connect(trayServerMenu, &QMenu::aboutToShow, this, [=, this]() {
trayServerMenu->clear();
// Stop action if a profile is running
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull Request introduces several UI/UX enhancements and bugfixes to the system tray context menu and main window title/tooltip display:
1. Routing Presets Selector in Tray Menu
Adds a new dynamic «Select Routing» sub-menu directly in the system tray context menu, positioned underneath the "System Proxy Mode" menu item.
2. Group/Subscription Server Clustering in Tray Menu
Previously, having multiple subscriptions resulted in a flat, paginated list of all profiles in the tray, which was difficult to navigate.
✓) to the group containing the active connection.3. Bugfix: Active Route Name in Window Title & Tray Tooltip
Defaultor empty because they relied on an obsoleteactive_routingsetting field.make_titleto resolve the routing profile name dynamically from the activecurrent_route_id.