[Sugar-devel] [PATCH sugar] Add empty messages for empty devices and empty DOCUMENTS folders
Gonzalo Odiard
gonzalo at laptop.org
Tue Sep 6 14:59:56 EDT 2011
Tested and works ok.
IMHO, sending the constants had more sense when we only had two messages,
now should be more clear if we do:
if len(tree_model) == 0:
> if self._is_query_empty():
> - self._show_message(MESSAGE_EMPTY_JOURNAL)
> + if self._query['mountpoints'] == ['/']:
> + self._show_message(_('Your Journal is empty'))
> + elif self._query['mountpoints'] == \
> + [model.get_documents_path()]:
> + self._show_message(_('Your documents folder is
> empty'))
> + else:
> + self._show_message(_('The device is empty'))
> else:
> self._show_message(_('No matching
> entries'),show_clear_query=True)
> else:
> @@ -385,6 +393,10 @@ class BaseListView(gtk.Bin):
>
>
def _show_message(self, message, show_clear_query=False):
.....
if show_clear_query:
button = gtk.Button(label=_('Clear search'))
button.connect('clicked', self.__clear_button_clicked_cb)
button.props.image = Icon(icon_name='dialog-cancel',
icon_size=gtk.ICON_SIZE_BUTTON)
canvas_button = hippo.CanvasWidget(widget=button,
xalign=hippo.ALIGNMENT_CENTER)
box.append(canvas_button)
... but is only me.
Regards,
Gonzalo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110906/8f27551c/attachment-0001.html>
More information about the Sugar-devel
mailing list