mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
strings + better dialogbox
This commit is contained in:
parent
e2590cbd9b
commit
1b2b93eed7
3 changed files with 13 additions and 7 deletions
|
@ -214,7 +214,7 @@ class ExtensionsFragment : Fragment() {
|
|||
RepositoryManager.addRepository(newRepo)
|
||||
extensionViewModel.loadStats()
|
||||
extensionViewModel.loadRepositories()
|
||||
this@ExtensionsFragment.activity?.downloadAllPluginsDialog(url)
|
||||
this@ExtensionsFragment.activity?.downloadAllPluginsDialog(url, fixedName)
|
||||
}
|
||||
dialog.dismissSafe(activity)
|
||||
}
|
||||
|
|
|
@ -259,24 +259,26 @@ object AppUtils {
|
|||
)
|
||||
}
|
||||
afterRepositoryLoadedEvent.invoke(true)
|
||||
downloadAllPluginsDialog(url)
|
||||
downloadAllPluginsDialog(url, repo.name)
|
||||
}
|
||||
}
|
||||
|
||||
fun Activity.downloadAllPluginsDialog(repositoryUrl: String) {
|
||||
fun Activity.downloadAllPluginsDialog(repositoryUrl: String, repositoryName: String) {
|
||||
runOnUiThread {
|
||||
val context = this
|
||||
val builder: AlertDialog.Builder = AlertDialog.Builder(this)
|
||||
builder.setTitle(
|
||||
"Download all plugins from this repo?"
|
||||
repositoryName
|
||||
)
|
||||
builder.setMessage(
|
||||
R.string.download_all_plugins_from_repo
|
||||
)
|
||||
builder.apply {
|
||||
// TODO: R.string Yes No
|
||||
setPositiveButton("Yes") { _, _ ->
|
||||
setPositiveButton(R.string.yes) { _, _ ->
|
||||
downloadAll(context, repositoryUrl, null)
|
||||
}
|
||||
|
||||
setNegativeButton("No") { _, _ -> }
|
||||
setNegativeButton(R.string.no) { _, _ -> }
|
||||
}
|
||||
builder.show()
|
||||
}
|
||||
|
|
|
@ -602,4 +602,8 @@
|
|||
<string name="view_public_repositories_button">View community repositories</string>
|
||||
<string name="view_public_repositories_button_short">Public list</string>
|
||||
<string name="uppercase_all_subtitles">Uppercase all subtitles</string>
|
||||
|
||||
<string name="yes">Yes</string>
|
||||
<string name="no">No</string>
|
||||
<string name="download_all_plugins_from_repo">Download all plugins from this repo?</string>
|
||||
</resources>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue