Re: Patch for bug #140827
- From: Dave Camp <dave ximian com>
- To: padraig o'briain <Padraig Obriain Sun COM>
- Cc: nautilus-list gnome org
- Subject: Re: Patch for bug #140827
- Date: Mon, 26 Apr 2004 12:50:24 -0400
Looks good, please commit.
-dave
On Mon, 2004-04-26 at 15:55 +0100, padraig o'briain wrote:
> This is arequest for review of patch for bug #140827 to allow unselection of all icons using the keyboard. Patch attached for convenience.
>
> Padraig
> Plain text document attachment (140827.patch)
> Index: nautilus-icon-container.c
> ===================================================================
> RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-container.c,v
> retrieving revision 1.369
> diff -u -p -r1.369 nautilus-icon-container.c
> --- nautilus-icon-container.c 20 Apr 2004 14:04:17 -0000 1.369
> +++ nautilus-icon-container.c 26 Apr 2004 14:44:06 -0000
> @@ -153,6 +153,7 @@ static NautilusIcon *get_first_selected_
> static NautilusIcon *get_nth_selected_icon (NautilusIconContainer *container,
> int index);
> static gboolean has_multiple_selection (NautilusIconContainer *container);
> +static gboolean all_selected (NautilusIconContainer *container);
> static gboolean has_selection (NautilusIconContainer *container);
> static void icon_destroy (NautilusIconContainer *container,
> NautilusIcon *icon);
> @@ -435,7 +436,6 @@ icon_toggle_selected (NautilusIconContai
> if (icon->is_selected) {
> icon_raise (icon);
> }
> -
> }
>
> /* Select an icon. Return TRUE if selection has changed. */
> @@ -2675,9 +2675,15 @@ keyboard_arrow_key (NautilusIconContaine
>
> if (from == NULL) {
> if (has_multiple_selection (container)) {
> - from = find_best_selected_icon
> - (container, NULL,
> - better_start, NULL);
> + if (all_selected (container)) {
> + from = find_best_selected_icon
> + (container, NULL,
> + empty_start, NULL);
> + } else {
> + from = find_best_selected_icon
> + (container, NULL,
> + better_start, NULL);
> + }
> } else {
> from = get_first_selected_icon (container);
> }
> @@ -5570,6 +5576,21 @@ static gboolean
> has_multiple_selection (NautilusIconContainer *container)
> {
> return get_nth_selected_icon (container, 2) != NULL;
> +}
> +
> +static gboolean
> +all_selected (NautilusIconContainer *container)
> +{
> + GList *p;
> + NautilusIcon *icon;
> +
> + for (p = container->details->icons; p != NULL; p = p->next) {
> + icon = p->data;
> + if (!icon->is_selected) {
> + return FALSE;
> + }
> + }
> + return TRUE;
> }
>
> static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]