Link to view progress in settings after starting an offline area download

This commit is contained in:
stopflock
2025-11-21 21:08:10 -06:00
parent 32a0ac17ad
commit 5673c2b627
12 changed files with 111 additions and 7 deletions

View File

@@ -98,6 +98,8 @@ cp lib/keys.dart.example lib/keys.dart
## Roadmap
### Needed Bugfixes
- Disallow new/edit nodes below zoom 10 (15?) (don't allow zooming out beyond that either)
- Disallow large downloads or otherwise fix performance issue calculating number of tiles
- Update node cache to reflect cleared queue entries
- Improve/retune tile fetching backoff/retry
- Are offline areas preferred for fast loading even when online? Check working.

View File

@@ -1,4 +1,10 @@
{
"1.4.5": {
"content": [
"• IMPROVED: Offline area download confirmation now shows as popup with 'View Progress in Settings' button instead of simple notification",
"• UX: Download failures now display as dialog instead of snackbar for better visibility"
]
},
"1.4.4": {
"content": [
"• FOV range notation parsing - now supports OSM data like '90-270' (180° FOV centered at 180°)",

View File

@@ -136,6 +136,12 @@
"downloadStarted": "Download gestartet! Lade Kacheln und Knoten...",
"downloadFailed": "Download konnte nicht gestartet werden: {}"
},
"downloadStarted": {
"title": "Download gestartet",
"message": "Download gestartet! Lade Kacheln und Knoten...",
"ok": "OK",
"viewProgress": "Fortschritt in Einstellungen anzeigen"
},
"uploadMode": {
"title": "Upload-Ziel",
"subtitle": "Wählen Sie, wohin Kameras hochgeladen werden",

View File

@@ -154,6 +154,12 @@
"downloadStarted": "Download started! Fetching tiles and nodes...",
"downloadFailed": "Failed to start download: {}"
},
"downloadStarted": {
"title": "Download Started",
"message": "Download started! Fetching tiles and nodes...",
"ok": "OK",
"viewProgress": "View Progress in Settings"
},
"uploadMode": {
"title": "Upload Destination",
"subtitle": "Choose where cameras are uploaded",

View File

@@ -154,6 +154,12 @@
"downloadStarted": "¡Descarga iniciada! Obteniendo mosaicos y nodos...",
"downloadFailed": "Error al iniciar la descarga: {}"
},
"downloadStarted": {
"title": "Descarga Iniciada",
"message": "¡Descarga iniciada! Obteniendo mosaicos y nodos...",
"ok": "OK",
"viewProgress": "Ver Progreso en Configuración"
},
"uploadMode": {
"title": "Destino de Subida",
"subtitle": "Elige dónde se suben las cámaras",

View File

@@ -154,6 +154,12 @@
"downloadStarted": "Téléchargement démarré! Récupération des tuiles et nœuds...",
"downloadFailed": "Échec du démarrage du téléchargement: {}"
},
"downloadStarted": {
"title": "Téléchargement Démarré",
"message": "Téléchargement démarré! Récupération des tuiles et nœuds...",
"ok": "OK",
"viewProgress": "Voir le Progrès dans Paramètres"
},
"uploadMode": {
"title": "Destination de Téléchargement",
"subtitle": "Choisir où les caméras sont téléchargées",

View File

@@ -154,6 +154,12 @@
"downloadStarted": "Download avviato! Recupero tile e nodi...",
"downloadFailed": "Impossibile avviare il download: {}"
},
"downloadStarted": {
"title": "Download Avviato",
"message": "Download avviato! Recupero tile e nodi...",
"ok": "OK",
"viewProgress": "Visualizza Progresso in Impostazioni"
},
"uploadMode": {
"title": "Destinazione Upload",
"subtitle": "Scegli dove vengono caricate le telecamere",

View File

@@ -154,6 +154,12 @@
"downloadStarted": "Download iniciado! Buscando tiles e nós...",
"downloadFailed": "Falha ao iniciar o download: {}"
},
"downloadStarted": {
"title": "Download Iniciado",
"message": "Download iniciado! Buscando tiles e nós...",
"ok": "OK",
"viewProgress": "Ver Progresso nas Configurações"
},
"uploadMode": {
"title": "Destino do Upload",
"subtitle": "Escolha onde as câmeras são enviadas",

View File

@@ -154,6 +154,12 @@
"downloadStarted": "下载已开始!正在获取瓦片和节点...",
"downloadFailed": "启动下载失败:{}"
},
"downloadStarted": {
"title": "下载已开始",
"message": "下载已开始!正在获取瓦片和节点...",
"ok": "确定",
"viewProgress": "在设置中查看进度"
},
"uploadMode": {
"title": "上传目标",
"subtitle": "选择摄像头上传位置",

View File

@@ -9,6 +9,7 @@ import '../dev_config.dart';
import '../services/localization_service.dart';
import '../services/offline_area_service.dart';
import '../services/offline_areas/offline_tile_utils.dart';
import 'download_started_dialog.dart';
class DownloadAreaDialog extends StatefulWidget {
final MapController controller;
@@ -275,16 +276,29 @@ class _DownloadAreaDialogState extends State<DownloadAreaDialog> {
tileTypeName: selectedTileType?.name,
);
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(locService.t('download.downloadStarted')),
),
showDialog(
context: context,
builder: (context) => const DownloadStartedDialog(),
);
} catch (e) {
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Row(
children: [
const Icon(Icons.error, color: Colors.red),
const SizedBox(width: 10),
Text(locService.t('download.title')),
],
),
content: Text(locService.t('download.downloadFailed', params: [e.toString()])),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(locService.t('actions.ok')),
),
],
),
);
}

View File

@@ -0,0 +1,40 @@
import 'package:flutter/material.dart';
import '../services/localization_service.dart';
class DownloadStartedDialog extends StatelessWidget {
const DownloadStartedDialog({super.key});
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: LocalizationService.instance,
builder: (context, child) {
final locService = LocalizationService.instance;
return AlertDialog(
title: Row(
children: [
const Icon(Icons.download_for_offline, color: Colors.green),
const SizedBox(width: 10),
Text(locService.t('downloadStarted.title')),
],
),
content: Text(locService.t('downloadStarted.message')),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(locService.t('downloadStarted.ok')),
),
ElevatedButton(
onPressed: () {
Navigator.pop(context);
Navigator.pushNamed(context, '/settings/offline');
},
child: Text(locService.t('downloadStarted.viewProgress')),
),
],
);
},
);
}
}

View File

@@ -1,7 +1,7 @@
name: deflockapp
description: Map public surveillance infrastructure with OpenStreetMap
publish_to: "none"
version: 1.4.4+15 # The thing after the + is the version code, incremented with each release
version: 1.4.5+16 # The thing after the + is the version code, incremented with each release
environment:
sdk: ">=3.5.0 <4.0.0" # oauth2_client 4.x needs Dart 3.5+