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 501065 - Can't rename group
Can't rename group
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Contact List
unspecified
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
: 567037 583960 615538 (view as bug list)
Depends on: 669984
Blocks: 669747
 
 
Reported: 2007-12-02 17:26 UTC by Guillaume Desmottes
Modified: 2012-10-08 07:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (3.24 KB, patch)
2007-12-04 23:39 UTC, Cosimo Cecchi
none Details | Review
proposed patch v2 (3.13 KB, patch)
2007-12-04 23:45 UTC, Cosimo Cecchi
rejected Details | Review
non-working patch (10.11 KB, patch)
2008-01-01 17:47 UTC, Cosimo Cecchi
needs-work Details | Review
Add edited-callback to GtkCellRenderer( EmpathyCellRendererText) (4.68 KB, patch)
2008-01-07 23:09 UTC, Juan Pizarro
needs-work Details | Review
Add edited-callback to GtkCellRenderer( EmpathyCellRendererText) (4.74 KB, patch)
2008-01-09 15:00 UTC, Juan Pizarro
needs-work Details | Review
add empathy_connection_aggregator_rename_group() (2.43 KB, patch)
2012-04-05 12:39 UTC, Guillaume Desmottes
committed Details | Review
individual-view: add menu item to rename groups (6.63 KB, patch)
2012-04-05 12:39 UTC, Guillaume Desmottes
committed Details | Review
live-search: don't forward shift keys (1.27 KB, patch)
2012-04-05 12:39 UTC, Guillaume Desmottes
committed Details | Review
strip the new group name (1.39 KB, patch)
2012-04-20 09:39 UTC, Guillaume Desmottes
committed Details | Review

Description Guillaume Desmottes 2007-12-02 17:26:48 UTC
When you right click on a group in your roster there is a "Rename" menu entry but it doesn't do anything.
Comment 1 Gaute Hope 2007-12-02 21:47:03 UTC
Possibly dub: bug 459520
Comment 2 Gaute Hope 2007-12-02 21:52:12 UTC
dub=dup=duplicate
Comment 3 Xavier Claessens 2007-12-02 21:58:55 UTC
bug #459520 is about removing the group, here we want to rename an existing group. It's not a dup.
Comment 4 Cosimo Cecchi 2007-12-04 23:39:56 UTC
Created attachment 100211 [details] [review]
proposed patch

Attached patch implements this request using a new GtkDialog popping up when clicking rename in the menu.
Comment 5 Cosimo Cecchi 2007-12-04 23:45:45 UTC
Created attachment 100212 [details] [review]
proposed patch v2

Forgot a g_free (), sorry for the spam...this is the right patch.
Comment 6 Guillaume Desmottes 2007-12-05 00:03:07 UTC
Not sure we need a popup here. Why not just directly edit in the treeview?
Comment 7 Xavier Claessens 2007-12-05 08:15:20 UTC
That could be interesting to edit in the treeview, for contacts too. However, I think we can't do that for groups because clicking on the group expand/collapse it.

I'll review the patch this afternoon, thank.
Comment 8 Guillaume Desmottes 2007-12-05 10:28:48 UTC
I don't suggest to edit the group name each time we click on it. But you right click -> Renamme and then you can edit in the treeview
Comment 9 Xavier Claessens 2007-12-05 10:35:37 UTC
Good idea!
Comment 10 Guillaume Desmottes 2007-12-10 14:10:42 UTC
Cosimo: What do you think about this proposal? Could you modify your patch to implement that?
Comment 11 Xavier Claessens 2007-12-10 14:22:15 UTC
Guillaume > AFAIK Cosimo did the patch but he was facing some strange GtkTreeView behaviours.
Comment 12 Cosimo Cecchi 2007-12-10 14:25:40 UTC
Yes, I'm working on this, but I have to deal with some unexpected GtkCellRenderer behaviour...the first time I want to rename a group, I have to right-click->rename twice to activate the entry on the treeview. Does not happen if I try to do it again then...very strange.
I'll post my updates here when I have something that works properly.
Comment 13 Xavier Claessens 2007-12-20 14:24:52 UTC
No progress? If you post the code you have so far maybe some GTK guru will help.
Comment 14 Cosimo Cecchi 2008-01-01 17:47:29 UTC
Created attachment 101946 [details] [review]
non-working patch

This is what I've done so far, without luck.
I hope someone could find what we're doing wrong :)
Comment 15 Juan Pizarro 2008-01-07 23:09:20 UTC
Created attachment 102352 [details] [review]
Add edited-callback to GtkCellRenderer( EmpathyCellRendererText)

Add the pointer "GtkCellRenderer *text_rend" on "struct _EmpathyContactListView".
Add callbacks to signals editing-started, editing-canceled, edited.
Comment 16 Xavier Claessens 2008-01-08 09:39:41 UTC
It doesn't seems to work here, nothing happens when I right-click on a group and click rename :(
Comment 17 Juan Pizarro 2008-01-08 12:02:03 UTC
The first time, after the right-click on a group and click rename, you need one left-click.
Then works well.
This code is based of pidgin-code, and pidgin runs same.
Comment 18 Xavier Claessens 2008-01-08 19:26:50 UTC
Right, pidgin is bugged too... We should try to fix that problem, does the bug comes from GTK itself?

Btw, please try to respect coding style, functions should be like that:

static void
my_function (typ1      *arg1,
             tyyyyype2 *arg2)
{
        foo (x);
}

Do not make lines longer than 80 chars.
In signals cb you can directly set the type of the user_data instead of gpointer.

