-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add error handling for camera initialization. #2
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR! It works fine in the second case the pop up is displayed, however, the cross or the "OK" button lets the user go into the UI. It'd be great if it can redirect to home screen or just close the activity In the first case, when no camera is attached. It just gets unresponsive and freezes and needs to be force closed.
|
def show_error_message(self, message): | ||
# Create an error dialog | ||
dialog = Gtk.MessageDialog( | ||
parent=self, | ||
flags=Gtk.DialogFlags.MODAL, | ||
type=Gtk.MessageType.ERROR, | ||
buttons=Gtk.ButtonsType.OK, | ||
message_format=message | ||
) | ||
dialog.run() | ||
dialog.destroy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use the sugar3.graphics.alert
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks!
Well let me see the other way around it but it gets me in terminal directly in both the cases but that might due to I am running these activity from terminal only |
People who use sugar would rarely ever run activities from the terminal, test activities through the activity ring and see how they behave as that's how you'll expect people to run them. |
Added error handling and display for connection failure related to bug index of bound.