Fix/issue 865 create action disabled#910
Merged
Merged
Conversation
MarcelGeo
approved these changes
May 13, 2026
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.
Summary
Fixes #865 - at the QGIS welcome screen with no project open, the "Create Mergin Maps Project" toolbar action stays disabled. Opening any project (then optionally closing it) is required to get it to wake up.
Root cause
enable_toolbar_actions(Mergin/plugin.py:291-303) already has the correct special case for the Create button — it should be enabled wheneverself.mcandself.managerare both set,regardless of whether a project is open. The bug is that
create_manager()never callsenable_toolbar_actions()after populatingself.mc/self.managerat startup. Other state-change paths(
on_config_changed,on_qgis_project_changed) do, but the initial-load path does not — so on a clean QGIS launch the Create button stays at its initialenabled=Falsestate untilon_qgis_project_changedfires (i.e. a project is opened).Fix
One line - call
self.enable_toolbar_actions()at the end ofcreate_manager(). The existingmc/managercheck then enables the Create button at startup with no project required. The call is idempotent, and the same function is already invoked from the other state-change paths, so there is no behavioural risk elsewhere (the only side effect is a slightly redundant second call fromon_config_changed, which is harmless).