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

Set layout based on system's layout on first connection, fix #1197 #1245

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

deXol
Copy link
Collaborator

@deXol deXol commented Oct 12, 2024

Add tracking for first device connection. (based on serial number)
When device is connected first time to the given system, set layouts according to system's layout.

@deXol deXol marked this pull request as draft October 12, 2024 13:00
@deXol deXol marked this pull request as ready for review October 21, 2024 19:17
@deXol deXol requested a review from limpkin October 21, 2024 19:17

void KeyboardLayoutDetectorMac::fillKeyboardLayoutMap()
{
m_layoutMap = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that won't work, you need to pick the (MacOS) layouts

#include "DeviceConnectionChecker.h"
#include "AppGui.h"

const QString DeviceConnectionChecker::CONNECTED_DEVICES_GROUP = "ConnectedDevices/";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of curiosity, we didn't have a similar service before? for example, in our logic to check the change number for a given user

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have DbExportsRegistry: https://github.com/mooltipass/moolticute/blob/master/src/DbExportsRegistry.cpp
It is embedded in DbBackup codes, so was not able to reuse it, it writes dbExportsRegistry.ini with the changeNumbers for given cardId.
I would be able to use that file, but I believe a new connectedDevices.ini much more clean.

@@ -261,6 +261,7 @@ void SettingsGuiHelper::updateParameters(const QJsonObject &data)
val = data["value"].toBool();
}
m_settings->updateParam(m_settings->getParamId(param), val);
m_mw->checkSettingsChanged();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of curiosity, what's that for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/utils/KeyboardLayoutDetector.cpp:23 I am sending parameters directly for layouts, it updates these parameters in daemon and send back param_changed message, which calls this function and setting UI element to correct value (in this case the layout). However settingsChanged is not checked and due to the new layout Save/Cancel buttons are displayed without this call.

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.

2 participants