After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 533638 - Topic by expander
Topic by expander
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: General
0.22.x
Other Linux
: Normal enhancement
: ---
Assigned To: Jonny Lamb
empathy-maint
: 564260 565588 586285 601166 609255 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-05-17 22:15 UTC by Juan Manuel Borges Caño
Modified: 2010-04-02 08:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use a GtkEntry instead of GtkLabel to display the topic (2.81 KB, patch)
2008-07-01 22:12 UTC, Jonny Lamb
none Details | Review
xchat example (184.42 KB, image/png)
2008-07-07 04:18 UTC, Juan Manuel Borges Caño
  Details
Pull in xchat-gnome's TopicLabel and use it instead of GtkLabel to display the channel topic. (13.47 KB, patch)
2008-07-10 17:05 UTC, Jonny Lamb
none Details | Review
Remove need for libsexy (2.74 KB, patch)
2008-07-10 17:26 UTC, Jonny Lamb
needs-work Details | Review
Topic label not filling. (8.22 KB, image/png)
2008-07-10 17:26 UTC, Jonny Lamb
  Details
topic_by_expander.patch (6.77 KB, patch)
2009-07-16 09:02 UTC, Nicolò Chieffo
none Details | Review
topic_by_expander.patch (6.76 KB, patch)
2009-07-16 09:47 UTC, Nicolò Chieffo
none Details | Review

Description Juan Manuel Borges Caño 2008-05-17 22:15:06 UTC
Hello, I'm trying empathy 0.22.1 for IRC.

 I'm used to color nicknames and I find difficult to follow a group conversation without it. Something like assigning a random color for a nick that says something and stick with this color for this nick.

 Sometimes the topic doesn't appears completetely, I think that something like an expander with a text view for the topic would be more useful, the text could handle hypertext as many channels put here references to content on the web. Also the expander label could contain the info from the topic author and date, as this comes from the IRC protocol if it is set, or a message like "No topic set".

 I hope this help you improve this application.
Comment 1 Jonny Lamb 2008-07-01 22:12:21 UTC
Created attachment 113816 [details] [review]
Use a GtkEntry instead of GtkLabel to display the topic

I had a stab at "fixing" the not being able to see the entire topic problem. I've simply changed the topic from a label to an entry. This is what X-Chat does, I think.

Please check out the topic-entry branch at git://git.collabora.co.uk/git/user/jonny/empathy.git

I've attached the patch for your convenience.
Comment 2 Xavier Claessens 2008-07-05 06:30:27 UTC
Juan: Could you please open one bug per feature request? I'm splitting this bug, keep the expander conversation here and the nick color at bug #541632.

Thanks.
Comment 3 Xavier Claessens 2008-07-05 06:46:07 UTC
About the patch: That could make the job, but maybe you could set the entry editable so the user can set a new topic? The problem is I don't know how/if we can know if the user has the permission to set the topic. Seems there is nothing in the spec to know that.
Comment 4 Jonny Lamb 2008-07-07 00:15:32 UTC
Having that entry editable and using it to set the topic is a great idea, but if there's no way of checking whether the user is allowed to do so, it's not really worth thinking about, is it?

Nevertheless, my patch successfully fixes *this* bug, does it not? After all, it does now allow viewing the whole topic.. :-)
Comment 5 Juan Manuel Borges Caño 2008-07-07 04:18:40 UTC
Created attachment 114096 [details]
xchat example
Comment 6 Juan Manuel Borges Caño 2008-07-07 04:20:11 UTC
 First, thank you for the job with this bug.

 I think the topic still doesn't appears completely, the user would need to scroll and there is no possibility of make links from urls with this scheme, something possible with a textview, and appreciable.

 As I stated I think an expander with a textview inside is a good solution, the GUI toolkit provides it, so we can use it.

 As an example implementation xchat-gnome provides something similar to what I'm talking about. But I don't like the cutted topic with "..." I think that the 'Topic set by "nickauthor" at "timestamp"' scheme (data provided by the irc protocol once you join a channel) is a good use of the irc protocol for the expander label.

 Also the user can expand or unexpand the topic when needed, it will be always here and not consuming a lot of space.
Comment 7 Xavier Claessens 2008-07-08 08:22:17 UTC
I agree with Juan that an expander with a textview inside looks better. However I don't agree that the expander label should be the nickname of the guy who set the topic, that information is not important. I like xchat-gnome's way to elipse the topic with "..." and show the full topic if expanded. I lots of channels the topic can fit without the expander anyway.
Comment 8 Jonny Lamb 2008-07-10 17:05:48 UTC
Created attachment 114328 [details] [review]
Pull in xchat-gnome's TopicLabel and use it instead of GtkLabel to display the channel topic.

