Permalink
Browse files

Example 25: When there is a connection or login failure render a butt…

…on to dismiss the dialog.

Now it's possible for the user to try again if they mess up the credentials.
  • Loading branch information...
1 parent 4e416c0 commit 58dd866e2e65ee027612f5e0c273aa97df9d3c66 Dusty Phillips committed Jul 5, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 orkiv/__main__.py
View
@@ -7,6 +7,7 @@
from kivy.uix.textinput import TextInput
from kivy.uix.modalview import ModalView
from kivy.uix.label import Label
+from kivy.uix.button import Button
class ConnectionModal(ModalView):
@@ -26,6 +27,11 @@ def connect_to_jabber(self):
self.label.text = "\n".join(app.xmpp.client_roster.keys())
except (XMPPError, InvalidJID):
self.label.text = "Sorry, couldn't connect, check your credentials"
+ button = Button(text="Try Again")
+ button.size_hint = (1.0, None)
+ button.height = "40dp"
+ button.bind(on_press=self.dismiss)
+ self.add_widget(button)
finally:
if hasattr(app, "xmpp") and app.xmpp:
app.xmpp.disconnect()

0 comments on commit 58dd866

Please sign in to comment.