withwx.MessageDialog(None,_("This process will retrieve the users you selected from your Mastodon account, and add them to the user autocomplete database. Please note that if there are many users or you have tried to perform this action less than 15 minutes ago, TWBlue may reach a limit in API calls when trying to load the users into the database. If this happens, we will show you an error, in which case you will have to try this process again in a few minutes. If this process ends with no error, you will be redirected back to the account settings dialog. Do you want to continue?"),_("Attention"),style=wx.ICON_QUESTION|wx.YES_NO)asresult:
ifresult.ShowModal()==wx.ID_YES:
returnTrue
returnFalse
defshow_success(users):
withwx.MessageDialog(None,_("TWBlue has imported {} users successfully.").format(users),_("Done"))asdlg:
dlg.ShowModal()
defshow_error():
withwx.MessageDialog(None,_("Error adding users from Mastodon. Please try again in about 15 minutes."),_("Error"),style=wx.ICON_ERROR)asdlg: