synced with last dev, added profiles for cyr2lat replacement dictionaries

This commit is contained in:
HDDen
2026-04-25 01:30:55 +03:00
parent 7a4ac9ae9b
commit f56c28a27d
45 changed files with 1547 additions and 394 deletions
+36
View File
@@ -1401,10 +1401,17 @@ class _ChannelsScreenState extends State<ChannelsScreen>
MeshCoreConnector connector,
Channel channel,
) {
final appSettingsService = Provider.of<AppSettingsService>(
context,
listen: false,
);
final nameController = TextEditingController(text: channel.name);
final pskController = TextEditingController(text: channel.pskHex);
bool smazEnabled = connector.isChannelSmazEnabled(channel.index);
bool cyr2latEnabled = connector.isChannelCyr2LatEnabled(channel.index);
String? selectedCyr2LatProfileId = connector.getChannelCyr2LatProfileId(
channel.index,
);
showDialog(
context: context,
@@ -1471,6 +1478,31 @@ class _ChannelsScreenState extends State<ChannelsScreen>
}
}),
),
if (cyr2latEnabled) ...[
Padding(
padding: const EdgeInsets.fromLTRB(0, 8, 0, 8),
child: DropdownButtonFormField<String>(
initialValue: selectedCyr2LatProfileId,
decoration: InputDecoration(
labelText: dialogContext
.l10n
.channels_cyr2latSettingsSubheading,
border: const OutlineInputBorder(),
),
items: appSettingsService.settings.cyr2latProfiles.map((
profile,
) {
return DropdownMenuItem(
value: profile.id,
child: Text(profile.name),
);
}).toList(),
onChanged: (value) => setState(() {
selectedCyr2LatProfileId = value;
}),
),
),
],
],
),
),
@@ -1506,6 +1538,10 @@ class _ChannelsScreenState extends State<ChannelsScreen>
channel.index,
cyr2latEnabled,
);
await connector.setChannelCyr2LatProfileId(
channel.index,
selectedCyr2LatProfileId,
);
if (!context.mounted) return;
showDismissibleSnackBar(
context,