diff browser_side/menu.py @ 300:4f221f34bdc7

browser_side (plugins radiocol, xep-0054): handle upload errors
author souliane <souliane@mailoo.org>
date Tue, 17 Dec 2013 19:37:47 +0100
parents 7316a5696366
children 629c99bbd031
line wrap: on
line diff
--- a/browser_side/menu.py	Tue Dec 24 02:00:30 2013 +0100
+++ b/browser_side/menu.py	Tue Dec 17 19:37:47 2013 +0100
@@ -124,8 +124,12 @@
     def onSubmitComplete(self, event):
         result = event.getResults()
         if result != "OK":
-            Window.alert('Something went wrong while submitting file')
-        self.close_cb()
+            Window.alert("Can't open image... did you actually submit an image?")
+            self.message.setHTML('Please select another image file')
+            self.upload_btn.setEnabled(True)
+        else:
+            Window.alert("Your new profile picture has been set!")
+            self.close_cb()
 
 
 class Menu(SimplePanel):