Skip to content

Commit

Permalink
logic fixes the second (and last for today i hope)
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Aug 20, 2024
1 parent e896860 commit 628f648
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/org/andbootmgr/app/CreatePartFlow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,7 @@ private fun Flash(c: CreatePartDataHolder) {
makeOne(0)
} else { // Portable partition
terminal.add(vm.activity.getString(R.string.term_create_part))
vm.logic.unmountBootset()
val r = vm.logic.create(c.p,
c.l.toLong(),
c.u.toLong(),
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/java/org/andbootmgr/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import android.util.Log
import android.view.WindowManager
import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.activity.compose.BackHandler
import androidx.activity.compose.setContent
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
Expand Down Expand Up @@ -76,7 +77,6 @@ class MainActivityState(val activity: MainActivity?) {
var wizardCompat by mutableStateOf<String?>(null)

fun startFlow(flow: String) {
unmountBootset()
wizardCompat = flow
}

Expand Down Expand Up @@ -268,20 +268,22 @@ class MainActivity : ComponentActivity() {
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
onDispose { window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) }
}
BackHandler {}
Column(modifier = Modifier.fillMaxSize()) {
Terminal(null, { canFinish = true }, null)
Row(modifier = Modifier.fillMaxWidth().weight(1.0f)) {
Terminal(null, { canFinish = true }, null)
}
Row(modifier = Modifier.fillMaxWidth()) {
TextButton(onClick = {
}, modifier = Modifier.weight(1f, true)) {
Text("") // This button is useless.
}
TextButton(onClick = {
if (canFinish) {
if (canFinish)
CoroutineScope(Dispatchers.IO).launch {
vm.init()
showTerminal = false
}
}
}, modifier = Modifier.weight(1f, true)) {
Text(if (canFinish) stringResource(R.string.finish) else "")
}
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/org/andbootmgr/app/WizardActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ class WizardActivityState(val mvm: MainActivityState) {
mvm.wizardCompatE = null
mvm.wizardCompatPid = null
mvm.wizardCompatSid = null
mvm.mountBootset()
}

fun copy(inputStream: InputStream, outputStream: OutputStream): Long {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/org/andbootmgr/app/util/Terminal.kt
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ fun Terminal(logFile: String? = null, doWhenDone: (() -> Unit)? = null,
}, s)
} else {
val s = service.workExtra as BudgetCallbackList
text.value = s.joinToString("\n")
text.value = s.joinToString("\n").let { if (s.isNotEmpty()) it + "\n" else it }
s.cb = { element ->
scope.launch {
text.value += element + "\n"
Expand Down

0 comments on commit 628f648

Please sign in to comment.