eros: minosoft updating: log progress

This commit is contained in:
Moritz Zwerger 2024-01-19 15:33:42 +01:00
parent c2f3a7c00b
commit e6fe8135c0
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
3 changed files with 13 additions and 5 deletions

View File

@ -1,6 +1,6 @@
/*
* Minosoft
* Copyright (C) 2020-2022 Moritz Zwerger
* Copyright (C) 2020-2024 Moritz Zwerger
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
@ -13,7 +13,7 @@
package de.bixilon.minosoft.commands.stack.print
interface PrintTarget {
fun interface PrintTarget {
fun print(message: Any)
}

View File

@ -1,6 +1,6 @@
/*
* Minosoft
* Copyright (C) 2020-2023 Moritz Zwerger
* Copyright (C) 2020-2024 Moritz Zwerger
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
@ -24,6 +24,9 @@ import de.bixilon.minosoft.gui.eros.util.JavaFXUtil.text
import de.bixilon.minosoft.updater.MinosoftUpdate
import de.bixilon.minosoft.updater.MinosoftUpdater
import de.bixilon.minosoft.updater.UpdateProgress
import de.bixilon.minosoft.util.logging.Log
import de.bixilon.minosoft.util.logging.LogLevels
import de.bixilon.minosoft.util.logging.LogMessageType
import de.bixilon.minosoft.util.system.SystemUtil
import javafx.fxml.FXML
import javafx.scene.control.Button
@ -87,7 +90,7 @@ class UpdateAvailableDialog(
@FXML
fun update() {
val progress = UpdateProgress()
val progress = UpdateProgress(log = { Log.log(LogMessageType.OTHER, LogLevels.INFO, it) })
MinosoftUpdater.download(update, progress)
// TODO: Show progress
}

View File

@ -1,6 +1,6 @@
/*
* Minosoft
* Copyright (C) 2020-2023 Moritz Zwerger
* Copyright (C) 2020-2024 Moritz Zwerger
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
@ -183,6 +183,11 @@ object Log {
log(type, level = level, additionalPrefix = null, messageBuilder = messageBuilder)
}
inline fun log(type: LogMessageType, level: LogLevels, message: Any?) {
log(type, level, null, message)
}
@JvmStatic
fun log(type: LogMessageType, messageBuilder: () -> Any?) {
contract {