Okay, you got it. I pulled xchat-gnome's TopicLabel widget and plugged it into Empathy. I simply know you're going to love this.

The results are a few commits in my "topic-entry" (same name, different meaning) branch at git://git.collabora.co.uk/git/user/jonny/empathy.git

I've attached a big patch of the commits merged together.
Comment 9 Jonny Lamb 2008-07-10 17:26:07 UTC
Created attachment 114337 [details] [review]
Remove need for libsexy

This additional patch removes the need for libsexy. However, it doesn't quite work properly. The following image attached shows what happens.

This patch is in my Git branch.
Comment 10 Jonny Lamb 2008-07-10 17:26:42 UTC
Created attachment 114338 [details]
Topic label not filling.
Comment 11 Xavier Claessens 2008-07-14 07:02:41 UTC
Thanks for the patch, comments:

1) We don't want to install topic-label.h, it should not be part of the empathy api/abi. Keep it private. So remove the header from libempathy_gtk_headers, it is alreadi in libempathy_gtk_la_SOURCES.

2) Did you copy topic-label.c/h as-is from xchat-gnome? Or did you add some changes?

Otherwise it seems OK to me.
Comment 12 Jonny Lamb 2008-07-14 10:04:17 UTC
(In reply to comment #11)
> 1) We don't want to install topic-label.h, it should not be part of the empathy
> api/abi. Keep it private. So remove the header from libempathy_gtk_headers, it
> is alreadi in libempathy_gtk_la_SOURCES.

Oh, yes of course, sorry. This is fixed in the aforementioned branch.

> 2) Did you copy topic-label.c/h as-is from xchat-gnome? Or did you add some
> changes?

Most of it is exactly the same, although I have removed large chunks of it. The original can be found at:

http://svn.gnome.org/viewvc/xchat-gnome/trunk/src/fe-gnome/topic-label.c?view=markup

There was a fair but of session stuff in the original code which is useless in Empathy. I didn't add much though.

> Otherwise it seems OK to me.

Cool. What do you think about the libsexy dep? Using a SexyUrlLabel might bring some other advantages.. *shrug* If you don't want to use libsexy though, I'm not sure why the label is showing up like in my previous screenshot..?
Comment 13 Xavier Claessens 2008-07-14 17:20:10 UTC
why is this bug closed?
Comment 14 Xavier Claessens 2008-07-14 17:25:45 UTC
I would like to avoid libsexy dep, and if possible I prefer to have a verbatim copy so it's easier to update if there is changes in x-g.
Comment 15 Guillaume Desmottes 2008-07-14 17:37:16 UTC
You shouldn't worry too much about that, x-g code didn't change since a while.
Comment 16 Jonny Lamb 2008-07-14 17:44:47 UTC
Oops, sorry I must have clicked on one of the auto-responders by accident!

I'm cool with dropping with libsexy. Any hints on fixing that annoying label
problem though?! :-)

Correct me if I'm wrong, but I don't think that it's possible to keep an intact
copy of the xchat-gnome code due to their session way of doing things, and if
you don't want the libsexy dep, then of course a fair bit should change. I
doubt their code will change any time soon though; it's not been touched for
over fifteen months now.
Comment 17 Xavier Claessens 2008-07-19 10:18:52 UTC
libsexy should at least be an option build dep as it's not blessed by GNOME. I think it's not a problem to diverge from x-g, they won't change that file anymore.

Otherwise the code seems OK, I didn't test it but of course we should sort out that filling problem.
Comment 18 Wouter Bolsterlee (uws) 2008-12-25 13:21:50 UTC
*** Bug 565588 has been marked as a duplicate of this bug. ***
Comment 19 Will Thompson 2009-06-11 13:05:48 UTC
*** Bug 564260 has been marked as a duplicate of this bug. ***
Comment 20 Jonny Lamb 2009-06-18 17:46:51 UTC
*** Bug 586285 has been marked as a duplicate of this bug. ***
Comment 21 Nicolò Chieffo 2009-07-16 09:02:45 UTC
Created attachment 138518 [details] [review]
topic_by_expander.patch

This is not what we want but it's a start:
- expander with a label inside
- a label outside the expander (the normal ellipsized) which hides when the expander is expanded and shows when the expander is collapsed

I don't know how to set the markup for URLs, if you tell my how I will do it now.
Comment 22 Nicolò Chieffo 2009-07-16 09:47:20 UTC
Created attachment 138519 [details] [review]
topic_by_expander.patch

