Map Provider and API Key changes no longer require restart#596
Merged
Map Provider and API Key changes no longer require restart#596
Conversation
- Need to handle when map style doesn't exist on other provider
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables map provider and API key changes to take effect immediately without requiring a restart. It achieves this by upgrading the SettingsVariable<T> signal to carry ChangedEvent<T> (with old/new values), adding a ResetMap/ConfigureMapSettings mechanism to the map layer, and wiring provider/key changes to reactive signal handlers.
Changes:
SettingsVariable<T>signals now carry aChangedEvent<T>{oldValue_, newValue_}struct, andConnectChanged/ConnectStagedvirtual methods are added toSettingsVariableBasefor type-erased signal connectionmap_widget.cppgainsResetMap()andResolveMapStyleName()to handle dynamic provider and API key changes, and consolidates signal connections intoconnections_vectormain_window.cppwiresmap_providerand custom style changes toPopulateMapStyles/ConfigureMapStyles; OS name is added to the user agent and startup log
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
settings_variable_base.hpp/cpp |
Removes changed_signal()/staged_signal() from base class; adds ConnectChanged/ConnectStaged pure virtual methods |
settings_variable.hpp/cpp |
Adds ChangedEvent<T> struct and moves typed signals here; updates all mutation paths to pass old/new values |
settings_category.cpp |
Updates ConnectVariable to use new ConnectChanged/ConnectStaged helpers |
map_widget.hpp/cpp |
Adds SetMapStyle force parameter; adds ResetMap/ResolveMapStyleName; connects provider/API key changed signals |
map_provider.hpp/cpp |
Extracts ConfigureMapSettings() from MainWindowImpl |
main_window.cpp |
Dynamically responds to provider changes; uses QSignalBlocker for combobox updates; connects custom style signals |
marker_settings_widget.cpp, overlay_layer.cpp |
Updates lambda signatures to auto&&... to accept new signal arguments |
placefile_manager.cpp |
Adds URL to error messages for placefile load failures |
main.cpp |
Adds OS name to log output and user agent |
- Don't reset map location on map reset - Ensure "Custom" is re-added to Map Style combobox
Contributor
Co-authored-by: dpaulat <2886605+dpaulat@users.noreply.github.com>
Add ChangedEvent signal tests for SettingsVariable
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.
No description provided.