Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Feb 16, 2024
2 parents e4acfc8 + 246e193 commit e9d55ec
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 51 deletions.
2 changes: 1 addition & 1 deletion app/src/main/assets/files/tar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ elif [[ $command == "extract" ]]; then
dir=$1
shift

$utilbox tar -x -f "$archive" -C "$dir" $exclude
$utilbox tar -x -o -f "$archive" -C "$dir" $exclude

exit $?
fi
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/java/com/machiav3lli/backup/OABX.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ import kotlinx.serialization.modules.SerializersModule
import timber.log.Timber
import java.lang.Integer.max
import java.lang.ref.WeakReference
import java.util.*
import java.util.concurrent.ConcurrentLinkedQueue
import java.util.concurrent.atomic.AtomicInteger

Expand Down Expand Up @@ -118,8 +117,8 @@ val pref_uncaughtExceptionsJumpToPreferences = BooleanPref(

val pref_logToSystemLogcat = BooleanPref(
key = "dev-log.logToSystemLogcat",
summary = "log to Android logcat, otherwise only internal (internal doesn't help if the app is restarted)",
defaultValue = false
summary = "log to Android logcat, otherwise only internal (internal doesn't help if the app is restarted or if you are catching logs externally, e.g. via Scoop)",
defaultValue = true
)

val pref_autoLogExceptions = BooleanPref(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,10 @@ open class BackupAppAction(context: Context, work: AppActionWork?, shell: ShellH
}

result = true
} catch (e: IOException) {
val message = "${e.javaClass.canonicalName} occurred on $dataType backup: $e"
Timber.e(message)
throw BackupFailedException(message, e)
} catch (e: Throwable) {
val message = "${e.javaClass.canonicalName} occurred on $dataType backup: $e"
LogsHandler.unexpectedException(e, message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.Divider
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.ListItem
Expand Down Expand Up @@ -190,12 +190,12 @@ fun Selections(
else {
DropdownMenuItem(
enabled = false, onClick = {},
text = { Text("selections saved:") }
text = { Text("--- selections saved ---") }
)
files.forEach { file ->
file.name?.let { name ->
DropdownMenuItem(
text = { Text(name) },
text = { Text(" $name") },
onClick = {
when (action) {
"get" -> {
Expand Down Expand Up @@ -230,12 +230,12 @@ fun Selections(
else {
DropdownMenuItem(
enabled = false, onClick = {},
text = { Text("schedules include:") }
text = { Text("--- schedules include ---") }
)
schedules.forEach { schedule ->
schedule.name.let { name ->
DropdownMenuItem(
text = { Text(name) },
text = { Text(" $name") },
onClick = {
when (action) {
"get" -> {
Expand All @@ -258,12 +258,12 @@ fun Selections(
}
DropdownMenuItem(
enabled = false, onClick = {},
text = { Text("schedules exclude:") }
text = { Text("--- schedules exclude ---") }
)
schedules.forEach { schedule ->
schedule.name.let { name ->
DropdownMenuItem(
text = { Text(name) },
text = { Text(" $name") },
onClick = {
when (action) {
"get" -> {
Expand All @@ -284,29 +284,29 @@ fun Selections(
)
}
}
DropdownMenuItem(
enabled = false, onClick = {},
text = { Text("global:") }
)
DropdownMenuItem(
text = { Text("blocklist") },
onClick = {
when (action) {
"get" -> {
val newSelection =
OABX.main?.viewModel?.getBlocklist()
?: emptyList()
onAction(newSelection)
}
}
DropdownMenuItem(
enabled = false, onClick = {},
text = { Text("--- global ---") }
)
DropdownMenuItem(
text = { Text(" blocklist") },
onClick = {
when (action) {
"get" -> {
val newSelection =
OABX.main?.viewModel?.getBlocklist()
?: emptyList()
onAction(newSelection)
}

"put" -> {
OABX.main?.viewModel?.setBlocklist(selection.toSet())
onAction(selection)
}
"put" -> {
OABX.main?.viewModel?.setBlocklist(selection.toSet())
onAction(selection)
}
}
)
}
}
)
}
}

Expand Down Expand Up @@ -469,11 +469,11 @@ fun launchRestore(packages: List<Package>) {
)
}

fun launchToBlocklist(packages: List<Package>) {
launchEachPackage(packages, "blocklist <-", parallel = false) {
OABX.main?.viewModel?.addToBlocklist(it.packageName)
}
}
// fun launchToBlocklist(packages: List<Package>) {
// launchEachPackage(packages, "blocklist <-", parallel = false) {
// OABX.main?.viewModel?.addToBlocklist(it.packageName)
// }
// }

fun launchEnable(packages: List<Package>) {
launchEachPackage(packages, "enable", parallel = false) {
Expand Down Expand Up @@ -590,7 +590,7 @@ fun MainPackageContextMenu(
}
)

Divider() //----------------------------------------------------------------------------
HorizontalDivider() //----------------------------------------------------------------------------
}

DropdownMenuItem(
Expand Down Expand Up @@ -673,7 +673,7 @@ fun MainPackageContextMenu(

if (selection.count { it.value } > 0) {

Divider() //----------------------------------------------------------------------------
HorizontalDivider() //----------------------------------------------------------------------------

DropdownMenuItem(
enabled = false, onClick = {},
Expand All @@ -699,20 +699,20 @@ fun MainPackageContextMenu(
}
)

Divider() //----------------------------------------------------------------------------
// Divider() //----------------------------------------------------------------------------

DropdownMenuItem(
text = { Text("Add to Blocklist...") },
onClick = {
openSubMenu(subMenu) {
Confirmation(expanded) {
launchToBlocklist(selectedVisible)
}
}
}
)
// DropdownMenuItem(
// text = { Text("Add to Blocklist...") },
// onClick = {
// openSubMenu(subMenu) {
// Confirmation(expanded) {
// launchToBlocklist(selectedVisible)
// }
// }
// }
// )

Divider() //----------------------------------------------------------------------------
HorizontalDivider() //----------------------------------------------------------------------------

DropdownMenuItem(
text = { Text("Enable") },
Expand Down Expand Up @@ -744,7 +744,7 @@ fun MainPackageContextMenu(
}
)

Divider() //----------------------------------------------------------------------------
HorizontalDivider() //----------------------------------------------------------------------------

DropdownMenuItem(
text = { Text("Delete All Backups...") },
Expand Down

0 comments on commit e9d55ec

Please sign in to comment.