Skip to content

Commit

Permalink
Dialog_Load_Failed,Dialog_Repair_Collection, Dialog_New_Collection co…
Browse files Browse the repository at this point in the history
…nverted to alert dialog
  • Loading branch information
neeldoshii committed Feb 10, 2024
1 parent 1825df1 commit b4848d6
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ class DatabaseErrorDialog : AsyncDialogFragment() {
DIALOG_LOAD_FAILED -> {
// Collection failed to load; give user the option of either choosing from repair options, or closing
// the activity
dialog.show {
alertDialog.show {
title(R.string.open_collection_failed_title)
cancelable(false)
contentNullable(message)
icon(R.drawable.ic_warning)
message(text = message)
setIcon(R.drawable.ic_warning)
positiveButton(R.string.error_handling_options) {
(activity as DeckPicker?)
?.showDatabaseErrorDialog(DIALOG_ERROR_HANDLING)
Expand Down Expand Up @@ -184,9 +185,10 @@ class DatabaseErrorDialog : AsyncDialogFragment() {
}
DIALOG_REPAIR_COLLECTION -> {
// Allow user to run BackupManager.repairCollection()
dialog.show {
contentNullable(message)
icon(R.drawable.ic_warning)
alertDialog.show {
title(R.string.dialog_positive_repair)
message(text = message)
setIcon(R.drawable.ic_warning)
positiveButton(R.string.dialog_positive_repair) {
(activity as DeckPicker).repairCollection()
dismissAllDialogFragments()
Expand Down Expand Up @@ -252,8 +254,9 @@ class DatabaseErrorDialog : AsyncDialogFragment() {
}
DIALOG_NEW_COLLECTION -> {
// Allow user to create a new empty collection
dialog.show {
contentNullable(message)
alertDialog.show {
title(R.string.backup_new_collection)
message(text = message)
positiveButton(R.string.dialog_positive_create) {
val ch = CollectionHelper.instance
val time = TimeManager.time
Expand Down

0 comments on commit b4848d6

Please sign in to comment.