Confirm exit for migrations
(cherry picked from commit 640bd8d9babb3ace1d6a370adad35050271aa008)
This commit is contained in:
parent
3d0dc64de1
commit
949cdccbae
@ -130,6 +130,13 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle),
|
|||||||
sourceManager.get(value) as? CatalogueSource }
|
sourceManager.get(value) as? CatalogueSource }
|
||||||
if (config == null) return
|
if (config == null) return
|
||||||
for (manga in mangas) {
|
for (manga in mangas) {
|
||||||
|
if (migrationsJob?.isCancelled == true) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
// in case it was removed
|
||||||
|
if (manga.mangaId !in config.mangaIds) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if (!manga.searchResult.initialized && manga.migrationJob.isActive) {
|
if (!manga.searchResult.initialized && manga.migrationJob.isActive) {
|
||||||
val mangaObj = manga.manga()
|
val mangaObj = manga.manga()
|
||||||
|
|
||||||
@ -246,7 +253,9 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle),
|
|||||||
|
|
||||||
override fun updateCount() {
|
override fun updateCount() {
|
||||||
launchUI {
|
launchUI {
|
||||||
setTitle()
|
if (router.backstack.last().controller() == this@MigrationListController) {
|
||||||
|
setTitle()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,6 +379,24 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun handleBack(): Boolean {
|
||||||
|
activity?.let {
|
||||||
|
MaterialDialog.Builder(it).title(R.string.stop_migration)
|
||||||
|
.positiveText(R.string.yes)
|
||||||
|
.negativeText(R.string.no)
|
||||||
|
.onPositive { _, _ ->
|
||||||
|
router.popCurrentController()
|
||||||
|
migrationsJob?.cancel()
|
||||||
|
}
|
||||||
|
.show()
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroyView(view: View) {
|
||||||
|
super.onDestroyView(view)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
|
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
|
||||||
inflater.inflate(R.menu.migration_list, menu)
|
inflater.inflate(R.menu.migration_list, menu)
|
||||||
}
|
}
|
||||||
|
@ -493,9 +493,11 @@
|
|||||||
<string name="skipping_x">(skipping %1$d)</string>
|
<string name="skipping_x">(skipping %1$d)</string>
|
||||||
<string name="x_migrations">%1$s manga migrated</string>
|
<string name="x_migrations">%1$s manga migrated</string>
|
||||||
<string name="no">No</string>
|
<string name="no">No</string>
|
||||||
|
<string name="yes">Yes</string>
|
||||||
<string name="error_fetching_migration">No chapters found, this manga cannot be used for
|
<string name="error_fetching_migration">No chapters found, this manga cannot be used for
|
||||||
migration</string>
|
migration</string>
|
||||||
<string name="no_alternatives_found">No Alternatives Found</string>
|
<string name="no_alternatives_found">No Alternatives Found</string>
|
||||||
|
<string name="stop_migration">Stop migrating?</string>
|
||||||
|
|
||||||
<!-- Tracking Screen -->
|
<!-- Tracking Screen -->
|
||||||
<string name="manga_tracking_tab">Tracking</string>
|
<string name="manga_tracking_tab">Tracking</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user