Bug 325183

Summary: Group chat theme preview in settings dialog is not loaded
Product: [Unmaintained] telepathy Reporter: Daniel Vrátil <dvratil>
Component: text-uiAssignee: Telepathy Bugs <kde-telepathy-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: diane, kde, mail, mklapetek
Priority: NOR    
Version: git-latest   
Target Milestone: 0.8.0   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Daniel Vrátil 2013-09-22 21:18:27 UTC
text-ui -> Settings -> Chat Window Appearance -> Group Chat -> preview is empty

You have to pick another theme in the combo box, then the preview is loaded correctly.
Comment 1 David Edmundson 2013-09-23 00:50:10 UTC
I can't reproduce that here.
Comment 2 Sven Brauch 2013-09-23 01:00:33 UTC
I can't reproduce it either.
Comment 3 Daniel Vrátil 2013-09-23 13:30:19 UTC
Hmm, it seems to happen only with a specific theme (Mochastyle) - Renkoo works fine. 

Still it's weird, because when I select Renkoo (without applying) and then select Mochastyle again, the preview will load correctly, so maybe there's some timing issue with slower/faster themes.
Comment 4 Martin Klapetek 2013-09-23 13:57:33 UTC
Does not happen here with HipChat theme.
Comment 5 Martin Klapetek 2014-02-24 17:56:47 UTC
Dan, can you reliably reproduce with the said theme?
Comment 6 Diane Trout 2014-02-24 19:51:03 UTC
I can reproduce it. 

Open ktp-text-ui, Select Settings, Configure Text UI, Group Chat.

For me, if its set to Message Style "Renkoo" (variant Blue on Green No Names Alt)  I have no rendered preview. When I switch to simkete the preview pane renders, and if I switch back Renkoo renders.
Comment 7 Diane Trout 2014-02-24 19:57:37 UTC
A played a bit more for it to happen your normal chat theme has to be renkoo, and when you switch to group chat the renkoo style doesn't render.

If your normal chat theme is simkete, a renkoo group chat will render.
Comment 8 Diane Trout 2014-02-25 07:02:37 UTC
A bit more about duplicating (at least for me).

It appears to only happen when normal and group chat are set to the same style.
if you launch /usr/lib/kde4/libexec/ktp-text-ui by hand so it shows a blank window with no rendered chats, both normal & group chat previews seem to render correctly.
If you then double click on a contact that has recent chat history, then the group chat wont render.

At the end of AppearanceConfigTab::onStylesLoaded() there's a "//FIXME call onStyleSelected".  I wonder if that's a hint whats wrong.
Comment 9 David Edmundson 2014-02-25 09:03:20 UTC
Reopening
Comment 10 Martin Klapetek 2014-04-10 13:13:41 UTC
> It appears to only happen when normal and group chat are set to the same style.

That does not happen here, I have both set to HipChat and both previews load correctly.

I can't actually reproduce in any way, setting Rankoo randomly to either normal or group chats or any other combination does not trigger this here.
Comment 12 Martin Klapetek 2014-04-10 16:06:50 UTC
Thanks, closing :)
Comment 13 David Edmundson 2014-06-11 09:47:18 UTC
Git commit 9a0d4e6910767879be731d09438213de10da4985 by David Edmundson, on behalf of Diane Trout.
Committed on 04/03/2014 at 20:05.
Pushed by davidedmundson into branch 'kde-telepathy-0.8'.

Provide a proxy javascript can call to say when its finished initialising its part of the AdiumThemeView. Fixes 325183

What I discovered is that occasionally the AdiumThemeView will fire its loadFinished event before the body has finished loading. (which also means that some of the javascript functions don't get defined as they're created from the onLoad property of body.

What this patch does is injects a small proxy QObject (AdiumThemeViewProxy) into the javascript environment in AdiumThemeView::injectProxyIntoJavascript(). The proxy gives javascript access to a signal that it can call at the end of a new "configureEnvironment" javascript function.

I added the new function instead of adding the signal to the end of the current initStyles functions because that appears to be overridable by some of the themes.

Also since this now lets you definitavely know that javascript is ready to append your messages, I removed some extra sendDemoMessages calls.

I'm not sure what happens if a theme tries to override data/Template.html though.

Also I stuck AdiumThemeViewProxy in with the AdiumThemeView because it seemed small and tightly coupled with AdiumThemeView. However it seems like the convention is every class gets its own .h/.cpp file. So that might need to be fixed.

REVIEW: 116559

M  +1    -3    config/appearance-config-tab.cpp
M  +33   -4    lib/adium-theme-view.cpp
M  +13   -0    lib/adium-theme-view.h

http://commits.kde.org/telepathy-text-ui/9a0d4e6910767879be731d09438213de10da4985