Merge lp:~bratsche/indicator-me/auto-select-entry into lp:indicator-me

Proposed by Cody Russell
Status: Merged
Approved by: David Barth
Approved revision: 83
Merge reported by: David Barth
Merged at revision: not available
Proposed branch: lp:~bratsche/indicator-me/auto-select-entry
Merge into: lp:indicator-me
Diff against target: 73 lines (+35/-7)
1 file modified
src/indicator-me.c (+35/-7)
To merge this branch: bzr merge lp:~bratsche/indicator-me/auto-select-entry
Reviewer Review Type Date Requested Status
David Barth Approve
Ted Gould (community) Approve
Review via email: mp+21177@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :
Download full text (3.4 KiB)

Looks good

  review approve

On Thu, 2010-03-11 at 20:26 +0000, Cody Russell wrote:
> Cody Russell has proposed merging lp:~bratsche/indicator-me/auto-select-entry into lp:indicator-me.
>
> Requested reviews:
> Indicator Applet Developers (indicator-applet-developers)
> Related bugs:
> #528302 The text field should receive focus automatically
> https://bugs.launchpad.net/bugs/528302
>
> differences between files attachment (review-diff.txt)
> === modified file 'src/indicator-me.c'
> --- src/indicator-me.c 2010-03-11 17:10:36 +0000
> +++ src/indicator-me.c 2010-03-11 20:26:16 +0000
> @@ -7,17 +7,18 @@
>
> Authors:
> Ted Gould <email address hidden>
> + Cody Russell <email address hidden>
>
> - This program is free software: you can redistribute it and/or modify it
> - under the terms of the GNU General Public License version 3, as published
> + This program is free software: you can redistribute it and/or modify it
> + under the terms of the GNU General Public License version 3, as published
> by the Free Software Foundation.
>
> - This program is distributed in the hope that it will be useful, but
> - WITHOUT ANY WARRANTY; without even the implied warranties of
> - MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + This program is distributed in the hope that it will be useful, but
> + WITHOUT ANY WARRANTY; without even the implied warranties of
> + MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> PURPOSE. See the GNU General Public License for more details.
>
> - You should have received a copy of the GNU General Public License along
> + You should have received a copy of the GNU General Public License along
> with this program. If not, see <http://www.gnu.org/licenses/>.
> */
>
> @@ -253,9 +254,32 @@
> }
>
> static gboolean
> +menu_visibility_changed (GtkWidget *widget,
> + IdoEntryMenuItem *menuitem)
> +{
> + gtk_menu_shell_select_item (GTK_MENU_SHELL (widget), GTK_WIDGET (menuitem));
> +
> + return FALSE;
> +}
> +
> +static void
> +entry_parent_changed (GtkWidget *widget,
> + gpointer user_data)
> +{
> + GtkWidget *parent = gtk_widget_get_parent (widget);
> +
> + if (parent && GTK_IS_MENU_SHELL (parent))
> + {
> + g_signal_connect (parent,
> + "map", G_CALLBACK (menu_visibility_changed),
> + widget);
> + }
> +}
> +
> +static gboolean
> new_entry_item (DbusmenuMenuitem * newitem,
> DbusmenuMenuitem * parent,
> - DbusmenuClient * client)
> + DbusmenuClient * client)
> {
> g_return_val_if_fail(DBUSMENU_IS_MENUITEM(newitem), FALSE);
> g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), FALSE);
> @@ -267,6 +291,10 @@
> gtk_entry_set_text(entry, dbusmenu_menuitem_property_get(newitem, DBUSMENU_ENTRY_MENUITEM_PROP_TEXT));
> gtk_entry_set_width_chars (entry, 23); /* set some nice aspect ratio for the menu */
>
> + g_signal_connect (ido,
> + "notify::parent", G_CALLBACK (entry_parent_changed),
> + NULL);
> +
> dbusmenu_gtkclient...

Read more...

review: Approve
Revision history for this message
David Barth (dbarth) wrote :

Excellent, thanks for the patch Cody.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/indicator-me.c'
2--- src/indicator-me.c 2010-03-11 17:10:36 +0000
3+++ src/indicator-me.c 2010-03-11 20:26:25 +0000
4@@ -7,17 +7,18 @@
5
6 Authors:
7 Ted Gould <ted@canonical.com>
8+ Cody Russell <cody.russell@canonical.com>
9
10- This program is free software: you can redistribute it and/or modify it
11- under the terms of the GNU General Public License version 3, as published
12+ This program is free software: you can redistribute it and/or modify it
13+ under the terms of the GNU General Public License version 3, as published
14 by the Free Software Foundation.
15
16- This program is distributed in the hope that it will be useful, but
17- WITHOUT ANY WARRANTY; without even the implied warranties of
18- MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
19+ This program is distributed in the hope that it will be useful, but
20+ WITHOUT ANY WARRANTY; without even the implied warranties of
21+ MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
22 PURPOSE. See the GNU General Public License for more details.
23
24- You should have received a copy of the GNU General Public License along
25+ You should have received a copy of the GNU General Public License along
26 with this program. If not, see <http://www.gnu.org/licenses/>.
27 */
28
29@@ -253,9 +254,32 @@
30 }
31
32 static gboolean
33+menu_visibility_changed (GtkWidget *widget,
34+ IdoEntryMenuItem *menuitem)
35+{
36+ gtk_menu_shell_select_item (GTK_MENU_SHELL (widget), GTK_WIDGET (menuitem));
37+
38+ return FALSE;
39+}
40+
41+static void
42+entry_parent_changed (GtkWidget *widget,
43+ gpointer user_data)
44+{
45+ GtkWidget *parent = gtk_widget_get_parent (widget);
46+
47+ if (parent && GTK_IS_MENU_SHELL (parent))
48+ {
49+ g_signal_connect (parent,
50+ "map", G_CALLBACK (menu_visibility_changed),
51+ widget);
52+ }
53+}
54+
55+static gboolean
56 new_entry_item (DbusmenuMenuitem * newitem,
57 DbusmenuMenuitem * parent,
58- DbusmenuClient * client)
59+ DbusmenuClient * client)
60 {
61 g_return_val_if_fail(DBUSMENU_IS_MENUITEM(newitem), FALSE);
62 g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), FALSE);
63@@ -267,6 +291,10 @@
64 gtk_entry_set_text(entry, dbusmenu_menuitem_property_get(newitem, DBUSMENU_ENTRY_MENUITEM_PROP_TEXT));
65 gtk_entry_set_width_chars (entry, 23); /* set some nice aspect ratio for the menu */
66
67+ g_signal_connect (ido,
68+ "notify::parent", G_CALLBACK (entry_parent_changed),
69+ NULL);
70+
71 dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, GTK_MENU_ITEM(ido), parent);
72 /* disconnect the activate signal that newitem_base connected with the wrong
73 widget, ie menuitem, and re-connect it with the /entry/ instead */

Subscribers

People subscribed via source and target branches