Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add format-no-controller to bluetooth module and fix it still being visible if the format string is empty #2413

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

PucklaJ
Copy link
Contributor

@PucklaJ PucklaJ commented Aug 16, 2023

Fixes #2163

This PR contains the following changes:

  1. Adds the format-no-controller and tooltip-format-no-controller format strings that will be used if no bluetooth controller could be found.
  2. Fixes the bluetooth module still being visible if the format string is empty.

The reason for why the bluetooth module was still being displayed is the return statement in the constructor of the bluetooth module:

// NOTE: assumption made that the controller that is selcected stays unchanged
// for duration of the module
if (!findCurController(cur_controller_)) {
if (config_["controller-alias"].isString()) {
spdlog::error("findCurController() failed: no bluetooth controller found with alias '{}'",
config_["controller-alias"].asString());
} else {
spdlog::error("findCurController() failed: no bluetooth controller found");
}
event_box_.hide();
return;
}

This return statement caused dp.emit() not to be called and somehow this removed the ability for the module to hide.

I also think that it makes sense to have an additional format string for the case when the system does not have a bluetooth controller. If the user still wants to hide the bluetooth module he just needs to set format-no-controller to an empty string.

@Alexays
Copy link
Owner

Alexays commented Aug 16, 2023

LGTM thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bluetooth module visible if no bluetooth controller found
2 participants