minor tweaks.

As someone was telling, the GtkLabel does not expand automatically. I can't find an option to do this.
Even if the GtkExpander is set to expand in the GtkBox, the label is always of the same size
Comment 23 Nicolò Chieffo 2009-07-16 10:09:50 UTC
There's another aesthetic problem with my patch: when the expander is un-expanded the hbox size does not automatically shrink to only fit "Topic:" so the label with the topic is displayed starting in the center of the window.
So it's worth to keep Jonny's patch. Sorry for wasting your time.
Comment 24 Xavier Claessens 2009-11-09 08:10:00 UTC
*** Bug 601166 has been marked as a duplicate of this bug. ***
Comment 25 Guillaume Desmottes 2009-11-18 16:39:47 UTC
Jonny: could you take care of this bug please? You've done some work on it so you're probably the best to review this patch. thanks!
Comment 26 Pietro Battiston 2009-12-23 00:05:41 UTC
Strictly speaking, this should be a separate bug, but since you're redesigning the topic appearance, I would add that currently Ctrl+C is not working on it (and it should!).

Pietro
Comment 27 Xavier Claessens 2010-03-04 09:51:16 UTC
*** Bug 609255 has been marked as a duplicate of this bug. ***
Comment 28 Xavier Claessens 2010-03-04 09:56:33 UTC
I made a proper patch: http://git.collabora.co.uk/?p=user/xclaesse/empathy.git;a=shortlog;h=refs/heads/expand-topic

It is better than xchat-gnome's topic label. xg's SexyUrlLabel request too much height when the topic is expanded, and it is using an hidden label that does not wrap/ellipsize just to know if the expander must be shown. My branch fix all this.

Note that my branch is based on the one for bug #525576 to have clickable links in the topic too.
Comment 29 Guillaume Desmottes 2010-03-04 15:00:56 UTC
I didn't review the branch but that's something that should wait 2.31 as we are now in UI freeze.
Comment 30 Guillaume Desmottes 2010-03-08 16:41:02 UTC
Not sure if it's related to your branch but I got this crash while selecting the topic with the mouse:

  • #0 strlen
    at ../sysdeps/x86_64/strlen.S line 31
  • #1 empathy_add_link_markup
    at empathy-string-parser.c line 204
  • #2 contact_widget_presence_notify_cb
    at empathy-contact-widget.c line 956
  • #3 contact_widget_contact_update
    at empathy-contact-widget.c line 1051
  • #4 contact_widget_set_contact
    at empathy-contact-widget.c line 1093
  • #5 empathy_contact_widget_new
    at empathy-contact-widget.c line 1410
  • #6 contact_list_view_query_tooltip_cb
    at empathy-contact-list-view.c line 175
  • #7 _gtk_marshal_BOOLEAN__INT_INT_BOOLEAN_OBJECT
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkmarshalers.c line 835
  • #8 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.22.3/gobject/gclosure.c line 767
  • #9 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.22.3/gobject/gsignal.c line 3247
  • #10 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.22.3/gobject/gsignal.c line 2990
  • #11 IA__g_signal_emit_by_name
    at /build/buildd/glib2.0-2.22.3/gobject/gsignal.c line 3074
  • #12 gtk_tooltip_run_requery
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtktooltip.c line 803
  • #13 _gtk_tooltip_handle_event
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtktooltip.c line 1334
  • #14 IA__gtk_main_do_event
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkmain.c line 1664
  • #15 gdk_event_dispatch
    at /build/buildd/gtk+2.0-2.18.3/gdk/x11/gdkevents-x11.c line 2369
  • #16 g_main_dispatch
    at /build/buildd/glib2.0-2.22.3/glib/gmain.c line 1960
  • #17 IA__g_main_context_dispatch
    at /build/buildd/glib2.0-2.22.3/glib/gmain.c line 2513
  • #18 g_main_context_iterate
    at /build/buildd/glib2.0-2.22.3/glib/gmain.c line 2591
  • #19 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.22.3/glib/gmain.c line 2799
  • #20 IA__gtk_main
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkmain.c line 1218
  • #21 main
    at empathy.c line 721

Comment 31 Xavier Claessens 2010-03-08 17:03:42 UTC
Already fixed, I forgot to rebase my branch on master. Now I did, just pull ;-)
Comment 32 Guillaume Desmottes 2010-04-02 08:51:31 UTC
Looks good. Code is a bit gruik but seems to work fine.
Comment 33 Xavier Claessens 2010-04-02 08:59:54 UTC
Branch pushed to master, will be fixed for 2.32/3.0.