Re: [PATCH 4/4] Select the previous item when RemoveButton is clicked (KeyboardSpoke)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>          (store, itr) = selection.get_selected()
> +        itr2 = store.get_iter_first()
> +        #if the first item is selected, try to select the next one
> +        if store.get_value(itr, 0) == store.get_value(itr2, 0):

I believe you can skip the get_value call and just do:  store[itr][0].

> +            itr2 = store.iter_next(itr2)
> +            if itr2:#next one existing

Please add some whitespace here.

> +                selection.select_iter(itr2)
> +            #nothing left to be selected
> +            store.remove(itr)
> +            return
> +
> +        #the selected item is not the first, select the previous one
> +        #XXX: there is no model.iter_previous() so we have to find it this way
> +        itr2 = store.iter_next(itr2)
> +        while store.get_value(store.iter_next(itr2), 0) != store.get_value(itr, 0):

You should be able to do the subscripting thing here too.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux