def testError(self): d = hig.ErrorAlert(primary="You don't want to do it like that", secondary="Chaos will ensue.") self.runAndDismiss(d) d = hig.ErrorAlert(primary="Could not destroy universe", secondary="Destructor ray malfunctioned.", fix_button="Try again") self.runAndDismiss(d)
def show_error(self,message,secondary): running=False self.error=True gtk.gdk.threads_enter() error_dlg = hig.ErrorAlert( parent=self, primary=message, secondary=secondary) error_dlg.run() error_dlg.destroy() gtk.gdk.threads_leave() event = gtk.gdk.Event(gtk.gdk.DELETE) self.emit('delete_event', event)
def onTokenReceived(self, slave): try: self.token = flickr.parseToken(slave.response()) except flickr.FlickrError, err: msg = _("Make sure you followed the link and authorized access.\n" ) + str(err) d = hig.ErrorAlert(primary=_("Flickr returned an error."), secondary=msg, parent=self.main_window) d.run() d.destroy() return
def show_error_message(self,message,exception=None): if exception == None: secondary_message = "" else: if isinstance(exception,EnvironmentError): secondary_message = exception.strerror or str(exception) or "" else: secondary_message = str(exception) d = hig.ErrorAlert( primary=message, secondary=secondary_message, parent=self.window) d.run() d.destroy()
def display_flickr_error(err): d = hig.ErrorAlert(primary=_("Upload Error"), secondary=str(err)) d.run() d.destroy()