[Dextrose] [PATCH] Downgrading activities not allowed. (SL #2164)

Martin Abente martin.abente.lahaye at gmail.com
Mon Dec 13 10:21:38 EST 2010


Oh, I did not see it because is part of the original patch. Guess we have
the same typo in mainstream. Want me to send a patch for mainstream too?

On Sat, Dec 11, 2010 at 1:02 PM, Aleksey Lim <alsroot at member.fsf.org> wrote:

> Reviewed-by: Aleksey Lim <alsroot at member.fsf.org>
>
> On Fri, Dec 10, 2010 at 11:56:39AM -0300, Martin Abente wrote:
> > From: shanjit at seeta.in <shanjit at seeta.in>
> >
> > diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py
> > index 6e3cb95..ec1f53d 100644
> > --- a/src/jarabe/journal/misc.py
> > +++ b/src/jarabe/journal/misc.py
> > @@ -229,6 +229,35 @@ def resume(metadata, bundle_id=None):
> >          else:
> >              activityfactory.create_with_object_id(bundle, object_id)
> >
> > +def _launch_bundle(bundle):
> > +    registry = bundleregistry.get_registry()
> > +    logging.debug('activityfactory.creating bundle with id %r',
> > +                       bundle.get_bundle_id())
> > +    installed_bundle = registry.get_bundle(bundle.get_bundle_id())
> > +    if installed_bundle:
> > +        activityfactory.create(installed_bundle)
> > +    else:
> > +        logging.error('Bundle %r is not installed.',
> > +                    bundle.get_bundle_id())
> > +
> > +def _downgrade_option_alert(bundle):
> > +    alert = ConfirmationAlert()
> > +    alert.props.title = _('Older Version Of %s Activity') %
> (bundle.get_name())
>
> > +    alert.props.msg = _('Do you want to downgrade to version %s\
> > +    ') % (bundle.get_activity_version())
> -----
> > +    alert.props.msg = _('Do you want to downgrade to version %s') % \
> > +            bundle.get_activity_version()
> a typo
>
> > +    alert.connect('response', _downgrade_alert_response_cb, bundle)
> > +    journalwindow.get_journal_window().add_alert(alert)
> > +    alert.show()
> > +
> > +def _downgrade_alert_response_cb(alert, response_id, bundle):
> > +    if response_id is gtk.RESPONSE_OK:
> > +        journalwindow.get_journal_window().remove_alert(alert)
> > +        registry = bundleregistry.get_registry()
> > +        registry.install(bundle, force_downgrade=True)
> > +        _launch_bundle(bundle)
> > +    elif response_id is gtk.RESPONSE_CANCEL:
> > +        journalwindow.get_journal_window().remove_alert(alert)
> > +
> >  def is_activity_bundle(metadata):
> >      mime_type = metadata.get('mime_type', '')
> >      return mime_type == ActivityBundle.MIME_TYPE or \
>
> --
> Aleksey
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/dextrose/attachments/20101213/d3eb0f6b/attachment.html>


More information about the Dextrose mailing list