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

[GUI] remember last used keyboard layout #11242

Merged
merged 1 commit into from Dec 25, 2016
Merged

Conversation

da-anda
Copy link
Member

@da-anda da-anda commented Dec 21, 2016

When having multiple keyboard layouts selected, the OSD keyboard will always show the first layout in the list. With this change, Kodi will remember the last used keyboard layout and will use that instead.

Description

A hidden setting has been added which will be updated each time the layout is being changed.

Motivation and Context

There is currently no way to define a preferred keyboard layout. Even when you select the keyboard layouts in a specific order, they will always be stored in alphabetical order. Remembering the last used layout makes a custom order superflous and is even more flexible.

How Has This Been Tested?

runtime tested

Types of change

added hidden setting to store the last active keyboard layout

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@da-anda da-anda added Component: GUI engine Type: Improvement non-breaking change which improves existing functionality Component: Settings v18 Leia labels Dec 21, 2016
m_layouts.push_back(keyboardLayout->second);
if (layoutName->asString() == activeLayout)
m_currentLayout = m_layouts.size() - 1;

This comment was marked as spam.

@Memphiz
Copy link
Member

Memphiz commented Dec 22, 2016

I think its fine as is. There is no other way to get the index as long as those are vectors and not dictionaries.

@da-anda
Copy link
Member Author

da-anda commented Dec 22, 2016

thanks for review. I'll wait until sunday, and will merge then if nobody objects.

@MartijnKaijser trivial enough for a backport?

@phil65
Copy link
Contributor

phil65 commented Dec 22, 2016

@Memphiz Wouldn't std::distance() work here ?
I think we should keep backports to critical fixes at this stage.

@MartijnKaijser
Copy link
Member

ping @Montellese if he knows another way

@Memphiz
Copy link
Member

Memphiz commented Dec 22, 2016

@phil65 size() is already a shortcut to distance() as of the vector.size() docu...

@Memphiz
Copy link
Member

Memphiz commented Dec 22, 2016

Also there is nothing wrong with that way - the for loop is already there - size has constant complexity - i find no reason why this should be unclean...

@phil65
Copy link
Contributor

phil65 commented Dec 22, 2016

sure. @Montellese pointed me to std::distance() some weeks ago for very similar use case, that´s why I was askin.
All fine then, feature makes sense.

@da-anda da-anda merged commit 5b7006a into xbmc:master Dec 25, 2016
@da-anda da-anda deleted the rememberlayout branch December 25, 2016 12:26
@hudokkow hudokkow added this to the L 18.0-alpha1 milestone Dec 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: GUI engine Component: Settings Type: Improvement non-breaking change which improves existing functionality v18 Leia
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants