Release v6.8.1

This commit is contained in:
NerdNumber9
2018-02-14 17:21:29 -05:00
parent 2b7c0e8e80
commit 5447bd098b
11 changed files with 122 additions and 41 deletions
@@ -7,12 +7,37 @@ import com.afollestad.materialdialogs.MaterialDialog
import eu.kanade.tachiyomi.ui.base.controller.DialogController
import eu.kanade.tachiyomi.util.launchUI
import eu.kanade.tachiyomi.util.toast
import timber.log.Timber
import kotlin.concurrent.thread
class ConfiguringDialogController : DialogController() {
private var materialDialog: MaterialDialog? = null
override fun onCreateDialog(savedViewState: Bundle?): Dialog {
if(savedViewState == null)
thread {
try {
EHConfigurator().configureAll()
launchUI {
activity?.toast("Settings successfully uploaded!")
}
} catch (e: Exception) {
activity?.let {
it.runOnUiThread {
MaterialDialog.Builder(it)
.title("Configuration failed!")
.content("An error occurred during the configuration process: " + e.message)
.positiveText("Ok")
.show()
}
}
Timber.e(e, "Configuration error!")
}
launchUI {
finish()
}
}
return MaterialDialog.Builder(activity!!)
.title("Uploading settings to server")
.content("Please wait, this may take some time...")
@@ -23,31 +48,6 @@ class ConfiguringDialogController : DialogController() {
}
}
override fun onAttach(view: View) {
super.onAttach(view)
thread {
try {
EHConfigurator().configureAll()
launchUI {
activity?.toast("Settings successfully uploaded!")
}
} catch (e: Exception) {
activity?.let {
it.runOnUiThread {
MaterialDialog.Builder(it)
.title("Configuration failed!")
.content("An error occurred during the configuration process: " + e.message)
.positiveText("Ok")
.show()
}
}
}
launchUI {
finish()
}
}
}
override fun onDestroyView(view: View) {
super.onDestroyView(view)
materialDialog = null