mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-05-14 05:12:11 +02:00
dont let user edit editable....... lol and make some builtins editable
This commit is contained in:
@@ -50,7 +50,7 @@ class CameraProfile {
|
||||
builtin: true,
|
||||
requiresDirection: true,
|
||||
submittable: true,
|
||||
editable: false,
|
||||
editable: true,
|
||||
);
|
||||
|
||||
/// Built‑in: Motorola Solutions/Vigilant ALPR camera
|
||||
@@ -69,7 +69,7 @@ class CameraProfile {
|
||||
builtin: true,
|
||||
requiresDirection: true,
|
||||
submittable: true,
|
||||
editable: false,
|
||||
editable: true,
|
||||
);
|
||||
|
||||
/// Built‑in: Genetec ALPR camera
|
||||
@@ -88,7 +88,7 @@ class CameraProfile {
|
||||
builtin: true,
|
||||
requiresDirection: true,
|
||||
submittable: true,
|
||||
editable: false,
|
||||
editable: true,
|
||||
);
|
||||
|
||||
/// Built‑in: Leonardo/ELSAG ALPR camera
|
||||
@@ -107,7 +107,7 @@ class CameraProfile {
|
||||
builtin: true,
|
||||
requiresDirection: true,
|
||||
submittable: true,
|
||||
editable: false,
|
||||
editable: true,
|
||||
);
|
||||
|
||||
/// Built‑in: Neology ALPR camera
|
||||
@@ -125,7 +125,7 @@ class CameraProfile {
|
||||
builtin: true,
|
||||
requiresDirection: true,
|
||||
submittable: true,
|
||||
editable: false,
|
||||
editable: true,
|
||||
);
|
||||
|
||||
/// Built‑in: Generic gunshot detector (customizable template, not submittable)
|
||||
@@ -156,7 +156,7 @@ class CameraProfile {
|
||||
builtin: true,
|
||||
requiresDirection: false,
|
||||
submittable: true,
|
||||
editable: false,
|
||||
editable: true,
|
||||
);
|
||||
|
||||
/// Built‑in: Flock Raven gunshot detector
|
||||
@@ -173,7 +173,7 @@ class CameraProfile {
|
||||
builtin: true,
|
||||
requiresDirection: false,
|
||||
submittable: true,
|
||||
editable: false,
|
||||
editable: true,
|
||||
);
|
||||
|
||||
/// Returns true if this profile can be used for submissions
|
||||
|
||||
@@ -19,7 +19,6 @@ class _ProfileEditorState extends State<ProfileEditor> {
|
||||
late List<MapEntry<String, String>> _tags;
|
||||
late bool _requiresDirection;
|
||||
late bool _submittable;
|
||||
late bool _editable;
|
||||
|
||||
static const _defaultTags = [
|
||||
MapEntry('man_made', 'surveillance'),
|
||||
@@ -38,7 +37,6 @@ class _ProfileEditorState extends State<ProfileEditor> {
|
||||
_nameCtrl = TextEditingController(text: widget.profile.name);
|
||||
_requiresDirection = widget.profile.requiresDirection;
|
||||
_submittable = widget.profile.submittable;
|
||||
_editable = widget.profile.editable;
|
||||
|
||||
if (widget.profile.tags.isEmpty) {
|
||||
// New profile → start with sensible defaults
|
||||
@@ -89,14 +87,6 @@ class _ProfileEditorState extends State<ProfileEditor> {
|
||||
onChanged: (value) => setState(() => _submittable = value ?? true),
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
),
|
||||
if (!widget.profile.builtin)
|
||||
CheckboxListTile(
|
||||
title: const Text('Editable'),
|
||||
subtitle: const Text('Whether this profile can be modified after creation'),
|
||||
value: _editable,
|
||||
onChanged: (value) => setState(() => _editable = value ?? true),
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
@@ -203,7 +193,7 @@ class _ProfileEditorState extends State<ProfileEditor> {
|
||||
builtin: false,
|
||||
requiresDirection: _requiresDirection,
|
||||
submittable: _submittable,
|
||||
editable: _editable,
|
||||
editable: true, // All custom profiles are editable by definition
|
||||
);
|
||||
|
||||
context.read<AppState>().addOrUpdateProfile(newProfile);
|
||||
|
||||
Reference in New Issue
Block a user