[anaconda][rhel7-branch/master][PATCH] Allow to search specialized and network devices after pressing Enter (#1058364)

Martin Kolman mkolman at redhat.com
Wed Sep 10 16:29:40 UTC 2014


On Wed, 2014-09-10 at 17:12 +0200, Vratislav Podzimek wrote:
> On Wed, 2014-09-10 at 16:57 +0200, Martin Kolman wrote:
> > Done by emitting the 'clicked' signal from the find button as that appears to be the easiest
> > way to get the information that a search should be done to the filtering machinery.
> > 
> > Resolves: rhbz#1058364
> > Signed-off-by: Martin Kolman <mkolman at redhat.com>
> > ---
> >  pyanaconda/ui/gui/spokes/filter.py | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> > 
> > diff --git a/pyanaconda/ui/gui/spokes/filter.py b/pyanaconda/ui/gui/spokes/filter.py
> > index cdd0e6d..4c87f12 100644
> > --- a/pyanaconda/ui/gui/spokes/filter.py
> > +++ b/pyanaconda/ui/gui/spokes/filter.py
> > @@ -157,6 +157,11 @@ class FilterPage(object):
> >  
> >          return disk.name
> >  
> > +    def _on_entry_activated(self, _entry, find_button):
> > +        # User pressed enter on a search related entry box, trigger search by emitting
> > +        # the "clicked" signal from the corresponding find button
> > +        find_button.emit("clicked")
> > +
> >  class SearchPage(FilterPage):
> >      def __init__(self, storage, builder):
> >          FilterPage.__init__(self, storage, builder)
> > @@ -171,6 +176,11 @@ class SearchPage(FilterPage):
> >  
> >          self._combo = self.builder.get_object("searchTypeCombo")
> >  
> > +        find_button = self.builder.get_object("searchFindButton")
> Please make it 'self._findButton' and pull it just once from the
> builder. Otherwise this looks good to me.
> 
There are actually four different buttons, one for each filter page, so
it needs to be pulled four times in any case. As for assigning the
button to self._findButton, that would just bring more code duplication
as the method that triggers the 'clicked' signal would need to be either
defined separately for each page or the self._findButton variable
would need to be defined in the parent class and there would need to
be checks to see if it has been assigned. So I'd like to leave the patch
as is. :)



More information about the anaconda-patches mailing list