Merge origin/dev into cursor/routing-send-settings-ef15
This commit is contained in:
commit
4065d60a16
84 files changed
+7843
-1144
No files matched your search
@@ -5198,9 +5198,8 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
}) async {
|
||||
if (!isConnected || text.isEmpty) return;
|
||||
|
||||
final outboundBytes = utf8.encode(
|
||||
prepareContactOutboundText(contact, text),
|
||||
);
|
||||
final prepared = prepareContactOutbound(contact, text);
|
||||
final outboundBytes = utf8.encode(prepared.text);
|
||||
if (outboundBytes.length > maxTextPayloadBytes) {
|
||||
debugPrint(
|
||||
'sendMessage: dropping overlong message '
|
||||
@@ -5249,6 +5248,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
originalText: originalText,
|
||||
translatedLanguageCode: translatedLanguageCode,
|
||||
translationModelId: translationModelId,
|
||||
isSmazCompressed: prepared.isSmazCompressed,
|
||||
);
|
||||
} else {
|
||||
// Fallback to old behavior if retry service not initialized
|
||||
@@ -5261,11 +5261,11 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
originalText: originalText,
|
||||
translatedLanguageCode: translatedLanguageCode,
|
||||
translationModelId: translationModelId,
|
||||
isSmazCompressed: prepared.isSmazCompressed,
|
||||
);
|
||||
_addMessage(contact.publicKeyHex, message); // recipient as "sender"
|
||||
notifyListeners();
|
||||
final outboundText = prepareContactOutboundText(contact, text);
|
||||
await sendFrame(buildSendTextMsgFrame(contact.publicKey, outboundText));
|
||||
await sendFrame(buildSendTextMsgFrame(contact.publicKey, prepared.text));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5695,6 +5695,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
// we continue to process it normally.
|
||||
}
|
||||
|
||||
final prepared = prepareChannelOutbound(channel.index, text);
|
||||
final message = ChannelMessage.outgoing(
|
||||
text,
|
||||
_selfName ?? 'Me',
|
||||
@@ -5704,12 +5705,13 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
translationModelId: translationModelId,
|
||||
region: sendRegion,
|
||||
replyTo: replyTo,
|
||||
isSmazCompressed: prepared.isSmazCompressed,
|
||||
);
|
||||
_addChannelMessage(channel.index, message);
|
||||
_pendingChannelSentQueue.add(message.messageId);
|
||||
notifyListeners();
|
||||
|
||||
final outboundText = prepareChannelOutboundText(channel.index, text);
|
||||
final outboundText = prepared.text;
|
||||
// Resends reuse the timestamp, so they are the same packet: repeaters
|
||||
// that already forwarded it drop the copy and recipients see it once.
|
||||
Future<void> transmit({bool isResend = false}) =>
|
||||
@@ -8367,9 +8369,8 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
appLogger.warn('Received message with empty text, ignoring');
|
||||
return null;
|
||||
}
|
||||
final decodedText = isCli
|
||||
? msgText
|
||||
: (Smaz.tryDecodePrefixed(msgText) ?? msgText);
|
||||
final smazDecoded = isCli ? null : Smaz.tryDecodePrefixed(msgText);
|
||||
final decodedText = smazDecoded ?? msgText;
|
||||
|
||||
final contact = _contacts.cast<Contact?>().firstWhere(
|
||||
(c) => c != null && _matchesPrefix(c.publicKey, senderPrefix),
|
||||
@@ -8389,6 +8390,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
receivedAt: DateTime.now(),
|
||||
isOutgoing: false,
|
||||
isCli: isCli,
|
||||
isSmazCompressed: smazDecoded != null,
|
||||
status: MessageStatus.delivered,
|
||||
pathLength: pathLength == 0xFF ? null : (pathLength & 0x3F),
|
||||
pathBytes: Uint8List(0),
|
||||
@@ -8518,7 +8520,13 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
|
||||
/// Prepares contact outbound text by applying SMAZ encoding if enabled.
|
||||
/// This should be used to transform text before computing ACK hashes.
|
||||
String prepareContactOutboundText(Contact contact, String text) {
|
||||
String prepareContactOutboundText(Contact contact, String text) =>
|
||||
prepareContactOutbound(contact, text).text;
|
||||
|
||||
({String text, bool isSmazCompressed}) prepareContactOutbound(
|
||||
Contact contact,
|
||||
String text,
|
||||
) {
|
||||
final trimmed = text.trim();
|
||||
final isStructuredPayload =
|
||||
trimmed.startsWith('g:') ||
|
||||
@@ -8526,7 +8534,8 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
trimmed.startsWith('V1|');
|
||||
if (!isStructuredPayload) {
|
||||
if (isContactSmazEnabled(contact.publicKeyHex)) {
|
||||
return Smaz.encodeIfSmaller(text);
|
||||
final encoded = Smaz.encodeIfSmaller(text);
|
||||
return (text: encoded, isSmazCompressed: encoded != text);
|
||||
} else if (isContactCyr2LatEnabled(contact.publicKeyHex)) {
|
||||
final profileId = getContactCyr2LatProfileId(contact.publicKeyHex);
|
||||
final profile = profileId != null && _appSettingsService != null
|
||||
@@ -8542,19 +8551,26 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
Cyr2Lat.setCharMap(globalProfile.charMap);
|
||||
}
|
||||
}
|
||||
return Cyr2Lat.encode(text);
|
||||
return (text: Cyr2Lat.encode(text), isSmazCompressed: false);
|
||||
}
|
||||
}
|
||||
return text;
|
||||
return (text: text, isSmazCompressed: false);
|
||||
}
|
||||
|
||||
String prepareChannelOutboundText(int channelIndex, String text) {
|
||||
String prepareChannelOutboundText(int channelIndex, String text) =>
|
||||
prepareChannelOutbound(channelIndex, text).text;
|
||||
|
||||
({String text, bool isSmazCompressed}) prepareChannelOutbound(
|
||||
int channelIndex,
|
||||
String text,
|
||||
) {
|
||||
final trimmed = text.trim();
|
||||
final isStructuredPayload =
|
||||
trimmed.startsWith('g:') || trimmed.startsWith('m:');
|
||||
if (!isStructuredPayload) {
|
||||
if (isChannelSmazEnabled(channelIndex)) {
|
||||
return Smaz.encodeIfSmaller(text);
|
||||
final encoded = Smaz.encodeIfSmaller(text);
|
||||
return (text: encoded, isSmazCompressed: encoded != text);
|
||||
} else if (isChannelCyr2LatEnabled(channelIndex)) {
|
||||
final profileId = getChannelCyr2LatProfileId(channelIndex);
|
||||
final profile = profileId != null && _appSettingsService != null
|
||||
@@ -8570,10 +8586,10 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
Cyr2Lat.setCharMap(globalProfile.charMap);
|
||||
}
|
||||
}
|
||||
return Cyr2Lat.encode(text);
|
||||
return (text: Cyr2Lat.encode(text), isSmazCompressed: false);
|
||||
}
|
||||
}
|
||||
return text;
|
||||
return (text: text, isSmazCompressed: false);
|
||||
}
|
||||
|
||||
// Falls back to the cached channel list, which stays populated while a
|
||||
@@ -8761,8 +8777,8 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
|
||||
final text = decrypted.readCString();
|
||||
final parsed = _splitSenderText(text);
|
||||
final decodedText =
|
||||
Smaz.tryDecodePrefixed(parsed.text) ?? parsed.text;
|
||||
final smazDecoded = Smaz.tryDecodePrefixed(parsed.text);
|
||||
final decodedText = smazDecoded ?? parsed.text;
|
||||
if (_shouldDropSelfChannelMessage(
|
||||
parsed.senderName,
|
||||
packet.pathBytes,
|
||||
@@ -8792,6 +8808,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
timestamp: DateTime.fromMillisecondsSinceEpoch(timestampRaw * 1000),
|
||||
receivedAt: DateTime.now(),
|
||||
isOutgoing: false,
|
||||
isSmazCompressed: smazDecoded != null,
|
||||
status: ChannelMessageStatus.sent,
|
||||
pathLength: packet.isFlood ? packet.hopCount : 0,
|
||||
pathHashWidth: packet.pathHashWidth,
|
||||
@@ -9280,8 +9297,13 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
}
|
||||
|
||||
messages.add(message);
|
||||
if (messages.length > _messageWindowSize) {
|
||||
final trimCount = messages.length - _messageWindowSize;
|
||||
// The open chat keeps the older pages its reader scrolled back to;
|
||||
// trimming them would pull the history out from under the reader.
|
||||
final windowSize = pubKeyHex == _activeContactKey
|
||||
? MessageStore.maxStoredMessages
|
||||
: _messageWindowSize;
|
||||
if (messages.length > windowSize) {
|
||||
final trimCount = messages.length - windowSize;
|
||||
_messageStore.archive(pubKeyHex, messages.sublist(0, trimCount));
|
||||
messages.removeRange(0, trimCount);
|
||||
}
|
||||
@@ -9606,6 +9628,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
timestamp: message.timestamp,
|
||||
receivedAt: message.receivedAt,
|
||||
isOutgoing: message.isOutgoing,
|
||||
isSmazCompressed: message.isSmazCompressed,
|
||||
status: message.status,
|
||||
repeats: message.repeats,
|
||||
repeatCount: message.repeatCount,
|
||||
@@ -9654,6 +9677,8 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
existing.status == ChannelMessageStatus.pending;
|
||||
messages[existingIndex] = existing.copyWith(
|
||||
repeatCount: newRepeatCount,
|
||||
isSmazCompressed:
|
||||
existing.isSmazCompressed || processedMessage.isSmazCompressed,
|
||||
pathLength: mergedPathLength,
|
||||
pathHashWidth: existing.pathHashWidth ?? processedMessage.pathHashWidth,
|
||||
pathBytes: mergedPathBytes,
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
/// Keeps the rows a reader is looking at in place when messages are added
|
||||
/// below them in a reversed chat list.
|
||||
///
|
||||
/// In a `reverse: true` list the newest message is index 0, so every new
|
||||
/// message moves the older ones up an index. The list keeps layout offsets by
|
||||
/// index, which leaves the scroll offset unchanged and shifts what is on
|
||||
/// screen up by the new rows' height. Call [rowsInsertedBelow] while building
|
||||
/// the list, before it lays out the new rows; [AnchoredChatListView] then
|
||||
/// scrolls by however far the lowest row on screen moved, in the same layout
|
||||
/// pass, so nothing visibly jumps.
|
||||
class ChatScrollAnchor {
|
||||
_RenderAnchorSliver? _sliver;
|
||||
_Anchor? _pending;
|
||||
|
||||
/// Notes that [count] rows are being added at index 0, below every row
|
||||
/// currently laid out, and remembers the lowest row on screen.
|
||||
void rowsInsertedBelow(int count) {
|
||||
_pending = null;
|
||||
final list = _sliver?.child;
|
||||
if (count <= 0 || list is! RenderSliverMultiBoxAdaptor) return;
|
||||
if (list.geometry == null) return;
|
||||
final start = list.constraints.scrollOffset;
|
||||
final end = start + list.constraints.remainingPaintExtent;
|
||||
for (var row = list.firstChild; row != null; row = list.childAfter(row)) {
|
||||
final offset = list.childScrollOffset(row);
|
||||
if (offset == null || !row.hasSize) continue;
|
||||
if (offset >= end) break;
|
||||
if (offset + _extentOf(row, list) > start) {
|
||||
_pending = _Anchor(list.indexOf(row) + count, offset);
|
||||
// Rows of equal height would not relayout the list on their own.
|
||||
_sliver!.markNeedsLayout();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The scroll correction that puts the remembered row back where it was,
|
||||
/// or null when none is needed (yet).
|
||||
double? _correctionAfterLayout(
|
||||
RenderSliverMultiBoxAdaptor list,
|
||||
double? listCorrection,
|
||||
) {
|
||||
final pending = _pending;
|
||||
if (pending == null) return null;
|
||||
if (listCorrection != null) {
|
||||
// The list shifts every row by this itself; measure on the next pass.
|
||||
pending.offset += listCorrection;
|
||||
return null;
|
||||
}
|
||||
double? target;
|
||||
final first = list.firstChild;
|
||||
final last = list.lastChild;
|
||||
if (first == null || last == null) {
|
||||
_pending = null;
|
||||
return null;
|
||||
}
|
||||
for (RenderBox? row = first; row != null; row = list.childAfter(row)) {
|
||||
if (list.indexOf(row) == pending.index) {
|
||||
target = list.childScrollOffset(row);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (target != null) {
|
||||
_pending = null;
|
||||
final delta = target - pending.offset;
|
||||
return delta.abs() < 0.5 ? null : delta;
|
||||
}
|
||||
// The row is not laid out at this offset: scroll to an estimate of where
|
||||
// it is, which lays out the rows there, and correct exactly next pass.
|
||||
if (++pending.passes > 3) {
|
||||
_pending = null;
|
||||
return null;
|
||||
}
|
||||
final firstIndex = list.indexOf(first);
|
||||
final lastIndex = list.indexOf(last);
|
||||
final firstOffset = list.childScrollOffset(first);
|
||||
final lastOffset = list.childScrollOffset(last);
|
||||
if (firstOffset == null || lastOffset == null) {
|
||||
_pending = null;
|
||||
return null;
|
||||
}
|
||||
// Child sizes are off limits here, so space rows by their mean pitch.
|
||||
final average = lastIndex > firstIndex
|
||||
? (lastOffset - firstOffset) / (lastIndex - firstIndex)
|
||||
: 50.0;
|
||||
final estimate = pending.index > lastIndex
|
||||
? lastOffset + (pending.index - lastIndex) * average
|
||||
: firstOffset - (firstIndex - pending.index) * average;
|
||||
final delta = estimate - pending.offset;
|
||||
pending.offset = estimate;
|
||||
return delta.abs() < 0.5 ? null : delta;
|
||||
}
|
||||
|
||||
static double _extentOf(RenderBox row, RenderSliver list) =>
|
||||
list.constraints.axis == Axis.vertical ? row.size.height : row.size.width;
|
||||
}
|
||||
|
||||
class _Anchor {
|
||||
_Anchor(this.index, this.offset);
|
||||
|
||||
/// The remembered row's index once the new rows are in.
|
||||
final int index;
|
||||
|
||||
/// Where the row has to be laid out for the reader to see no movement.
|
||||
double offset;
|
||||
int passes = 0;
|
||||
}
|
||||
|
||||
/// A [ListView.builder] whose on-screen rows stay put when a
|
||||
/// [ChatScrollAnchor] is told rows were added below them.
|
||||
class AnchoredChatListView extends ListView {
|
||||
AnchoredChatListView.builder({
|
||||
super.key,
|
||||
required this.scrollAnchor,
|
||||
super.reverse,
|
||||
super.controller,
|
||||
super.padding,
|
||||
required super.itemBuilder,
|
||||
super.itemCount,
|
||||
}) : super.builder();
|
||||
|
||||
final ChatScrollAnchor scrollAnchor;
|
||||
|
||||
@override
|
||||
Widget buildChildLayout(BuildContext context) => _AnchorSliver(
|
||||
anchor: scrollAnchor,
|
||||
child: super.buildChildLayout(context),
|
||||
);
|
||||
}
|
||||
|
||||
class _AnchorSliver extends SingleChildRenderObjectWidget {
|
||||
const _AnchorSliver({required this.anchor, required Widget super.child});
|
||||
|
||||
final ChatScrollAnchor anchor;
|
||||
|
||||
@override
|
||||
RenderObject createRenderObject(BuildContext context) =>
|
||||
_RenderAnchorSliver(anchor);
|
||||
|
||||
@override
|
||||
void updateRenderObject(
|
||||
BuildContext context,
|
||||
_RenderAnchorSliver renderObject,
|
||||
) {
|
||||
renderObject.anchor = anchor;
|
||||
}
|
||||
}
|
||||
|
||||
class _RenderAnchorSliver extends RenderProxySliver {
|
||||
_RenderAnchorSliver(this._anchor);
|
||||
|
||||
ChatScrollAnchor _anchor;
|
||||
set anchor(ChatScrollAnchor value) {
|
||||
if (identical(value, _anchor)) return;
|
||||
if (attached) {
|
||||
if (identical(_anchor._sliver, this)) _anchor._sliver = null;
|
||||
value._sliver = this;
|
||||
}
|
||||
_anchor = value;
|
||||
}
|
||||
|
||||
@override
|
||||
void attach(PipelineOwner owner) {
|
||||
super.attach(owner);
|
||||
_anchor._sliver = this;
|
||||
}
|
||||
|
||||
@override
|
||||
void detach() {
|
||||
if (identical(_anchor._sliver, this)) _anchor._sliver = null;
|
||||
super.detach();
|
||||
}
|
||||
|
||||
@override
|
||||
void performLayout() {
|
||||
final list = child!;
|
||||
list.layout(constraints, parentUsesSize: true);
|
||||
final listGeometry = list.geometry!;
|
||||
final correction = list is RenderSliverMultiBoxAdaptor
|
||||
? _anchor._correctionAfterLayout(
|
||||
list,
|
||||
listGeometry.scrollOffsetCorrection,
|
||||
)
|
||||
: null;
|
||||
geometry = correction == null
|
||||
? listGeometry
|
||||
: SliverGeometry(scrollOffsetCorrection: correction);
|
||||
}
|
||||
}
|
||||
+12
-3
@@ -2625,7 +2625,7 @@
|
||||
"pathEditor_searchRepeaters": "Търсене на повторители",
|
||||
"pathEditor_advancedHex": "Разширено: суров шестнадесетичен път",
|
||||
"pathEditor_hexLabel": "Шестнадесетични префикси",
|
||||
"pathEditor_hexHelper": "Два шестнадесетични идентификатора на скок, разделени със запетаи",
|
||||
"pathEditor_hexHelper": "{count} шестнадесетични идентификатора на скок, разделени със запетаи",
|
||||
"pathEditor_invalidTokens": "Невалидни: {tokens}",
|
||||
"routing_lastWorked": "последно работил {when}",
|
||||
"routing_deliveryCounts": "{successes} доставени, {failures} неуспешни",
|
||||
@@ -3756,7 +3756,7 @@
|
||||
"backupRestore_backupComplete": "Файлът с резервно копие е създаден.",
|
||||
"backupRestore_restoreComplete": "Възстановяването приключи. Свържете се отново, ако сте възстановили идентичността на радиото.",
|
||||
"backupRestore_missingModelsTitle": "Моделите не са изтеглени",
|
||||
"backupRestore_missingModelsMessage": "Възстановените настройки избират модели, които не са налични на това устройство:\n{models}\n\nДа се изтеглят ли сега?",
|
||||
"backupRestore_missingModelsMessage": "Възстановените настройки избират модели, които не са налични на това устройство. Да се изтеглят ли сега?",
|
||||
"backupRestore_downloadModels": "Изтегли модели",
|
||||
"backupRestore_downloading": "Изтегляне…",
|
||||
"backupRestore_cancelDownload": "Отмени изтеглянето",
|
||||
@@ -3793,5 +3793,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Настройките за повторители и стаи са нулирани",
|
||||
"repeater_clockSyncDefault": "По подразбиране",
|
||||
"repeater_clockSyncOn": "Вкл.",
|
||||
"repeater_clockSyncOff": "Изкл."
|
||||
"repeater_clockSyncOff": "Изкл.",
|
||||
"modelDownload_notDownloaded": "Не е изтеглен",
|
||||
"modelDownload_downloading": "Изтегляне",
|
||||
"modelDownload_active": "Активен",
|
||||
"modelDownload_failed": "Неуспешно изтегляне",
|
||||
"modelDownload_incomplete": "Непълен",
|
||||
"modelDownload_verifying": "Проверка на изтеглянето",
|
||||
"modelDownload_useModel": "Използвай този модел",
|
||||
"modelDownload_removeFailed": "Моделът не можа да бъде премахнат: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -1243,7 +1243,7 @@
|
||||
"pathEditor_searchRepeaters": "Hledat opakovače",
|
||||
"pathEditor_advancedHex": "Pokročilé: surová hex cesta",
|
||||
"pathEditor_hexLabel": "Hex prefixy",
|
||||
"pathEditor_hexHelper": "Dva hex znaky na skok, oddělené čárkami",
|
||||
"pathEditor_hexHelper": "{count} hex znaky na skok, oddělené čárkami",
|
||||
"pathEditor_invalidTokens": "Neplatné: {tokens}",
|
||||
"@pathEditor_invalidTokens": {
|
||||
"placeholders": {
|
||||
@@ -4369,7 +4369,7 @@
|
||||
"backupRestore_backupComplete": "Soubor zálohy byl vytvořen.",
|
||||
"backupRestore_restoreComplete": "Obnovení dokončeno. Pokud jste obnovili identitu rádia, připojte se znovu.",
|
||||
"backupRestore_missingModelsTitle": "Modely nejsou stažené",
|
||||
"backupRestore_missingModelsMessage": "Obnovené nastavení vybírá modely, které nejsou v tomto zařízení k dispozici:\n{models}\n\nStáhnout je nyní?",
|
||||
"backupRestore_missingModelsMessage": "Obnovené nastavení vybírá modely, které nejsou v tomto zařízení k dispozici. Stáhnout je nyní?",
|
||||
"backupRestore_downloadModels": "Stáhnout modely",
|
||||
"backupRestore_downloading": "Stahování…",
|
||||
"backupRestore_cancelDownload": "Zrušit stahování",
|
||||
@@ -4406,5 +4406,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Nastavení opakovačů a místností obnoveno",
|
||||
"repeater_clockSyncDefault": "Výchozí",
|
||||
"repeater_clockSyncOn": "Zapnuto",
|
||||
"repeater_clockSyncOff": "Vypnuto"
|
||||
"repeater_clockSyncOff": "Vypnuto",
|
||||
"modelDownload_notDownloaded": "Nestaženo",
|
||||
"modelDownload_downloading": "Stahování",
|
||||
"modelDownload_active": "Aktivní",
|
||||
"modelDownload_failed": "Stažení se nezdařilo",
|
||||
"modelDownload_incomplete": "Neúplné",
|
||||
"modelDownload_verifying": "Ověřování stažení",
|
||||
"modelDownload_useModel": "Použít tento model",
|
||||
"modelDownload_removeFailed": "Model se nepodařilo odebrat: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -2791,7 +2791,7 @@
|
||||
"pathEditor_searchRepeaters": "Repeater suchen",
|
||||
"pathEditor_advancedHex": "Erweitert: roher Hex-Pfad",
|
||||
"pathEditor_hexLabel": "Hex-Präfixe",
|
||||
"pathEditor_hexHelper": "Zwei Hex-Zeichen pro Sprung, durch Kommas getrennt",
|
||||
"pathEditor_hexHelper": "{count} Hex-Zeichen pro Sprung, durch Kommas getrennt",
|
||||
"pathEditor_invalidTokens": "Ungültig: {tokens}",
|
||||
"pathEditor_tooManyHops": "Maximal 64 Sprünge",
|
||||
"pathEditor_usePath": "Diesen Pfad verwenden",
|
||||
@@ -3891,7 +3891,7 @@
|
||||
"backupRestore_backupComplete": "Sicherungsdatei erstellt.",
|
||||
"backupRestore_restoreComplete": "Wiederherstellung abgeschlossen. Verbinden Sie sich erneut, wenn Sie die Funkidentität wiederhergestellt haben.",
|
||||
"backupRestore_missingModelsTitle": "Modelle nicht heruntergeladen",
|
||||
"backupRestore_missingModelsMessage": "Die wiederhergestellten Einstellungen wählen Modelle aus, die auf diesem Gerät nicht verfügbar sind:\n{models}\n\nJetzt herunterladen?",
|
||||
"backupRestore_missingModelsMessage": "Die wiederhergestellten Einstellungen wählen Modelle aus, die auf diesem Gerät nicht verfügbar sind. Jetzt herunterladen?",
|
||||
"backupRestore_downloadModels": "Modelle herunterladen",
|
||||
"backupRestore_downloading": "Wird heruntergeladen…",
|
||||
"backupRestore_cancelDownload": "Download abbrechen",
|
||||
@@ -3928,5 +3928,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Repeater- und Raum-Einstellungen zurückgesetzt",
|
||||
"repeater_clockSyncDefault": "Standard",
|
||||
"repeater_clockSyncOn": "An",
|
||||
"repeater_clockSyncOff": "Aus"
|
||||
"repeater_clockSyncOff": "Aus",
|
||||
"modelDownload_notDownloaded": "Nicht heruntergeladen",
|
||||
"modelDownload_downloading": "Wird heruntergeladen",
|
||||
"modelDownload_active": "Aktiv",
|
||||
"modelDownload_failed": "Download fehlgeschlagen",
|
||||
"modelDownload_incomplete": "Unvollständig",
|
||||
"modelDownload_verifying": "Download wird geprüft",
|
||||
"modelDownload_useModel": "Dieses Modell verwenden",
|
||||
"modelDownload_removeFailed": "Das Modell konnte nicht entfernt werden: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+35
-9
@@ -237,12 +237,7 @@
|
||||
"backupRestore_backupComplete": "Backup file created.",
|
||||
"backupRestore_restoreComplete": "Restore complete. Reconnect if you restored the radio identity.",
|
||||
"backupRestore_missingModelsTitle": "Models Not Downloaded",
|
||||
"backupRestore_missingModelsMessage": "The restored settings select models that are not available on this device:\n{models}\n\nDownload them now?",
|
||||
"@backupRestore_missingModelsMessage": {
|
||||
"placeholders": {
|
||||
"models": {"type": "String"}
|
||||
}
|
||||
},
|
||||
"backupRestore_missingModelsMessage": "The restored settings select models that are not on this device. Download them now?",
|
||||
"backupRestore_downloadModels": "Download Models",
|
||||
"backupRestore_downloading": "Downloading…",
|
||||
"backupRestore_cancelDownload": "Cancel Download",
|
||||
@@ -601,6 +596,8 @@
|
||||
"appSettings_enableMessageTracingSubtitle": "Also show repeat counts and trip times. Long-press a message and choose Path for full details.",
|
||||
"appSettings_regionOnHopsLine": "Region next to hop count",
|
||||
"appSettings_regionOnHopsLineSubtitle": "Show a channel message's region on the same line as its hop count instead of below it.",
|
||||
"appSettings_showCompressionIndicator": "Compression indicator",
|
||||
"appSettings_showCompressionIndicatorSubtitle": "Show an icon on messages compressed with SMAZ.",
|
||||
"appSettings_notifications": "Notifications",
|
||||
"appSettings_enableNotifications": "Enable Notifications",
|
||||
"appSettings_enableNotificationsSubtitle": "Receive notifications for messages and adverts",
|
||||
@@ -1424,10 +1421,17 @@
|
||||
},
|
||||
"pathEditor_noHops": "No hops yet. Tap repeaters below to add them in order, or save with no hops to send direct.",
|
||||
"pathEditor_addHops": "Add hops in order",
|
||||
"pathEditor_searchRepeaters": "Search repeaters",
|
||||
"pathEditor_searchRepeaters": "Search name or hash",
|
||||
"pathEditor_advancedHex": "Advanced: raw hex path",
|
||||
"pathEditor_hexLabel": "Hex prefixes",
|
||||
"pathEditor_hexHelper": "Two hex characters per hop, separated by commas",
|
||||
"pathEditor_hexHelper": "{count} hex characters per hop, separated by commas",
|
||||
"@pathEditor_hexHelper": {
|
||||
"placeholders": {
|
||||
"count": {
|
||||
"type": "int"
|
||||
}
|
||||
}
|
||||
},
|
||||
"pathEditor_invalidTokens": "Invalid: {tokens}",
|
||||
"@pathEditor_invalidTokens": {
|
||||
"placeholders": {
|
||||
@@ -4377,6 +4381,27 @@
|
||||
"@chat_composerOffline": {
|
||||
"description": "Shown in place of the message box while no radio is connected"
|
||||
},
|
||||
"modelDownload_notDownloaded": "Not downloaded",
|
||||
"modelDownload_downloading": "Downloading",
|
||||
"modelDownload_active": "Active",
|
||||
"modelDownload_failed": "Couldn't download",
|
||||
"modelDownload_incomplete": "Incomplete",
|
||||
"modelDownload_verifying": "Verifying the download",
|
||||
"modelDownload_useModel": "Use this model",
|
||||
"modelDownload_removeFailed": "Couldn't remove the model: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)",
|
||||
"@modelDownload_removeFailed": {
|
||||
"placeholders": {
|
||||
"error": {"type": "String"}
|
||||
}
|
||||
},
|
||||
"@modelDownload_progress": {
|
||||
"placeholders": {
|
||||
"current": {"type": "String"},
|
||||
"total": {"type": "String"},
|
||||
"percent": {"type": "String"}
|
||||
}
|
||||
},
|
||||
"chatCompression_title": "Compression",
|
||||
"chatCompression_label": "Compression: {mode}",
|
||||
"@chatCompression_label": {
|
||||
@@ -4397,5 +4422,6 @@
|
||||
"chatCompression_cyr2latDescription": "Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.",
|
||||
"chatCompression_profile": "Cyr2Lat profile",
|
||||
"chatCompression_noStorageId": "Can't change compression until this channel has synced from the radio.",
|
||||
"chatCompression_saveFailed": "Couldn't save the compression setting. Showing the saved setting."
|
||||
"chatCompression_saveFailed": "Couldn't save the compression setting. Showing the saved setting.",
|
||||
"messageMeta_smazCompressed": "SMAZ compressed"
|
||||
}
|
||||
+12
-3
@@ -2675,7 +2675,7 @@
|
||||
"pathEditor_searchRepeaters": "Buscar repetidores",
|
||||
"pathEditor_advancedHex": "Avanzado: ruta hexadecimal sin procesar",
|
||||
"pathEditor_hexLabel": "Prefijos hexadecimales",
|
||||
"pathEditor_hexHelper": "Dos caracteres hexadecimales por salto, separados por comas.",
|
||||
"pathEditor_hexHelper": "{count} caracteres hexadecimales por salto, separados por comas.",
|
||||
"pathEditor_invalidTokens": "Inválido: {tokens}",
|
||||
"pathEditor_tooManyHops": "Máximo 64 saltos",
|
||||
"pathEditor_usePath": "Usar esta ruta",
|
||||
@@ -3942,7 +3942,7 @@
|
||||
"backupRestore_backupComplete": "Archivo de copia de seguridad creado.",
|
||||
"backupRestore_restoreComplete": "Restauración completada. Reconecta si restauraste la identidad de la radio.",
|
||||
"backupRestore_missingModelsTitle": "Modelos no descargados",
|
||||
"backupRestore_missingModelsMessage": "Los ajustes restaurados seleccionan modelos que no están disponibles en este dispositivo:\n{models}\n\n¿Descargarlos ahora?",
|
||||
"backupRestore_missingModelsMessage": "Los ajustes restaurados seleccionan modelos que no están disponibles en este dispositivo. ¿Descargarlos ahora?",
|
||||
"backupRestore_downloadModels": "Descargar modelos",
|
||||
"backupRestore_downloading": "Descargando…",
|
||||
"backupRestore_cancelDownload": "Cancelar descarga",
|
||||
@@ -3979,5 +3979,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Ajustes de repetidores y salas restablecidos",
|
||||
"repeater_clockSyncDefault": "Predeterminado",
|
||||
"repeater_clockSyncOn": "Activado",
|
||||
"repeater_clockSyncOff": "Desactivado"
|
||||
"repeater_clockSyncOff": "Desactivado",
|
||||
"modelDownload_notDownloaded": "No descargado",
|
||||
"modelDownload_downloading": "Descargando",
|
||||
"modelDownload_active": "Activo",
|
||||
"modelDownload_failed": "No se pudo descargar",
|
||||
"modelDownload_incomplete": "Incompleto",
|
||||
"modelDownload_verifying": "Comprobando la descarga",
|
||||
"modelDownload_useModel": "Usar este modelo",
|
||||
"modelDownload_removeFailed": "No se pudo quitar el modelo: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -2675,7 +2675,7 @@
|
||||
"pathEditor_searchRepeaters": "Rechercher des répétiteurs",
|
||||
"pathEditor_advancedHex": "Avancé : chemin hexadécimal brut",
|
||||
"pathEditor_hexLabel": "Préfixes hexadécimaux",
|
||||
"pathEditor_hexHelper": "Deux caractères hexadécimaux par saut, séparés par des virgules.",
|
||||
"pathEditor_hexHelper": "{count} caractères hexadécimaux par saut, séparés par des virgules.",
|
||||
"pathEditor_invalidTokens": "Invalide : {tokens}",
|
||||
"pathEditor_tooManyHops": "Maximum 64 sauts",
|
||||
"pathEditor_usePath": "Utiliser ce chemin",
|
||||
@@ -3890,7 +3890,7 @@
|
||||
"backupRestore_backupComplete": "Fichier de sauvegarde créé.",
|
||||
"backupRestore_restoreComplete": "Restauration terminée. Reconnectez-vous si vous avez restauré l'identité de la radio.",
|
||||
"backupRestore_missingModelsTitle": "Modèles non téléchargés",
|
||||
"backupRestore_missingModelsMessage": "Les réglages restaurés sélectionnent des modèles indisponibles sur cet appareil :\n{models}\n\nLes télécharger maintenant ?",
|
||||
"backupRestore_missingModelsMessage": "Les réglages restaurés sélectionnent des modèles indisponibles sur cet appareil. Les télécharger maintenant ?",
|
||||
"backupRestore_downloadModels": "Télécharger les modèles",
|
||||
"backupRestore_downloading": "Téléchargement…",
|
||||
"backupRestore_cancelDownload": "Annuler le téléchargement",
|
||||
@@ -3927,5 +3927,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Paramètres répéteurs et salons réinitialisés",
|
||||
"repeater_clockSyncDefault": "Défaut",
|
||||
"repeater_clockSyncOn": "Activé",
|
||||
"repeater_clockSyncOff": "Désactivé"
|
||||
"repeater_clockSyncOff": "Désactivé",
|
||||
"modelDownload_notDownloaded": "Non téléchargé",
|
||||
"modelDownload_downloading": "Téléchargement",
|
||||
"modelDownload_active": "Actif",
|
||||
"modelDownload_failed": "Échec du téléchargement",
|
||||
"modelDownload_incomplete": "Incomplet",
|
||||
"modelDownload_verifying": "Vérification du téléchargement",
|
||||
"modelDownload_useModel": "Utiliser ce modèle",
|
||||
"modelDownload_removeFailed": "Impossible de retirer le modèle : {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -2663,7 +2663,7 @@
|
||||
"pathEditor_searchRepeaters": "Ismétlő keresése",
|
||||
"pathEditor_advancedHex": "Haladó: nyers hexadecimális útvonal",
|
||||
"pathEditor_hexLabel": "Hexadecimális előtagok",
|
||||
"pathEditor_hexHelper": "Két hexadecimális karakter ugrásonként, vesszővel elválasztva",
|
||||
"pathEditor_hexHelper": "{count} hexadecimális karakter ugrásonként, vesszővel elválasztva",
|
||||
"pathEditor_invalidTokens": "Érvénytelen: {tokens}",
|
||||
"routing_lastWorked": "dolgozott {when}",
|
||||
"routing_deliveryCounts": "{successes} kézbesítve, {failures} sikertelen",
|
||||
@@ -3847,7 +3847,7 @@
|
||||
"backupRestore_backupComplete": "A mentési fájl elkészült.",
|
||||
"backupRestore_restoreComplete": "A visszaállítás kész. Csatlakozzon újra, ha a rádió azonosítóját is visszaállította.",
|
||||
"backupRestore_missingModelsTitle": "A modellek nincsenek letöltve",
|
||||
"backupRestore_missingModelsMessage": "A visszaállított beállítások olyan modelleket választanak, amelyek nem érhetők el ezen az eszközön:\n{models}\n\nLetölti őket most?",
|
||||
"backupRestore_missingModelsMessage": "A visszaállított beállítások olyan modelleket választanak, amelyek nem érhetők el ezen az eszközön. Letölti őket most?",
|
||||
"backupRestore_downloadModels": "Modellek letöltése",
|
||||
"backupRestore_downloading": "Letöltés…",
|
||||
"backupRestore_cancelDownload": "Letöltés megszakítása",
|
||||
@@ -3884,5 +3884,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Átjátszó- és szobabeállítások visszaállítva",
|
||||
"repeater_clockSyncDefault": "Alapért.",
|
||||
"repeater_clockSyncOn": "Be",
|
||||
"repeater_clockSyncOff": "Ki"
|
||||
"repeater_clockSyncOff": "Ki",
|
||||
"modelDownload_notDownloaded": "Nincs letöltve",
|
||||
"modelDownload_downloading": "Letöltés",
|
||||
"modelDownload_active": "Aktív",
|
||||
"modelDownload_failed": "A letöltés sikertelen",
|
||||
"modelDownload_incomplete": "Hiányos",
|
||||
"modelDownload_verifying": "A letöltés ellenőrzése",
|
||||
"modelDownload_useModel": "Ezt a modellt használja",
|
||||
"modelDownload_removeFailed": "A modellt nem sikerült eltávolítani: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -2680,7 +2680,7 @@
|
||||
"pathEditor_searchRepeaters": "Cerca ripetitori",
|
||||
"pathEditor_advancedHex": "Avanzato: percorso esadecimale grezzo",
|
||||
"pathEditor_hexLabel": "Prefissi esadecimali",
|
||||
"pathEditor_hexHelper": "Due caratteri esadecimali per ogni salto, separati da virgole.",
|
||||
"pathEditor_hexHelper": "{count} caratteri esadecimali per ogni salto, separati da virgole.",
|
||||
"pathEditor_invalidTokens": "Non valido: {tokens}",
|
||||
"routing_lastWorked": "ha funzionato {when}",
|
||||
"pathEditor_tooManyHops": "Massimo 64 salti",
|
||||
@@ -3890,7 +3890,7 @@
|
||||
"backupRestore_backupComplete": "File di backup creato.",
|
||||
"backupRestore_restoreComplete": "Ripristino completato. Riconnettiti se hai ripristinato l'identità della radio.",
|
||||
"backupRestore_missingModelsTitle": "Modelli non scaricati",
|
||||
"backupRestore_missingModelsMessage": "Le impostazioni ripristinate selezionano modelli non disponibili su questo dispositivo:\n{models}\n\nScaricarli ora?",
|
||||
"backupRestore_missingModelsMessage": "Le impostazioni ripristinate selezionano modelli non disponibili su questo dispositivo. Scaricarli ora?",
|
||||
"backupRestore_downloadModels": "Scarica modelli",
|
||||
"backupRestore_downloading": "Download in corso…",
|
||||
"backupRestore_cancelDownload": "Annulla download",
|
||||
@@ -3927,5 +3927,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Impostazioni di ripetitori e stanze reimpostate",
|
||||
"repeater_clockSyncDefault": "Predefinito",
|
||||
"repeater_clockSyncOn": "Attivo",
|
||||
"repeater_clockSyncOff": "Disattivo"
|
||||
"repeater_clockSyncOff": "Disattivo",
|
||||
"modelDownload_notDownloaded": "Non scaricato",
|
||||
"modelDownload_downloading": "Download in corso",
|
||||
"modelDownload_active": "Attivo",
|
||||
"modelDownload_failed": "Download non riuscito",
|
||||
"modelDownload_incomplete": "Incompleto",
|
||||
"modelDownload_verifying": "Verifica del download",
|
||||
"modelDownload_useModel": "Usa questo modello",
|
||||
"modelDownload_removeFailed": "Impossibile rimuovere il modello: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -2675,7 +2675,7 @@
|
||||
"pathEditor_searchRepeaters": "リピータを検索",
|
||||
"pathEditor_advancedHex": "詳細: 生の 16 進経路",
|
||||
"pathEditor_hexLabel": "16 進接頭辞",
|
||||
"pathEditor_hexHelper": "ホップごとに 16 進数 2 文字をカンマ区切りで入力します",
|
||||
"pathEditor_hexHelper": "ホップごとに 16 進数 {count} 文字をカンマ区切りで入力します",
|
||||
"pathEditor_invalidTokens": "無効: {tokens}",
|
||||
"pathEditor_tooManyHops": "最大 64 ホップ",
|
||||
"pathEditor_usePath": "この経路を使用",
|
||||
@@ -4096,7 +4096,7 @@
|
||||
"backupRestore_backupComplete": "バックアップファイルを作成しました。",
|
||||
"backupRestore_restoreComplete": "復元が完了しました。無線機のIDを復元した場合は再接続してください。",
|
||||
"backupRestore_missingModelsTitle": "モデル未ダウンロード",
|
||||
"backupRestore_missingModelsMessage": "復元された設定で選択されているモデルが、このデバイスにありません:\n{models}\n\n今すぐダウンロードしますか?",
|
||||
"backupRestore_missingModelsMessage": "復元された設定で選択されているモデルが、このデバイスにありません。今すぐダウンロードしますか?",
|
||||
"backupRestore_downloadModels": "モデルをダウンロード",
|
||||
"backupRestore_downloading": "ダウンロード中…",
|
||||
"backupRestore_cancelDownload": "ダウンロードをキャンセル",
|
||||
@@ -4133,5 +4133,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "リピーターとルームの設定をリセットしました",
|
||||
"repeater_clockSyncDefault": "既定",
|
||||
"repeater_clockSyncOn": "オン",
|
||||
"repeater_clockSyncOff": "オフ"
|
||||
"repeater_clockSyncOff": "オフ",
|
||||
"modelDownload_notDownloaded": "未ダウンロード",
|
||||
"modelDownload_downloading": "ダウンロード中",
|
||||
"modelDownload_active": "使用中",
|
||||
"modelDownload_failed": "ダウンロードできませんでした",
|
||||
"modelDownload_incomplete": "未完了",
|
||||
"modelDownload_verifying": "ダウンロードを確認しています",
|
||||
"modelDownload_useModel": "このモデルを使う",
|
||||
"modelDownload_removeFailed": "モデルを削除できませんでした: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -2579,7 +2579,7 @@
|
||||
"pathEditor_searchRepeaters": "리피터 검색",
|
||||
"pathEditor_advancedHex": "고급: 원시 HEX 경로",
|
||||
"pathEditor_hexLabel": "HEX 접두사",
|
||||
"pathEditor_hexHelper": "각 홉마다 2개의 16진수 바이트, 쉼표로 구분",
|
||||
"pathEditor_hexHelper": "각 홉마다 {count}개의 16진수 문자, 쉼표로 구분",
|
||||
"pathEditor_invalidTokens": "유효하지 않음: {tokens}",
|
||||
"pathEditor_tooManyHops": "최대 64개의 홉",
|
||||
"pathEditor_usePath": "이 경로 사용",
|
||||
@@ -4096,7 +4096,7 @@
|
||||
"backupRestore_backupComplete": "백업 파일을 만들었습니다.",
|
||||
"backupRestore_restoreComplete": "복원이 완료되었습니다. 무전기 ID를 복원했다면 다시 연결하세요.",
|
||||
"backupRestore_missingModelsTitle": "모델이 다운로드되지 않음",
|
||||
"backupRestore_missingModelsMessage": "복원된 설정에서 선택한 모델이 이 기기에 없습니다:\n{models}\n\n지금 다운로드할까요?",
|
||||
"backupRestore_missingModelsMessage": "복원된 설정에서 선택한 모델이 이 기기에 없습니다. 지금 다운로드할까요?",
|
||||
"backupRestore_downloadModels": "모델 다운로드",
|
||||
"backupRestore_downloading": "다운로드 중…",
|
||||
"backupRestore_cancelDownload": "다운로드 취소",
|
||||
@@ -4133,5 +4133,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "리피터와 방 설정을 되돌렸습니다",
|
||||
"repeater_clockSyncDefault": "기본",
|
||||
"repeater_clockSyncOn": "켜기",
|
||||
"repeater_clockSyncOff": "끄기"
|
||||
"repeater_clockSyncOff": "끄기",
|
||||
"modelDownload_notDownloaded": "다운로드되지 않음",
|
||||
"modelDownload_downloading": "다운로드 중",
|
||||
"modelDownload_active": "사용 중",
|
||||
"modelDownload_failed": "다운로드하지 못했습니다",
|
||||
"modelDownload_incomplete": "불완전",
|
||||
"modelDownload_verifying": "다운로드를 확인하는 중",
|
||||
"modelDownload_useModel": "이 모델 사용",
|
||||
"modelDownload_removeFailed": "모델을 제거하지 못했습니다: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
@@ -1102,8 +1102,8 @@ abstract class AppLocalizations {
|
||||
/// No description provided for @backupRestore_missingModelsMessage.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'The restored settings select models that are not available on this device:\n{models}\n\nDownload them now?'**
|
||||
String backupRestore_missingModelsMessage(String models);
|
||||
/// **'The restored settings select models that are not on this device. Download them now?'**
|
||||
String get backupRestore_missingModelsMessage;
|
||||
|
||||
/// No description provided for @backupRestore_downloadModels.
|
||||
///
|
||||
@@ -2533,6 +2533,18 @@ abstract class AppLocalizations {
|
||||
/// **'Show a channel message\'s region on the same line as its hop count instead of below it.'**
|
||||
String get appSettings_regionOnHopsLineSubtitle;
|
||||
|
||||
/// No description provided for @appSettings_showCompressionIndicator.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Compression indicator'**
|
||||
String get appSettings_showCompressionIndicator;
|
||||
|
||||
/// No description provided for @appSettings_showCompressionIndicatorSubtitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Show an icon on messages compressed with SMAZ.'**
|
||||
String get appSettings_showCompressionIndicatorSubtitle;
|
||||
|
||||
/// No description provided for @appSettings_notifications.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
@@ -4792,7 +4804,7 @@ abstract class AppLocalizations {
|
||||
/// No description provided for @pathEditor_searchRepeaters.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Search repeaters'**
|
||||
/// **'Search name or hash'**
|
||||
String get pathEditor_searchRepeaters;
|
||||
|
||||
/// No description provided for @pathEditor_advancedHex.
|
||||
@@ -4810,8 +4822,8 @@ abstract class AppLocalizations {
|
||||
/// No description provided for @pathEditor_hexHelper.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Two hex characters per hop, separated by commas'**
|
||||
String get pathEditor_hexHelper;
|
||||
/// **'{count} hex characters per hop, separated by commas'**
|
||||
String pathEditor_hexHelper(int count);
|
||||
|
||||
/// No description provided for @pathEditor_invalidTokens.
|
||||
///
|
||||
@@ -12718,6 +12730,60 @@ abstract class AppLocalizations {
|
||||
/// **'Connect to a radio to send messages'**
|
||||
String get chat_composerOffline;
|
||||
|
||||
/// No description provided for @modelDownload_notDownloaded.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Not downloaded'**
|
||||
String get modelDownload_notDownloaded;
|
||||
|
||||
/// No description provided for @modelDownload_downloading.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Downloading'**
|
||||
String get modelDownload_downloading;
|
||||
|
||||
/// No description provided for @modelDownload_active.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Active'**
|
||||
String get modelDownload_active;
|
||||
|
||||
/// No description provided for @modelDownload_failed.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Couldn\'t download'**
|
||||
String get modelDownload_failed;
|
||||
|
||||
/// No description provided for @modelDownload_incomplete.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Incomplete'**
|
||||
String get modelDownload_incomplete;
|
||||
|
||||
/// No description provided for @modelDownload_verifying.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Verifying the download'**
|
||||
String get modelDownload_verifying;
|
||||
|
||||
/// No description provided for @modelDownload_useModel.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Use this model'**
|
||||
String get modelDownload_useModel;
|
||||
|
||||
/// No description provided for @modelDownload_removeFailed.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Couldn\'t remove the model: {error}'**
|
||||
String modelDownload_removeFailed(String error);
|
||||
|
||||
/// No description provided for @modelDownload_progress.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'{current} / {total} MB ({percent}%)'**
|
||||
String modelDownload_progress(String current, String total, String percent);
|
||||
|
||||
/// No description provided for @chatCompression_title.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
@@ -12795,6 +12861,12 @@ abstract class AppLocalizations {
|
||||
/// In en, this message translates to:
|
||||
/// **'Couldn\'t save the compression setting. Showing the saved setting.'**
|
||||
String get chatCompression_saveFailed;
|
||||
|
||||
/// No description provided for @messageMeta_smazCompressed.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'SMAZ compressed'**
|
||||
String get messageMeta_smazCompressed;
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate
|
||||
|
||||
@@ -557,9 +557,8 @@ class AppLocalizationsBg extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'Моделите не са изтеглени';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'Възстановените настройки избират модели, които не са налични на това устройство:\n$models\n\nДа се изтеглят ли сега?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'Възстановените настройки избират модели, които не са налични на това устройство. Да се изтеглят ли сега?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Изтегли модели';
|
||||
@@ -1385,6 +1384,13 @@ class AppLocalizationsBg extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Показвай региона на съобщението в канала на същия ред като броя хопове, а не под него.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Уведомления';
|
||||
|
||||
@@ -2765,8 +2771,9 @@ class AppLocalizationsBg extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Шестнадесетични префикси';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Два шестнадесетични идентификатора на скок, разделени със запетаи';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count шестнадесетични идентификатора на скок, разделени със запетаи';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7639,6 +7646,37 @@ class AppLocalizationsBg extends AppLocalizations {
|
||||
String get chat_composerOffline =>
|
||||
'Свържете се с радио, за да изпращате съобщения';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Не е изтеглен';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Изтегляне';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Активен';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Неуспешно изтегляне';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Непълен';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Проверка на изтеглянето';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Използвай този модел';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Моделът не можа да бъде премахнат: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7685,4 +7723,7 @@ class AppLocalizationsBg extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -551,9 +551,8 @@ class AppLocalizationsCs extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'Modely nejsou stažené';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'Obnovené nastavení vybírá modely, které nejsou v tomto zařízení k dispozici:\n$models\n\nStáhnout je nyní?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'Obnovené nastavení vybírá modely, které nejsou v tomto zařízení k dispozici. Stáhnout je nyní?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Stáhnout modely';
|
||||
@@ -1376,6 +1375,13 @@ class AppLocalizationsCs extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Zobrazit region zprávy kanálu na stejném řádku jako počet skoků místo pod ním.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Oznámení';
|
||||
|
||||
@@ -2756,7 +2762,9 @@ class AppLocalizationsCs extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Hex prefixy';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper => 'Dva hex znaky na skok, oddělené čárkami';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count hex znaky na skok, oddělené čárkami';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7609,6 +7617,37 @@ class AppLocalizationsCs extends AppLocalizations {
|
||||
@override
|
||||
String get chat_composerOffline => 'Pro odesílání zpráv se připojte k rádiu';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Nestaženo';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Stahování';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Aktivní';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Stažení se nezdařilo';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Neúplné';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Ověřování stažení';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Použít tento model';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Model se nepodařilo odebrat: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7655,4 +7694,7 @@ class AppLocalizationsCs extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -559,9 +559,8 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
'Modelle nicht heruntergeladen';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'Die wiederhergestellten Einstellungen wählen Modelle aus, die auf diesem Gerät nicht verfügbar sind:\n$models\n\nJetzt herunterladen?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'Die wiederhergestellten Einstellungen wählen Modelle aus, die auf diesem Gerät nicht verfügbar sind. Jetzt herunterladen?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Modelle herunterladen';
|
||||
@@ -1384,6 +1383,13 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Die Region einer Kanalnachricht in derselben Zeile wie die Hop-Anzahl anzeigen statt darunter.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Benachrichtigungen';
|
||||
|
||||
@@ -2767,8 +2773,9 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Hex-Präfixe';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Zwei Hex-Zeichen pro Sprung, durch Kommas getrennt';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count Hex-Zeichen pro Sprung, durch Kommas getrennt';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7653,6 +7660,37 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
String get chat_composerOffline =>
|
||||
'Mit einem Funkgerät verbinden, um Nachrichten zu senden';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Nicht heruntergeladen';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Wird heruntergeladen';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Aktiv';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Download fehlgeschlagen';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Unvollständig';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Download wird geprüft';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Dieses Modell verwenden';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Das Modell konnte nicht entfernt werden: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7699,4 +7737,7 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -547,9 +547,8 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'Models Not Downloaded';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'The restored settings select models that are not available on this device:\n$models\n\nDownload them now?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'The restored settings select models that are not on this device. Download them now?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Download Models';
|
||||
@@ -1359,6 +1358,13 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Show a channel message\'s region on the same line as its hop count instead of below it.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Notifications';
|
||||
|
||||
@@ -2710,7 +2716,7 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
String get pathEditor_addHops => 'Add hops in order';
|
||||
|
||||
@override
|
||||
String get pathEditor_searchRepeaters => 'Search repeaters';
|
||||
String get pathEditor_searchRepeaters => 'Search name or hash';
|
||||
|
||||
@override
|
||||
String get pathEditor_advancedHex => 'Advanced: raw hex path';
|
||||
@@ -2719,8 +2725,9 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Hex prefixes';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Two hex characters per hop, separated by commas';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count hex characters per hop, separated by commas';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7524,6 +7531,37 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
@override
|
||||
String get chat_composerOffline => 'Connect to a radio to send messages';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Not downloaded';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Downloading';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Active';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Couldn\'t download';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Incomplete';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Verifying the download';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Use this model';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Couldn\'t remove the model: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7570,4 +7608,7 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -557,9 +557,8 @@ class AppLocalizationsEs extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'Modelos no descargados';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'Los ajustes restaurados seleccionan modelos que no están disponibles en este dispositivo:\n$models\n\n¿Descargarlos ahora?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'Los ajustes restaurados seleccionan modelos que no están disponibles en este dispositivo. ¿Descargarlos ahora?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Descargar modelos';
|
||||
@@ -1377,6 +1376,13 @@ class AppLocalizationsEs extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Mostrar la región de un mensaje de canal en la misma línea que su número de saltos en lugar de debajo.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Notificaciones';
|
||||
|
||||
@@ -2758,8 +2764,9 @@ class AppLocalizationsEs extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Prefijos hexadecimales';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Dos caracteres hexadecimales por salto, separados por comas.';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count caracteres hexadecimales por salto, separados por comas.';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7631,6 +7638,37 @@ class AppLocalizationsEs extends AppLocalizations {
|
||||
String get chat_composerOffline =>
|
||||
'Conéctate a una radio para enviar mensajes';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'No descargado';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Descargando';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Activo';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'No se pudo descargar';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Incompleto';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Comprobando la descarga';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Usar este modelo';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'No se pudo quitar el modelo: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7677,4 +7715,7 @@ class AppLocalizationsEs extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -556,9 +556,8 @@ class AppLocalizationsFr extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'Modèles non téléchargés';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'Les réglages restaurés sélectionnent des modèles indisponibles sur cet appareil :\n$models\n\nLes télécharger maintenant ?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'Les réglages restaurés sélectionnent des modèles indisponibles sur cet appareil. Les télécharger maintenant ?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Télécharger les modèles';
|
||||
@@ -1383,6 +1382,13 @@ class AppLocalizationsFr extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Afficher la région d\'un message de canal sur la même ligne que son nombre de sauts plutôt qu\'en dessous.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Notifications';
|
||||
|
||||
@@ -2762,8 +2768,9 @@ class AppLocalizationsFr extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Préfixes hexadécimaux';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Deux caractères hexadécimaux par saut, séparés par des virgules.';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count caractères hexadécimaux par saut, séparés par des virgules.';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7659,6 +7666,37 @@ class AppLocalizationsFr extends AppLocalizations {
|
||||
String get chat_composerOffline =>
|
||||
'Connectez-vous à une radio pour envoyer des messages';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Non téléchargé';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Téléchargement';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Actif';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Échec du téléchargement';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Incomplet';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Vérification du téléchargement';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Utiliser ce modèle';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Impossible de retirer le modèle : $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7705,4 +7743,7 @@ class AppLocalizationsFr extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -552,9 +552,8 @@ class AppLocalizationsHu extends AppLocalizations {
|
||||
'A modellek nincsenek letöltve';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'A visszaállított beállítások olyan modelleket választanak, amelyek nem érhetők el ezen az eszközön:\n$models\n\nLetölti őket most?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'A visszaállított beállítások olyan modelleket választanak, amelyek nem érhetők el ezen az eszközön. Letölti őket most?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Modellek letöltése';
|
||||
@@ -1376,6 +1375,13 @@ class AppLocalizationsHu extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'A csatornaüzenet régiója az ugrásszámmal azonos sorban jelenik meg, nem alatta.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Értesítések';
|
||||
|
||||
@@ -2754,8 +2760,9 @@ class AppLocalizationsHu extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Hexadecimális előtagok';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Két hexadecimális karakter ugrásonként, vesszővel elválasztva';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count hexadecimális karakter ugrásonként, vesszővel elválasztva';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7622,6 +7629,37 @@ class AppLocalizationsHu extends AppLocalizations {
|
||||
@override
|
||||
String get chat_composerOffline => 'Üzenetküldéshez csatlakozzon rádióhoz';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Nincs letöltve';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Letöltés';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Aktív';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'A letöltés sikertelen';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Hiányos';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'A letöltés ellenőrzése';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Ezt a modellt használja';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'A modellt nem sikerült eltávolítani: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7668,4 +7706,7 @@ class AppLocalizationsHu extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -556,9 +556,8 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'Modelli non scaricati';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'Le impostazioni ripristinate selezionano modelli non disponibili su questo dispositivo:\n$models\n\nScaricarli ora?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'Le impostazioni ripristinate selezionano modelli non disponibili su questo dispositivo. Scaricarli ora?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Scarica modelli';
|
||||
@@ -1381,6 +1380,13 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Mostra la regione di un messaggio di canale sulla stessa riga del numero di salti invece che sotto.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Notifiche';
|
||||
|
||||
@@ -2761,8 +2767,9 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Prefissi esadecimali';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Due caratteri esadecimali per ogni salto, separati da virgole.';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count caratteri esadecimali per ogni salto, separati da virgole.';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7642,6 +7649,37 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
String get chat_composerOffline =>
|
||||
'Connettiti a una radio per inviare messaggi';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Non scaricato';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Download in corso';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Attivo';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Download non riuscito';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Incompleto';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Verifica del download';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Usa questo modello';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Impossibile rimuovere il modello: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7688,4 +7726,7 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -531,9 +531,8 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'モデル未ダウンロード';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return '復元された設定で選択されているモデルが、このデバイスにありません:\n$models\n\n今すぐダウンロードしますか?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'復元された設定で選択されているモデルが、このデバイスにありません。今すぐダウンロードしますか?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'モデルをダウンロード';
|
||||
@@ -1316,6 +1315,13 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'チャンネルメッセージの地域を、ホップ数の下ではなく同じ行に表示します。';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => '通知';
|
||||
|
||||
@@ -2636,7 +2642,9 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => '16 進接頭辞';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper => 'ホップごとに 16 進数 2 文字をカンマ区切りで入力します';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return 'ホップごとに 16 進数 $count 文字をカンマ区切りで入力します';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7283,6 +7291,37 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
@override
|
||||
String get chat_composerOffline => 'メッセージを送信するには無線機に接続してください';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => '未ダウンロード';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'ダウンロード中';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => '使用中';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'ダウンロードできませんでした';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => '未完了';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'ダウンロードを確認しています';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'このモデルを使う';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'モデルを削除できませんでした: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7329,4 +7368,7 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -531,9 +531,8 @@ class AppLocalizationsKo extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => '모델이 다운로드되지 않음';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return '복원된 설정에서 선택한 모델이 이 기기에 없습니다:\n$models\n\n지금 다운로드할까요?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'복원된 설정에서 선택한 모델이 이 기기에 없습니다. 지금 다운로드할까요?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => '모델 다운로드';
|
||||
@@ -1319,6 +1318,13 @@ class AppLocalizationsKo extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'채널 메시지의 지역을 홉 수 아래가 아닌 같은 줄에 표시합니다.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => '알림';
|
||||
|
||||
@@ -2638,7 +2644,9 @@ class AppLocalizationsKo extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'HEX 접두사';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper => '각 홉마다 2개의 16진수 바이트, 쉼표로 구분';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '각 홉마다 $count개의 16진수 문자, 쉼표로 구분';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7295,6 +7303,37 @@ class AppLocalizationsKo extends AppLocalizations {
|
||||
@override
|
||||
String get chat_composerOffline => '메시지를 보내려면 무전기에 연결하세요';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => '다운로드되지 않음';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => '다운로드 중';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => '사용 중';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => '다운로드하지 못했습니다';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => '불완전';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => '다운로드를 확인하는 중';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => '이 모델 사용';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return '모델을 제거하지 못했습니다: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7341,4 +7380,7 @@ class AppLocalizationsKo extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -552,9 +552,8 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'Modellen niet gedownload';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'De herstelde instellingen selecteren modellen die op dit apparaat niet beschikbaar zijn:\n$models\n\nNu downloaden?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'De herstelde instellingen selecteren modellen die op dit apparaat niet beschikbaar zijn. Nu downloaden?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Modellen downloaden';
|
||||
@@ -1374,6 +1373,13 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Toon de regio van een kanaalbericht op dezelfde regel als het aantal hops in plaats van eronder.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Notificaties';
|
||||
|
||||
@@ -2746,8 +2752,9 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Hex-prefixen';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Twee hex-tekens per hop, gescheiden door komma\'s';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count hex-tekens per hop, gescheiden door komma\'s';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7598,6 +7605,37 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
String get chat_composerOffline =>
|
||||
'Verbind met een radio om berichten te versturen';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Niet gedownload';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Downloaden';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Actief';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Downloaden mislukt';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Onvolledig';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Download controleren';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Dit model gebruiken';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Het model kon niet worden verwijderd: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7644,4 +7682,7 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -560,9 +560,8 @@ class AppLocalizationsPl extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'Modele nie zostały pobrane';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'Przywrócone ustawienia wybierają modele, które nie są dostępne na tym urządzeniu:\n$models\n\nPobrać je teraz?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'Przywrócone ustawienia wybierają modele, które nie są dostępne na tym urządzeniu. Pobrać je teraz?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Pobierz modele';
|
||||
@@ -1387,6 +1386,13 @@ class AppLocalizationsPl extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Pokaż region wiadomości kanału w tym samym wierszu co liczba hopów, zamiast pod nią.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Powiadomienia';
|
||||
|
||||
@@ -2788,8 +2794,9 @@ class AppLocalizationsPl extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Prefiksy heksadecymalne';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Dwa znaki szesnastkowe na każdym kroku, oddzielone przecinkami';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count znaki szesnastkowe na każdym kroku, oddzielone przecinkami';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7676,6 +7683,37 @@ class AppLocalizationsPl extends AppLocalizations {
|
||||
String get chat_composerOffline =>
|
||||
'Połącz się z radiem, aby wysyłać wiadomości';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Nie pobrano';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Pobieranie';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Aktywny';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Nie udało się pobrać';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Niekompletny';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Sprawdzanie pobierania';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Użyj tego modelu';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Nie udało się usunąć modelu: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7722,4 +7760,7 @@ class AppLocalizationsPl extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -557,9 +557,8 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'Modelos não baixados';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'As configurações restauradas selecionam modelos que não estão disponíveis neste dispositivo:\n$models\n\nBaixar agora?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'As configurações restauradas selecionam modelos que não estão disponíveis neste dispositivo. Baixar agora?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Baixar modelos';
|
||||
@@ -1380,6 +1379,13 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Mostra a região de uma mensagem de canal na mesma linha da contagem de saltos, em vez de abaixo dela.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Notificações';
|
||||
|
||||
@@ -2756,8 +2762,9 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Prefixos hexadecimais';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Dois caracteres hexadecimais por salto, separados por vírgulas.';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count caracteres hexadecimais por salto, separados por vírgulas.';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7620,6 +7627,37 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
String get chat_composerOffline =>
|
||||
'Conecte-se a um rádio para enviar mensagens';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Não baixado';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Baixando';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Ativo';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Não foi possível baixar';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Incompleto';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Verificando o download';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Usar este modelo';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Não foi possível remover o modelo: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7666,6 +7704,9 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
|
||||
/// The translations for Portuguese, as used in Portugal (`pt_PT`).
|
||||
@@ -8215,9 +8256,8 @@ class AppLocalizationsPtPt extends AppLocalizationsPt {
|
||||
String get backupRestore_missingModelsTitle => 'Modelos não transferidos';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'As definições restauradas selecionam modelos que não estão disponíveis neste dispositivo:\n$models\n\nTransferi-los agora?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'As definições restauradas selecionam modelos que não estão disponíveis neste dispositivo. Transferi-los agora?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Transferir modelos';
|
||||
@@ -10382,8 +10422,9 @@ class AppLocalizationsPtPt extends AppLocalizationsPt {
|
||||
String get pathEditor_hexLabel => 'Prefixos hex';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Dois caracteres hex por hop, separados por vírgulas';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count caracteres hex por hop, separados por vírgulas';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -15172,4 +15213,35 @@ class AppLocalizationsPtPt extends AppLocalizationsPt {
|
||||
@override
|
||||
String get chat_composerOffline =>
|
||||
'Ligue-se a um rádio para enviar mensagens';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Não transferido';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'A transferir';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Ativo';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Não foi possível transferir';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Incompleto';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'A verificar a transferência';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Utilizar este modelo';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Não foi possível remover o modelo: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
}
|
||||
@@ -554,9 +554,8 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'Модели не загружены';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'Восстановленные настройки выбирают модели, которых нет на этом устройстве:\n$models\n\nЗагрузить их сейчас?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'Восстановленные настройки выбирают модели, которых нет на этом устройстве. Загрузить их сейчас?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Загрузить модели';
|
||||
@@ -1379,6 +1378,13 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Показывать регион сообщения канала в одной строке с числом хопов, а не под ней.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Уведомления';
|
||||
|
||||
@@ -2767,8 +2773,9 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Префиксы шестнадцатеричной системы';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Два шестнадцатеричных символа на каждом шаге, разделенные запятыми.';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count шестнадцатеричных символа на каждом шаге, разделенные запятыми.';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7656,6 +7663,37 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
String get chat_composerOffline =>
|
||||
'Подключитесь к радио, чтобы отправлять сообщения';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Не скачано';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Загрузка';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Активна';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Не удалось скачать';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Неполная';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Проверка загрузки';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Использовать эту модель';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Не удалось удалить модель: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7702,4 +7740,7 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -555,9 +555,8 @@ class AppLocalizationsSk extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'Modely nie sú stiahnuté';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'Obnovené nastavenia vyberajú modely, ktoré nie sú v tomto zariadení k dispozícii:\n$models\n\nStiahnuť ich teraz?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'Obnovené nastavenia vyberajú modely, ktoré nie sú v tomto zariadení k dispozícii. Stiahnuť ich teraz?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Stiahnuť modely';
|
||||
@@ -1374,6 +1373,13 @@ class AppLocalizationsSk extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Zobraziť región správy kanála v rovnakom riadku ako počet skokov namiesto pod ním.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Upozornenia';
|
||||
|
||||
@@ -2758,8 +2764,9 @@ class AppLocalizationsSk extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Prefiksy pre hexadecimálne čísla';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Dve hexové čísla na každý krok, oddelené čiarkami';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count hexové čísla na každý krok, oddelené čiarkami';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7621,6 +7628,37 @@ class AppLocalizationsSk extends AppLocalizations {
|
||||
@override
|
||||
String get chat_composerOffline => 'Na odosielanie správ sa pripojte k rádiu';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Nestiahnuté';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Sťahovanie';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Aktívny';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Sťahovanie zlyhalo';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Nekompletné';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Overuje sa sťahovanie';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Použiť tento model';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Model sa nepodarilo odstrániť: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7667,4 +7705,7 @@ class AppLocalizationsSk extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -554,9 +554,8 @@ class AppLocalizationsSl extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'Modeli niso preneseni';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'Obnovljene nastavitve izbirajo modele, ki niso na voljo v tej napravi:\n$models\n\nJih želite prenesti zdaj?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'Obnovljene nastavitve izbirajo modele, ki niso na voljo v tej napravi. Jih želite prenesti zdaj?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Prenesi modele';
|
||||
@@ -1373,6 +1372,13 @@ class AppLocalizationsSl extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Regijo sporočila kanala prikaži v isti vrstici kot število skokov, ne pod njim.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Obvestila';
|
||||
|
||||
@@ -2755,8 +2761,9 @@ class AppLocalizationsSl extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Predfiks za heksadecimalno šifro';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Dva šestbitna znaka na vsak skok, ločena z vejico';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count šestnajstiških znakov na vsak skok, ločenih z vejico';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7615,6 +7622,37 @@ class AppLocalizationsSl extends AppLocalizations {
|
||||
String get chat_composerOffline =>
|
||||
'Za pošiljanje sporočil se povežite z radiem';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Ni preneseno';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Prenašanje';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Aktiven';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Prenos ni uspel';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Nepopolno';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Preverjanje prenosa';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Uporabi ta model';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Modela ni bilo mogoče odstraniti: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7661,4 +7699,7 @@ class AppLocalizationsSl extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -553,9 +553,8 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'Modeller inte nedladdade';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'De återställda inställningarna väljer modeller som inte finns på den här enheten:\n$models\n\nLadda ned dem nu?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'De återställda inställningarna väljer modeller som inte finns på den här enheten. Ladda ned dem nu?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Ladda ned modeller';
|
||||
@@ -1364,6 +1363,13 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Visa ett kanalmeddelandes region på samma rad som dess hoppantal i stället för under det.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Notifieringar';
|
||||
|
||||
@@ -2734,8 +2740,9 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => 'Hex-prefikser';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Två hextecken per hopp, separerade med kommatecken';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count hextecken per hopp, separerade med kommatecken';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7575,6 +7582,37 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||
String get chat_composerOffline =>
|
||||
'Anslut till en radio för att skicka meddelanden';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Inte nedladdad';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Laddar ner';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Aktiv';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Kunde inte ladda ner';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Ofullständig';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Verifierar nedladdningen';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Använd den här modellen';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Det gick inte att ta bort modellen: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7621,4 +7659,7 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -553,9 +553,8 @@ class AppLocalizationsUk extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => 'Моделі не завантажено';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return 'Відновлені налаштування вибирають моделі, яких немає на цьому пристрої:\n$models\n\nЗавантажити їх зараз?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage =>
|
||||
'Відновлені налаштування вибирають моделі, яких немає на цьому пристрої. Завантажити їх зараз?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => 'Завантажити моделі';
|
||||
@@ -1375,6 +1374,13 @@ class AppLocalizationsUk extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'Показувати регіон повідомлення каналу в одному рядку з кількістю хопів, а не під ним.';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => 'Сповіщення';
|
||||
|
||||
@@ -2765,8 +2771,9 @@ class AppLocalizationsUk extends AppLocalizations {
|
||||
'Префікси для шестнадцяткової системи числення';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper =>
|
||||
'Два шестизначні символи на кожний крок, розділені комами';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '$count шістнадцяткові символи на кожний крок, розділені комами';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7668,6 +7675,37 @@ class AppLocalizationsUk extends AppLocalizations {
|
||||
String get chat_composerOffline =>
|
||||
'Підключіться до радіо, щоб надсилати повідомлення';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => 'Не завантажено';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => 'Завантаження';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => 'Активна';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => 'Не вдалося завантажити';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => 'Неповна';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => 'Перевірка завантаження';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => 'Використовувати цю модель';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return 'Не вдалося видалити модель: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7714,4 +7752,7 @@ class AppLocalizationsUk extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
@@ -520,9 +520,7 @@ class AppLocalizationsZh extends AppLocalizations {
|
||||
String get backupRestore_missingModelsTitle => '模型未下载';
|
||||
|
||||
@override
|
||||
String backupRestore_missingModelsMessage(String models) {
|
||||
return '恢复的设置所选用的模型在此设备上不可用:\n$models\n\n现在下载吗?';
|
||||
}
|
||||
String get backupRestore_missingModelsMessage => '恢复的设置所选用的模型在此设备上不可用。现在下载吗?';
|
||||
|
||||
@override
|
||||
String get backupRestore_downloadModels => '下载模型';
|
||||
@@ -1297,6 +1295,13 @@ class AppLocalizationsZh extends AppLocalizations {
|
||||
String get appSettings_regionOnHopsLineSubtitle =>
|
||||
'将频道消息的地区与跳数显示在同一行,而不是在其下方。';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicator => 'Compression indicator';
|
||||
|
||||
@override
|
||||
String get appSettings_showCompressionIndicatorSubtitle =>
|
||||
'Show an icon on messages compressed with SMAZ.';
|
||||
|
||||
@override
|
||||
String get appSettings_notifications => '通知';
|
||||
|
||||
@@ -2594,7 +2599,9 @@ class AppLocalizationsZh extends AppLocalizations {
|
||||
String get pathEditor_hexLabel => '十六进制前缀';
|
||||
|
||||
@override
|
||||
String get pathEditor_hexHelper => '每跳使用两个十六进制字符,用逗号分隔。';
|
||||
String pathEditor_hexHelper(int count) {
|
||||
return '每跳使用$count个十六进制字符,用逗号分隔。';
|
||||
}
|
||||
|
||||
@override
|
||||
String pathEditor_invalidTokens(String tokens) {
|
||||
@@ -7126,6 +7133,37 @@ class AppLocalizationsZh extends AppLocalizations {
|
||||
@override
|
||||
String get chat_composerOffline => '连接到无线电后才能发送消息';
|
||||
|
||||
@override
|
||||
String get modelDownload_notDownloaded => '未下载';
|
||||
|
||||
@override
|
||||
String get modelDownload_downloading => '正在下载';
|
||||
|
||||
@override
|
||||
String get modelDownload_active => '当前使用';
|
||||
|
||||
@override
|
||||
String get modelDownload_failed => '下载失败';
|
||||
|
||||
@override
|
||||
String get modelDownload_incomplete => '不完整';
|
||||
|
||||
@override
|
||||
String get modelDownload_verifying => '正在校验下载';
|
||||
|
||||
@override
|
||||
String get modelDownload_useModel => '使用此模型';
|
||||
|
||||
@override
|
||||
String modelDownload_removeFailed(String error) {
|
||||
return '无法移除模型:$error';
|
||||
}
|
||||
|
||||
@override
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@@ -7172,4 +7210,7 @@ class AppLocalizationsZh extends AppLocalizations {
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
|
||||
@override
|
||||
String get messageMeta_smazCompressed => 'SMAZ compressed';
|
||||
}
|
||||
+12
-3
@@ -2682,7 +2682,7 @@
|
||||
"pathEditor_searchRepeaters": "Repeaters zoeken",
|
||||
"pathEditor_advancedHex": "Geavanceerd: ruwe hex-pad",
|
||||
"pathEditor_hexLabel": "Hex-prefixen",
|
||||
"pathEditor_hexHelper": "Twee hex-tekens per hop, gescheiden door komma's",
|
||||
"pathEditor_hexHelper": "{count} hex-tekens per hop, gescheiden door komma's",
|
||||
"pathEditor_invalidTokens": "Ongeldig: {tokens}",
|
||||
"pathEditor_tooManyHops": "Maximaal 64 hops",
|
||||
"pathEditor_usePath": "Dit pad gebruiken",
|
||||
@@ -3657,7 +3657,7 @@
|
||||
"backupRestore_backupComplete": "Back-upbestand gemaakt.",
|
||||
"backupRestore_restoreComplete": "Herstel voltooid. Verbind opnieuw als je de radio-identiteit hebt hersteld.",
|
||||
"backupRestore_missingModelsTitle": "Modellen niet gedownload",
|
||||
"backupRestore_missingModelsMessage": "De herstelde instellingen selecteren modellen die op dit apparaat niet beschikbaar zijn:\n{models}\n\nNu downloaden?",
|
||||
"backupRestore_missingModelsMessage": "De herstelde instellingen selecteren modellen die op dit apparaat niet beschikbaar zijn. Nu downloaden?",
|
||||
"backupRestore_downloadModels": "Modellen downloaden",
|
||||
"backupRestore_downloading": "Downloaden…",
|
||||
"backupRestore_cancelDownload": "Download annuleren",
|
||||
@@ -3694,5 +3694,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Repeater- en roominstellingen gereset",
|
||||
"repeater_clockSyncDefault": "Standaard",
|
||||
"repeater_clockSyncOn": "Aan",
|
||||
"repeater_clockSyncOff": "Uit"
|
||||
"repeater_clockSyncOff": "Uit",
|
||||
"modelDownload_notDownloaded": "Niet gedownload",
|
||||
"modelDownload_downloading": "Downloaden",
|
||||
"modelDownload_active": "Actief",
|
||||
"modelDownload_failed": "Downloaden mislukt",
|
||||
"modelDownload_incomplete": "Onvolledig",
|
||||
"modelDownload_verifying": "Download controleren",
|
||||
"modelDownload_useModel": "Dit model gebruiken",
|
||||
"modelDownload_removeFailed": "Het model kon niet worden verwijderd: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -2658,7 +2658,7 @@
|
||||
"pathEditor_searchRepeaters": "Funkcje powtarzania",
|
||||
"pathEditor_advancedHex": "Zaawansowane: ścieżka w formacie szesnastkowym",
|
||||
"pathEditor_hexLabel": "Prefiksy heksadecymalne",
|
||||
"pathEditor_hexHelper": "Dwa znaki szesnastkowe na każdym kroku, oddzielone przecinkami",
|
||||
"pathEditor_hexHelper": "{count} znaki szesnastkowe na każdym kroku, oddzielone przecinkami",
|
||||
"pathEditor_invalidTokens": "Nieprawidłowe: {tokens}",
|
||||
"pathEditor_tooManyHops": "Maksymalnie 64 hopów",
|
||||
"pathEditor_usePath": "Użyj tej ścieżki.",
|
||||
@@ -3995,7 +3995,7 @@
|
||||
"backupRestore_backupComplete": "Plik kopii zapasowej został utworzony.",
|
||||
"backupRestore_restoreComplete": "Przywracanie zakończone. Połącz się ponownie, jeśli przywrócono tożsamość radia.",
|
||||
"backupRestore_missingModelsTitle": "Modele nie zostały pobrane",
|
||||
"backupRestore_missingModelsMessage": "Przywrócone ustawienia wybierają modele, które nie są dostępne na tym urządzeniu:\n{models}\n\nPobrać je teraz?",
|
||||
"backupRestore_missingModelsMessage": "Przywrócone ustawienia wybierają modele, które nie są dostępne na tym urządzeniu. Pobrać je teraz?",
|
||||
"backupRestore_downloadModels": "Pobierz modele",
|
||||
"backupRestore_downloading": "Pobieranie…",
|
||||
"backupRestore_cancelDownload": "Anuluj pobieranie",
|
||||
@@ -4032,5 +4032,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Ustawienia przemienników i pokoi zresetowane",
|
||||
"repeater_clockSyncDefault": "Domyślnie",
|
||||
"repeater_clockSyncOn": "Wł.",
|
||||
"repeater_clockSyncOff": "Wył."
|
||||
"repeater_clockSyncOff": "Wył.",
|
||||
"modelDownload_notDownloaded": "Nie pobrano",
|
||||
"modelDownload_downloading": "Pobieranie",
|
||||
"modelDownload_active": "Aktywny",
|
||||
"modelDownload_failed": "Nie udało się pobrać",
|
||||
"modelDownload_incomplete": "Niekompletny",
|
||||
"modelDownload_verifying": "Sprawdzanie pobierania",
|
||||
"modelDownload_useModel": "Użyj tego modelu",
|
||||
"modelDownload_removeFailed": "Nie udało się usunąć modelu: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -2540,7 +2540,7 @@
|
||||
"pathEditor_searchRepeaters": "Encontrar repetidores",
|
||||
"pathEditor_advancedHex": "Avançado: caminho hexadecimal bruto",
|
||||
"pathEditor_hexLabel": "Prefixos hexadecimais",
|
||||
"pathEditor_hexHelper": "Dois caracteres hexadecimais por salto, separados por vírgulas.",
|
||||
"pathEditor_hexHelper": "{count} caracteres hexadecimais por salto, separados por vírgulas.",
|
||||
"pathEditor_invalidTokens": "Inválido: {tokens}",
|
||||
"routing_lastWorked": "funcionou {when}",
|
||||
"pathEditor_tooManyHops": "Máximo de 64 saltos",
|
||||
@@ -3808,7 +3808,7 @@
|
||||
"backupRestore_backupComplete": "Arquivo de backup criado.",
|
||||
"backupRestore_restoreComplete": "Restauração concluída. Reconecte se você restaurou a identidade do rádio.",
|
||||
"backupRestore_missingModelsTitle": "Modelos não baixados",
|
||||
"backupRestore_missingModelsMessage": "As configurações restauradas selecionam modelos que não estão disponíveis neste dispositivo:\n{models}\n\nBaixar agora?",
|
||||
"backupRestore_missingModelsMessage": "As configurações restauradas selecionam modelos que não estão disponíveis neste dispositivo. Baixar agora?",
|
||||
"backupRestore_downloadModels": "Baixar modelos",
|
||||
"backupRestore_downloading": "Baixando…",
|
||||
"backupRestore_cancelDownload": "Cancelar download",
|
||||
@@ -3845,5 +3845,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Configurações de repetidores e salas redefinidas",
|
||||
"repeater_clockSyncDefault": "Padrão",
|
||||
"repeater_clockSyncOn": "Ligado",
|
||||
"repeater_clockSyncOff": "Desligado"
|
||||
"repeater_clockSyncOff": "Desligado",
|
||||
"modelDownload_notDownloaded": "Não baixado",
|
||||
"modelDownload_downloading": "Baixando",
|
||||
"modelDownload_active": "Ativo",
|
||||
"modelDownload_failed": "Não foi possível baixar",
|
||||
"modelDownload_incomplete": "Incompleto",
|
||||
"modelDownload_verifying": "Verificando o download",
|
||||
"modelDownload_useModel": "Usar este modelo",
|
||||
"modelDownload_removeFailed": "Não foi possível remover o modelo: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -160,7 +160,7 @@
|
||||
"backupRestore_backupComplete": "Ficheiro de cópia criado.",
|
||||
"backupRestore_restoreComplete": "Restauro concluído. Volte a ligar se restaurou a identidade do rádio.",
|
||||
"backupRestore_missingModelsTitle": "Modelos não transferidos",
|
||||
"backupRestore_missingModelsMessage": "As definições restauradas selecionam modelos que não estão disponíveis neste dispositivo:\n{models}\n\nTransferi-los agora?",
|
||||
"backupRestore_missingModelsMessage": "As definições restauradas selecionam modelos que não estão disponíveis neste dispositivo. Transferi-los agora?",
|
||||
"backupRestore_downloadModels": "Transferir modelos",
|
||||
"backupRestore_downloading": "A transferir…",
|
||||
"backupRestore_cancelDownload": "Cancelar transferência",
|
||||
@@ -758,7 +758,7 @@
|
||||
"pathEditor_searchRepeaters": "Pesquisar repetidores",
|
||||
"pathEditor_advancedHex": "Avançado: caminho hex em bruto",
|
||||
"pathEditor_hexLabel": "Prefixos hex",
|
||||
"pathEditor_hexHelper": "Dois caracteres hex por hop, separados por vírgulas",
|
||||
"pathEditor_hexHelper": "{count} caracteres hex por hop, separados por vírgulas",
|
||||
"pathEditor_invalidTokens": "Inválido: {tokens}",
|
||||
"pathEditor_tooManyHops": "Máximo de 64 hops",
|
||||
"pathEditor_usePath": "Usar este caminho",
|
||||
@@ -2072,5 +2072,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Definições de repetidores e salas repostas",
|
||||
"repeater_clockSyncDefault": "Predefinição",
|
||||
"repeater_clockSyncOn": "Ligado",
|
||||
"repeater_clockSyncOff": "Desligado"
|
||||
"repeater_clockSyncOff": "Desligado",
|
||||
"modelDownload_notDownloaded": "Não transferido",
|
||||
"modelDownload_downloading": "A transferir",
|
||||
"modelDownload_active": "Ativo",
|
||||
"modelDownload_failed": "Não foi possível transferir",
|
||||
"modelDownload_incomplete": "Incompleto",
|
||||
"modelDownload_verifying": "A verificar a transferência",
|
||||
"modelDownload_useModel": "Utilizar este modelo",
|
||||
"modelDownload_removeFailed": "Não foi possível remover o modelo: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -1922,7 +1922,7 @@
|
||||
"pathEditor_searchRepeaters": "Поиск повторителей",
|
||||
"pathEditor_advancedHex": "Продвинутый уровень: прямой путь в шестнадцатеричном формате",
|
||||
"pathEditor_hexLabel": "Префиксы шестнадцатеричной системы",
|
||||
"pathEditor_hexHelper": "Два шестнадцатеричных символа на каждом шаге, разделенные запятыми.",
|
||||
"pathEditor_hexHelper": "{count} шестнадцатеричных символа на каждом шаге, разделенные запятыми.",
|
||||
"pathEditor_invalidTokens": "Неверно: {tokens}",
|
||||
"routing_lastWorked": "работал {when}",
|
||||
"routing_deliveryCounts": "{successes} доставлено, {failures} не доставлено",
|
||||
@@ -3053,7 +3053,7 @@
|
||||
"backupRestore_backupComplete": "Файл резервной копии создан.",
|
||||
"backupRestore_restoreComplete": "Восстановление завершено. Переподключитесь, если вы восстановили идентификатор радио.",
|
||||
"backupRestore_missingModelsTitle": "Модели не загружены",
|
||||
"backupRestore_missingModelsMessage": "Восстановленные настройки выбирают модели, которых нет на этом устройстве:\n{models}\n\nЗагрузить их сейчас?",
|
||||
"backupRestore_missingModelsMessage": "Восстановленные настройки выбирают модели, которых нет на этом устройстве. Загрузить их сейчас?",
|
||||
"backupRestore_downloadModels": "Загрузить модели",
|
||||
"backupRestore_downloading": "Загрузка…",
|
||||
"backupRestore_cancelDownload": "Отменить загрузку",
|
||||
@@ -3090,5 +3090,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Настройки ретрансляторов и комнат сброшены",
|
||||
"repeater_clockSyncDefault": "По умолчанию",
|
||||
"repeater_clockSyncOn": "Вкл.",
|
||||
"repeater_clockSyncOff": "Выкл."
|
||||
"repeater_clockSyncOff": "Выкл.",
|
||||
"modelDownload_notDownloaded": "Не скачано",
|
||||
"modelDownload_downloading": "Загрузка",
|
||||
"modelDownload_active": "Активна",
|
||||
"modelDownload_failed": "Не удалось скачать",
|
||||
"modelDownload_incomplete": "Неполная",
|
||||
"modelDownload_verifying": "Проверка загрузки",
|
||||
"modelDownload_useModel": "Использовать эту модель",
|
||||
"modelDownload_removeFailed": "Не удалось удалить модель: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -2625,7 +2625,7 @@
|
||||
"pathEditor_searchRepeaters": "Hľadať opakované",
|
||||
"pathEditor_advancedHex": "Pokročilé: pôvodná hexová cesta",
|
||||
"pathEditor_hexLabel": "Prefiksy pre hexadecimálne čísla",
|
||||
"pathEditor_hexHelper": "Dve hexové čísla na každý krok, oddelené čiarkami",
|
||||
"pathEditor_hexHelper": "{count} hexové čísla na každý krok, oddelené čiarkami",
|
||||
"routing_lastWorked": "fungovala {when}",
|
||||
"pathEditor_invalidTokens": "Neplatné: {tokens}",
|
||||
"routing_deliveryCounts": "{successes} doručených, {failures} neúspešných",
|
||||
@@ -3809,7 +3809,7 @@
|
||||
"backupRestore_backupComplete": "Súbor zálohy bol vytvorený.",
|
||||
"backupRestore_restoreComplete": "Obnovenie dokončené. Ak ste obnovili identitu rádia, pripojte sa znova.",
|
||||
"backupRestore_missingModelsTitle": "Modely nie sú stiahnuté",
|
||||
"backupRestore_missingModelsMessage": "Obnovené nastavenia vyberajú modely, ktoré nie sú v tomto zariadení k dispozícii:\n{models}\n\nStiahnuť ich teraz?",
|
||||
"backupRestore_missingModelsMessage": "Obnovené nastavenia vyberajú modely, ktoré nie sú v tomto zariadení k dispozícii. Stiahnuť ich teraz?",
|
||||
"backupRestore_downloadModels": "Stiahnuť modely",
|
||||
"backupRestore_downloading": "Sťahovanie…",
|
||||
"backupRestore_cancelDownload": "Zrušiť sťahovanie",
|
||||
@@ -3846,5 +3846,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Nastavenia opakovačov a miestností obnovené",
|
||||
"repeater_clockSyncDefault": "Predvolené",
|
||||
"repeater_clockSyncOn": "Zapnuté",
|
||||
"repeater_clockSyncOff": "Vypnuté"
|
||||
"repeater_clockSyncOff": "Vypnuté",
|
||||
"modelDownload_notDownloaded": "Nestiahnuté",
|
||||
"modelDownload_downloading": "Sťahovanie",
|
||||
"modelDownload_active": "Aktívny",
|
||||
"modelDownload_failed": "Sťahovanie zlyhalo",
|
||||
"modelDownload_incomplete": "Nekompletné",
|
||||
"modelDownload_verifying": "Overuje sa sťahovanie",
|
||||
"modelDownload_useModel": "Použiť tento model",
|
||||
"modelDownload_removeFailed": "Model sa nepodarilo odstrániť: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -2534,7 +2534,7 @@
|
||||
"pathEditor_searchRepeaters": "Iskanje ponovitev",
|
||||
"pathEditor_advancedHex": "Napredno: surovi šestnajstni pot",
|
||||
"pathEditor_hexLabel": "Predfiks za heksadecimalno šifro",
|
||||
"pathEditor_hexHelper": "Dva šestbitna znaka na vsak skok, ločena z vejico",
|
||||
"pathEditor_hexHelper": "{count} šestnajstiških znakov na vsak skok, ločenih z vejico",
|
||||
"pathEditor_invalidTokens": "Neveljaven: {tokens}",
|
||||
"pathEditor_tooManyHops": "Največ 64 hopov",
|
||||
"pathEditor_usePath": "Uporabite to poto",
|
||||
@@ -3963,7 +3963,7 @@
|
||||
"backupRestore_backupComplete": "Datoteka varnostne kopije je ustvarjena.",
|
||||
"backupRestore_restoreComplete": "Obnovitev je končana. Če ste obnovili identiteto radia, se znova povežite.",
|
||||
"backupRestore_missingModelsTitle": "Modeli niso preneseni",
|
||||
"backupRestore_missingModelsMessage": "Obnovljene nastavitve izbirajo modele, ki niso na voljo v tej napravi:\n{models}\n\nJih želite prenesti zdaj?",
|
||||
"backupRestore_missingModelsMessage": "Obnovljene nastavitve izbirajo modele, ki niso na voljo v tej napravi. Jih želite prenesti zdaj?",
|
||||
"backupRestore_downloadModels": "Prenesi modele",
|
||||
"backupRestore_downloading": "Prenašanje…",
|
||||
"backupRestore_cancelDownload": "Prekliči prenos",
|
||||
@@ -4000,5 +4000,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Nastavitve repetitorjev in sob so ponastavljene",
|
||||
"repeater_clockSyncDefault": "Privzeto",
|
||||
"repeater_clockSyncOn": "Vklop",
|
||||
"repeater_clockSyncOff": "Izklop"
|
||||
"repeater_clockSyncOff": "Izklop",
|
||||
"modelDownload_notDownloaded": "Ni preneseno",
|
||||
"modelDownload_downloading": "Prenašanje",
|
||||
"modelDownload_active": "Aktiven",
|
||||
"modelDownload_failed": "Prenos ni uspel",
|
||||
"modelDownload_incomplete": "Nepopolno",
|
||||
"modelDownload_verifying": "Preverjanje prenosa",
|
||||
"modelDownload_useModel": "Uporabi ta model",
|
||||
"modelDownload_removeFailed": "Modela ni bilo mogoče odstraniti: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -2529,7 +2529,7 @@
|
||||
"pathEditor_searchRepeaters": "Sök repeaters",
|
||||
"pathEditor_advancedHex": "Avancerat: rå rutt i hexformat",
|
||||
"pathEditor_hexLabel": "Hex-prefikser",
|
||||
"pathEditor_hexHelper": "Två hextecken per hopp, separerade med kommatecken",
|
||||
"pathEditor_hexHelper": "{count} hextecken per hopp, separerade med kommatecken",
|
||||
"pathEditor_invalidTokens": "Ogiltigt: {tokens}",
|
||||
"pathEditor_tooManyHops": "Maximalt 64 hopp",
|
||||
"pathEditor_usePath": "Använd den här rutten",
|
||||
@@ -3803,7 +3803,7 @@
|
||||
"backupRestore_backupComplete": "Säkerhetskopia skapad.",
|
||||
"backupRestore_restoreComplete": "Återställningen är klar. Återanslut om du återställde radions identitet.",
|
||||
"backupRestore_missingModelsTitle": "Modeller inte nedladdade",
|
||||
"backupRestore_missingModelsMessage": "De återställda inställningarna väljer modeller som inte finns på den här enheten:\n{models}\n\nLadda ned dem nu?",
|
||||
"backupRestore_missingModelsMessage": "De återställda inställningarna väljer modeller som inte finns på den här enheten. Ladda ned dem nu?",
|
||||
"backupRestore_downloadModels": "Ladda ned modeller",
|
||||
"backupRestore_downloading": "Laddar ned…",
|
||||
"backupRestore_cancelDownload": "Avbryt nedladdning",
|
||||
@@ -3840,5 +3840,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Repeater- och ruminställningar återställda",
|
||||
"repeater_clockSyncDefault": "Standard",
|
||||
"repeater_clockSyncOn": "På",
|
||||
"repeater_clockSyncOff": "Av"
|
||||
"repeater_clockSyncOff": "Av",
|
||||
"modelDownload_notDownloaded": "Inte nedladdad",
|
||||
"modelDownload_downloading": "Laddar ner",
|
||||
"modelDownload_active": "Aktiv",
|
||||
"modelDownload_failed": "Kunde inte ladda ner",
|
||||
"modelDownload_incomplete": "Ofullständig",
|
||||
"modelDownload_verifying": "Verifierar nedladdningen",
|
||||
"modelDownload_useModel": "Använd den här modellen",
|
||||
"modelDownload_removeFailed": "Det gick inte att ta bort modellen: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -2598,7 +2598,7 @@
|
||||
"pathEditor_searchRepeaters": "Пошук повторювачів",
|
||||
"pathEditor_advancedHex": "Просунутий рівень: пряма шлях у форматі шестнадцяткової системи.",
|
||||
"pathEditor_hexLabel": "Префікси для шестнадцяткової системи числення",
|
||||
"pathEditor_hexHelper": "Два шестизначні символи на кожний крок, розділені комами",
|
||||
"pathEditor_hexHelper": "{count} шістнадцяткові символи на кожний крок, розділені комами",
|
||||
"pathEditor_invalidTokens": "Неправильно: {tokens}",
|
||||
"routing_lastWorked": "працював {when}",
|
||||
"routing_deliveryCounts": "{successes} доставлено, {failures} не доставлено",
|
||||
@@ -3736,7 +3736,7 @@
|
||||
"backupRestore_backupComplete": "Файл резервної копії створено.",
|
||||
"backupRestore_restoreComplete": "Відновлення завершено. Перепідключіться, якщо ви відновили ідентифікатор радіо.",
|
||||
"backupRestore_missingModelsTitle": "Моделі не завантажено",
|
||||
"backupRestore_missingModelsMessage": "Відновлені налаштування вибирають моделі, яких немає на цьому пристрої:\n{models}\n\nЗавантажити їх зараз?",
|
||||
"backupRestore_missingModelsMessage": "Відновлені налаштування вибирають моделі, яких немає на цьому пристрої. Завантажити їх зараз?",
|
||||
"backupRestore_downloadModels": "Завантажити моделі",
|
||||
"backupRestore_downloading": "Завантаження…",
|
||||
"backupRestore_cancelDownload": "Скасувати завантаження",
|
||||
@@ -3773,5 +3773,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "Налаштування ретрансляторів і кімнат скинуто",
|
||||
"repeater_clockSyncDefault": "Типово",
|
||||
"repeater_clockSyncOn": "Увімк.",
|
||||
"repeater_clockSyncOff": "Вимк."
|
||||
"repeater_clockSyncOff": "Вимк.",
|
||||
"modelDownload_notDownloaded": "Не завантажено",
|
||||
"modelDownload_downloading": "Завантаження",
|
||||
"modelDownload_active": "Активна",
|
||||
"modelDownload_failed": "Не вдалося завантажити",
|
||||
"modelDownload_incomplete": "Неповна",
|
||||
"modelDownload_verifying": "Перевірка завантаження",
|
||||
"modelDownload_useModel": "Використовувати цю модель",
|
||||
"modelDownload_removeFailed": "Не вдалося видалити модель: {error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
+12
-3
@@ -2538,7 +2538,7 @@
|
||||
"pathEditor_searchRepeaters": "重复搜索",
|
||||
"pathEditor_advancedHex": "高级:原始十六进制路径",
|
||||
"pathEditor_hexLabel": "十六进制前缀",
|
||||
"pathEditor_hexHelper": "每跳使用两个十六进制字符,用逗号分隔。",
|
||||
"pathEditor_hexHelper": "每跳使用{count}个十六进制字符,用逗号分隔。",
|
||||
"pathEditor_invalidTokens": "无效:{tokens}",
|
||||
"pathEditor_tooManyHops": "最多 64 跳",
|
||||
"pathEditor_usePath": "请使用此路径",
|
||||
@@ -3813,7 +3813,7 @@
|
||||
"backupRestore_backupComplete": "备份文件已创建。",
|
||||
"backupRestore_restoreComplete": "恢复完成。如果恢复了无线电身份,请重新连接。",
|
||||
"backupRestore_missingModelsTitle": "模型未下载",
|
||||
"backupRestore_missingModelsMessage": "恢复的设置所选用的模型在此设备上不可用:\n{models}\n\n现在下载吗?",
|
||||
"backupRestore_missingModelsMessage": "恢复的设置所选用的模型在此设备上不可用。现在下载吗?",
|
||||
"backupRestore_downloadModels": "下载模型",
|
||||
"backupRestore_downloading": "正在下载…",
|
||||
"backupRestore_cancelDownload": "取消下载",
|
||||
@@ -3850,5 +3850,14 @@
|
||||
"appSettings_repeaterRoomSettingsReset": "中继和房间设置已重置",
|
||||
"repeater_clockSyncDefault": "默认",
|
||||
"repeater_clockSyncOn": "开",
|
||||
"repeater_clockSyncOff": "关"
|
||||
"repeater_clockSyncOff": "关",
|
||||
"modelDownload_notDownloaded": "未下载",
|
||||
"modelDownload_downloading": "正在下载",
|
||||
"modelDownload_active": "当前使用",
|
||||
"modelDownload_failed": "下载失败",
|
||||
"modelDownload_incomplete": "不完整",
|
||||
"modelDownload_verifying": "正在校验下载",
|
||||
"modelDownload_useModel": "使用此模型",
|
||||
"modelDownload_removeFailed": "无法移除模型:{error}",
|
||||
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
|
||||
}
|
||||
@@ -123,6 +123,7 @@ class AppSettings {
|
||||
final bool mapClusterNodes;
|
||||
final bool enableMessageTracing;
|
||||
final bool regionOnHopsLine;
|
||||
final bool showCompressionIndicator;
|
||||
final Map<String, double>? mapCacheBounds;
|
||||
final int mapCacheMinZoom;
|
||||
final int mapCacheMaxZoom;
|
||||
@@ -299,6 +300,7 @@ class AppSettings {
|
||||
this.mapClusterNodes = true,
|
||||
this.enableMessageTracing = false,
|
||||
this.regionOnHopsLine = false,
|
||||
this.showCompressionIndicator = false,
|
||||
this.mapCacheBounds,
|
||||
this.mapCacheMinZoom = 10,
|
||||
this.mapCacheMaxZoom = 15,
|
||||
@@ -400,6 +402,7 @@ class AppSettings {
|
||||
'map_cluster_nodes': mapClusterNodes,
|
||||
'enable_message_tracing': enableMessageTracing,
|
||||
'region_on_hops_line': regionOnHopsLine,
|
||||
'show_compression_indicator': showCompressionIndicator,
|
||||
'map_cache_bounds': mapCacheBounds,
|
||||
'map_cache_min_zoom': mapCacheMinZoom,
|
||||
'map_cache_max_zoom': mapCacheMaxZoom,
|
||||
@@ -541,6 +544,8 @@ class AppSettings {
|
||||
mapClusterNodes: json['map_cluster_nodes'] as bool? ?? true,
|
||||
enableMessageTracing: json['enable_message_tracing'] as bool? ?? false,
|
||||
regionOnHopsLine: json['region_on_hops_line'] as bool? ?? false,
|
||||
showCompressionIndicator:
|
||||
json['show_compression_indicator'] as bool? ?? false,
|
||||
mapCacheBounds: (json['map_cache_bounds'] as Map?)?.map(
|
||||
(key, value) => MapEntry(key.toString(), (value as num).toDouble()),
|
||||
),
|
||||
@@ -720,6 +725,7 @@ class AppSettings {
|
||||
bool? mapClusterNodes,
|
||||
bool? enableMessageTracing,
|
||||
bool? regionOnHopsLine,
|
||||
bool? showCompressionIndicator,
|
||||
Object? mapCacheBounds = _unset,
|
||||
int? mapCacheMinZoom,
|
||||
int? mapCacheMaxZoom,
|
||||
@@ -807,6 +813,8 @@ class AppSettings {
|
||||
mapClusterNodes: mapClusterNodes ?? this.mapClusterNodes,
|
||||
enableMessageTracing: enableMessageTracing ?? this.enableMessageTracing,
|
||||
regionOnHopsLine: regionOnHopsLine ?? this.regionOnHopsLine,
|
||||
showCompressionIndicator:
|
||||
showCompressionIndicator ?? this.showCompressionIndicator,
|
||||
mapCacheBounds: mapCacheBounds == _unset
|
||||
? this.mapCacheBounds
|
||||
: mapCacheBounds as Map<String, double>?,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import '../connector/meshcore_protocol.dart';
|
||||
import '../helpers/reaction_helper.dart';
|
||||
import '../helpers/smaz.dart';
|
||||
@@ -44,6 +45,7 @@ class ChannelMessage {
|
||||
final DateTime receivedAt;
|
||||
final bool isOutgoing;
|
||||
final bool isBookmarked;
|
||||
final bool isSmazCompressed;
|
||||
final ChannelMessageStatus status;
|
||||
final List<Repeat> repeats;
|
||||
final int repeatCount;
|
||||
@@ -79,6 +81,7 @@ class ChannelMessage {
|
||||
DateTime? receivedAt,
|
||||
required this.isOutgoing,
|
||||
this.isBookmarked = false,
|
||||
this.isSmazCompressed = false,
|
||||
this.status = ChannelMessageStatus.pending,
|
||||
this.repeats = const [],
|
||||
this.repeatCount = 0,
|
||||
@@ -120,6 +123,7 @@ class ChannelMessage {
|
||||
ChannelMessage copyWith({
|
||||
ChannelMessageStatus? status,
|
||||
bool? isBookmarked,
|
||||
bool? isSmazCompressed,
|
||||
List<Repeat>? repeats,
|
||||
int? repeatCount,
|
||||
int? pathLength,
|
||||
@@ -163,6 +167,7 @@ class ChannelMessage {
|
||||
receivedAt: receivedAt,
|
||||
isOutgoing: isOutgoing,
|
||||
isBookmarked: isBookmarked ?? this.isBookmarked,
|
||||
isSmazCompressed: isSmazCompressed ?? this.isSmazCompressed,
|
||||
status: status ?? this.status,
|
||||
repeats: repeats ?? this.repeats,
|
||||
repeatCount: repeatCount ?? this.repeatCount,
|
||||
@@ -252,7 +257,8 @@ class ChannelMessage {
|
||||
}
|
||||
}
|
||||
|
||||
final decodedText = Smaz.tryDecodePrefixed(actualText) ?? actualText;
|
||||
final smazDecoded = Smaz.tryDecodePrefixed(actualText);
|
||||
final decodedText = smazDecoded ?? actualText;
|
||||
|
||||
return ChannelMessage(
|
||||
senderKey: null,
|
||||
@@ -261,6 +267,7 @@ class ChannelMessage {
|
||||
timestamp: DateTime.fromMillisecondsSinceEpoch(timestampRaw * 1000),
|
||||
receivedAt: DateTime.now(),
|
||||
isOutgoing: false,
|
||||
isSmazCompressed: smazDecoded != null,
|
||||
status: ChannelMessageStatus.sent,
|
||||
pathLength: pathLen,
|
||||
pathHashWidth: packetPathHashWidth,
|
||||
@@ -283,6 +290,7 @@ class ChannelMessage {
|
||||
String? translationModelId,
|
||||
String? region,
|
||||
ChannelMessage? replyTo,
|
||||
bool isSmazCompressed = false,
|
||||
}) {
|
||||
return ChannelMessage(
|
||||
senderKey: null,
|
||||
@@ -296,6 +304,7 @@ class ChannelMessage {
|
||||
replyToText: replyTo?.text,
|
||||
timestamp: DateTime.now(),
|
||||
isOutgoing: true,
|
||||
isSmazCompressed: isSmazCompressed,
|
||||
status: ChannelMessageStatus.pending,
|
||||
pathLength: null,
|
||||
pathBytes: Uint8List(0),
|
||||
|
||||
+12
-1
@@ -1,6 +1,8 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import '../connector/meshcore_protocol.dart';
|
||||
import '../helpers/reaction_helper.dart';
|
||||
import '../helpers/smaz.dart';
|
||||
import 'translation_support.dart';
|
||||
|
||||
enum MessageStatus { pending, sent, delivered, failed }
|
||||
@@ -36,6 +38,7 @@ class Message {
|
||||
final bool isOutgoing;
|
||||
final bool isBookmarked;
|
||||
final bool isCli;
|
||||
final bool isSmazCompressed;
|
||||
final MessageStatus status;
|
||||
final String? originalText;
|
||||
final String? translatedText;
|
||||
@@ -65,6 +68,7 @@ class Message {
|
||||
required this.isOutgoing,
|
||||
this.isBookmarked = false,
|
||||
this.isCli = false,
|
||||
this.isSmazCompressed = false,
|
||||
this.status = MessageStatus.pending,
|
||||
String? messageId,
|
||||
this.originalText,
|
||||
@@ -110,6 +114,7 @@ class Message {
|
||||
int? pathLength,
|
||||
Uint8List? pathBytes,
|
||||
bool? isCli,
|
||||
bool? isSmazCompressed,
|
||||
bool? isBookmarked,
|
||||
Object? originalText = _unset,
|
||||
Object? translatedText = _unset,
|
||||
@@ -128,6 +133,7 @@ class Message {
|
||||
isOutgoing: isOutgoing,
|
||||
isBookmarked: isBookmarked ?? this.isBookmarked,
|
||||
isCli: isCli ?? this.isCli,
|
||||
isSmazCompressed: isSmazCompressed ?? this.isSmazCompressed,
|
||||
status: status ?? this.status,
|
||||
messageId: messageId,
|
||||
originalText: originalText == _unset
|
||||
@@ -173,7 +179,9 @@ class Message {
|
||||
if ((flags >> 2) != txtTypePlain) {
|
||||
return null;
|
||||
}
|
||||
final text = reader.readCString();
|
||||
final rawText = reader.readCString();
|
||||
final smazDecoded = Smaz.tryDecodePrefixed(rawText);
|
||||
final text = smazDecoded ?? rawText;
|
||||
|
||||
return Message(
|
||||
senderKey: senderKey,
|
||||
@@ -182,6 +190,7 @@ class Message {
|
||||
receivedAt: DateTime.now(),
|
||||
isOutgoing: false,
|
||||
isCli: false,
|
||||
isSmazCompressed: smazDecoded != null,
|
||||
status: MessageStatus.delivered,
|
||||
pathBytes: Uint8List(0),
|
||||
);
|
||||
@@ -198,6 +207,7 @@ class Message {
|
||||
String? translationModelId,
|
||||
int? pathLength,
|
||||
Uint8List? pathBytes,
|
||||
bool isSmazCompressed = false,
|
||||
}) {
|
||||
return Message(
|
||||
senderKey: recipientKey,
|
||||
@@ -208,6 +218,7 @@ class Message {
|
||||
timestamp: DateTime.now(),
|
||||
isOutgoing: true,
|
||||
isCli: false,
|
||||
isSmazCompressed: isSmazCompressed,
|
||||
status: MessageStatus.pending,
|
||||
pathLength: pathLength,
|
||||
pathBytes: pathBytes,
|
||||
|
||||
@@ -5,15 +5,14 @@ import 'package:provider/provider.dart';
|
||||
import '../connector/meshcore_connector.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../models/app_settings.dart';
|
||||
import '../models/image_codec_support.dart';
|
||||
import '../services/app_settings_service.dart';
|
||||
import '../services/background_service.dart';
|
||||
import '../services/image_codec_service.dart';
|
||||
import '../services/map_tile_cache_service.dart';
|
||||
import '../services/notification_service.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import '../utils/platform_info.dart';
|
||||
import '../widgets/adaptive_app_bar_title.dart';
|
||||
import '../widgets/image_codec_models_section.dart';
|
||||
import '../widgets/cyr2lat_profile_dialog.dart';
|
||||
import '../widgets/language_picker_sheet.dart';
|
||||
import '../widgets/mesh_nav_tile.dart';
|
||||
@@ -460,6 +459,20 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
value: settingsService.settings.regionOnHopsLine,
|
||||
onChanged: settingsService.setRegionOnHopsLine,
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
SwitchListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 4,
|
||||
),
|
||||
secondary: const Icon(Icons.compress, size: 24),
|
||||
title: Text(context.l10n.appSettings_showCompressionIndicator),
|
||||
subtitle: Text(
|
||||
context.l10n.appSettings_showCompressionIndicatorSubtitle,
|
||||
),
|
||||
value: settingsService.settings.showCompressionIndicator,
|
||||
onChanged: settingsService.setShowCompressionIndicator,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -769,7 +782,10 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
onChanged: (value) =>
|
||||
settingsService.setImageProcessAutomatically(value),
|
||||
),
|
||||
_buildImageCodecModels(context),
|
||||
if (_imageCodecService(context) != null) ...[
|
||||
const Divider(height: 1, indent: 16),
|
||||
const ImageCodecModelsSection(),
|
||||
],
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -795,167 +811,6 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
/// Model registry for image messages: the download entry point, the
|
||||
/// downloaded weights, and — when the build simply cannot run the codec —
|
||||
/// [ImageCodecService.unavailableReason] instead of a dead download button.
|
||||
Widget _buildImageCodecModels(BuildContext context) {
|
||||
final ImageCodecService codec;
|
||||
try {
|
||||
codec = context.watch<ImageCodecService>();
|
||||
} on ProviderNotFoundException {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final textTheme = Theme.of(context).textTheme;
|
||||
final reason = codec.unavailableReason;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 4, 16, 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
context.l10n.imageMessages_modelSectionTitle,
|
||||
style: textTheme.titleSmall,
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
if (reason != null)
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: scheme.surfaceContainerLow,
|
||||
borderRadius: BorderRadius.circular(MeshRadii.md),
|
||||
border: Border.all(color: scheme.outlineVariant),
|
||||
),
|
||||
child: Text(
|
||||
reason,
|
||||
style: textTheme.bodyMedium?.copyWith(
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
for (final spec in imageCodecPresetModels)
|
||||
_buildImageCodecPreset(context, codec, spec),
|
||||
for (final model in codec.availableModels)
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
dense: true,
|
||||
leading: const Icon(Icons.check_circle_outline, size: 24),
|
||||
title: Text(model.name.isEmpty ? model.id : model.name),
|
||||
subtitle: Text(_formatModelBytes(context, model.fileSizeBytes)),
|
||||
trailing: IconButton(
|
||||
icon: const Icon(Icons.delete_outline, size: 24),
|
||||
tooltip: context.l10n.imageMessages_removeModel,
|
||||
onPressed: codec.isBusy || codec.isDownloading
|
||||
? null
|
||||
: () => codec.removeModel(model),
|
||||
),
|
||||
),
|
||||
if (codec.lastError != null) ...[
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
codec.lastError!,
|
||||
style: textTheme.bodyMedium?.copyWith(color: scheme.error),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildImageCodecPreset(
|
||||
BuildContext context,
|
||||
ImageCodecService codec,
|
||||
ImageCodecModelSpec spec,
|
||||
) {
|
||||
final textTheme = Theme.of(context).textTheme;
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final alreadyHave = spec.hasCompleteInstalledRecord(codec.availableModels);
|
||||
// downloadPresetModel throws StateError on a placeholder URL, deliberately,
|
||||
// so the button must not be offerable until the weights are published.
|
||||
final blocked = spec.urlsArePlaceholders;
|
||||
final busy = codec.isDownloading;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
dense: true,
|
||||
leading: const Icon(Icons.download_outlined, size: 24),
|
||||
title: Text(spec.label),
|
||||
subtitle: Text(
|
||||
blocked
|
||||
? context.l10n.imageMessages_modelNotPublished
|
||||
: _formatModelBytes(context, spec.totalSizeBytes),
|
||||
),
|
||||
trailing: alreadyHave
|
||||
? Text(
|
||||
context.l10n.imageMessages_modelReady,
|
||||
style: textTheme.labelMedium?.copyWith(
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
: busy
|
||||
? TextButton(
|
||||
onPressed: codec.cancelDownload,
|
||||
child: Text(context.l10n.imageMessages_cancelDownload),
|
||||
)
|
||||
: TextButton(
|
||||
onPressed: blocked
|
||||
? null
|
||||
: () => _downloadImageCodecModel(context, codec, spec),
|
||||
child: Text(context.l10n.imageMessages_downloadModel),
|
||||
),
|
||||
),
|
||||
if (busy)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
child: LinearProgressIndicator(value: codec.downloadProgress),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _downloadImageCodecModel(
|
||||
BuildContext context,
|
||||
ImageCodecService codec,
|
||||
ImageCodecModelSpec spec,
|
||||
) async {
|
||||
final messenger = ScaffoldMessenger.of(context);
|
||||
final l10n = context.l10n;
|
||||
try {
|
||||
await codec.downloadPresetModel(spec);
|
||||
} catch (error) {
|
||||
messenger.showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(l10n.imageMessages_downloadFailedWithError('$error')),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
String _formatModelBytes(BuildContext context, int bytes) {
|
||||
final l10n = context.l10n;
|
||||
if (bytes >= 1024 * 1024 * 1024) {
|
||||
return l10n.mapCache_sizeGigabytes(
|
||||
(bytes / (1024 * 1024 * 1024)).toStringAsFixed(2),
|
||||
);
|
||||
}
|
||||
if (bytes >= 1024 * 1024) {
|
||||
return l10n.mapCache_sizeMegabytes(
|
||||
(bytes / (1024 * 1024)).toStringAsFixed(0),
|
||||
);
|
||||
}
|
||||
if (bytes >= 1024) {
|
||||
return l10n.mapCache_sizeKilobytes((bytes / 1024).toStringAsFixed(0));
|
||||
}
|
||||
return l10n.mapCache_sizeBytes('$bytes');
|
||||
}
|
||||
|
||||
Widget _buildBatteryContent(
|
||||
BuildContext context,
|
||||
AppSettingsService settingsService,
|
||||
|
||||
@@ -22,6 +22,7 @@ import '../utils/platform_info.dart';
|
||||
import '../utils/share_origin.dart';
|
||||
import '../widgets/app_bar.dart';
|
||||
import '../widgets/mesh_ui.dart';
|
||||
import '../widgets/model_download_list.dart';
|
||||
import '../widgets/sync_progress_overlay.dart';
|
||||
|
||||
class BackupRestoreScreen extends StatefulWidget {
|
||||
@@ -630,12 +631,6 @@ class _BackupRestoreScreenState extends State<BackupRestoreScreen> {
|
||||
required ImageCodecService imageCodecService,
|
||||
}) async {
|
||||
final l10n = context.l10n;
|
||||
final modelNames = [
|
||||
if (translationModel != null)
|
||||
translationModelFriendlyName(translationModel),
|
||||
if (imageCodecModel != null)
|
||||
imageCodecSpec?.label ?? imageCodecModel.name,
|
||||
];
|
||||
var starting = false;
|
||||
var cancelRequested = false;
|
||||
var translationDone = translationModel == null;
|
||||
@@ -658,16 +653,9 @@ class _BackupRestoreScreenState extends State<BackupRestoreScreen> {
|
||||
starting ||
|
||||
translationService.isDownloading ||
|
||||
imageCodecService.isDownloading;
|
||||
final currentProgress = currentModel == translationModel?.name
|
||||
? translationService.downloadProgress
|
||||
: currentModel == imageCodecModel?.name
|
||||
? imageCodecService.downloadProgress
|
||||
: null;
|
||||
final currentFile = currentModel == translationModel?.name
|
||||
? translationService.downloadFileName
|
||||
: currentModel == imageCodecModel?.name
|
||||
? imageCodecService.downloadFileName
|
||||
: null;
|
||||
final translationCurrent = currentModel == translationModel?.name;
|
||||
final imageCurrent = currentModel == imageCodecModel?.name;
|
||||
final failure = downloadError;
|
||||
|
||||
void requestDownloadCancel() {
|
||||
cancelRequested = true;
|
||||
@@ -682,31 +670,73 @@ class _BackupRestoreScreenState extends State<BackupRestoreScreen> {
|
||||
},
|
||||
child: AlertDialog(
|
||||
title: Text(l10n.backupRestore_missingModelsTitle),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
l10n.backupRestore_missingModelsMessage(
|
||||
modelNames.join('\n'),
|
||||
),
|
||||
),
|
||||
if (isDownloading) ...[
|
||||
const SizedBox(height: 16),
|
||||
Text(currentFile ?? currentModel ?? ''),
|
||||
const SizedBox(height: 8),
|
||||
LinearProgressIndicator(value: currentProgress),
|
||||
],
|
||||
if (downloadError != null) ...[
|
||||
content: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(l10n.backupRestore_missingModelsMessage),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
l10n.backupRestore_failed(downloadError!),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
),
|
||||
ModelDownloadList(
|
||||
rowPadding: const EdgeInsets.symmetric(vertical: 4),
|
||||
items: [
|
||||
if (translationModel != null)
|
||||
_missingModelItem(
|
||||
id: 'translation-${translationModel.id}',
|
||||
name: translationModelFriendlyName(
|
||||
translationModel,
|
||||
),
|
||||
sizeBytes: translationModel.fileSizeBytes,
|
||||
done: translationDone,
|
||||
current: translationCurrent,
|
||||
downloading:
|
||||
translationService.isDownloading ||
|
||||
(starting && translationCurrent),
|
||||
progress: translationService.downloadProgress,
|
||||
downloadedBytes:
|
||||
translationService.downloadedBytes,
|
||||
totalBytes: translationService.downloadTotalBytes,
|
||||
detail:
|
||||
translationService.downloadFileName ==
|
||||
'Merging chunks...'
|
||||
? l10n.translation_mergingChunks
|
||||
: null,
|
||||
error: failure == null
|
||||
? null
|
||||
: l10n.backupRestore_failed(failure),
|
||||
),
|
||||
if (imageCodecModel != null)
|
||||
_missingModelItem(
|
||||
id: 'image-${imageCodecModel.id}',
|
||||
name:
|
||||
imageCodecSpec?.label ??
|
||||
imageCodecModelFriendlyName(imageCodecModel),
|
||||
sizeBytes:
|
||||
imageCodecSpec?.totalSizeBytes ??
|
||||
imageCodecModel.fileSizeBytes,
|
||||
done: imageCodecDone,
|
||||
current: imageCurrent,
|
||||
downloading:
|
||||
imageCodecService.isDownloading ||
|
||||
(starting && imageCurrent),
|
||||
progress: imageCodecService.downloadProgress,
|
||||
downloadedBytes:
|
||||
imageCodecService.downloadedBytes,
|
||||
totalBytes: imageCodecService.downloadTotalBytes,
|
||||
detail:
|
||||
imageCodecService.downloadFileName
|
||||
?.startsWith('Verifying ') ==
|
||||
true
|
||||
? l10n.modelDownload_verifying
|
||||
: null,
|
||||
error: failure == null
|
||||
? null
|
||||
: l10n.backupRestore_failed(failure),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
@@ -830,3 +860,40 @@ class _BackupRestoreScreenState extends State<BackupRestoreScreen> {
|
||||
showDismissibleSnackBar(context, content: Text(message));
|
||||
}
|
||||
}
|
||||
|
||||
ModelDownloadItem _missingModelItem({
|
||||
required String id,
|
||||
required String name,
|
||||
required int sizeBytes,
|
||||
required bool done,
|
||||
required bool current,
|
||||
required bool downloading,
|
||||
required double? progress,
|
||||
required int downloadedBytes,
|
||||
required int? totalBytes,
|
||||
required String? detail,
|
||||
required String? error,
|
||||
}) {
|
||||
final inProgress = downloading && current && !done;
|
||||
final failed = error != null && current && !inProgress && !done;
|
||||
return ModelDownloadItem(
|
||||
id: id,
|
||||
name: name,
|
||||
sizeBytes: sizeBytes > 0 ? sizeBytes : null,
|
||||
status: done
|
||||
? ModelDownloadStatus.ready
|
||||
: failed
|
||||
? ModelDownloadStatus.error
|
||||
: inProgress
|
||||
? ModelDownloadStatus.downloading
|
||||
: ModelDownloadStatus.notDownloaded,
|
||||
progress: inProgress ? progress : null,
|
||||
downloadedBytes: inProgress ? downloadedBytes : 0,
|
||||
totalBytes: inProgress ? totalBytes : null,
|
||||
detail: failed
|
||||
? error
|
||||
: inProgress
|
||||
? detail
|
||||
: null,
|
||||
);
|
||||
}
|
||||
@@ -99,12 +99,15 @@ class ChannelChatScreen extends StatefulWidget {
|
||||
State<ChannelChatScreen> createState() => _ChannelChatScreenState();
|
||||
}
|
||||
|
||||
class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
class _ChannelChatScreenState extends State<ChannelChatScreen>
|
||||
with WidgetsBindingObserver {
|
||||
final _holidayWatcher = HolidayTriggerWatcher();
|
||||
final _messageAreaKey = GlobalKey();
|
||||
final TextEditingController _textController = TextEditingController();
|
||||
final ChatScrollController _scrollController = ChatScrollController();
|
||||
final FocusNode _textFieldFocusNode = FocusNode();
|
||||
bool _focusLostWhileAway = false;
|
||||
bool _focusLostToRoute = false;
|
||||
ChannelMessage? _replyingToMessage;
|
||||
bool _useReplyRegion = false;
|
||||
final CommunityStore _communityStore = CommunityStore();
|
||||
@@ -135,6 +138,13 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
MeshCoreConnector? _connector;
|
||||
final ChatSendGuard _sendGuard = ChatSendGuard();
|
||||
bool _channelSkipNextBottomSnap = false;
|
||||
|
||||
/// Newest entry and selection size seen by the last bottom-snap check, so
|
||||
/// a rebuild that only changed the selection is not mistaken for a new
|
||||
/// message.
|
||||
String? _snapNewestEntryId;
|
||||
int _snapSelectionCount = 0;
|
||||
|
||||
String? _unreadDividerMessageId;
|
||||
_TranscriptLayout? _transcriptLayout;
|
||||
ReceivedImageStore? _watchedImageStore;
|
||||
@@ -173,6 +183,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
_textFieldFocusNode.addListener(_onTextFieldFocusChange);
|
||||
_scrollController.onScrollNearTop = _loadOlderMessages;
|
||||
_scrollController.showJumpToBottom.addListener(_clearDividerAtBottom);
|
||||
@@ -263,10 +274,28 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
if (state != AppLifecycleState.resumed) return;
|
||||
// The focus manager observes the lifecycle from app start, so its restore
|
||||
// is already queued and runs first. Clearing afterwards keeps a focus
|
||||
// that was not restored (the user clicked elsewhere) from swallowing the
|
||||
// next real tap on the composer.
|
||||
scheduleMicrotask(() => _focusLostWhileAway = false);
|
||||
}
|
||||
|
||||
void _onTextFieldFocusChange() {
|
||||
if (_textFieldFocusNode.hasFocus && mounted) {
|
||||
_scrollController.handleKeyboardOpen();
|
||||
if (!mounted) return;
|
||||
if (!_textFieldFocusNode.hasFocus) {
|
||||
final state = WidgetsBinding.instance.lifecycleState;
|
||||
_focusLostWhileAway = state != null && state != AppLifecycleState.resumed;
|
||||
_focusLostToRoute = !(ModalRoute.of(context)?.isCurrent ?? true);
|
||||
return;
|
||||
}
|
||||
final restored = _focusLostWhileAway || _focusLostToRoute;
|
||||
_focusLostWhileAway = false;
|
||||
_focusLostToRoute = false;
|
||||
if (!restored) _scrollController.handleKeyboardOpen();
|
||||
}
|
||||
|
||||
Future<void> _loadOlderMessages() async {
|
||||
@@ -347,6 +376,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
_route?.secondaryAnimation?.removeStatusListener(_onCoveringRouteStatus);
|
||||
_watchedImageStore?.removeListener(_onImageStoreChanged);
|
||||
_unregisterActive();
|
||||
@@ -929,12 +959,25 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
rowCount + (_isLoadingOlder ? 1 : 0);
|
||||
|
||||
// Auto-scroll to bottom if user is already at bottom
|
||||
final newestEntryId = layout.ids.first;
|
||||
final selectionCount = _selectedIds.length;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!mounted) return;
|
||||
final newEntry =
|
||||
newestEntryId != _snapNewestEntryId;
|
||||
final selectionChanged =
|
||||
selectionCount != _snapSelectionCount;
|
||||
_snapNewestEntryId = newestEntryId;
|
||||
_snapSelectionCount = selectionCount;
|
||||
if (_channelSkipNextBottomSnap) {
|
||||
_channelSkipNextBottomSnap = false;
|
||||
return;
|
||||
}
|
||||
// Picking or clearing messages is not a new
|
||||
// message: keep the reading position.
|
||||
if (!newEntry && (_selecting || selectionChanged)) {
|
||||
return;
|
||||
}
|
||||
_scrollController.scrollToBottomIfAtBottom();
|
||||
});
|
||||
|
||||
@@ -1109,6 +1152,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
final publicIpfsGateway = settingsService.settings.publicIpfsGateway;
|
||||
final enableTracing = settingsService.settings.enableMessageTracing;
|
||||
final regionOnHopsLine = settingsService.settings.regionOnHopsLine;
|
||||
final showCompressionIndicator =
|
||||
settingsService.settings.showCompressionIndicator;
|
||||
final isOutgoing = message.isOutgoing;
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final gifId = GifHelper.parseGif(message.text);
|
||||
@@ -1423,8 +1468,10 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
bottom: 4,
|
||||
)
|
||||
: EdgeInsets.zero,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
child: Wrap(
|
||||
spacing: 4,
|
||||
runSpacing: 2,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
formatChatTime(context, message.timestamp),
|
||||
@@ -1433,20 +1480,23 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
color: metaColor,
|
||||
),
|
||||
),
|
||||
if (message.hasFutureTimestamp) ...[
|
||||
const SizedBox(width: 4),
|
||||
if (message.hasFutureTimestamp)
|
||||
FutureTimestampIndicator(size: 16 * textScale),
|
||||
],
|
||||
if (showCompressionIndicator &&
|
||||
message.isSmazCompressed)
|
||||
CompressionIndicator(
|
||||
size: 14 * textScale,
|
||||
color: metaColor,
|
||||
),
|
||||
if (enableTracing &&
|
||||
!isOutgoing &&
|
||||
message.repeatCount > 0) ...[
|
||||
const SizedBox(width: 6),
|
||||
const SizedBox(width: 2),
|
||||
Icon(
|
||||
Icons.repeat,
|
||||
size: 14 * textScale,
|
||||
color: metaColor,
|
||||
),
|
||||
const SizedBox(width: 2),
|
||||
Text(
|
||||
'${message.repeatCount}',
|
||||
style: MeshTheme.mono(
|
||||
@@ -1455,8 +1505,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
),
|
||||
),
|
||||
],
|
||||
if (isOutgoing) ...[
|
||||
const SizedBox(width: 4),
|
||||
if (isOutgoing)
|
||||
MessageStatusIcon(
|
||||
size: 16 * textScale,
|
||||
isAcked: false,
|
||||
@@ -1476,7 +1525,6 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
ChannelMessageStatus.failed,
|
||||
onColor: metaColor,
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -20,6 +20,7 @@ import '../helpers/path_helper.dart';
|
||||
import '../helpers/reaction_helper.dart';
|
||||
import '../widgets/message_status_icon.dart';
|
||||
import '../widgets/empty_state.dart';
|
||||
import '../helpers/chat_scroll_anchor.dart';
|
||||
import '../helpers/chat_scroll_controller.dart';
|
||||
import '../helpers/gif_helper.dart';
|
||||
import '../helpers/ipfs_link_attach_flow.dart';
|
||||
@@ -90,12 +91,16 @@ class ChatScreen extends StatefulWidget {
|
||||
State<ChatScreen> createState() => _ChatScreenState();
|
||||
}
|
||||
|
||||
class _ChatScreenState extends State<ChatScreen> {
|
||||
class _ChatScreenState extends State<ChatScreen> with WidgetsBindingObserver {
|
||||
final _holidayWatcher = HolidayTriggerWatcher();
|
||||
final _messageAreaKey = GlobalKey();
|
||||
final _textController = TextEditingController();
|
||||
final _scrollController = ChatScrollController();
|
||||
final _scrollAnchor = ChatScrollAnchor();
|
||||
({String id, bool bookmarksOnly})? _newestRow;
|
||||
final _textFieldFocusNode = FocusNode();
|
||||
bool _focusLostWhileAway = false;
|
||||
bool _focusLostToRoute = false;
|
||||
final GlobalKey _unreadScrollKey = GlobalKey();
|
||||
bool _isLoadingOlder = false;
|
||||
bool _showBookmarkedOnly = false;
|
||||
@@ -151,6 +156,7 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
_textFieldFocusNode.addListener(_onTextFieldFocusChange);
|
||||
_scrollController.onScrollNearTop = _loadOlderMessages;
|
||||
_scrollController.showJumpToBottom.addListener(_clearDividerAtBottom);
|
||||
@@ -218,10 +224,28 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
if (state != AppLifecycleState.resumed) return;
|
||||
// The focus manager observes the lifecycle from app start, so its restore
|
||||
// is already queued and runs first. Clearing afterwards keeps a focus
|
||||
// that was not restored (the user clicked elsewhere) from swallowing the
|
||||
// next real tap on the composer.
|
||||
scheduleMicrotask(() => _focusLostWhileAway = false);
|
||||
}
|
||||
|
||||
void _onTextFieldFocusChange() {
|
||||
if (_textFieldFocusNode.hasFocus && mounted) {
|
||||
_scrollController.handleKeyboardOpen();
|
||||
if (!mounted) return;
|
||||
if (!_textFieldFocusNode.hasFocus) {
|
||||
final state = WidgetsBinding.instance.lifecycleState;
|
||||
_focusLostWhileAway = state != null && state != AppLifecycleState.resumed;
|
||||
_focusLostToRoute = !(ModalRoute.of(context)?.isCurrent ?? true);
|
||||
return;
|
||||
}
|
||||
final restored = _focusLostWhileAway || _focusLostToRoute;
|
||||
_focusLostWhileAway = false;
|
||||
_focusLostToRoute = false;
|
||||
if (!restored) _scrollController.handleKeyboardOpen();
|
||||
}
|
||||
|
||||
Future<void> _loadOlderMessages() async {
|
||||
@@ -238,6 +262,7 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
_route?.secondaryAnimation?.removeStatusListener(_onCoveringRouteStatus);
|
||||
_unregisterActive();
|
||||
_scrollController.showJumpToBottom.removeListener(_clearDividerAtBottom);
|
||||
@@ -701,15 +726,41 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
final reversedMessages = visibleMessages.reversed.toList();
|
||||
final itemCount = reversedMessages.length + (_isLoadingOlder ? 1 : 0);
|
||||
|
||||
// A reader scrolled up keeps their place when messages arrive below, as
|
||||
// a room's backlog does in a burst right after login.
|
||||
final previous = _newestRow;
|
||||
final newest = (
|
||||
id: reversedMessages.first.messageId,
|
||||
bookmarksOnly: _showBookmarkedOnly,
|
||||
);
|
||||
_newestRow = newest;
|
||||
if (previous != null &&
|
||||
previous.bookmarksOnly == newest.bookmarksOnly &&
|
||||
previous.id != newest.id &&
|
||||
_pendingUnreadScrollTarget == null &&
|
||||
_scrollController.showJumpToBottom.value) {
|
||||
final inserted = reversedMessages.indexWhere(
|
||||
(m) => m.messageId == previous.id,
|
||||
);
|
||||
if (inserted > 0) _scrollAnchor.rowsInsertedBelow(inserted);
|
||||
}
|
||||
|
||||
// Auto-scroll to bottom if user is already at bottom
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!mounted) return;
|
||||
if (_pendingUnreadScrollTarget != null) return;
|
||||
// Never take over a drag or fling: during a sync every update would
|
||||
// pull a reader who starts scrolling up back to the newest message.
|
||||
if (_scrollController.hasClients &&
|
||||
_scrollController.position.isScrollingNotifier.value) {
|
||||
return;
|
||||
}
|
||||
_scrollController.scrollToBottomIfAtBottom();
|
||||
});
|
||||
|
||||
return ChatZoomWrapper(
|
||||
child: ListView.builder(
|
||||
child: AnchoredChatListView.builder(
|
||||
scrollAnchor: _scrollAnchor,
|
||||
reverse: true, // List grows from bottom up
|
||||
controller: _scrollController,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 16),
|
||||
@@ -1584,6 +1635,8 @@ class _MessageBubble extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final settingsService = context.watch<AppSettingsService>();
|
||||
final enableTracing = settingsService.settings.enableMessageTracing;
|
||||
final showCompressionIndicator =
|
||||
settingsService.settings.showCompressionIndicator;
|
||||
final isOutgoing = message.isOutgoing;
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final gifId = GifHelper.parseGif(message.text);
|
||||
@@ -1845,6 +1898,12 @@ class _MessageBubble extends StatelessWidget {
|
||||
FutureTimestampIndicator(
|
||||
size: 16 * textScale,
|
||||
),
|
||||
if (showCompressionIndicator &&
|
||||
message.isSmazCompressed)
|
||||
CompressionIndicator(
|
||||
size: 14 * textScale,
|
||||
color: metaColor,
|
||||
),
|
||||
if (isOutgoing) ...[
|
||||
const SizedBox(width: 2),
|
||||
MessageStatusIcon(
|
||||
|
||||
@@ -1243,34 +1243,38 @@ class _ContactsScreenState extends State<ContactsScreen> {
|
||||
}).toList();
|
||||
}
|
||||
|
||||
switch (viewState.contactsSortOption) {
|
||||
case ContactSortOption.lastSeen:
|
||||
final lastSeenAt = {
|
||||
for (final c in filtered)
|
||||
c: resolveContactLastSeen(
|
||||
c,
|
||||
addedAt: connector.contactAddedAt(c.publicKeyHex),
|
||||
),
|
||||
};
|
||||
filtered.sort((a, b) => lastSeenAt[b]!.compareTo(lastSeenAt[a]!));
|
||||
break;
|
||||
case ContactSortOption.recentMessages:
|
||||
final lastMessageAt = {
|
||||
for (final c in filtered) c: _lastMessageTime(connector, c),
|
||||
};
|
||||
filtered.sort((a, b) {
|
||||
final timeCompare = lastMessageAt[b]!.compareTo(lastMessageAt[a]!);
|
||||
final lastSeenAt =
|
||||
viewState.contactsSortOption == ContactSortOption.lastSeen
|
||||
? {
|
||||
for (final c in filtered)
|
||||
c: resolveContactLastSeen(
|
||||
c,
|
||||
addedAt: connector.contactAddedAt(c.publicKeyHex),
|
||||
),
|
||||
}
|
||||
: null;
|
||||
final lastMessageAt =
|
||||
viewState.contactsSortOption == ContactSortOption.recentMessages
|
||||
? {for (final c in filtered) c: _lastMessageTime(connector, c)}
|
||||
: null;
|
||||
int tieBreak(Contact a, Contact b) {
|
||||
switch (viewState.contactsSortOption) {
|
||||
case ContactSortOption.lastSeen:
|
||||
return lastSeenAt![b]!.compareTo(lastSeenAt[a]!);
|
||||
case ContactSortOption.recentMessages:
|
||||
final timeCompare = lastMessageAt![b]!.compareTo(lastMessageAt[a]!);
|
||||
if (timeCompare != 0) return timeCompare;
|
||||
return a.name.toLowerCase().compareTo(b.name.toLowerCase());
|
||||
});
|
||||
break;
|
||||
case ContactSortOption.name:
|
||||
filtered.sort(
|
||||
(a, b) => a.name.toLowerCase().compareTo(b.name.toLowerCase()),
|
||||
);
|
||||
break;
|
||||
case ContactSortOption.name:
|
||||
return a.name.toLowerCase().compareTo(b.name.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
filtered.sort(
|
||||
(a, b) =>
|
||||
compareContactQueryRank(a, b, viewState.contactsSearchText, tieBreak),
|
||||
);
|
||||
|
||||
return filtered;
|
||||
}
|
||||
|
||||
@@ -1459,11 +1463,14 @@ class _ContactsScreenState extends State<ContactsScreen> {
|
||||
builder: (builderContext, setDialogState) {
|
||||
final filteredContacts = filterQuery.isEmpty
|
||||
? sortedContacts
|
||||
: sortedContacts
|
||||
: (sortedContacts
|
||||
.where(
|
||||
(contact) => matchesContactQuery(contact, filterQuery),
|
||||
)
|
||||
.toList();
|
||||
.toList()
|
||||
..sort(
|
||||
(a, b) => compareContactQueryRank(a, b, filterQuery),
|
||||
));
|
||||
return AlertDialog(
|
||||
title: Text(
|
||||
isEditing
|
||||
|
||||
@@ -662,17 +662,32 @@ class _DiscoveryScreenState extends State<DiscoveryScreen> {
|
||||
return _matchesTypeFilter(contact);
|
||||
}).toList();
|
||||
|
||||
switch (sortOption) {
|
||||
case ContactSortOption.lastSeen:
|
||||
filtered.sort((a, b) => b.lastSeen.compareTo(a.lastSeen));
|
||||
break;
|
||||
case ContactSortOption.name:
|
||||
filtered.sort(
|
||||
(a, b) => a.name.toLowerCase().compareTo(b.name.toLowerCase()),
|
||||
);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
int tieBreak(Contact a, Contact b) {
|
||||
switch (sortOption) {
|
||||
case ContactSortOption.lastSeen:
|
||||
return b.lastSeen.compareTo(a.lastSeen);
|
||||
case ContactSortOption.name:
|
||||
return a.name.toLowerCase().compareTo(b.name.toLowerCase());
|
||||
default:
|
||||
return a.name.toLowerCase().compareTo(b.name.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
if (searchQuery.trim().isEmpty) {
|
||||
switch (sortOption) {
|
||||
case ContactSortOption.lastSeen:
|
||||
filtered.sort((a, b) => b.lastSeen.compareTo(a.lastSeen));
|
||||
case ContactSortOption.name:
|
||||
filtered.sort(
|
||||
(a, b) => a.name.toLowerCase().compareTo(b.name.toLowerCase()),
|
||||
);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
filtered.sort(
|
||||
(a, b) => compareContactQueryRank(a, b, searchQuery, tieBreak),
|
||||
);
|
||||
}
|
||||
|
||||
return filtered;
|
||||
|
||||
+30
-26
@@ -2292,13 +2292,14 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
) {
|
||||
final query = _searchQuery.trim().toLowerCase();
|
||||
final matches =
|
||||
allContacts.where((c) => matchesContactQuery(c, query)).toList()
|
||||
..sort((a, b) {
|
||||
allContacts.where((c) => matchesContactQuery(c, query)).toList()..sort(
|
||||
(a, b) => compareContactQueryRank(a, b, query, (a, b) {
|
||||
if (a.hasLocation != b.hasLocation) {
|
||||
return a.hasLocation ? -1 : 1;
|
||||
}
|
||||
return b.lastHeard.compareTo(a.lastHeard);
|
||||
});
|
||||
}),
|
||||
);
|
||||
final results = matches.take(8).toList();
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(top: 6),
|
||||
@@ -3464,6 +3465,15 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
contact.type != advTypeRoom,
|
||||
)
|
||||
.toList();
|
||||
final people = allContacts
|
||||
.where(
|
||||
(contact) =>
|
||||
query.isEmpty || matchesContactQuery(contact, query),
|
||||
)
|
||||
.toList();
|
||||
if (query.isNotEmpty) {
|
||||
people.sort((a, b) => compareContactQueryRank(a, b, query));
|
||||
}
|
||||
return SafeArea(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
@@ -3499,29 +3509,23 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
},
|
||||
),
|
||||
),
|
||||
...allContacts
|
||||
.where(
|
||||
(contact) =>
|
||||
query.isEmpty ||
|
||||
matchesContactQuery(contact, query),
|
||||
)
|
||||
.map((contact) {
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.person),
|
||||
title: Text(contact.name),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
if (!_markerFits(
|
||||
context,
|
||||
markerText,
|
||||
maxContactMessageBytes(),
|
||||
)) {
|
||||
return;
|
||||
}
|
||||
liveConnector.sendMessage(contact, markerText);
|
||||
},
|
||||
);
|
||||
}),
|
||||
...people.map((contact) {
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.person),
|
||||
title: Text(contact.name),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
if (!_markerFits(
|
||||
context,
|
||||
markerText,
|
||||
maxContactMessageBytes(),
|
||||
)) {
|
||||
return;
|
||||
}
|
||||
liveConnector.sendMessage(contact, markerText);
|
||||
},
|
||||
);
|
||||
}),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 4),
|
||||
child: Text(
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import '../models/app_settings.dart';
|
||||
import '../models/custom_theme.dart';
|
||||
import '../models/send_attempt_plan.dart';
|
||||
@@ -136,6 +138,10 @@ class AppSettingsService extends ChangeNotifier {
|
||||
await updateSettings(_settings.copyWith(regionOnHopsLine: value));
|
||||
}
|
||||
|
||||
Future<void> setShowCompressionIndicator(bool value) async {
|
||||
await updateSettings(_settings.copyWith(showCompressionIndicator: value));
|
||||
}
|
||||
|
||||
Future<void> setMapCacheBounds(Map<String, double>? value) async {
|
||||
await updateSettings(_settings.copyWith(mapCacheBounds: value));
|
||||
}
|
||||
|
||||
@@ -6,6 +6,27 @@ import '../l10n/locale_tag.dart';
|
||||
import '../utils/platform_info.dart';
|
||||
|
||||
class BackgroundService {
|
||||
/// Options for the service that keeps the radio link alive in the
|
||||
/// background.
|
||||
///
|
||||
/// The radio link lives in the app process; once the user swipes the app
|
||||
/// away it is gone, so a lingering "connected" notification (or an
|
||||
/// automatic restart) would only be misleading. Swiping away stops the
|
||||
/// service through `android:stopWithTask="true"` in AndroidManifest.xml.
|
||||
///
|
||||
/// `stopWithTask` must stay unset here: in flutter_foreground_task (9.2 to
|
||||
/// 11.0 at least) the option does not watch the task but stops the service
|
||||
/// as soon as no activity is resumed, which is every time the app goes to
|
||||
/// the background or the screen turns off. Android then caches and freezes
|
||||
/// the process, the Bluetooth link drops and the low-memory killer ends it.
|
||||
@visibleForTesting
|
||||
static final ForegroundTaskOptions taskOptions = ForegroundTaskOptions(
|
||||
eventAction: ForegroundTaskEventAction.repeat(5000),
|
||||
autoRunOnBoot: false,
|
||||
allowWifiLock: false,
|
||||
allowAutoRestart: false,
|
||||
);
|
||||
|
||||
bool _initialized = false;
|
||||
String? Function()? _languageOverrideProvider;
|
||||
|
||||
@@ -30,16 +51,7 @@ class BackgroundService {
|
||||
showNotification: false,
|
||||
playSound: false,
|
||||
),
|
||||
foregroundTaskOptions: ForegroundTaskOptions(
|
||||
eventAction: ForegroundTaskEventAction.repeat(5000),
|
||||
autoRunOnBoot: false,
|
||||
allowWifiLock: false,
|
||||
// The radio link lives in the app process; once the user swipes the
|
||||
// app away it is gone, so a lingering "connected" notification (or
|
||||
// an automatic restart) would only be misleading.
|
||||
allowAutoRestart: false,
|
||||
stopWithTask: true,
|
||||
),
|
||||
foregroundTaskOptions: taskOptions,
|
||||
);
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
import 'package:crypto/crypto.dart';
|
||||
|
||||
import '../connector/meshcore_protocol.dart';
|
||||
import '../models/contact.dart';
|
||||
import '../models/message.dart';
|
||||
@@ -202,6 +204,7 @@ class MessageRetryService extends ChangeNotifier {
|
||||
String? translationModelId,
|
||||
Uint8List? pathBytes,
|
||||
int? pathLength,
|
||||
bool isSmazCompressed = false,
|
||||
}) async {
|
||||
final messageId = const Uuid().v4();
|
||||
final resolved = resolvePathSelection(contact);
|
||||
@@ -220,6 +223,7 @@ class MessageRetryService extends ChangeNotifier {
|
||||
translationModelId: translationModelId,
|
||||
timestamp: DateTime.now(),
|
||||
isOutgoing: true,
|
||||
isSmazCompressed: isSmazCompressed,
|
||||
status: MessageStatus.pending,
|
||||
messageId: messageId,
|
||||
retryCount: 0,
|
||||
|
||||
@@ -39,11 +39,14 @@ class TranslationDownloadCancelled implements Exception {
|
||||
class TranslationService extends ChangeNotifier {
|
||||
final AppSettingsService _appSettingsService;
|
||||
final TranslationFileStore _fileStore;
|
||||
final http.Client Function() _newClient;
|
||||
|
||||
TranslationService(
|
||||
this._appSettingsService, {
|
||||
TranslationFileStore? fileStore,
|
||||
}) : _fileStore = fileStore ?? TranslationFileStore() {
|
||||
http.Client Function()? clientFactory,
|
||||
}) : _fileStore = fileStore ?? TranslationFileStore(),
|
||||
_newClient = clientFactory ?? http.Client.new {
|
||||
// Initialize langdetect once at service construction.
|
||||
_langDetectInit = initLangDetect();
|
||||
}
|
||||
@@ -61,6 +64,13 @@ class TranslationService extends ChangeNotifier {
|
||||
int _downloadedBytes = 0;
|
||||
int? _downloadTotalBytes;
|
||||
String? _downloadFileName;
|
||||
String? _downloadTargetFileName;
|
||||
String? _downloadSourceUrl;
|
||||
String? _downloadModelId;
|
||||
String? _failedDownloadError;
|
||||
String? _failedDownloadSourceUrl;
|
||||
String? _failedDownloadFileName;
|
||||
String? _failedDownloadModelId;
|
||||
|
||||
bool get isBusy => _isBusy;
|
||||
bool get isDownloading => _isDownloading;
|
||||
@@ -68,6 +78,29 @@ class TranslationService extends ChangeNotifier {
|
||||
int get downloadedBytes => _downloadedBytes;
|
||||
int? get downloadTotalBytes => _downloadTotalBytes;
|
||||
String? get downloadFileName => _downloadFileName;
|
||||
|
||||
/// File being fetched. Stays set while chunks are merged, when
|
||||
/// [downloadFileName] is replaced with the merge status.
|
||||
String? get downloadTargetFileName => _downloadTargetFileName;
|
||||
|
||||
/// URL of the download in progress. Settings can rebuild the row after
|
||||
/// the page that started the download has been disposed.
|
||||
String? get downloadSourceUrl => _downloadSourceUrl;
|
||||
|
||||
/// Preset id when the download was started as a preset, otherwise null.
|
||||
String? get downloadModelId => _downloadModelId;
|
||||
|
||||
/// Error message from the most recent failed download, if any.
|
||||
String? get failedDownloadError => _failedDownloadError;
|
||||
|
||||
/// URL of the most recent failed download, if any.
|
||||
String? get failedDownloadSourceUrl => _failedDownloadSourceUrl;
|
||||
|
||||
/// Resolved filename of the most recent failed download, if any.
|
||||
String? get failedDownloadFileName => _failedDownloadFileName;
|
||||
|
||||
/// Preset id of the most recent failed download, if it was a preset.
|
||||
String? get failedDownloadModelId => _failedDownloadModelId;
|
||||
double? get downloadProgress {
|
||||
final total = _downloadTotalBytes;
|
||||
if (!_isDownloading || total == null || total <= 0) {
|
||||
@@ -195,22 +228,26 @@ class TranslationService extends ChangeNotifier {
|
||||
}
|
||||
return _runExclusive(() async {
|
||||
_setBusy(true);
|
||||
_setDownloading(true);
|
||||
_lastError = null;
|
||||
_clearFailedDownload();
|
||||
final resolvedFileName =
|
||||
fileName ??
|
||||
_sanitizeFileName(
|
||||
uri.pathSegments.isNotEmpty
|
||||
? uri.pathSegments.last
|
||||
: 'translation-model.gguf',
|
||||
);
|
||||
_downloadSourceUrl = sourceUrl;
|
||||
_downloadModelId = id;
|
||||
_downloadTargetFileName = resolvedFileName;
|
||||
_downloadFileName = resolvedFileName;
|
||||
_downloadedBytes = 0;
|
||||
_downloadTotalBytes = null;
|
||||
_cancelDownloadRequested = false;
|
||||
_setDownloading(true);
|
||||
try {
|
||||
final resolvedFileName =
|
||||
fileName ??
|
||||
_sanitizeFileName(
|
||||
uri.pathSegments.isNotEmpty
|
||||
? uri.pathSegments.last
|
||||
: 'translation-model.gguf',
|
||||
);
|
||||
_downloadFileName = resolvedFileName;
|
||||
_downloadedBytes = 0;
|
||||
_cancelDownloadRequested = false;
|
||||
|
||||
// HEAD request to check size and range support.
|
||||
final headClient = http.Client();
|
||||
final headClient = _newClient();
|
||||
int? totalSize;
|
||||
bool supportsRange = false;
|
||||
try {
|
||||
@@ -223,6 +260,10 @@ class TranslationService extends ChangeNotifier {
|
||||
headClient.close();
|
||||
}
|
||||
|
||||
if (_cancelDownloadRequested) {
|
||||
throw const TranslationDownloadCancelled();
|
||||
}
|
||||
|
||||
_downloadTotalBytes = totalSize;
|
||||
_notify();
|
||||
|
||||
@@ -260,6 +301,15 @@ class TranslationService extends ChangeNotifier {
|
||||
await _appSettingsService.setTranslationModelSourceUrl(sourceUrl);
|
||||
_failedModelPath = null;
|
||||
return record;
|
||||
} on TranslationDownloadCancelled {
|
||||
rethrow;
|
||||
} catch (error) {
|
||||
_lastError = '$error';
|
||||
_failedDownloadError = '$error';
|
||||
_failedDownloadSourceUrl = sourceUrl;
|
||||
_failedDownloadFileName = resolvedFileName;
|
||||
_failedDownloadModelId = id;
|
||||
rethrow;
|
||||
} finally {
|
||||
_setDownloading(false);
|
||||
}
|
||||
@@ -270,7 +320,7 @@ class TranslationService extends ChangeNotifier {
|
||||
required Uri uri,
|
||||
required String fileName,
|
||||
}) async {
|
||||
final client = http.Client();
|
||||
final client = _newClient();
|
||||
try {
|
||||
final response = await client.send(http.Request('GET', uri));
|
||||
if (response.statusCode < 200 || response.statusCode >= 300) {
|
||||
@@ -314,7 +364,7 @@ class TranslationService extends ChangeNotifier {
|
||||
if (start >= totalSize) break;
|
||||
final chunkPath = await _fileStore.chunkFilePath(fileName, i);
|
||||
chunkPaths.add(chunkPath);
|
||||
final client = http.Client();
|
||||
final client = _newClient();
|
||||
clients.add(client);
|
||||
futures.add(
|
||||
_downloadRange(
|
||||
@@ -701,6 +751,37 @@ class TranslationService extends ChangeNotifier {
|
||||
_notify();
|
||||
}
|
||||
|
||||
void _clearFailedDownload() {
|
||||
_failedDownloadError = null;
|
||||
_failedDownloadSourceUrl = null;
|
||||
_failedDownloadFileName = null;
|
||||
_failedDownloadModelId = null;
|
||||
}
|
||||
|
||||
/// Puts the service in the same state [downloadModel] publishes while a
|
||||
/// fetch is running, so settings can be rebuilt without a network call.
|
||||
@visibleForTesting
|
||||
void debugSetActiveDownload({
|
||||
required String sourceUrl,
|
||||
String? fileName,
|
||||
String? modelId,
|
||||
String? displayedFileName,
|
||||
int downloadedBytes = 0,
|
||||
int? totalBytes,
|
||||
}) {
|
||||
_lastError = null;
|
||||
_clearFailedDownload();
|
||||
_downloadSourceUrl = sourceUrl;
|
||||
_downloadModelId = modelId;
|
||||
_downloadTargetFileName = fileName;
|
||||
_downloadFileName = displayedFileName ?? fileName;
|
||||
_downloadedBytes = downloadedBytes;
|
||||
_downloadTotalBytes = totalBytes;
|
||||
_isBusy = true;
|
||||
_isDownloading = true;
|
||||
_notify();
|
||||
}
|
||||
|
||||
void _setDownloading(bool value) {
|
||||
_isDownloading = value;
|
||||
if (!value) {
|
||||
@@ -708,6 +789,9 @@ class TranslationService extends ChangeNotifier {
|
||||
_downloadedBytes = 0;
|
||||
_downloadTotalBytes = null;
|
||||
_downloadFileName = null;
|
||||
_downloadTargetFileName = null;
|
||||
_downloadSourceUrl = null;
|
||||
_downloadModelId = null;
|
||||
}
|
||||
_notify();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:meshcore_open/utils/app_logger.dart';
|
||||
|
||||
import '../models/channel_message.dart';
|
||||
@@ -160,6 +161,7 @@ class ChannelMessageStore {
|
||||
'receivedAt': msg.receivedAt.millisecondsSinceEpoch,
|
||||
'isOutgoing': msg.isOutgoing,
|
||||
'isBookmarked': msg.isBookmarked,
|
||||
'isSmazCompressed': msg.isSmazCompressed,
|
||||
'status': msg.status.index,
|
||||
'channelIndex': msg.channelIndex,
|
||||
'region': msg.region,
|
||||
@@ -186,9 +188,12 @@ class ChannelMessageStore {
|
||||
/// Convert JSON map to ChannelMessage
|
||||
ChannelMessage _messageFromJson(Map<String, dynamic> json) {
|
||||
final rawText = json['text'] as String;
|
||||
final decodedText = json['plainText'] == true
|
||||
? rawText
|
||||
: (Smaz.tryDecodePrefixed(rawText) ?? rawText);
|
||||
final smazDecoded = json['plainText'] == true
|
||||
? null
|
||||
: Smaz.tryDecodePrefixed(rawText);
|
||||
final decodedText = smazDecoded ?? rawText;
|
||||
final isSmazCompressed =
|
||||
json['isSmazCompressed'] as bool? ?? (smazDecoded != null);
|
||||
|
||||
final rawPathLength = json['pathLength'] as int?;
|
||||
final rawPathBytes = json['pathBytes'] != null
|
||||
@@ -238,6 +243,7 @@ class ChannelMessageStore {
|
||||
receivedAt: legacyAwareReceivedAt(json),
|
||||
isOutgoing: json['isOutgoing'] as bool? ?? false,
|
||||
isBookmarked: json['isBookmarked'] as bool? ?? false,
|
||||
isSmazCompressed: isSmazCompressed,
|
||||
status: _statusAt(json['status']) ?? ChannelMessageStatus.failed,
|
||||
repeatCount: (json['repeatCount'] as int?) ?? 0,
|
||||
pathLength: decodedPathLength,
|
||||
|
||||
@@ -202,6 +202,7 @@ class MessageStore {
|
||||
'isOutgoing': msg.isOutgoing,
|
||||
'isBookmarked': msg.isBookmarked,
|
||||
'isCli': msg.isCli,
|
||||
'isSmazCompressed': msg.isSmazCompressed,
|
||||
'status': msg.status.index,
|
||||
'messageId': msg.messageId,
|
||||
'originalText': msg.originalText,
|
||||
@@ -233,9 +234,12 @@ class MessageStore {
|
||||
Message _messageFromJson(Map<String, dynamic> json) {
|
||||
final rawText = json['text'] as String;
|
||||
final isCli = json['isCli'] as bool? ?? false;
|
||||
final decodedText = isCli || json['plainText'] == true
|
||||
? rawText
|
||||
: (Smaz.tryDecodePrefixed(rawText) ?? rawText);
|
||||
final smazDecoded = (isCli || json['plainText'] == true)
|
||||
? null
|
||||
: Smaz.tryDecodePrefixed(rawText);
|
||||
final decodedText = smazDecoded ?? rawText;
|
||||
final isSmazCompressed =
|
||||
json['isSmazCompressed'] as bool? ?? (smazDecoded != null);
|
||||
|
||||
final rawPathLength = json['pathLength'] as int?;
|
||||
final rawPathBytes = json['pathBytes'] != null
|
||||
@@ -273,6 +277,7 @@ class MessageStore {
|
||||
isOutgoing: json['isOutgoing'] as bool? ?? false,
|
||||
isBookmarked: json['isBookmarked'] as bool? ?? false,
|
||||
isCli: isCli,
|
||||
isSmazCompressed: isSmazCompressed,
|
||||
status: _statusAt(json['status']) ?? MessageStatus.failed,
|
||||
messageId: json['messageId'] as String?,
|
||||
originalText: json['originalText'] as String?,
|
||||
|
||||
@@ -2,31 +2,90 @@ import '../models/contact.dart';
|
||||
|
||||
export 'contact_filter_types.dart';
|
||||
|
||||
bool matchesContactQuery(Contact contact, String query) {
|
||||
final normalizedQuery = query.trim().toLowerCase();
|
||||
if (normalizedQuery.isEmpty) return true;
|
||||
/// How closely a contact matches a search query. Lower ranks sort first.
|
||||
enum ContactQueryRank { namePrefix, nameContains, keyPrefix }
|
||||
|
||||
if (contact.name.toLowerCase().contains(normalizedQuery)) {
|
||||
return true;
|
||||
/// Rank for [query], or null when the contact does not match.
|
||||
///
|
||||
/// Names that start with the query come before other substring matches.
|
||||
/// A public-key / hop-hash prefix matches only when the name does not.
|
||||
/// Name-only half of [rankContactQuery], for a label that is not itself a
|
||||
/// contact (for example the "my contact" alias on the share sheet).
|
||||
ContactQueryRank? rankNameQuery(String name, String query) {
|
||||
final normalized = query.trim().toLowerCase();
|
||||
if (normalized.isEmpty) return ContactQueryRank.namePrefix;
|
||||
final label = name.toLowerCase();
|
||||
if (label.startsWith(normalized)) return ContactQueryRank.namePrefix;
|
||||
if (label.contains(normalized)) return ContactQueryRank.nameContains;
|
||||
return null;
|
||||
}
|
||||
|
||||
ContactQueryRank? rankContactQuery(Contact contact, String query) {
|
||||
final normalized = query.trim().toLowerCase();
|
||||
if (normalized.isEmpty) return ContactQueryRank.namePrefix;
|
||||
|
||||
final byName = rankNameQuery(contact.name, normalized);
|
||||
if (byName != null) return byName;
|
||||
if (_publicKeyPrefixMatches(contact, normalized)) {
|
||||
return ContactQueryRank.keyPrefix;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
final hexPrefix = _extractHexPrefix(normalizedQuery);
|
||||
if (hexPrefix == null) return false;
|
||||
/// Whether [name], any [aliases], or [publicKeyHex] matches [query] with the
|
||||
/// same prefix, substring, then hash order as [rankContactQuery].
|
||||
ContactQueryRank? rankLabeledKeyQuery({
|
||||
required String name,
|
||||
required String publicKeyHex,
|
||||
required String query,
|
||||
List<String> aliases = const [],
|
||||
}) {
|
||||
final normalized = query.trim().toLowerCase();
|
||||
if (normalized.isEmpty) return ContactQueryRank.namePrefix;
|
||||
ContactQueryRank? best = rankNameQuery(name, normalized);
|
||||
for (final alias in aliases) {
|
||||
final rank = rankNameQuery(alias, normalized);
|
||||
if (rank != null && (best == null || rank.index < best.index)) {
|
||||
best = rank;
|
||||
}
|
||||
}
|
||||
if (best != null) return best;
|
||||
final hexPrefix = _extractHexPrefix(normalized);
|
||||
if (hexPrefix != null && publicKeyHex.toLowerCase().startsWith(hexPrefix)) {
|
||||
return ContactQueryRank.keyPrefix;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
return contact.publicKeyHex.toLowerCase().startsWith(hexPrefix);
|
||||
bool matchesContactQuery(Contact contact, String query) {
|
||||
return rankContactQuery(contact, query) != null;
|
||||
}
|
||||
|
||||
bool matchesDiscoveryContactQuery(Contact contact, String query) {
|
||||
final normalizedQuery = query.trim().toLowerCase();
|
||||
if (normalizedQuery.isEmpty) return true;
|
||||
return matchesContactQuery(contact, query);
|
||||
}
|
||||
|
||||
if (contact.name.toLowerCase().contains(normalizedQuery)) {
|
||||
return true;
|
||||
}
|
||||
/// Sorts prefix matches ahead of other substring matches, then key matches.
|
||||
///
|
||||
/// [tieBreak] orders contacts that share a rank. With an empty query every
|
||||
/// contact shares the top rank, so [tieBreak] is the whole order.
|
||||
int compareContactQueryRank(
|
||||
Contact a,
|
||||
Contact b,
|
||||
String query, [
|
||||
int Function(Contact a, Contact b)? tieBreak,
|
||||
]) {
|
||||
final left = rankContactQuery(a, query);
|
||||
final right = rankContactQuery(b, query);
|
||||
final byRank = (left?.index ?? 3).compareTo(right?.index ?? 3);
|
||||
if (byRank != 0) return byRank;
|
||||
return tieBreak?.call(a, b) ??
|
||||
a.name.toLowerCase().compareTo(b.name.toLowerCase());
|
||||
}
|
||||
|
||||
bool _publicKeyPrefixMatches(Contact contact, String normalizedQuery) {
|
||||
final hexPrefix = _extractHexPrefix(normalizedQuery);
|
||||
if (hexPrefix == null) return false;
|
||||
|
||||
if (hexPrefix == null || contact.publicKey.isEmpty) return false;
|
||||
return contact.publicKeyHex.toLowerCase().startsWith(hexPrefix);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,298 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../helpers/snack_bar_builder.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../models/image_codec_support.dart';
|
||||
import '../services/image_codec_service.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import 'model_download_list.dart';
|
||||
|
||||
/// Image-codec registry: one [ModelDownloadList] row per model.
|
||||
///
|
||||
/// A preset and the files it installed are the same row. The friendly name is
|
||||
/// the preset label, never the on-disk graph filename.
|
||||
class ImageCodecModelsSection extends StatefulWidget {
|
||||
const ImageCodecModelsSection({super.key});
|
||||
|
||||
@override
|
||||
State<ImageCodecModelsSection> createState() =>
|
||||
_ImageCodecModelsSectionState();
|
||||
}
|
||||
|
||||
class _ImageCodecModelsSectionState extends State<ImageCodecModelsSection> {
|
||||
String? _failedId;
|
||||
String? _failedDetail;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final codec = context.watch<ImageCodecService>();
|
||||
final l10n = context.l10n;
|
||||
final theme = Theme.of(context);
|
||||
final scheme = theme.colorScheme;
|
||||
final reason = codec.unavailableReason;
|
||||
final lastError = codec.lastError;
|
||||
final showLastError =
|
||||
lastError != null &&
|
||||
lastError.isNotEmpty &&
|
||||
lastError != 'Download stopped.' &&
|
||||
lastError != _failedDetail;
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 4),
|
||||
child: Text(
|
||||
l10n.imageMessages_modelSectionTitle,
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
),
|
||||
if (reason != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 4, 16, 8),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: scheme.surfaceContainerLow,
|
||||
borderRadius: BorderRadius.circular(MeshRadii.md),
|
||||
border: Border.all(color: scheme.outlineVariant),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Text(
|
||||
reason,
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
ModelDownloadList(items: _items(context, codec)),
|
||||
if (showLastError)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 4, 16, 12),
|
||||
child: Text(
|
||||
lastError,
|
||||
style: theme.textTheme.bodyMedium?.copyWith(color: scheme.error),
|
||||
),
|
||||
)
|
||||
else
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
List<ModelDownloadItem> _items(
|
||||
BuildContext context,
|
||||
ImageCodecService codec,
|
||||
) {
|
||||
final models = codec.availableModels;
|
||||
final used = <ImageCodecModelRecord>{};
|
||||
final items = <ModelDownloadItem>[];
|
||||
|
||||
for (final spec in imageCodecPresetModels) {
|
||||
final belonging = [
|
||||
for (final model in models)
|
||||
if (_belongsToSpec(model, spec)) model,
|
||||
];
|
||||
used.addAll(belonging);
|
||||
final record = _preferredRecord(belonging, spec);
|
||||
items.add(_presetItem(context, codec, spec, record));
|
||||
}
|
||||
|
||||
for (final model in models) {
|
||||
if (used.contains(model)) continue;
|
||||
items.add(_customItem(context, codec, model));
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
ModelDownloadItem _presetItem(
|
||||
BuildContext context,
|
||||
ImageCodecService codec,
|
||||
ImageCodecModelSpec spec,
|
||||
ImageCodecModelRecord? record,
|
||||
) {
|
||||
final l10n = context.l10n;
|
||||
final blocked = spec.urlsArePlaceholders;
|
||||
final installedId = record?.id;
|
||||
final complete =
|
||||
record != null && spec.hasCompleteInstalledRecord([record]);
|
||||
final downloading = !blocked && _specIsDownloading(codec, spec);
|
||||
final verifying = downloading && _isVerifying(codec);
|
||||
final failed = !downloading && !complete && _failedId == spec.id;
|
||||
final selectedId = codec.selectedModel?.id;
|
||||
final selected =
|
||||
complete && (selectedId == spec.id || selectedId == installedId);
|
||||
final busy = codec.isBusy || codec.isDownloading;
|
||||
|
||||
final ModelDownloadStatus status;
|
||||
String? statusLabel;
|
||||
if (downloading) {
|
||||
status = ModelDownloadStatus.downloading;
|
||||
} else if (complete) {
|
||||
status = ModelDownloadStatus.ready;
|
||||
} else if (failed) {
|
||||
status = ModelDownloadStatus.error;
|
||||
} else {
|
||||
status = ModelDownloadStatus.notDownloaded;
|
||||
if (record != null && !blocked) {
|
||||
statusLabel = l10n.modelDownload_incomplete;
|
||||
}
|
||||
}
|
||||
|
||||
final size = record != null && record.fileSizeBytes > 0
|
||||
? record.fileSizeBytes
|
||||
: spec.totalSizeBytes;
|
||||
|
||||
return ModelDownloadItem(
|
||||
id: spec.id,
|
||||
name: spec.label,
|
||||
sizeBytes: size > 0 ? size : null,
|
||||
status: status,
|
||||
statusLabel: statusLabel,
|
||||
selected: selected,
|
||||
enabled: !blocked,
|
||||
progress: verifying ? null : codec.downloadProgress,
|
||||
downloadedBytes: downloading ? codec.downloadedBytes : 0,
|
||||
totalBytes: downloading ? codec.downloadTotalBytes : null,
|
||||
detail: blocked
|
||||
? l10n.imageMessages_modelNotPublished
|
||||
: verifying
|
||||
? l10n.modelDownload_verifying
|
||||
: failed
|
||||
? _failedDetail
|
||||
: null,
|
||||
onDownload: !blocked && !complete && !codec.isDownloading
|
||||
? () => _download(spec)
|
||||
: null,
|
||||
onCancel: downloading ? codec.cancelDownload : null,
|
||||
onDelete: record != null && !busy ? () => _delete(record) : null,
|
||||
onSelect: complete && !selected && !busy
|
||||
? () => codec.setSelectedModelId(installedId ?? spec.id)
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
ModelDownloadItem _customItem(
|
||||
BuildContext context,
|
||||
ImageCodecService codec,
|
||||
ImageCodecModelRecord model,
|
||||
) {
|
||||
final l10n = context.l10n;
|
||||
final downloading = _recordIsDownloading(codec, model);
|
||||
final verifying = downloading && _isVerifying(codec);
|
||||
final ready = model.localPath.isNotEmpty && !downloading;
|
||||
final busy = codec.isBusy || codec.isDownloading;
|
||||
final selected = ready && codec.selectedModel?.id == model.id;
|
||||
|
||||
return ModelDownloadItem(
|
||||
id: model.id,
|
||||
name: imageCodecModelFriendlyName(model),
|
||||
sizeBytes: model.fileSizeBytes > 0 ? model.fileSizeBytes : null,
|
||||
status: downloading
|
||||
? ModelDownloadStatus.downloading
|
||||
: ready
|
||||
? ModelDownloadStatus.ready
|
||||
: ModelDownloadStatus.notDownloaded,
|
||||
selected: selected,
|
||||
progress: verifying ? null : codec.downloadProgress,
|
||||
downloadedBytes: downloading ? codec.downloadedBytes : 0,
|
||||
totalBytes: downloading ? codec.downloadTotalBytes : null,
|
||||
detail: verifying ? l10n.modelDownload_verifying : null,
|
||||
onCancel: downloading ? codec.cancelDownload : null,
|
||||
onDelete: !busy ? () => _delete(model) : null,
|
||||
onSelect: ready && !selected && !busy
|
||||
? () => codec.setSelectedModelId(model.id)
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
bool _specIsDownloading(ImageCodecService codec, ImageCodecModelSpec spec) {
|
||||
if (!codec.isDownloading) return false;
|
||||
final name = _downloadFileName(codec);
|
||||
if (name == null) return imageCodecPresetModels.length == 1;
|
||||
return spec.assets.any((asset) => asset.fileName == name);
|
||||
}
|
||||
|
||||
bool _recordIsDownloading(
|
||||
ImageCodecService codec,
|
||||
ImageCodecModelRecord model,
|
||||
) {
|
||||
if (!codec.isDownloading) return false;
|
||||
final name = _downloadFileName(codec);
|
||||
if (name == null) return false;
|
||||
return model.name == name || model.assetFileNames.contains(name);
|
||||
}
|
||||
|
||||
bool _isVerifying(ImageCodecService codec) =>
|
||||
codec.downloadFileName?.startsWith('Verifying ') ?? false;
|
||||
|
||||
String? _downloadFileName(ImageCodecService codec) {
|
||||
final raw = codec.downloadFileName;
|
||||
if (raw == null || raw.isEmpty) return null;
|
||||
const prefix = 'Verifying ';
|
||||
return raw.startsWith(prefix) ? raw.substring(prefix.length) : raw;
|
||||
}
|
||||
|
||||
Future<void> _download(ImageCodecModelSpec spec) async {
|
||||
setState(() {
|
||||
_failedId = null;
|
||||
_failedDetail = null;
|
||||
});
|
||||
final l10n = context.l10n;
|
||||
try {
|
||||
await context.read<ImageCodecService>().downloadPresetModel(spec);
|
||||
} on ImageCodecDownloadCancelled {
|
||||
if (!mounted) return;
|
||||
showDismissibleSnackBar(
|
||||
context,
|
||||
content: Text(l10n.translation_downloadStopped),
|
||||
);
|
||||
} catch (error) {
|
||||
if (!mounted) return;
|
||||
final message = l10n.imageMessages_downloadFailedWithError('$error');
|
||||
setState(() {
|
||||
_failedId = spec.id;
|
||||
_failedDetail = message;
|
||||
});
|
||||
showDismissibleSnackBar(context, content: Text(message));
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _delete(ImageCodecModelRecord model) async {
|
||||
final l10n = context.l10n;
|
||||
try {
|
||||
await context.read<ImageCodecService>().removeModel(model);
|
||||
} catch (error) {
|
||||
if (!mounted) return;
|
||||
showDismissibleSnackBar(
|
||||
context,
|
||||
content: Text(l10n.modelDownload_removeFailed('$error')),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool _belongsToSpec(ImageCodecModelRecord model, ImageCodecModelSpec spec) {
|
||||
if (model.id == spec.id || model.name == spec.fileName) return true;
|
||||
for (final asset in spec.assets) {
|
||||
if (asset.fileName == model.name) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ImageCodecModelRecord? _preferredRecord(
|
||||
List<ImageCodecModelRecord> models,
|
||||
ImageCodecModelSpec spec,
|
||||
) {
|
||||
for (final model in models) {
|
||||
if (spec.hasCompleteInstalledRecord([model])) return model;
|
||||
}
|
||||
for (final model in models) {
|
||||
if (model.id == spec.id) return model;
|
||||
}
|
||||
if (models.isEmpty) return null;
|
||||
return models.first;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../l10n/l10n.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
|
||||
/// Colours shared by the direct-message and channel chat bubbles.
|
||||
@@ -149,3 +150,25 @@ class MessageBubbleFrame extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Subtle indicator shown in a message bubble's metadata row when SMAZ
|
||||
/// compression was applied to the message.
|
||||
class CompressionIndicator extends StatelessWidget {
|
||||
final double size;
|
||||
final Color color;
|
||||
|
||||
const CompressionIndicator({super.key, this.size = 14, required this.color});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final label = context.l10n.messageMeta_smazCompressed;
|
||||
return Tooltip(
|
||||
message: label,
|
||||
triggerMode: TooltipTriggerMode.tap,
|
||||
child: Semantics(
|
||||
label: label,
|
||||
child: Icon(Icons.compress, size: size, color: color),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,337 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import 'mesh_nav_tile.dart';
|
||||
|
||||
/// Install state of one on-device model row.
|
||||
enum ModelDownloadStatus { notDownloaded, downloading, ready, error }
|
||||
|
||||
/// One model in a [ModelDownloadList].
|
||||
///
|
||||
/// Callers own the download. This only describes what the row should show
|
||||
/// and which action to offer.
|
||||
class ModelDownloadItem {
|
||||
final String id;
|
||||
final String name;
|
||||
|
||||
/// Bytes on disk, or the expected download size before anything is fetched.
|
||||
/// Zero and null both mean "size unknown" and are omitted.
|
||||
final int? sizeBytes;
|
||||
final ModelDownloadStatus status;
|
||||
|
||||
/// True when this installed model is the one the feature will use.
|
||||
final bool selected;
|
||||
|
||||
/// False dims the row and drops its actions, same as a disabled settings tile.
|
||||
final bool enabled;
|
||||
|
||||
/// 0–1 while [status] is [ModelDownloadStatus.downloading]. Null is an
|
||||
/// indeterminate bar (size unknown, merging, or verifying).
|
||||
final double? progress;
|
||||
final int downloadedBytes;
|
||||
final int? totalBytes;
|
||||
|
||||
/// Extra line under the status: a failure, a "not published" note, or
|
||||
/// "merging" / "verifying" while a download finishes.
|
||||
final String? detail;
|
||||
|
||||
/// Replaces the default status word. Used for an install that started but
|
||||
/// did not finish ("Incomplete").
|
||||
final String? statusLabel;
|
||||
|
||||
final VoidCallback? onDownload;
|
||||
final VoidCallback? onCancel;
|
||||
final VoidCallback? onDelete;
|
||||
final VoidCallback? onSelect;
|
||||
|
||||
const ModelDownloadItem({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.status,
|
||||
this.sizeBytes,
|
||||
this.selected = false,
|
||||
this.enabled = true,
|
||||
this.progress,
|
||||
this.downloadedBytes = 0,
|
||||
this.totalBytes,
|
||||
this.detail,
|
||||
this.statusLabel,
|
||||
this.onDownload,
|
||||
this.onCancel,
|
||||
this.onDelete,
|
||||
this.onSelect,
|
||||
});
|
||||
|
||||
bool get isActive => selected && status == ModelDownloadStatus.ready;
|
||||
}
|
||||
|
||||
/// Shared list of on-device models: name, size, status, selection, and one
|
||||
/// action (download, cancel, or remove).
|
||||
///
|
||||
/// Sits inside an existing card. It does not scroll; the page or dialog does.
|
||||
class ModelDownloadList extends StatelessWidget {
|
||||
final List<ModelDownloadItem> items;
|
||||
|
||||
/// When null, a row with an action keeps the button's own padding on the
|
||||
/// right, and a row without one uses 16.
|
||||
final EdgeInsets? rowPadding;
|
||||
|
||||
const ModelDownloadList({super.key, required this.items, this.rowPadding});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
for (var i = 0; i < items.length; i++) ...[
|
||||
if (i > 0) const Divider(height: 1, indent: 16),
|
||||
_ModelDownloadRow(item: items[i], padding: rowPadding),
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ModelDownloadRow extends StatelessWidget {
|
||||
final ModelDownloadItem item;
|
||||
final EdgeInsets? padding;
|
||||
|
||||
const _ModelDownloadRow({required this.item, required this.padding});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = context.l10n;
|
||||
final theme = Theme.of(context);
|
||||
final scheme = theme.colorScheme;
|
||||
final onTap = _rowTap();
|
||||
final actions = _actions(l10n);
|
||||
final statusWord = _statusWord(l10n);
|
||||
final sizeLabel = _sizeLabel(l10n);
|
||||
final caption = _progressCaption(l10n);
|
||||
|
||||
final row = Padding(
|
||||
padding:
|
||||
padding ??
|
||||
(actions.isEmpty
|
||||
? const EdgeInsets.symmetric(horizontal: 16, vertical: 12)
|
||||
: const EdgeInsets.fromLTRB(16, 12, 4, 12)),
|
||||
child: Row(
|
||||
children: [
|
||||
_leading(scheme),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(item.name, style: meshTileTitleStyle(theme)),
|
||||
const SizedBox(height: 2),
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
children: [
|
||||
if (sizeLabel != null) ...[
|
||||
TextSpan(
|
||||
text: sizeLabel,
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 14,
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
const TextSpan(text: ' · '),
|
||||
],
|
||||
TextSpan(text: statusWord),
|
||||
if (item.isActive) ...[
|
||||
const TextSpan(text: ' · '),
|
||||
TextSpan(
|
||||
text: l10n.modelDownload_active,
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
color: scheme.onSurface,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
if (item.detail != null && item.detail!.isNotEmpty) ...[
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
item.detail!,
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
color: item.status == ModelDownloadStatus.error
|
||||
? scheme.error
|
||||
: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
if (item.status == ModelDownloadStatus.downloading) ...[
|
||||
const SizedBox(height: 8),
|
||||
LinearProgressIndicator(value: item.progress),
|
||||
if (caption != null) ...[
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
caption,
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 12,
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
if (actions.isNotEmpty)
|
||||
Row(mainAxisSize: MainAxisSize.min, children: actions),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
return Opacity(
|
||||
opacity: item.enabled ? 1 : 0.5,
|
||||
child: Semantics(
|
||||
button: onTap != null,
|
||||
enabled: item.enabled,
|
||||
selected: item.isActive,
|
||||
hint: item.status == ModelDownloadStatus.ready && item.onSelect != null
|
||||
? l10n.modelDownload_useModel
|
||||
: null,
|
||||
child: IgnorePointer(
|
||||
ignoring: !item.enabled,
|
||||
child: InkWell(
|
||||
key: ValueKey('model-row-${item.id}'),
|
||||
onTap: onTap,
|
||||
child: row,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
VoidCallback? _rowTap() {
|
||||
if (!item.enabled) return null;
|
||||
if (item.status == ModelDownloadStatus.ready) return item.onSelect;
|
||||
if (item.status == ModelDownloadStatus.downloading) return null;
|
||||
return item.onDownload;
|
||||
}
|
||||
|
||||
Widget _leading(ColorScheme scheme) {
|
||||
switch (item.status) {
|
||||
case ModelDownloadStatus.downloading:
|
||||
return const SizedBox(
|
||||
width: 24,
|
||||
height: 24,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
);
|
||||
case ModelDownloadStatus.error:
|
||||
return Icon(Icons.error_outline, size: 24, color: scheme.error);
|
||||
case ModelDownloadStatus.ready:
|
||||
return Icon(
|
||||
item.isActive ? Icons.check_circle : Icons.check_circle_outline,
|
||||
size: 24,
|
||||
color: item.isActive ? scheme.primary : scheme.onSurfaceVariant,
|
||||
);
|
||||
case ModelDownloadStatus.notDownloaded:
|
||||
return Icon(
|
||||
Icons.memory_outlined,
|
||||
size: 24,
|
||||
color: scheme.onSurfaceVariant,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<Widget> _actions(AppLocalizations l10n) {
|
||||
if (!item.enabled) return const [];
|
||||
if (item.status == ModelDownloadStatus.downloading) {
|
||||
if (item.onCancel == null) return const [];
|
||||
return [
|
||||
IconButton(
|
||||
key: ValueKey('model-cancel-${item.id}'),
|
||||
tooltip: l10n.imageMessages_cancelDownload,
|
||||
onPressed: item.onCancel,
|
||||
iconSize: 24,
|
||||
icon: const Icon(Icons.close),
|
||||
),
|
||||
];
|
||||
}
|
||||
final actions = <Widget>[];
|
||||
if (item.status != ModelDownloadStatus.ready && item.onDownload != null) {
|
||||
actions.add(
|
||||
IconButton(
|
||||
key: ValueKey('model-download-${item.id}'),
|
||||
tooltip: l10n.imageMessages_downloadModel,
|
||||
onPressed: item.onDownload,
|
||||
iconSize: 24,
|
||||
icon: const Icon(Icons.download_outlined),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (item.onDelete != null) {
|
||||
actions.add(
|
||||
IconButton(
|
||||
key: ValueKey('model-remove-${item.id}'),
|
||||
tooltip: l10n.imageMessages_removeModel,
|
||||
onPressed: item.onDelete,
|
||||
iconSize: 24,
|
||||
icon: const Icon(Icons.delete_outline),
|
||||
),
|
||||
);
|
||||
}
|
||||
return actions;
|
||||
}
|
||||
|
||||
String _statusWord(AppLocalizations l10n) {
|
||||
final override = item.statusLabel;
|
||||
if (override != null && override.isNotEmpty) return override;
|
||||
switch (item.status) {
|
||||
case ModelDownloadStatus.notDownloaded:
|
||||
return l10n.modelDownload_notDownloaded;
|
||||
case ModelDownloadStatus.downloading:
|
||||
return l10n.modelDownload_downloading;
|
||||
case ModelDownloadStatus.ready:
|
||||
return l10n.imageMessages_modelReady;
|
||||
case ModelDownloadStatus.error:
|
||||
return l10n.modelDownload_failed;
|
||||
}
|
||||
}
|
||||
|
||||
String? _sizeLabel(AppLocalizations l10n) {
|
||||
final bytes = item.sizeBytes;
|
||||
if (bytes == null || bytes <= 0) return null;
|
||||
if (bytes >= 1024 * 1024 * 1024) {
|
||||
return l10n.mapCache_sizeGigabytes(
|
||||
(bytes / (1024 * 1024 * 1024)).toStringAsFixed(2),
|
||||
);
|
||||
}
|
||||
if (bytes >= 1024 * 1024) {
|
||||
final mb = bytes / (1024 * 1024);
|
||||
final digits = mb >= 100 ? 0 : 1;
|
||||
return l10n.mapCache_sizeMegabytes(mb.toStringAsFixed(digits));
|
||||
}
|
||||
if (bytes >= 1024) {
|
||||
return l10n.mapCache_sizeKilobytes((bytes / 1024).toStringAsFixed(0));
|
||||
}
|
||||
return l10n.mapCache_sizeBytes('$bytes');
|
||||
}
|
||||
|
||||
String? _progressCaption(AppLocalizations l10n) {
|
||||
if (item.status != ModelDownloadStatus.downloading) return null;
|
||||
if (item.detail != null && item.detail!.isNotEmpty) return null;
|
||||
final currentMb = item.downloadedBytes / (1024 * 1024);
|
||||
final total = item.totalBytes;
|
||||
if (total == null || total <= 0) {
|
||||
return l10n.mapCache_sizeMegabytes(currentMb.toStringAsFixed(1));
|
||||
}
|
||||
final totalMb = total / (1024 * 1024);
|
||||
final fraction = item.progress ?? (item.downloadedBytes / total);
|
||||
final percent = (fraction * 100).clamp(0, 100).toStringAsFixed(0);
|
||||
return l10n.modelDownload_progress(
|
||||
currentMb.toStringAsFixed(1),
|
||||
totalMb.toStringAsFixed(1),
|
||||
percent,
|
||||
);
|
||||
}
|
||||
}
|
||||
+538
-171
@@ -1,12 +1,17 @@
|
||||
import 'dart:typed_data';
|
||||
import 'dart:async';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../connector/meshcore_protocol.dart';
|
||||
import '../helpers/path_helper.dart';
|
||||
import '../l10n/contact_localization.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../models/contact.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import '../utils/contact_search.dart';
|
||||
import 'mesh_ui.dart';
|
||||
|
||||
class PathEditorSheet extends StatefulWidget {
|
||||
final List<Contact> availableContacts;
|
||||
@@ -26,23 +31,28 @@ class PathEditorSheet extends StatefulWidget {
|
||||
List<int> initialPath = const [],
|
||||
int pathHashByteWidth = pathHashSize,
|
||||
}) {
|
||||
return showModalBottomSheet<Uint8List>(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
useSafeArea: true,
|
||||
builder: (context) => Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context).viewInsets.bottom,
|
||||
),
|
||||
child: FractionallySizedBox(
|
||||
heightFactor: 0.9,
|
||||
child: PathEditorSheet(
|
||||
availableContacts: availableContacts,
|
||||
initialPath: initialPath,
|
||||
pathHashByteWidth: pathHashByteWidth,
|
||||
),
|
||||
),
|
||||
),
|
||||
// Same container as the other sheets: safe area on the top and sides,
|
||||
// keyboard inset on the bottom, and the header at the top of the sheet.
|
||||
// A fraction inside an expanding align left an empty band above the handle.
|
||||
return showMeshSheet<Uint8List>(
|
||||
context,
|
||||
builder: (context) {
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final height = constraints.maxHeight.isFinite
|
||||
? constraints.maxHeight
|
||||
: MediaQuery.sizeOf(context).height;
|
||||
return SizedBox(
|
||||
height: height,
|
||||
child: PathEditorSheet(
|
||||
availableContacts: availableContacts,
|
||||
initialPath: initialPath,
|
||||
pathHashByteWidth: pathHashByteWidth,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -62,10 +72,15 @@ class _PathEditorSheetState extends State<PathEditorSheet> {
|
||||
|
||||
final List<_Hop> _hops = [];
|
||||
final _hexController = TextEditingController();
|
||||
final _hexFocus = FocusNode();
|
||||
final _searchFocus = FocusNode();
|
||||
final _hopScroll = ScrollController();
|
||||
String? _hexError;
|
||||
bool _syncingHex = false;
|
||||
String _search = '';
|
||||
int _nextHopId = 0;
|
||||
int? _highlightedHopId;
|
||||
Timer? _highlightTimer;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -81,18 +96,27 @@ class _PathEditorSheetState extends State<PathEditorSheet> {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_highlightTimer?.cancel();
|
||||
_hopScroll.dispose();
|
||||
_hexFocus.dispose();
|
||||
_searchFocus.dispose();
|
||||
_hexController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
int get _hashChars {
|
||||
final width = widget.pathHashByteWidth.clamp(1, pubKeySize).toInt();
|
||||
return width * 2;
|
||||
}
|
||||
|
||||
List<Contact> get _repeaters {
|
||||
final query = _search.trim().toLowerCase();
|
||||
final query = _search.trim();
|
||||
return widget.availableContacts
|
||||
.where((c) => c.type == advTypeRepeater || c.type == advTypeRoom)
|
||||
.where((c) => c.publicKey.isNotEmpty)
|
||||
.where((c) => query.isEmpty || c.name.toLowerCase().contains(query))
|
||||
.where((c) => rankContactQuery(c, query) != null)
|
||||
.toList()
|
||||
..sort((a, b) => a.name.toLowerCase().compareTo(b.name.toLowerCase()));
|
||||
..sort((a, b) => compareContactQueryRank(a, b, query));
|
||||
}
|
||||
|
||||
void _syncHexFromHops() {
|
||||
@@ -129,6 +153,7 @@ class _PathEditorSheetState extends State<PathEditorSheet> {
|
||||
return;
|
||||
}
|
||||
_hexError = null;
|
||||
final previous = _hops.length;
|
||||
_hops
|
||||
..clear()
|
||||
..addAll(
|
||||
@@ -140,6 +165,9 @@ class _PathEditorSheetState extends State<PathEditorSheet> {
|
||||
return _Hop(_nextHopId++, Uint8List.fromList(bytes));
|
||||
}),
|
||||
);
|
||||
if (_hops.length > previous && _hops.isNotEmpty) {
|
||||
_markHopAdded(_hops.last.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -148,14 +176,38 @@ class _PathEditorSheetState extends State<PathEditorSheet> {
|
||||
final width = widget.pathHashByteWidth
|
||||
.clamp(1, contact.publicKey.length)
|
||||
.toInt();
|
||||
HapticFeedback.selectionClick();
|
||||
setState(() {
|
||||
_hops.add(
|
||||
_Hop(
|
||||
_nextHopId++,
|
||||
Uint8List.fromList(contact.publicKey.sublist(0, width)),
|
||||
),
|
||||
final hop = _Hop(
|
||||
_nextHopId++,
|
||||
Uint8List.fromList(contact.publicKey.sublist(0, width)),
|
||||
);
|
||||
_hops.add(hop);
|
||||
_syncHexFromHops();
|
||||
_markHopAdded(hop.id);
|
||||
});
|
||||
}
|
||||
|
||||
void _markHopAdded(int id) {
|
||||
_highlightedHopId = id;
|
||||
_highlightTimer?.cancel();
|
||||
_highlightTimer = Timer(const Duration(milliseconds: 1400), () {
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
if (_highlightedHopId == id) _highlightedHopId = null;
|
||||
});
|
||||
});
|
||||
_revealLatestHop();
|
||||
}
|
||||
|
||||
void _revealLatestHop() {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!mounted || !_hopScroll.hasClients) return;
|
||||
_hopScroll.animateTo(
|
||||
_hopScroll.position.maxScrollExtent,
|
||||
duration: const Duration(milliseconds: 180),
|
||||
curve: Curves.easeOut,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -182,7 +234,14 @@ class _PathEditorSheetState extends State<PathEditorSheet> {
|
||||
Navigator.pop(context, Uint8List.fromList(bytes));
|
||||
}
|
||||
|
||||
Widget _hopTile(BuildContext context, int index) {
|
||||
String _contactHopHex(Contact contact) {
|
||||
final width = widget.pathHashByteWidth
|
||||
.clamp(1, contact.publicKey.length)
|
||||
.toInt();
|
||||
return PathHelper.formatHopHex(contact.publicKey.sublist(0, width));
|
||||
}
|
||||
|
||||
Widget _hopTile(BuildContext context, int index, {required bool singleLine}) {
|
||||
final l10n = context.l10n;
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final hop = _hops[index];
|
||||
@@ -200,41 +259,61 @@ class _PathEditorSheetState extends State<PathEditorSheet> {
|
||||
: matches.length == 1
|
||||
? matches.first.name
|
||||
: matches.map((c) => c.name).join(' | ');
|
||||
final highlighted = hop.id == _highlightedHopId;
|
||||
|
||||
return ListTile(
|
||||
final label = name ?? l10n.pathEditor_unknownHop;
|
||||
final hash = Text(hex, style: MeshTheme.mono(fontSize: 12));
|
||||
return Material(
|
||||
key: ValueKey(hop.id),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
leading: CircleAvatar(
|
||||
radius: 14,
|
||||
backgroundColor: scheme.primaryContainer,
|
||||
child: Text(
|
||||
'${index + 1}',
|
||||
style: TextStyle(fontSize: 12, color: scheme.onPrimaryContainer),
|
||||
color: highlighted ? scheme.primaryContainer : scheme.surfaceContainerLow,
|
||||
child: ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
visualDensity: singleLine
|
||||
? VisualDensity.compact
|
||||
: VisualDensity.standard,
|
||||
minVerticalPadding: singleLine ? 0 : 4,
|
||||
leading: CircleAvatar(
|
||||
radius: 16,
|
||||
backgroundColor: scheme.primary,
|
||||
child: Text(
|
||||
'${index + 1}',
|
||||
style: TextStyle(fontSize: 12, color: scheme.onPrimary),
|
||||
),
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
name ?? l10n.pathEditor_unknownHop,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
subtitle: Text(hex),
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.remove_circle_outline),
|
||||
tooltip: l10n.pathEditor_removeHop,
|
||||
constraints: const BoxConstraints(minWidth: 44, minHeight: 44),
|
||||
onPressed: () => _removeHop(index),
|
||||
),
|
||||
ReorderableDragStartListener(
|
||||
index: index,
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 12),
|
||||
child: Icon(Icons.drag_handle),
|
||||
title: singleLine
|
||||
? Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
label,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
hash,
|
||||
],
|
||||
)
|
||||
: Text(label, maxLines: 1, overflow: TextOverflow.ellipsis),
|
||||
subtitle: singleLine ? null : hash,
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.remove_circle_outline),
|
||||
tooltip: l10n.pathEditor_removeHop,
|
||||
onPressed: () => _removeHop(index),
|
||||
),
|
||||
),
|
||||
],
|
||||
ReorderableDragStartListener(
|
||||
index: index,
|
||||
child: const SizedBox(
|
||||
width: 48,
|
||||
height: 48,
|
||||
child: Icon(Icons.drag_handle),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -246,16 +325,16 @@ class _PathEditorSheetState extends State<PathEditorSheet> {
|
||||
final full = _hops.length >= _maxHops;
|
||||
|
||||
return ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 4),
|
||||
enabled: !full,
|
||||
leading: CircleAvatar(
|
||||
radius: 16,
|
||||
radius: 18,
|
||||
backgroundColor: isRepeater
|
||||
? scheme.primaryContainer
|
||||
: scheme.secondaryContainer,
|
||||
child: Icon(
|
||||
isRepeater ? Icons.router : Icons.meeting_room,
|
||||
size: 16,
|
||||
size: 18,
|
||||
color: isRepeater
|
||||
? scheme.onPrimaryContainer
|
||||
: scheme.onSecondaryContainer,
|
||||
@@ -263,127 +342,372 @@ class _PathEditorSheetState extends State<PathEditorSheet> {
|
||||
),
|
||||
title: Text(contact.name, maxLines: 1, overflow: TextOverflow.ellipsis),
|
||||
subtitle: Text(
|
||||
'${contact.typeLabel(l10n)} • ${PathHelper.formatHopHex(contact.publicKey.sublist(0, widget.pathHashByteWidth.clamp(1, contact.publicKey.length).toInt()))}',
|
||||
'${contact.typeLabel(l10n)} • ${_contactHopHex(contact)}',
|
||||
style: MeshTheme.mono(fontSize: 12),
|
||||
),
|
||||
trailing: Icon(
|
||||
Icons.add_circle_outline,
|
||||
color: full ? scheme.outline : scheme.primary,
|
||||
),
|
||||
trailing: const Icon(Icons.add_circle_outline),
|
||||
onTap: full ? null : () => _addHop(contact),
|
||||
);
|
||||
}
|
||||
|
||||
/// Heights for the hop list, hex field, and search field inside the
|
||||
/// measured band between the title and the action buttons.
|
||||
///
|
||||
/// An invalid hex path grows the error text. That growth comes out of the
|
||||
/// hop viewport first, keeping one row when it fits. When even one hop row,
|
||||
/// the hex field with any active error, and the search field cannot fit,
|
||||
/// [scroll] switches the middle band to a single scroll view so nothing is
|
||||
/// crushed or overflows and all controls stay reachable.
|
||||
({double hop, double hex, double search, bool scroll}) _middleBudget(
|
||||
double space,
|
||||
bool compact,
|
||||
) {
|
||||
final scaler = MediaQuery.textScalerOf(context);
|
||||
final row = compact
|
||||
? scaler.scale(56).clamp(56.0, 96.0)
|
||||
: scaler.scale(76).clamp(72.0, 140.0);
|
||||
final minRepeater = compact ? 56.0 : 80.0;
|
||||
final searchH = scaler.scale(compact ? 48 : 56) + 20;
|
||||
final baseHex = scaler.scale(compact ? 48 : 64) + (compact ? 16 : 44);
|
||||
final errorExtra = _hexError == null
|
||||
? 0.0
|
||||
: scaler.scale(compact ? 56 : 52);
|
||||
final wantedHop = _hops.isEmpty
|
||||
? math.min(scaler.scale(compact ? 64 : 80), 140.0)
|
||||
: math.min(_hops.length, compact ? 2 : 3) * row + 4;
|
||||
final wantedHex = baseHex + errorExtra;
|
||||
final minHop = _hops.isEmpty ? 0.0 : row;
|
||||
final scroll = minHop + wantedHex + searchH > space;
|
||||
|
||||
var hopH = wantedHop;
|
||||
if (!scroll) {
|
||||
final targetMax = math.max(
|
||||
minHop + wantedHex + searchH,
|
||||
space - minRepeater,
|
||||
);
|
||||
final used = hopH + wantedHex + searchH;
|
||||
if (used > targetMax) {
|
||||
hopH -= math.min(used - targetMax, math.max(0.0, hopH - minHop));
|
||||
}
|
||||
}
|
||||
return (hop: hopH, hex: wantedHex, search: searchH, scroll: scroll);
|
||||
}
|
||||
|
||||
Widget _hopViewport(bool compact, double height) {
|
||||
final l10n = context.l10n;
|
||||
final theme = Theme.of(context);
|
||||
final scheme = theme.colorScheme;
|
||||
return SizedBox(
|
||||
height: height,
|
||||
child: height < 8
|
||||
? const SizedBox.shrink()
|
||||
: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 4, 16, 0),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: scheme.surfaceContainerLow,
|
||||
borderRadius: BorderRadius.circular(MeshRadii.md),
|
||||
border: Border.all(color: scheme.outlineVariant),
|
||||
),
|
||||
child: _hops.isEmpty
|
||||
? SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Text(
|
||||
l10n.pathEditor_noHops,
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
)
|
||||
: ReorderableListView.builder(
|
||||
scrollController: _hopScroll,
|
||||
buildDefaultDragHandles: false,
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: compact ? 0 : 4,
|
||||
),
|
||||
itemCount: _hops.length,
|
||||
onReorderItem: _reorderHop,
|
||||
itemBuilder: (context, index) =>
|
||||
_hopTile(context, index, singleLine: compact),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _hexViewport(bool compact, double height) {
|
||||
final l10n = context.l10n;
|
||||
final theme = Theme.of(context);
|
||||
return SizedBox(
|
||||
height: height,
|
||||
child: SingleChildScrollView(
|
||||
padding: EdgeInsets.fromLTRB(16, compact ? 6 : 12, 16, 0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (!compact) ...[
|
||||
Text(
|
||||
l10n.pathEditor_advancedHex,
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
TextField(
|
||||
key: const Key('path-editor-hex-field'),
|
||||
controller: _hexController,
|
||||
focusNode: _hexFocus,
|
||||
onChanged: _onHexChanged,
|
||||
textCapitalization: TextCapitalization.characters,
|
||||
style: MeshTheme.mono(fontSize: 14),
|
||||
scrollPadding: EdgeInsets.zero,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.pathEditor_hexLabel,
|
||||
helperText: compact || _hexError != null
|
||||
? null
|
||||
: l10n.pathEditor_hexHelper(_hashChars),
|
||||
helperMaxLines: 3,
|
||||
errorText: _hexError,
|
||||
errorMaxLines: compact ? 4 : 3,
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: compact,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _searchViewport(bool compact, double height) {
|
||||
final l10n = context.l10n;
|
||||
return SizedBox(
|
||||
height: height,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(16, compact ? 6 : 12, 16, 0),
|
||||
child: TextField(
|
||||
key: const Key('path-editor-search-field'),
|
||||
focusNode: _searchFocus,
|
||||
onChanged: (value) => setState(() => _search = value),
|
||||
scrollPadding: EdgeInsets.zero,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.pathEditor_searchRepeaters,
|
||||
prefixIcon: const Icon(Icons.search),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: compact,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _repeaterViewport(List<Contact> repeaters) {
|
||||
final l10n = context.l10n;
|
||||
final theme = Theme.of(context);
|
||||
final scheme = theme.colorScheme;
|
||||
if (repeaters.isEmpty) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 8),
|
||||
child: Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
l10n.path_noRepeatersFound,
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return ListView.builder(
|
||||
key: const Key('path-editor-repeater-list'),
|
||||
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
|
||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 8),
|
||||
itemCount: repeaters.length,
|
||||
itemBuilder: (context, index) => _repeaterTile(context, repeaters[index]),
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> _middleSlivers({
|
||||
required bool compact,
|
||||
required List<Contact> repeaters,
|
||||
}) {
|
||||
final l10n = context.l10n;
|
||||
final theme = Theme.of(context);
|
||||
final scheme = theme.colorScheme;
|
||||
return [
|
||||
SliverToBoxAdapter(child: _scrollHopBlock(compact)),
|
||||
SliverToBoxAdapter(child: _scrollHexBlock(compact)),
|
||||
SliverToBoxAdapter(child: _scrollSearchBlock(compact)),
|
||||
if (repeaters.isEmpty)
|
||||
SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 8),
|
||||
child: Text(
|
||||
l10n.path_noRepeatersFound,
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 8),
|
||||
sliver: SliverList.builder(
|
||||
key: const Key('path-editor-repeater-list'),
|
||||
itemCount: repeaters.length,
|
||||
itemBuilder: (context, index) =>
|
||||
_repeaterTile(context, repeaters[index]),
|
||||
),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
/// One scrollable for the hop list, hex field, search field, and repeaters.
|
||||
///
|
||||
/// The blocks are intrinsic height with no nested scrolling, so a drag
|
||||
/// anywhere in the band moves the search field and the repeater list into
|
||||
/// view. The pinned layout keeps its own viewports.
|
||||
Widget _scrollingMiddle({
|
||||
required bool compact,
|
||||
required List<Contact> repeaters,
|
||||
}) {
|
||||
return CustomScrollView(
|
||||
key: const Key('path-editor-scroll-fallback'),
|
||||
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
|
||||
slivers: _middleSlivers(compact: compact, repeaters: repeaters),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _scrollHopBlock(bool compact) {
|
||||
final l10n = context.l10n;
|
||||
final theme = Theme.of(context);
|
||||
final scheme = theme.colorScheme;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 4, 16, 0),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: scheme.surfaceContainerLow,
|
||||
borderRadius: BorderRadius.circular(MeshRadii.md),
|
||||
border: Border.all(color: scheme.outlineVariant),
|
||||
),
|
||||
child: _hops.isEmpty
|
||||
? Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Text(
|
||||
l10n.pathEditor_noHops,
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
)
|
||||
: ReorderableListView.builder(
|
||||
scrollController: _hopScroll,
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
buildDefaultDragHandles: false,
|
||||
padding: EdgeInsets.symmetric(vertical: compact ? 0 : 4),
|
||||
itemCount: _hops.length,
|
||||
onReorderItem: _reorderHop,
|
||||
itemBuilder: (context, index) =>
|
||||
_hopTile(context, index, singleLine: compact),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _scrollHexBlock(bool compact) {
|
||||
final l10n = context.l10n;
|
||||
final theme = Theme.of(context);
|
||||
return Padding(
|
||||
padding: EdgeInsets.fromLTRB(16, compact ? 6 : 12, 16, 0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (!compact) ...[
|
||||
Text(
|
||||
l10n.pathEditor_advancedHex,
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
TextField(
|
||||
key: const Key('path-editor-hex-field'),
|
||||
controller: _hexController,
|
||||
focusNode: _hexFocus,
|
||||
onChanged: _onHexChanged,
|
||||
textCapitalization: TextCapitalization.characters,
|
||||
style: MeshTheme.mono(fontSize: 14),
|
||||
scrollPadding: EdgeInsets.zero,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.pathEditor_hexLabel,
|
||||
helperText: compact || _hexError != null
|
||||
? null
|
||||
: l10n.pathEditor_hexHelper(_hashChars),
|
||||
helperMaxLines: 3,
|
||||
errorText: _hexError,
|
||||
errorMaxLines: compact ? 4 : 3,
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: compact,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _scrollSearchBlock(bool compact) {
|
||||
final l10n = context.l10n;
|
||||
return Padding(
|
||||
padding: EdgeInsets.fromLTRB(16, compact ? 6 : 12, 16, 0),
|
||||
child: TextField(
|
||||
key: const Key('path-editor-search-field'),
|
||||
focusNode: _searchFocus,
|
||||
onChanged: (value) => setState(() => _search = value),
|
||||
scrollPadding: EdgeInsets.zero,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.pathEditor_searchRepeaters,
|
||||
prefixIcon: const Icon(Icons.search),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: compact,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = context.l10n;
|
||||
final theme = Theme.of(context);
|
||||
final scheme = theme.colorScheme;
|
||||
final repeaters = _repeaters;
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
const SizedBox(height: 8),
|
||||
Container(
|
||||
width: 32,
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
color: scheme.outlineVariant,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final maxHeight = constraints.maxHeight.isFinite
|
||||
? constraints.maxHeight
|
||||
: 640.0;
|
||||
// Phone sheets and a keyboard-shrunk window use the shorter hop rows
|
||||
// so the action buttons stay below the repeater list.
|
||||
final compact = maxHeight < 680;
|
||||
final scaler = MediaQuery.textScalerOf(context);
|
||||
final header = Semantics(
|
||||
liveRegion: true,
|
||||
child: BottomSheetHeader(
|
||||
title: l10n.pathEditor_title,
|
||||
subtitle: l10n.pathEditor_hopCounter(_hops.length),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(l10n.pathEditor_title, style: theme.textTheme.titleLarge),
|
||||
Text(
|
||||
l10n.pathEditor_hopCounter(_hops.length),
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 8),
|
||||
children: [
|
||||
if (_hops.isEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
child: Text(
|
||||
l10n.pathEditor_noHops,
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
ReorderableListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
buildDefaultDragHandles: false,
|
||||
itemCount: _hops.length,
|
||||
onReorderItem: _reorderHop,
|
||||
itemBuilder: _hopTile,
|
||||
),
|
||||
const Divider(),
|
||||
const SizedBox(height: 8),
|
||||
Text(l10n.pathEditor_addHops, style: theme.textTheme.titleSmall),
|
||||
const SizedBox(height: 8),
|
||||
TextField(
|
||||
onChanged: (value) => setState(() => _search = value),
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.pathEditor_searchRepeaters,
|
||||
prefixIcon: const Icon(Icons.search),
|
||||
border: const OutlineInputBorder(),
|
||||
isDense: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
if (repeaters.isEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
child: Text(
|
||||
l10n.path_noRepeatersFound,
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
...repeaters.map((c) => _repeaterTile(context, c)),
|
||||
ExpansionTile(
|
||||
tilePadding: EdgeInsets.zero,
|
||||
title: Text(
|
||||
l10n.pathEditor_advancedHex,
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 12),
|
||||
child: TextField(
|
||||
controller: _hexController,
|
||||
onChanged: _onHexChanged,
|
||||
textCapitalization: TextCapitalization.characters,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.pathEditor_hexLabel,
|
||||
helperText: _hexError == null
|
||||
? l10n.pathEditor_hexHelper
|
||||
: null,
|
||||
errorText: _hexError,
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SafeArea(
|
||||
);
|
||||
final actions = SafeArea(
|
||||
top: false,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 16),
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
16,
|
||||
compact ? 4 : 8,
|
||||
16,
|
||||
compact ? 4 : 16,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -408,8 +732,51 @@ class _PathEditorSheetState extends State<PathEditorSheet> {
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
// When scaled header and action buttons leave less than one row for
|
||||
// the middle band, scroll the whole sheet so nothing clips or crowds
|
||||
// the viewport.
|
||||
if (maxHeight < scaler.scale(150) + 28) {
|
||||
return CustomScrollView(
|
||||
key: const Key('path-editor-scroll-fallback'),
|
||||
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
|
||||
slivers: [
|
||||
SliverToBoxAdapter(child: header),
|
||||
..._middleSlivers(compact: compact, repeaters: repeaters),
|
||||
SliverToBoxAdapter(child: actions),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
header,
|
||||
Expanded(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, inner) {
|
||||
final budget = _middleBudget(inner.maxHeight, compact);
|
||||
if (budget.scroll) {
|
||||
return _scrollingMiddle(
|
||||
compact: compact,
|
||||
repeaters: repeaters,
|
||||
);
|
||||
}
|
||||
return Column(
|
||||
children: [
|
||||
_hopViewport(compact, budget.hop),
|
||||
_hexViewport(compact, budget.hex),
|
||||
_searchViewport(compact, budget.search),
|
||||
Expanded(child: _repeaterViewport(repeaters)),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
actions,
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,13 @@ import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../connector/meshcore_connector.dart';
|
||||
import '../connector/meshcore_protocol.dart';
|
||||
import '../helpers/contact_share_message.dart';
|
||||
import '../l10n/contact_localization.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../models/contact.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import '../utils/contact_search.dart';
|
||||
import 'mesh_ui.dart';
|
||||
|
||||
/// Lets the user pick a saved contact (or themself) and appends the encoded
|
||||
@@ -50,21 +52,19 @@ class _ShareContactSheetState extends State<_ShareContactSheet> {
|
||||
final contacts =
|
||||
connector.contacts
|
||||
.where(
|
||||
(c) =>
|
||||
c.publicKey.length == 32 &&
|
||||
(needle.isEmpty || c.name.toLowerCase().contains(needle)),
|
||||
(c) => c.publicKey.length == 32 && matchesContactQuery(c, needle),
|
||||
)
|
||||
.toList()
|
||||
..sort(
|
||||
(a, b) => a.name.toLowerCase().compareTo(b.name.toLowerCase()),
|
||||
);
|
||||
..sort((a, b) => compareContactQueryRank(a, b, needle));
|
||||
final selfName = connector.selfName ?? '';
|
||||
final showSelf =
|
||||
selfKey != null &&
|
||||
selfKey.length == 32 &&
|
||||
(needle.isEmpty ||
|
||||
selfName.toLowerCase().contains(needle) ||
|
||||
l10n.contactShare_myContact.toLowerCase().contains(needle));
|
||||
final selfRank = selfKey != null && selfKey.length == 32
|
||||
? rankLabeledKeyQuery(
|
||||
name: selfName.isEmpty ? l10n.contactShare_myContact : selfName,
|
||||
publicKeyHex: pubKeyToHex(selfKey),
|
||||
query: needle,
|
||||
aliases: [l10n.contactShare_myContact],
|
||||
)
|
||||
: null;
|
||||
|
||||
return SafeArea(
|
||||
child: ConstrainedBox(
|
||||
@@ -86,43 +86,68 @@ class _ShareContactSheetState extends State<_ShareContactSheet> {
|
||||
onChanged: (value) => setState(() => _query = value),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
children: [
|
||||
if (showSelf)
|
||||
_tile(
|
||||
context,
|
||||
name: selfName.isEmpty
|
||||
? l10n.contactShare_myContact
|
||||
: selfName,
|
||||
subtitle: l10n.contactShare_myContact,
|
||||
token: encodeContactShare(
|
||||
publicKey: selfKey,
|
||||
type: 1,
|
||||
name: selfName,
|
||||
),
|
||||
),
|
||||
for (final c in contacts) _contactTile(context, c),
|
||||
if (!showSelf && contacts.isEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Center(
|
||||
child: Text(
|
||||
l10n.contactShare_noContacts,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Flexible(child: _shareList(context, contacts, selfRank)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _shareList(
|
||||
BuildContext context,
|
||||
List<Contact> contacts,
|
||||
ContactQueryRank? selfRank,
|
||||
) {
|
||||
final l10n = context.l10n;
|
||||
final connector = widget.connector;
|
||||
final selfKey = connector.selfPublicKey;
|
||||
final selfName = connector.selfName ?? '';
|
||||
final rows =
|
||||
<({int rank, String name, Widget tile})>[
|
||||
for (final contact in contacts)
|
||||
(
|
||||
rank: rankContactQuery(contact, _query)?.index ?? 3,
|
||||
name: contact.name.toLowerCase(),
|
||||
tile: _contactTile(context, contact),
|
||||
),
|
||||
if (selfRank != null && selfKey != null)
|
||||
(
|
||||
rank: selfRank.index,
|
||||
name: (selfName.isEmpty ? l10n.contactShare_myContact : selfName)
|
||||
.toLowerCase(),
|
||||
tile: _tile(
|
||||
context,
|
||||
name: selfName.isEmpty ? l10n.contactShare_myContact : selfName,
|
||||
subtitle: l10n.contactShare_myContact,
|
||||
token: encodeContactShare(
|
||||
publicKey: selfKey,
|
||||
type: 1,
|
||||
name: selfName,
|
||||
),
|
||||
),
|
||||
),
|
||||
]..sort((a, b) {
|
||||
final byRank = a.rank.compareTo(b.rank);
|
||||
if (byRank != 0) return byRank;
|
||||
return a.name.compareTo(b.name);
|
||||
});
|
||||
if (rows.isEmpty) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Center(
|
||||
child: Text(
|
||||
l10n.contactShare_noContacts,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return ListView(
|
||||
shrinkWrap: true,
|
||||
children: [for (final row in rows) row.tile],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _contactTile(BuildContext context, Contact c) {
|
||||
return _tile(
|
||||
context,
|
||||
|
||||
@@ -2,12 +2,15 @@ import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../helpers/snack_bar_builder.dart';
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../models/app_settings.dart';
|
||||
import '../models/translation_support.dart';
|
||||
import '../services/app_settings_service.dart';
|
||||
import '../services/translation_service.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import 'mesh_nav_tile.dart';
|
||||
import 'model_download_list.dart';
|
||||
import 'settings_reveal.dart';
|
||||
|
||||
/// [TranslationService] publishes this as `downloadFileName` while it merges
|
||||
/// downloaded chunks (see translation_service.dart). The service owns the
|
||||
@@ -15,24 +18,21 @@ import 'mesh_nav_tile.dart';
|
||||
/// place, until the service grows a proper "merging" getter.
|
||||
const String _mergingChunksFileName = 'Merging chunks...';
|
||||
|
||||
/// On-device translation settings: feature toggles, target language, model
|
||||
/// selection, model downloads and the downloaded-model list.
|
||||
/// On-device translation settings: feature toggles, target language, and the
|
||||
/// shared model list.
|
||||
///
|
||||
/// Watches only [AppSettingsService] and [TranslationService], so download
|
||||
/// progress ticks rebuild this card and nothing else on the settings screen.
|
||||
/// [_TranslationModels] watches [TranslationService], so download progress
|
||||
/// rebuilds the model rows and not the toggles above them.
|
||||
class TranslationSettingsSection extends StatelessWidget {
|
||||
const TranslationSettingsSection({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final settingsService = context.watch<AppSettingsService>();
|
||||
final translationService = context.watch<TranslationService>();
|
||||
final l10n = context.l10n;
|
||||
final settings = settingsService.settings;
|
||||
final translationEnabled = settings.translationEnabled;
|
||||
final theme = Theme.of(context);
|
||||
final scheme = theme.colorScheme;
|
||||
final textTheme = theme.textTheme;
|
||||
final disabledColor = translationEnabled ? null : theme.disabledColor;
|
||||
const tilePadding = EdgeInsets.symmetric(horizontal: 16, vertical: 4);
|
||||
|
||||
@@ -44,253 +44,74 @@ class TranslationSettingsSection extends StatelessWidget {
|
||||
secondary: const Icon(Icons.translate, size: 24),
|
||||
title: Text(l10n.translation_enableTitle),
|
||||
subtitle: Text(l10n.translation_enableSubtitle),
|
||||
value: settings.translationEnabled,
|
||||
value: translationEnabled,
|
||||
onChanged: settingsService.setTranslationEnabled,
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
SwitchListTile(
|
||||
contentPadding: tilePadding,
|
||||
secondary: Icon(
|
||||
Icons.auto_awesome_outlined,
|
||||
size: 24,
|
||||
color: disabledColor,
|
||||
),
|
||||
title: Text(
|
||||
l10n.translation_autoIncomingTitle,
|
||||
style: TextStyle(color: disabledColor),
|
||||
),
|
||||
subtitle: Text(
|
||||
l10n.translation_autoIncomingSubtitle,
|
||||
style: TextStyle(color: disabledColor),
|
||||
),
|
||||
value: settings.autoTranslateIncomingMessages,
|
||||
onChanged: translationEnabled
|
||||
? settingsService.setAutoTranslateIncomingMessages
|
||||
: null,
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
SwitchListTile(
|
||||
contentPadding: tilePadding,
|
||||
secondary: Icon(Icons.outgoing_mail, size: 24, color: disabledColor),
|
||||
title: Text(
|
||||
l10n.translation_composerTitle,
|
||||
style: TextStyle(color: disabledColor),
|
||||
),
|
||||
subtitle: Text(
|
||||
l10n.translation_composerSubtitle,
|
||||
style: TextStyle(color: disabledColor),
|
||||
),
|
||||
value: settings.composerTranslationEnabled,
|
||||
onChanged: translationEnabled
|
||||
? settingsService.setComposerTranslationEnabled
|
||||
: null,
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
MeshNavTile(
|
||||
icon: Icons.language,
|
||||
title: l10n.translation_targetLanguage,
|
||||
subtitle: _translationLanguageLabel(
|
||||
context,
|
||||
settings.translationTargetLanguageCode,
|
||||
),
|
||||
onTap: () => _showTranslationLanguageDialog(context, settingsService),
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 4),
|
||||
child: DropdownButtonFormField<String>(
|
||||
initialValue: settings.translationSelectedModelId,
|
||||
isExpanded: true,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.translation_downloadedModelLabel,
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
items: [
|
||||
for (final model in settings.translationDownloadedModels)
|
||||
DropdownMenuItem(
|
||||
value: model.id,
|
||||
child: Text(
|
||||
translationModelFriendlyName(model),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
onChanged: settings.translationDownloadedModels.isEmpty
|
||||
? null
|
||||
: (value) {
|
||||
settingsService.setTranslationSelectedModelId(value);
|
||||
},
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 4),
|
||||
child: DropdownButtonFormField<String>(
|
||||
initialValue: null,
|
||||
isExpanded: true,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.translation_presetModelLabel,
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
items: [
|
||||
for (final preset in translationPresetModels)
|
||||
DropdownMenuItem(
|
||||
value: preset.sourceUrl,
|
||||
child: Text(
|
||||
translationModelFriendlyName(preset),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
onChanged: translationService.isBusy
|
||||
? null
|
||||
: (value) async {
|
||||
if (value == null) return;
|
||||
final preset = translationPresetModels.firstWhere(
|
||||
(entry) => entry.sourceUrl == value,
|
||||
);
|
||||
await _downloadTranslationModel(
|
||||
context,
|
||||
translationService,
|
||||
settingsService,
|
||||
sourceUrl: preset.sourceUrl,
|
||||
fileName: preset.name,
|
||||
id: preset.id,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_TranslationUrlField(
|
||||
initialValue: settings.translationModelSourceUrl ?? '',
|
||||
onChanged: settingsService.setTranslationModelSourceUrl,
|
||||
onDownload: translationService.isBusy
|
||||
? null
|
||||
: (url) => _downloadTranslationModel(
|
||||
context,
|
||||
translationService,
|
||||
settingsService,
|
||||
sourceUrl: url,
|
||||
),
|
||||
downloadLabel: translationService.isDownloading
|
||||
? l10n.translation_downloading
|
||||
: translationService.isBusy
|
||||
? l10n.translation_working
|
||||
: l10n.translation_downloadModel,
|
||||
isDownloading: translationService.isDownloading,
|
||||
onCancel: translationService.cancelDownload,
|
||||
labelText: l10n.translation_manualUrlLabel,
|
||||
stopLabel: l10n.translation_stop,
|
||||
SettingsReveal(
|
||||
visible: translationEnabled,
|
||||
children: [
|
||||
SwitchListTile(
|
||||
contentPadding: tilePadding,
|
||||
secondary: Icon(
|
||||
Icons.auto_awesome_outlined,
|
||||
size: 24,
|
||||
color: disabledColor,
|
||||
),
|
||||
if (translationService.isDownloading) ...[
|
||||
const SizedBox(height: 12),
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
child: LinearProgressIndicator(
|
||||
value: _isMerging(translationService)
|
||||
? null
|
||||
: translationService.downloadProgress,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
_downloadProgressLabel(context, translationService),
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 14,
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
if (settings.translationDownloadedModels.isNotEmpty) ...[
|
||||
const SizedBox(height: 16),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
l10n.translation_downloadedModels,
|
||||
style: textTheme.titleSmall,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
for (final model in settings.translationDownloadedModels)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
model.id == settings.translationSelectedModelId
|
||||
? Icons.check_circle
|
||||
: Icons.memory_outlined,
|
||||
size: 24,
|
||||
color: model.id == settings.translationSelectedModelId
|
||||
? scheme.primary
|
||||
: scheme.onSurfaceVariant,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(MeshRadii.xs),
|
||||
onTap: () => settingsService
|
||||
.setTranslationSelectedModelId(model.id),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
translationModelFriendlyName(model),
|
||||
style: textTheme.bodyLarge?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
_downloadedModelLabel(context, model),
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 12,
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: l10n.translation_deleteModel,
|
||||
onPressed: translationService.isBusy
|
||||
? null
|
||||
: () => _deleteTranslationModel(
|
||||
context,
|
||||
translationService,
|
||||
model,
|
||||
),
|
||||
icon: const Icon(Icons.delete_outline),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
if (translationService.lastError != null) ...[
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
translationService.lastError!,
|
||||
style: TextStyle(color: scheme.error),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
title: Text(
|
||||
l10n.translation_autoIncomingTitle,
|
||||
style: TextStyle(color: disabledColor),
|
||||
),
|
||||
subtitle: Text(
|
||||
l10n.translation_autoIncomingSubtitle,
|
||||
style: TextStyle(color: disabledColor),
|
||||
),
|
||||
value: settings.autoTranslateIncomingMessages,
|
||||
onChanged: translationEnabled
|
||||
? settingsService.setAutoTranslateIncomingMessages
|
||||
: null,
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
SwitchListTile(
|
||||
contentPadding: tilePadding,
|
||||
secondary: Icon(
|
||||
Icons.outgoing_mail,
|
||||
size: 24,
|
||||
color: disabledColor,
|
||||
),
|
||||
title: Text(
|
||||
l10n.translation_composerTitle,
|
||||
style: TextStyle(color: disabledColor),
|
||||
),
|
||||
subtitle: Text(
|
||||
l10n.translation_composerSubtitle,
|
||||
style: TextStyle(color: disabledColor),
|
||||
),
|
||||
value: settings.composerTranslationEnabled,
|
||||
onChanged: translationEnabled
|
||||
? settingsService.setComposerTranslationEnabled
|
||||
: null,
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
MeshNavTile(
|
||||
icon: Icons.language,
|
||||
title: l10n.translation_targetLanguage,
|
||||
subtitle: _translationLanguageLabel(
|
||||
context,
|
||||
settings.translationTargetLanguageCode,
|
||||
),
|
||||
onTap: translationEnabled
|
||||
? () =>
|
||||
_showTranslationLanguageDialog(context, settingsService)
|
||||
: null,
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
const _TranslationModels(),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
static bool _isMerging(TranslationService service) =>
|
||||
service.downloadFileName == _mergingChunksFileName;
|
||||
|
||||
void _showTranslationLanguageDialog(
|
||||
BuildContext context,
|
||||
AppSettingsService settingsService,
|
||||
@@ -308,50 +129,6 @@ class TranslationSettingsSection extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _downloadTranslationModel(
|
||||
BuildContext context,
|
||||
TranslationService translationService,
|
||||
AppSettingsService settingsService, {
|
||||
required String sourceUrl,
|
||||
String? fileName,
|
||||
String? id,
|
||||
}) async {
|
||||
if (sourceUrl.isEmpty) {
|
||||
showDismissibleSnackBar(
|
||||
context,
|
||||
content: Text(context.l10n.translation_enterUrlFirst),
|
||||
);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await translationService.downloadModel(
|
||||
sourceUrl: sourceUrl,
|
||||
fileName: fileName,
|
||||
id: id,
|
||||
);
|
||||
if (!context.mounted) return;
|
||||
showDismissibleSnackBar(
|
||||
context,
|
||||
content: Text(context.l10n.translation_modelDownloaded),
|
||||
);
|
||||
await settingsService.setTranslationEnabled(true);
|
||||
} on TranslationDownloadCancelled {
|
||||
if (!context.mounted) return;
|
||||
showDismissibleSnackBar(
|
||||
context,
|
||||
content: Text(context.l10n.translation_downloadStopped),
|
||||
);
|
||||
} catch (error) {
|
||||
if (!context.mounted) return;
|
||||
showDismissibleSnackBar(
|
||||
context,
|
||||
content: Text(
|
||||
context.l10n.translation_downloadFailed(error.toString()),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
String _translationLanguageLabel(BuildContext context, String? languageCode) {
|
||||
if (languageCode == null || languageCode.isEmpty) {
|
||||
return context.l10n.translation_useAppLanguage;
|
||||
@@ -363,45 +140,418 @@ class TranslationSettingsSection extends StatelessWidget {
|
||||
}
|
||||
return languageCode.toUpperCase();
|
||||
}
|
||||
}
|
||||
|
||||
String _downloadProgressLabel(
|
||||
BuildContext context,
|
||||
TranslationService translationService,
|
||||
) {
|
||||
class _PendingDownload {
|
||||
final String id;
|
||||
final String name;
|
||||
final String sourceUrl;
|
||||
final String? fileName;
|
||||
final String? modelId;
|
||||
|
||||
const _PendingDownload({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.sourceUrl,
|
||||
this.fileName,
|
||||
this.modelId,
|
||||
});
|
||||
}
|
||||
|
||||
/// Preset rows, installed models, and the manual URL field.
|
||||
class _TranslationModels extends StatefulWidget {
|
||||
const _TranslationModels();
|
||||
|
||||
@override
|
||||
State<_TranslationModels> createState() => _TranslationModelsState();
|
||||
}
|
||||
|
||||
class _TranslationModelsState extends State<_TranslationModels> {
|
||||
_PendingDownload? _pending;
|
||||
String? _failedId;
|
||||
String? _failedDetail;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final settingsService = context.watch<AppSettingsService>();
|
||||
final translationService = context.watch<TranslationService>();
|
||||
final l10n = context.l10n;
|
||||
if (_isMerging(translationService)) {
|
||||
return l10n.translation_mergingChunks;
|
||||
}
|
||||
final fileName =
|
||||
translationService.downloadFileName ??
|
||||
l10n.translation_defaultModelName;
|
||||
final currentMb = translationService.downloadedBytes / (1024 * 1024);
|
||||
final totalBytes = translationService.downloadTotalBytes;
|
||||
if (totalBytes == null || totalBytes <= 0) {
|
||||
return l10n.translation_downloadProgressBytes(
|
||||
fileName,
|
||||
currentMb.toStringAsFixed(1),
|
||||
);
|
||||
}
|
||||
final totalMb = totalBytes / (1024 * 1024);
|
||||
final percent = ((translationService.downloadProgress ?? 0) * 100)
|
||||
.toStringAsFixed(0);
|
||||
return l10n.translation_downloadProgressTotal(
|
||||
fileName,
|
||||
currentMb.toStringAsFixed(1),
|
||||
totalMb.toStringAsFixed(1),
|
||||
percent,
|
||||
final settings = settingsService.settings;
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final lastError = translationService.lastError;
|
||||
final showLastError =
|
||||
lastError != null &&
|
||||
lastError.isNotEmpty &&
|
||||
lastError != 'Download stopped.' &&
|
||||
lastError != translationService.failedDownloadError &&
|
||||
lastError != _failedDetail;
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ModelDownloadList(
|
||||
items: _items(l10n, settings, settingsService, translationService),
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 16),
|
||||
child: _TranslationUrlField(
|
||||
initialValue: settings.translationModelSourceUrl ?? '',
|
||||
onChanged: settingsService.setTranslationModelSourceUrl,
|
||||
onDownload: translationService.isBusy
|
||||
? null
|
||||
: (url) => _download(sourceUrl: url),
|
||||
labelText: l10n.translation_manualUrlLabel,
|
||||
downloadTooltip: l10n.imageMessages_downloadModel,
|
||||
),
|
||||
),
|
||||
if (showLastError)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 12),
|
||||
child: Text(
|
||||
lastError,
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.bodyMedium?.copyWith(color: scheme.error),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _deleteTranslationModel(
|
||||
BuildContext context,
|
||||
List<ModelDownloadItem> _items(
|
||||
AppLocalizations l10n,
|
||||
AppSettings settings,
|
||||
AppSettingsService settingsService,
|
||||
TranslationService service,
|
||||
) {
|
||||
final downloaded = settings.translationDownloadedModels;
|
||||
final selectedId = settings.translationSelectedModelId;
|
||||
final pending = _pending;
|
||||
final used = <TranslationModelRecord>{};
|
||||
final items = <ModelDownloadItem>[];
|
||||
var pendingShown = false;
|
||||
|
||||
final serviceFailedError = service.failedDownloadError;
|
||||
|
||||
bool targets(String id, String sourceUrl, String name) {
|
||||
if (pending == null) return false;
|
||||
if (pending.id == id || pending.modelId == id) return true;
|
||||
if (sourceUrl.isNotEmpty && pending.sourceUrl == sourceUrl) return true;
|
||||
if (name.isNotEmpty && pending.name == name) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool matchesServiceFailure(
|
||||
String id,
|
||||
String sourceUrl,
|
||||
String? fileName,
|
||||
String? installedName,
|
||||
) {
|
||||
if (serviceFailedError == null) return false;
|
||||
if (service.failedDownloadModelId == id) return true;
|
||||
if (sourceUrl.isNotEmpty &&
|
||||
service.failedDownloadSourceUrl == sourceUrl) {
|
||||
return true;
|
||||
}
|
||||
final failedFile = service.failedDownloadFileName;
|
||||
if (failedFile != null &&
|
||||
failedFile.isNotEmpty &&
|
||||
(failedFile == fileName || failedFile == installedName)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ModelDownloadItem buildItem({
|
||||
required String id,
|
||||
required String name,
|
||||
required String sourceUrl,
|
||||
required String? fileName,
|
||||
required String? modelId,
|
||||
required TranslationModelRecord? installed,
|
||||
}) {
|
||||
if (installed != null) used.add(installed);
|
||||
final downloading =
|
||||
service.isDownloading &&
|
||||
(targets(id, sourceUrl, name) ||
|
||||
_fileNamesThisDownload(service, fileName, installed?.name));
|
||||
final failed =
|
||||
!downloading &&
|
||||
(_failedId == id ||
|
||||
(_failedId == null &&
|
||||
matchesServiceFailure(
|
||||
id,
|
||||
sourceUrl,
|
||||
fileName,
|
||||
installed?.name,
|
||||
)));
|
||||
if (downloading || failed) pendingShown = true;
|
||||
final merging = downloading && _isMerging(service);
|
||||
final busy = service.isBusy;
|
||||
final installedModel = installed;
|
||||
final failureDetail = _failedId == id
|
||||
? _failedDetail
|
||||
: (serviceFailedError != null
|
||||
? l10n.translation_downloadFailed(serviceFailedError)
|
||||
: null);
|
||||
|
||||
return ModelDownloadItem(
|
||||
id: id,
|
||||
name: name,
|
||||
sizeBytes: installedModel != null && installedModel.fileSizeBytes > 0
|
||||
? installedModel.fileSizeBytes
|
||||
: null,
|
||||
status: downloading
|
||||
? ModelDownloadStatus.downloading
|
||||
: failed
|
||||
? ModelDownloadStatus.error
|
||||
: installedModel != null
|
||||
? ModelDownloadStatus.ready
|
||||
: ModelDownloadStatus.notDownloaded,
|
||||
selected:
|
||||
installedModel != null &&
|
||||
!downloading &&
|
||||
installedModel.id == selectedId,
|
||||
detail: merging
|
||||
? l10n.translation_mergingChunks
|
||||
: failed
|
||||
? failureDetail
|
||||
: null,
|
||||
progress: downloading && !merging ? service.downloadProgress : null,
|
||||
downloadedBytes: downloading ? service.downloadedBytes : 0,
|
||||
totalBytes: downloading ? service.downloadTotalBytes : null,
|
||||
onDownload: !busy && installedModel == null
|
||||
? () => _download(
|
||||
sourceUrl: sourceUrl,
|
||||
fileName: fileName,
|
||||
id: modelId,
|
||||
)
|
||||
: null,
|
||||
onCancel: downloading ? service.cancelDownload : null,
|
||||
onDelete: installedModel != null && !busy
|
||||
? () => _delete(service, installedModel)
|
||||
: null,
|
||||
onSelect:
|
||||
installedModel != null &&
|
||||
!downloading &&
|
||||
installedModel.id != selectedId &&
|
||||
!busy
|
||||
? () => settingsService.setTranslationSelectedModelId(
|
||||
installedModel.id,
|
||||
)
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
for (final preset in translationPresetModels) {
|
||||
TranslationModelRecord? installed;
|
||||
for (final model in downloaded) {
|
||||
if (model.id == preset.id ||
|
||||
(preset.sourceUrl.isNotEmpty &&
|
||||
model.sourceUrl == preset.sourceUrl) ||
|
||||
(preset.name.isNotEmpty && model.name == preset.name)) {
|
||||
installed = model;
|
||||
break;
|
||||
}
|
||||
}
|
||||
items.add(
|
||||
buildItem(
|
||||
id: preset.id,
|
||||
name: translationModelFriendlyName(preset),
|
||||
sourceUrl: preset.sourceUrl,
|
||||
fileName: preset.name,
|
||||
modelId: preset.id,
|
||||
installed: installed,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
for (final model in downloaded) {
|
||||
if (used.contains(model)) continue;
|
||||
items.add(
|
||||
buildItem(
|
||||
id: model.id,
|
||||
name: translationModelFriendlyName(model),
|
||||
sourceUrl: model.sourceUrl,
|
||||
fileName: model.name,
|
||||
modelId: model.id,
|
||||
installed: model,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (!pendingShown && service.isDownloading) {
|
||||
items.add(_inProgressItem(l10n, service));
|
||||
} else if (pending != null && !pendingShown && _failedId == pending.id) {
|
||||
items.add(
|
||||
ModelDownloadItem(
|
||||
id: pending.id,
|
||||
name: pending.name,
|
||||
status: ModelDownloadStatus.error,
|
||||
detail: _failedDetail,
|
||||
onDownload: service.isBusy
|
||||
? null
|
||||
: () => _download(
|
||||
sourceUrl: pending.sourceUrl,
|
||||
fileName: pending.fileName,
|
||||
id: pending.modelId,
|
||||
),
|
||||
),
|
||||
);
|
||||
} else if (!pendingShown &&
|
||||
!service.isDownloading &&
|
||||
serviceFailedError != null &&
|
||||
service.failedDownloadSourceUrl != null) {
|
||||
final failedUrl = service.failedDownloadSourceUrl!;
|
||||
final failedFile = service.failedDownloadFileName;
|
||||
final failedModelId = service.failedDownloadModelId;
|
||||
final id = (failedModelId != null && failedModelId.isNotEmpty)
|
||||
? failedModelId
|
||||
: failedUrl.isNotEmpty
|
||||
? failedUrl
|
||||
: (failedFile ?? 'download');
|
||||
items.add(
|
||||
ModelDownloadItem(
|
||||
id: id,
|
||||
name: _displayName(failedUrl, failedFile, failedModelId),
|
||||
status: ModelDownloadStatus.error,
|
||||
detail: l10n.translation_downloadFailed(serviceFailedError),
|
||||
onDownload: service.isBusy
|
||||
? null
|
||||
: () => _download(
|
||||
sourceUrl: failedUrl,
|
||||
fileName: failedFile,
|
||||
id: failedModelId,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
/// True when this row is the file [service] is fetching, including while
|
||||
/// its displayed filename is the merge status.
|
||||
bool _fileNamesThisDownload(
|
||||
TranslationService service,
|
||||
String? fileName,
|
||||
String? installedName,
|
||||
) {
|
||||
bool matches(String? candidate) {
|
||||
if (candidate == null || candidate.isEmpty) return false;
|
||||
if (candidate == _mergingChunksFileName) return false;
|
||||
return candidate == fileName || candidate == installedName;
|
||||
}
|
||||
|
||||
return matches(service.downloadFileName) ||
|
||||
matches(service.downloadTargetFileName);
|
||||
}
|
||||
|
||||
/// Row for a download whose page state was discarded, or that has no
|
||||
/// preset or installed row yet. The service keeps the URL and file name.
|
||||
ModelDownloadItem _inProgressItem(
|
||||
AppLocalizations l10n,
|
||||
TranslationService service,
|
||||
) {
|
||||
final sourceUrl = service.downloadSourceUrl ?? '';
|
||||
final rawName = service.downloadTargetFileName ?? service.downloadFileName;
|
||||
final fileName = rawName == _mergingChunksFileName ? null : rawName;
|
||||
final modelId = service.downloadModelId;
|
||||
final id = (modelId != null && modelId.isNotEmpty)
|
||||
? modelId
|
||||
: sourceUrl.isNotEmpty
|
||||
? sourceUrl
|
||||
: (fileName ?? 'download');
|
||||
final merging = _isMerging(service);
|
||||
return ModelDownloadItem(
|
||||
id: id,
|
||||
name: _displayName(sourceUrl, fileName, modelId),
|
||||
status: ModelDownloadStatus.downloading,
|
||||
detail: merging ? l10n.translation_mergingChunks : null,
|
||||
progress: merging ? null : service.downloadProgress,
|
||||
downloadedBytes: service.downloadedBytes,
|
||||
totalBytes: service.downloadTotalBytes,
|
||||
onCancel: service.cancelDownload,
|
||||
);
|
||||
}
|
||||
|
||||
bool _isMerging(TranslationService service) =>
|
||||
service.downloadFileName == _mergingChunksFileName;
|
||||
|
||||
Future<void> _download({
|
||||
required String sourceUrl,
|
||||
String? fileName,
|
||||
String? id,
|
||||
}) async {
|
||||
final trimmed = sourceUrl.trim();
|
||||
if (trimmed.isEmpty) {
|
||||
showDismissibleSnackBar(
|
||||
context,
|
||||
content: Text(context.l10n.translation_enterUrlFirst),
|
||||
);
|
||||
return;
|
||||
}
|
||||
final pending = _PendingDownload(
|
||||
id: id ?? trimmed,
|
||||
name: _displayName(trimmed, fileName, id),
|
||||
sourceUrl: trimmed,
|
||||
fileName: fileName,
|
||||
modelId: id,
|
||||
);
|
||||
setState(() {
|
||||
_pending = pending;
|
||||
_failedId = null;
|
||||
_failedDetail = null;
|
||||
});
|
||||
final settingsService = context.read<AppSettingsService>();
|
||||
final translationService = context.read<TranslationService>();
|
||||
try {
|
||||
await translationService.downloadModel(
|
||||
sourceUrl: trimmed,
|
||||
fileName: fileName,
|
||||
id: id,
|
||||
);
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_pending = null;
|
||||
_failedId = null;
|
||||
_failedDetail = null;
|
||||
});
|
||||
showDismissibleSnackBar(
|
||||
context,
|
||||
content: Text(context.l10n.translation_modelDownloaded),
|
||||
);
|
||||
await settingsService.setTranslationEnabled(true);
|
||||
} on TranslationDownloadCancelled {
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_pending = null;
|
||||
_failedId = null;
|
||||
_failedDetail = null;
|
||||
});
|
||||
showDismissibleSnackBar(
|
||||
context,
|
||||
content: Text(context.l10n.translation_downloadStopped),
|
||||
);
|
||||
} catch (error) {
|
||||
if (!mounted) return;
|
||||
final message = context.l10n.translation_downloadFailed('$error');
|
||||
setState(() {
|
||||
_failedId = pending.id;
|
||||
_failedDetail = message;
|
||||
});
|
||||
showDismissibleSnackBar(context, content: Text(message));
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _delete(
|
||||
TranslationService translationService,
|
||||
TranslationModelRecord model,
|
||||
) async {
|
||||
try {
|
||||
await translationService.removeModel(model);
|
||||
if (!context.mounted) return;
|
||||
if (!mounted) return;
|
||||
showDismissibleSnackBar(
|
||||
context,
|
||||
content: Text(
|
||||
@@ -411,7 +561,7 @@ class TranslationSettingsSection extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
} catch (error) {
|
||||
if (!context.mounted) return;
|
||||
if (!mounted) return;
|
||||
showDismissibleSnackBar(
|
||||
context,
|
||||
content: Text(
|
||||
@@ -421,17 +571,36 @@ class TranslationSettingsSection extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
String _downloadedModelLabel(
|
||||
BuildContext context,
|
||||
TranslationModelRecord model,
|
||||
) {
|
||||
final sizeMb = model.fileSizeBytes / (1024 * 1024);
|
||||
final source = model.sourceUrl.isEmpty ? model.name : model.sourceUrl;
|
||||
return context.l10n.translation_downloadedModelDetails(
|
||||
sizeMb.toStringAsFixed(1),
|
||||
source,
|
||||
String _displayName(String sourceUrl, String? fileName, String? id) {
|
||||
for (final preset in translationPresetModels) {
|
||||
if (preset.id == id || preset.sourceUrl == sourceUrl) {
|
||||
return translationModelFriendlyName(preset);
|
||||
}
|
||||
}
|
||||
final name = (fileName != null && fileName.isNotEmpty)
|
||||
? fileName
|
||||
: _fileNameFromUrl(sourceUrl);
|
||||
return translationModelFriendlyName(
|
||||
TranslationModelRecord(
|
||||
id: id ?? name,
|
||||
name: name,
|
||||
sourceUrl: sourceUrl,
|
||||
localPath: '',
|
||||
downloadedAt: DateTime.fromMillisecondsSinceEpoch(0),
|
||||
fileSizeBytes: 0,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String _fileNameFromUrl(String sourceUrl) {
|
||||
final uri = Uri.tryParse(sourceUrl);
|
||||
if (uri == null || uri.pathSegments.isEmpty) {
|
||||
return context.l10n.translation_defaultModelName;
|
||||
}
|
||||
final last = uri.pathSegments.last.trim();
|
||||
if (last.isEmpty) return context.l10n.translation_defaultModelName;
|
||||
return last;
|
||||
}
|
||||
}
|
||||
|
||||
/// Owns the [TextEditingController] for the manual model URL field so it
|
||||
@@ -441,21 +610,15 @@ class _TranslationUrlField extends StatefulWidget {
|
||||
required this.initialValue,
|
||||
required this.onChanged,
|
||||
required this.onDownload,
|
||||
required this.downloadLabel,
|
||||
required this.isDownloading,
|
||||
required this.onCancel,
|
||||
required this.labelText,
|
||||
required this.stopLabel,
|
||||
required this.downloadTooltip,
|
||||
});
|
||||
|
||||
final String initialValue;
|
||||
final ValueChanged<String> onChanged;
|
||||
final void Function(String url)? onDownload;
|
||||
final String downloadLabel;
|
||||
final bool isDownloading;
|
||||
final VoidCallback onCancel;
|
||||
final String labelText;
|
||||
final String stopLabel;
|
||||
final String downloadTooltip;
|
||||
|
||||
@override
|
||||
State<_TranslationUrlField> createState() => _TranslationUrlFieldState();
|
||||
@@ -478,39 +641,26 @@ class _TranslationUrlFieldState extends State<_TranslationUrlField> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
TextField(
|
||||
controller: _controller,
|
||||
decoration: InputDecoration(
|
||||
labelText: widget.labelText,
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
onChanged: widget.onChanged,
|
||||
return TextField(
|
||||
controller: _controller,
|
||||
keyboardType: TextInputType.url,
|
||||
autocorrect: false,
|
||||
enableSuggestions: false,
|
||||
decoration: InputDecoration(
|
||||
labelText: widget.labelText,
|
||||
border: const OutlineInputBorder(),
|
||||
suffixIcon: IconButton(
|
||||
tooltip: widget.downloadTooltip,
|
||||
onPressed: widget.onDownload == null
|
||||
? null
|
||||
: () => widget.onDownload!(_controller.text.trim()),
|
||||
icon: const Icon(Icons.download_outlined),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: FilledButton.icon(
|
||||
onPressed: widget.onDownload == null
|
||||
? null
|
||||
: () => widget.onDownload!(_controller.text.trim()),
|
||||
icon: const Icon(Icons.download),
|
||||
label: Text(widget.downloadLabel),
|
||||
),
|
||||
),
|
||||
if (widget.isDownloading) ...[
|
||||
const SizedBox(width: 8),
|
||||
OutlinedButton.icon(
|
||||
onPressed: widget.onCancel,
|
||||
icon: const Icon(Icons.stop_circle_outlined),
|
||||
label: Text(widget.stopLabel),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
onChanged: widget.onChanged,
|
||||
onSubmitted: widget.onDownload == null
|
||||
? null
|
||||
: (value) => widget.onDownload!(value.trim()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user