common_dialogs.c 898 B

1234567891011121314151617181920
  1. #include "common_dialogs.h"
  2. #include "constants.h"
  3. static DialogMessageButton totp_dialogs_common(PluginState* plugin_state, const char* text) {
  4. DialogMessage* message = dialog_message_alloc();
  5. dialog_message_set_buttons(message, "Exit", NULL, NULL);
  6. dialog_message_set_text(
  7. message, text, SCREEN_WIDTH_CENTER, SCREEN_HEIGHT_CENTER, AlignCenter, AlignCenter);
  8. DialogMessageButton result = dialog_message_show(plugin_state->dialogs_app, message);
  9. dialog_message_free(message);
  10. return result;
  11. }
  12. DialogMessageButton totp_dialogs_config_loading_error(PluginState* plugin_state) {
  13. return totp_dialogs_common(plugin_state, "An error has occurred\nduring loading config file");
  14. }
  15. DialogMessageButton totp_dialogs_config_updating_error(PluginState* plugin_state) {
  16. return totp_dialogs_common(plugin_state, "An error has occurred\nduring updating config file");
  17. }