mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-19 21:16:30 +02:00
Fix disable options button always changing to No optional mods...
This commit is contained in:
parent
6c6a0100fd
commit
03b0f1b09b
@ -367,7 +367,8 @@ class UpdateManager internal constructor(private val opts: Options, val ui: IUse
|
||||
handleCancellation()
|
||||
}
|
||||
}
|
||||
ui.disableOptionsButton()
|
||||
// TODO: keep this enabled? then apply changes after download process?
|
||||
ui.disableOptionsButton(optionTasks.isNotEmpty())
|
||||
|
||||
// TODO: different thread pool type?
|
||||
val threadPool = Executors.newFixedThreadPool(10)
|
||||
|
@ -19,7 +19,7 @@ interface IUserInterface {
|
||||
fun showOptions(options: List<IOptionDetails>): Boolean
|
||||
|
||||
fun showExceptions(exceptions: List<ExceptionDetails>, numTotal: Int, allowsIgnore: Boolean): ExceptionListResult
|
||||
fun disableOptionsButton() {}
|
||||
fun disableOptionsButton(hasOptions: Boolean) {}
|
||||
|
||||
fun showCancellationDialog(): CancellationResult = CancellationResult.QUIT
|
||||
|
||||
|
@ -131,8 +131,8 @@ class GUIHandler : IUserInterface {
|
||||
return future.get()
|
||||
}
|
||||
|
||||
override fun disableOptionsButton() = EventQueue.invokeLater {
|
||||
frmPackwizlauncher.disableOptionsButton()
|
||||
override fun disableOptionsButton(hasOptions: Boolean) = EventQueue.invokeLater {
|
||||
frmPackwizlauncher.disableOptionsButton(hasOptions)
|
||||
}
|
||||
|
||||
override fun showCancellationDialog(): IUserInterface.CancellationResult {
|
||||
|
@ -77,10 +77,10 @@ class InstallWindow(private val handler: GUIHandler) : JFrame() {
|
||||
lblProgresslabel.text = progress.message
|
||||
}
|
||||
|
||||
fun disableOptionsButton() {
|
||||
fun disableOptionsButton(hasOptions: Boolean) {
|
||||
btnOptions.apply {
|
||||
text = "No optional mods"
|
||||
isEnabled = false
|
||||
text = if (hasOptions) { "Optional mods..." } else { "No optional mods" }
|
||||
isEnabled = false
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user