[Sugar-devel] How to have "CellRenderer.props" take effect, without a UI refresh?

Ajay Garg ajay at activitycentral.com
Tue Jul 24 09:14:37 EDT 2012


Sir,
Regards.


Thanks for the reply.


On Tue, Jul 24, 2012 at 6:36 PM, Sascha Silbe <silbe at activitycentral.com>wrote:

> Ajay Garg <ajay at activitycentral.com> writes:
>
> > This piece of code works as expected, and the toggling-UI-effect takes
> > place as soon as the star/favorite-icon is clicked (that is, the
> > mouse-pointer need not be hovered away).
> > But note that, there is listview-refresh involved after each toggling of
> > the star/favorite-icon.
>
> What exactly do you mean by "listview-refresh"? Do you mean a) a redraw
> of the current content or b) some operation that causes us to query the
> data store (or file system)?
>


By refresh, I mean to say that the data store is re-queried.




More clearly, I changed the code (in src/jarabe/journal/listview) from ::

##################################################################
    def refresh(self):
        logging.debug('ListView.refresh query %r', self._query)
        self._stop_progress_bar()

        if self._model is not None:
            self._model.stop()
        self._dirty = False

        self._model = ListModel(self._query)
        self._model.connect('ready', self.__model_ready_cb)
        self._model.connect('progress', self.__model_progress_cb)
        self._model.setup()
##################################################################



TO





##################################################################
    def refresh(self):
        if not self._inhibit_refresh:
            self.proceed_with_refresh()

    def proceed_with_refresh(self):
        logging.debug('ListView.refresh query %r', self._query)
        self._stop_progress_bar()

        if self._model is not None:
            self._model.stop()
        self._dirty = False

        self._model = ListModel(self._query)
        self._model.connect('ready', self.__model_ready_cb)
        self._model.connect('progress', self.__model_progress_cb)
        self._model.setup()
##################################################################


where "self._inhibit_refresh = False", in multi-select mode.



Regards,
Ajay




>
> > If the listview-refresh is inhibited, the toggling-UI-effect does take
> > place, but ONLY AFTER the mouse-pointer is hovered away from the
> > star/favorite-icon.
>
> What exactly do you mean by "listview-refresh is inhibited"? How did you
> inhibit it?
>
> Sascha
> --
> http://sascha.silbe.org/
> http://www.infra-silbe.de/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120724/574073aa/attachment.html>


More information about the Sugar-devel mailing list