[PATCH 13/13] Add elementary timezone spoke
Martin Sivak
msivak at redhat.com
Fri Aug 10 08:42:59 UTC 2012
> Remember to import _ and to also add this file to po/POTFILES.in so
> it'll get picked up for inclusion in anaconda.pot.
import _? isn't gettext putting the _ in builtins? Because it works OK with make runtextspoke
> So in the GUI, apply is almost always run always run without the
> spoke-specific code needing to know about it. It's run when the back
> button is clicked, for instance, or when _runSpoke is done. Here it
> looks like you're planning for apply to be run by a spoke
> intentionally.
> Is that the plan?
Well, actually no, but it was the easiest way of doing it. We do not have any async messages taking care
of clicking back/forward buttons and the spokes can have multiple screens to compensate for lack of space.
Martin
----- Original Message -----
> > + @property
> > + def status(self):
> > + if self.data.timezone.timezone:
> > + return _("%s timezone") % self.data.timezone.timezone
> > + elif self._selection:
> > + return _("%s timezone") % self._selection
> > + else:
> > + return _("Timezone is not set.")
>
>
> > + def input(self, args, key):
> > + try:
> > + keyid = int(key)
> > + if args:
> > + self._selection = "%s/%s" % (args,
> > self._timezones[args][keyid])
> > + self.apply()
> > + self.close()
> > + else:
> > + if len(self._timezones[self._regions[keyid]]) ==
> > 1:
> > + self._selection = "%s/%s" %
> > (self._regions[keyid],
> > +
> > self._timezones[self._regions[keyid]][0])
> > + self.apply()
> > + self.close()
> > + else:
> > + self.app.switch_screen(self,
> > self._regions[keyid])
> > + return True
> > + except ValueError:
> > + pass
> > +
> > + if key.lower() in self._lower_zones:
> > + id = self._lower_zones.index(key.lower())
> > + self._selection = self._zones[id]
> > + self.apply()
> > + self.close()
> > + return True
> > +
> > + elif key.lower() in self._lower_regions:
> > + id = self._lower_regions.index(key.lower())
> > + if len(self._timezones[self._regions[id]]) == 1:
> > + self._selection = "%s/%s" % (self._regions[id],
> > +
> > self._timezones[self._regions[id]][0])
> > + self.apply()
> > + self.close()
> > + else:
> > + self.app.switch_screen(self, self._regions[id])
> > + return True
> > +
> > + elif key.lower() == "b":
> > + self.app.switch_screen(self, None)
> > + return True
> > +
> > + else:
> > + return key
>
> So in the GUI, apply is almost always run always run without the
> spoke-specific code needing to know about it. It's run when the back
> button is clicked, for instance, or when _runSpoke is done. Here it
> looks like you're planning for apply to be run by a spoke
> intentionally.
> Is that the plan?
>
> - Chris
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
More information about the anaconda-patches
mailing list