[Sugar-devel] [PATCH sugar] Start the activity when the treeview row is activated

Simon Schampijer simon at schampijer.de
Mon Jan 14 08:52:18 EST 2013


Thanks Daniel!

Tested to not introduce regressions for mouse usage. And tested with 
your 'make check' test, impressive work, I was able to detect an error 
with stopping my Terminal and could pinpoint back using the logs in 
logs/check.log. Go sugar-build go!

Pushed as: 0bf9d535f55ed4b93e951de0fb980196cff84815

Cheers,
    Simon


On 12/03/2012 01:59 AM, Daniel Narvaez wrote:
> From: Daniel Narvaez <dwnarvaez at gmail.com>
>
> This makes the "activate" accessible action work, which is useful
> both for the UI tests and accessibility.
> It shouldn't interfer with the normal mouse behavior because gtk
> only calls row_activated on a double click.
> ---
>   src/jarabe/desktop/activitieslist.py |    8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/src/jarabe/desktop/activitieslist.py b/src/jarabe/desktop/activitieslist.py
> index 6594ee9..738a54f 100644
> --- a/src/jarabe/desktop/activitieslist.py
> +++ b/src/jarabe/desktop/activitieslist.py
> @@ -80,6 +80,8 @@ class ActivitiesTreeView(Gtk.TreeView):
>           column.add_attribute(cell_icon, 'file-name', ListModel.COLUMN_ICON)
>           self.append_column(column)
>
> +        self._icon_column = column
> +
>           cell_text = Gtk.CellRendererText()
>           cell_text.props.ellipsize = Pango.EllipsizeMode.MIDDLE
>           cell_text.props.ellipsize_set = True
> @@ -143,6 +145,9 @@ class ActivitiesTreeView(Gtk.TreeView):
>                                        not row[ListModel.COLUMN_FAVORITE])
>
>       def __icon_clicked_cb(self, cell, path):
> +        self._start_activity(path)
> +
> +    def _start_activity(self, path):
>           row = self.get_model()[path]
>
>           registry = bundleregistry.get_registry()
> @@ -165,6 +170,9 @@ class ActivitiesTreeView(Gtk.TreeView):
>           title = normalize_string(title.decode('utf-8'))
>           return title is not None and title.find(self._query) > -1
>
> +    def do_row_activated(self, path, column):
> +        if column == self._icon_column:
> +            self._start_activity(path)
>
>   class ListModel(Gtk.TreeModelSort):
>       __gtype_name__ = 'SugarListModel'
>



More information about the Sugar-devel mailing list