Thanks.
Comment 19 Xavier Claessens 2008-01-08 19:29:34 UTC
Also, did you wrote your patch based on Cosimo Cecchi's or did you wrote it from scratch?
Comment 20 Juan Pizarro 2008-01-09 15:00:42 UTC
Created attachment 102473 [details] [review]
Add edited-callback to GtkCellRenderer( EmpathyCellRendererText)   	 

Correction to coding style.
I wrote my patch from scratch based on pidgin-code, I began to write the patch in December.
Comment 21 Cosimo Cecchi 2008-01-10 11:55:28 UTC
BTW, the left-click thing is exactly the same issue you'll get with my patch.
Maybe both we and pidgin guys are doing something wrong, but chances are that the bug is really in GTK+ itself.

@Juan: I think it's better to have the text in the entry updated by writing the implementation of start_editing in the EmpathyCellRendererText class than linking to the start-editing signal, getting the text from the model and set it manually in the entry. Also, once you have it in the class, you won't have to do the steps above each time you want to edit the renderer. You can look or c/p from my patch (nevermind the rewrite of the button-press-event handler, which I did because I thought the problem was there).
Comment 22 Guillaume Desmottes 2009-01-26 21:28:39 UTC
*** Bug 567037 has been marked as a duplicate of this bug. ***
Comment 23 Guillaume Desmottes 2009-06-10 12:46:16 UTC
*** Bug 583960 has been marked as a duplicate of this bug. ***
Comment 24 Guillaume Desmottes 2010-04-13 07:25:18 UTC
*** Bug 615538 has been marked as a duplicate of this bug. ***
Comment 25 Guillaume Desmottes 2010-06-04 09:30:20 UTC
Let's wait for the new ContactList API before implementing this.
Comment 26 Guillaume Desmottes 2012-02-13 13:17:19 UTC
I have working code for this but it's blocked by bug #669984 and https://bugs.freedesktop.org/show_bug.cgi?id=45982
Comment 27 Guillaume Desmottes 2012-04-05 12:39:02 UTC
Created attachment 211373 [details] [review]
add empathy_connection_aggregator_rename_group()
Comment 28 Guillaume Desmottes 2012-04-05 12:39:08 UTC
Created attachment 211374 [details] [review]
individual-view: add menu item to rename groups
Comment 29 Guillaume Desmottes 2012-04-05 12:39:11 UTC
Created attachment 211375 [details] [review]
live-search: don't forward shift keys

Not doing so cancel any group renaming operation.
Comment 30 Xavier Claessens 2012-04-20 09:10:46 UTC
Review of attachment 211374 [details] [review]:

::: libempathy-gtk/empathy-individual-view.c
@@ +1830,3 @@
+  g_object_set (priv->text_renderer, "editable", FALSE, NULL);
+
+  if (tp_str_empty (new_name))

could verify if it is only whitespaces too, maybe.
Comment 31 Xavier Claessens 2012-04-20 09:10:47 UTC
Review of attachment 211374 [details] [review]:

::: libempathy-gtk/empathy-individual-view.c
@@ +1830,3 @@
+  g_object_set (priv->text_renderer, "editable", FALSE, NULL);
+
+  if (tp_str_empty (new_name))

could verify if it is only whitespaces too, maybe.
Comment 32 Xavier Claessens 2012-04-20 09:11:55 UTC
Review of attachment 211375 [details] [review]:

::: libempathy-gtk/empathy-live-search.c
@@ +365,3 @@
+       event->keyval == GDK_KEY_Shift_R)
+       return FALSE;
+

Does it still work to type capital letters in the live search with this?
Comment 33 Guillaume Desmottes 2012-04-20 09:39:21 UTC
Review of attachment 211374 [details] [review]:

::: libempathy-gtk/empathy-individual-view.c
@@ +1830,3 @@
+  g_object_set (priv->text_renderer, "editable", FALSE, NULL);
+
+    gchar *new_name,

Good point. It's worth stripping the string first anyway.
Comment 34 Guillaume Desmottes 2012-04-20 09:39:56 UTC
Created attachment 212409 [details] [review]
strip the new group name
Comment 35 Guillaume Desmottes 2012-04-20 09:41:07 UTC
(In reply to comment #32)
> Review of attachment 211375 [details] [review]:
> 
> ::: libempathy-gtk/empathy-live-search.c
> @@ +365,3 @@
> +       event->keyval == GDK_KEY_Shift_R)
> +       return FALSE;
> +
> 
> Does it still work to type capital letters in the live search with this?

Yes, that's a separate key event with the "Shift" flag on.
Comment 36 Xavier Claessens 2012-04-20 09:45:13 UTC
ok, looks good now, +1
Comment 37 Guillaume Desmottes 2012-04-20 11:36:44 UTC
Attachment 211373 [details] pushed as 69f4cb2 - add empathy_connection_aggregator_rename_group()
Attachment 211374 [details] pushed as 5405e5f - individual-view: add menu item to rename groups
Attachment 211375 [details] pushed as b5063fd - live-search: don't forward shift keys
Attachment 212409 [details] pushed as 4551d97 - strip the new group name
Comment 38 Mike Manilone 2012-07-16 03:35:17 UTC
*** Bug 679919 has been marked as a duplicate of this bug. ***
Comment 39 Laurent Bigonville 2012-10-07 22:47:31 UTC
Hi,

I've the feeling that this functionality is gone in 3.6 due to the rewritten rooster.

Should I open a new bug?
Comment 40 Guillaume Desmottes 2012-10-08 07:24:40 UTC
(In reply to comment #39)
> Hi,
> 
> I've the feeling that this functionality is gone in 3.6 due to the rewritten
> rooster.
> 
> Should I open a new bug?

Indeed, see bug #679919