Bug 308953

Summary: Integration with keyborad layout switcher, allow separate keyboard layout per chat tab
Product: [Unmaintained] telepathy Reporter: Julius Schwartzenberg <julius.schwartzenberg>
Component: text-uiAssignee: Telepathy Bugs <kde-telepathy-bugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: ahmedibrahimkhali, ddomenichelli, kde, mklapetek
Priority: NOR    
Version: 0.5.1   
Target Milestone: Future   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Julius Schwartzenberg 2012-10-24 19:35:51 UTC
I'm often chatting in multiple languages at the same time and I used to use the keyboard layout feature 'separate layout for each window' so I could quickly switch between chats without having to switch keyboard layouts all the time.

Having all chats in tabs in a single window is nice, but it means this feature doesn't work anymore. I'd like to see integration with the keyboard layout switcher, so that I can again chat with in multiple languages without having to switch manually all the time.

Reproducible: Always

Steps to Reproduce:
1. Use KDE Telepathy in tabbed mode
2. Use the keyboard layout switcher with the "different layout per window" feature
3. Get tired of still having to switch manually all the time while chatting ;)
Comment 1 Martin Klapetek 2012-10-24 21:35:01 UTC
There is a setting in text-ui that lets you open new conversations in new windows instead of tabs. However I just tried it and it seems not to work.

Anyway, we already have spellcheck language per tab, adding a kbd layout per tab could perhaps be done as well...
Comment 2 David Edmundson 2012-10-24 22:08:53 UTC
Does any other application support changing the keyboard switcher layout?

org.kde.kded /modules/keyboard/org.kde.KeyboardLayouts does have a setLayout method.
So this is possible. Would be easier if we had code to copy.

Interface also needs a design of how it would work. Randomly changing the layout because the user happened to be talking to someone 6 months ago with a different keyboard plugged in won't be very good either.
Comment 3 Daniele E. Domenichelli 2012-10-25 07:13:37 UTC
What about switching the keyboard layout together with the language instead of with the tab? would that work? Even though we should have some config dialog to associate one language with one keyboard (perhaps that could be useful system wide)
In that case we could just store the preferred language for a user and restore the keyboard accordingly, instead of storing the pair language-keyboard
Comment 4 Julius Schwartzenberg 2012-10-25 07:32:11 UTC
KWordQuiz supports switching automatically, so I guess that would be a good example.

For me, it would be fine to set the layout to the default layout for new tabs. When switching back to a tab for which I had set a layout previously, I'd like to have that layout again. I don't think it is needed to store a layour per contact on disk.

Daniele, I'm not sure what you mean with language switching, so I'm not sure whether it could work.
Comment 5 Daniele E. Domenichelli 2012-10-25 07:51:01 UTC
In the text-ui "Settings > Toolbars Shown > Language Toolbar" shows a combo-box for the spell-checking language.
When you write in some language you probably always want to use at the same time a combination of spell-checking and keyboard layout.
i.e. if you write in Italian, English (UK) and Russian but you have an Italian keyboard you might always want to use:
 Italian -> Italian spell-checking, Italian keyboard layout
 English (UK) -> English (UK) spell-checking, Italian keyboard layout
 Russian -> Russian spell-checking, Russian keyboard layout (for Cyrillic characters)
Comment 6 Daniele E. Domenichelli 2012-10-25 07:53:40 UTC
So, since we are going to store the language spoken with a contact, if we had some similar association, we could restore at the same time spell-checking language and keyboard layout...
Comment 7 Julius Schwartzenberg 2012-10-25 13:48:47 UTC
That would not always work for me. With some contacts I chat in multiple languages, sometimes I even need to switch between keyboard layouts for a single sentence.

Also I do not want to manually switch languages that I all type with a single keyboard layout. A perfect solution for me would be to have spell-checkers for multiple languages active at the same time.

In case it would be useful, I can describe multiple scenario's that I have myself.
Comment 8 Julius Schwartzenberg 2012-10-26 07:36:07 UTC
Thinking more about this.. what if you could select multiple languages per contact? It would then also combine the spell-checkers of the languages that are checked.

Thanks for all the comments so far! I am a bit addicted to chatting and sometimes chat in 3-4 languages at the same time with multiple people, sometimes using multiple languages per chat. If my situation could be fully supported that would be just amazing!!
Comment 9 Daniele E. Domenichelli 2012-10-26 07:42:48 UTC
Just to clarify... are you using different languages in the same message or you write a message, send it, then switch language and write another one?
Comment 10 Martin Klapetek 2012-10-26 07:56:45 UTC
Btw. if you can write C++ even little bit, we can help you code this ;)
Comment 11 Julius Schwartzenberg 2012-10-26 18:39:23 UTC
Yes, I'm using multiple languages and layouts in one message sometimes. Often it's a translation. Or I switch between the Russian and US layouts in one message because it's easier to write a particular name or word in the other alphabet. I do not really use separate messages for separate languages actively, it can be a mix.

I am not really a C++ programmer, but maybe I could try :)
Comment 12 Ahmed Ibrahim 2014-03-12 21:11:57 UTC
There is a switching policy that you can set to Application instance instead of being Global.
http://i.imgur.com/Rs74AlW.png
Comment 13 Julius Schwartzenberg 2014-03-12 21:32:28 UTC
Ahmed, that is the exact policy setting that would work when you have each conversation in a separate window. This will not solve the problem for users who would like to use multiple tabs in a single window.
Comment 14 Ahmed Ibrahim 2014-03-12 22:44:52 UTC
@Julius You are right, Sorry about that I didn't read the description well, I've realized that and sent a review request, hopefully everything goes fine.
https://git.reviewboard.kde.org/r/116774/
Comment 15 David Edmundson 2014-03-25 10:49:06 UTC
Git commit 7599bc88d73901e4a8eb05fee0791a604d8a1e08 by David Edmundson, on behalf of Ahmed Ibrahim.
Committed on 25/03/2014 at 10:49.
Pushed by davidedmundson into branch 'master'.

Integration with keyboard layout switcher, allow separate keyboard layout per chat tab.

Used DBus interface to switch the keyboard layout and listen to the keyboard layout change. Stored the language in each ChatTab instance and then restore it back when the ChatWindow is activated and when switching between tabs.

REVIEW: 116774

M  +49   -2    app/chat-window.cpp
M  +10   -0    app/chat-window.h
M  +11   -0    lib/chat-widget.cpp
M  +4    -0    lib/chat-widget.h

http://commits.kde.org/telepathy-text-ui/7599bc88d73901e4a8eb05fee0791a604d8a1e08