more granular selection and import of official meshcore file.

This commit is contained in:
ericz committed 2026-11-08 02:47:34 +01:00
1 parent aae2bf6d60
commit 79109c2c5c
27 files changed
+3839 -114

No files matched your search

+20
View File
@@ -198,13 +198,33 @@
"backupRestore_selectImportFile": "Import File",
"backupRestore_password": "Password (optional)",
"backupRestore_passwordHelp": "A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.",
"backupRestore_importUnavailable": "Check the password or choose a supported backup file.",
"backupRestore_items": "Backup and restore items",
"backupRestore_nodeSettings": "Node Settings",
"backupRestore_nodeSettingsDescription": "Device name, private and public keys, radio settings, and regions",
"backupRestore_deviceName": "Device Name",
"backupRestore_privateKey": "Private Key (sensitive)",
"backupRestore_publicKey": "Public Key",
"backupRestore_radioSettings": "Radio Settings",
"backupRestore_regions": "Regions",
"backupRestore_location": "Location",
"backupRestore_contactSettings": "Contact Settings",
"backupRestore_privacySettings": "Privacy Settings",
"backupRestore_contactsData": "Contacts",
"backupRestore_perContactSettings": "Contact Settings and Filters",
"backupRestore_contactGroups": "Contact Groups",
"backupRestore_contactHistory": "Contact History",
"backupRestore_channelsData": "Channels",
"backupRestore_channelFilters": "Message Filter Settings",
"backupRestore_channelSettings": "Channel Settings",
"backupRestore_communities": "Communities",
"backupRestore_channelHistory": "Channel History",
"backupRestore_locationSettings": "Location Settings",
"backupRestore_locationSettingsDescription": "Location, contact settings, and privacy settings",
"backupRestore_appSettings": "App Settings",
"backupRestore_appSettingsDescription": "App preferences and appearance settings",
"backupRestore_ipfsKey": "IPFS API Key (sensitive)",
"backupRestore_stadiaMapKey": "Stadia Maps API Key (sensitive)",
"backupRestore_contacts": "Contacts",
"backupRestore_contactsDescription": "Contacts, per-contact filters and settings, groups, and message history",
"backupRestore_discoveredContacts": "Discovered Contacts",
+120
View File
@@ -862,6 +862,12 @@ abstract class AppLocalizations {
/// **'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.'**
String get backupRestore_passwordHelp;
/// No description provided for @backupRestore_importUnavailable.
///
/// In en, this message translates to:
/// **'Check the password or choose a supported backup file.'**
String get backupRestore_importUnavailable;
/// No description provided for @backupRestore_items.
///
/// In en, this message translates to:
@@ -880,6 +886,108 @@ abstract class AppLocalizations {
/// **'Device name, private and public keys, radio settings, and regions'**
String get backupRestore_nodeSettingsDescription;
/// No description provided for @backupRestore_deviceName.
///
/// In en, this message translates to:
/// **'Device Name'**
String get backupRestore_deviceName;
/// No description provided for @backupRestore_privateKey.
///
/// In en, this message translates to:
/// **'Private Key (sensitive)'**
String get backupRestore_privateKey;
/// No description provided for @backupRestore_publicKey.
///
/// In en, this message translates to:
/// **'Public Key'**
String get backupRestore_publicKey;
/// No description provided for @backupRestore_radioSettings.
///
/// In en, this message translates to:
/// **'Radio Settings'**
String get backupRestore_radioSettings;
/// No description provided for @backupRestore_regions.
///
/// In en, this message translates to:
/// **'Regions'**
String get backupRestore_regions;
/// No description provided for @backupRestore_location.
///
/// In en, this message translates to:
/// **'Location'**
String get backupRestore_location;
/// No description provided for @backupRestore_contactSettings.
///
/// In en, this message translates to:
/// **'Contact Settings'**
String get backupRestore_contactSettings;
/// No description provided for @backupRestore_privacySettings.
///
/// In en, this message translates to:
/// **'Privacy Settings'**
String get backupRestore_privacySettings;
/// No description provided for @backupRestore_contactsData.
///
/// In en, this message translates to:
/// **'Contacts'**
String get backupRestore_contactsData;
/// No description provided for @backupRestore_perContactSettings.
///
/// In en, this message translates to:
/// **'Contact Settings and Filters'**
String get backupRestore_perContactSettings;
/// No description provided for @backupRestore_contactGroups.
///
/// In en, this message translates to:
/// **'Contact Groups'**
String get backupRestore_contactGroups;
/// No description provided for @backupRestore_contactHistory.
///
/// In en, this message translates to:
/// **'Contact History'**
String get backupRestore_contactHistory;
/// No description provided for @backupRestore_channelsData.
///
/// In en, this message translates to:
/// **'Channels'**
String get backupRestore_channelsData;
/// No description provided for @backupRestore_channelFilters.
///
/// In en, this message translates to:
/// **'Message Filter Settings'**
String get backupRestore_channelFilters;
/// No description provided for @backupRestore_channelSettings.
///
/// In en, this message translates to:
/// **'Channel Settings'**
String get backupRestore_channelSettings;
/// No description provided for @backupRestore_communities.
///
/// In en, this message translates to:
/// **'Communities'**
String get backupRestore_communities;
/// No description provided for @backupRestore_channelHistory.
///
/// In en, this message translates to:
/// **'Channel History'**
String get backupRestore_channelHistory;
/// No description provided for @backupRestore_locationSettings.
///
/// In en, this message translates to:
@@ -904,6 +1012,18 @@ abstract class AppLocalizations {
/// **'App preferences and appearance settings'**
String get backupRestore_appSettingsDescription;
/// No description provided for @backupRestore_ipfsKey.
///
/// In en, this message translates to:
/// **'IPFS API Key (sensitive)'**
String get backupRestore_ipfsKey;
/// No description provided for @backupRestore_stadiaMapKey.
///
/// In en, this message translates to:
/// **'Stadia Maps API Key (sensitive)'**
String get backupRestore_stadiaMapKey;
/// No description provided for @backupRestore_contacts.
///
/// In en, this message translates to:
+61
View File
@@ -425,6 +425,10 @@ class AppLocalizationsBg extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -435,6 +439,57 @@ class AppLocalizationsBg extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -449,6 +504,12 @@ class AppLocalizationsBg extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -428,6 +428,10 @@ class AppLocalizationsDe extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -438,6 +442,57 @@ class AppLocalizationsDe extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -452,6 +507,12 @@ class AppLocalizationsDe extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -421,6 +421,10 @@ class AppLocalizationsEn extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -431,6 +435,57 @@ class AppLocalizationsEn extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -445,6 +500,12 @@ class AppLocalizationsEn extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -426,6 +426,10 @@ class AppLocalizationsEs extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -436,6 +440,57 @@ class AppLocalizationsEs extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -450,6 +505,12 @@ class AppLocalizationsEs extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -428,6 +428,10 @@ class AppLocalizationsFr extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -438,6 +442,57 @@ class AppLocalizationsFr extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -452,6 +507,12 @@ class AppLocalizationsFr extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -424,6 +424,10 @@ class AppLocalizationsHu extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -434,6 +438,57 @@ class AppLocalizationsHu extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -448,6 +503,12 @@ class AppLocalizationsHu extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -428,6 +428,10 @@ class AppLocalizationsIt extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -438,6 +442,57 @@ class AppLocalizationsIt extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -452,6 +507,12 @@ class AppLocalizationsIt extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -409,6 +409,10 @@ class AppLocalizationsJa extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -419,6 +423,57 @@ class AppLocalizationsJa extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -433,6 +488,12 @@ class AppLocalizationsJa extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -409,6 +409,10 @@ class AppLocalizationsKo extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -419,6 +423,57 @@ class AppLocalizationsKo extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -433,6 +488,12 @@ class AppLocalizationsKo extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -424,6 +424,10 @@ class AppLocalizationsNl extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -434,6 +438,57 @@ class AppLocalizationsNl extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -448,6 +503,12 @@ class AppLocalizationsNl extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -431,6 +431,10 @@ class AppLocalizationsPl extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -441,6 +445,57 @@ class AppLocalizationsPl extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -455,6 +510,12 @@ class AppLocalizationsPl extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -427,6 +427,10 @@ class AppLocalizationsPt extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -437,6 +441,57 @@ class AppLocalizationsPt extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -451,6 +506,12 @@ class AppLocalizationsPt extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -427,6 +427,10 @@ class AppLocalizationsRu extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -437,6 +441,57 @@ class AppLocalizationsRu extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -451,6 +506,12 @@ class AppLocalizationsRu extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -427,6 +427,10 @@ class AppLocalizationsSk extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -437,6 +441,57 @@ class AppLocalizationsSk extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -451,6 +506,12 @@ class AppLocalizationsSk extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -426,6 +426,10 @@ class AppLocalizationsSl extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -436,6 +440,57 @@ class AppLocalizationsSl extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -450,6 +505,12 @@ class AppLocalizationsSl extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -422,6 +422,10 @@ class AppLocalizationsSv extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -432,6 +436,57 @@ class AppLocalizationsSv extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -446,6 +501,12 @@ class AppLocalizationsSv extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -426,6 +426,10 @@ class AppLocalizationsUk extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -436,6 +440,57 @@ class AppLocalizationsUk extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -450,6 +505,12 @@ class AppLocalizationsUk extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+61
View File
@@ -403,6 +403,10 @@ class AppLocalizationsZh extends AppLocalizations {
String get backupRestore_passwordHelp =>
'A password encrypts the file. Blank saves plaintext that may include private/channel keys, history, and credentials.';
@override
String get backupRestore_importUnavailable =>
'Check the password or choose a supported backup file.';
@override
String get backupRestore_items => 'Backup and restore items';
@@ -413,6 +417,57 @@ class AppLocalizationsZh extends AppLocalizations {
String get backupRestore_nodeSettingsDescription =>
'Device name, private and public keys, radio settings, and regions';
@override
String get backupRestore_deviceName => 'Device Name';
@override
String get backupRestore_privateKey => 'Private Key (sensitive)';
@override
String get backupRestore_publicKey => 'Public Key';
@override
String get backupRestore_radioSettings => 'Radio Settings';
@override
String get backupRestore_regions => 'Regions';
@override
String get backupRestore_location => 'Location';
@override
String get backupRestore_contactSettings => 'Contact Settings';
@override
String get backupRestore_privacySettings => 'Privacy Settings';
@override
String get backupRestore_contactsData => 'Contacts';
@override
String get backupRestore_perContactSettings => 'Contact Settings and Filters';
@override
String get backupRestore_contactGroups => 'Contact Groups';
@override
String get backupRestore_contactHistory => 'Contact History';
@override
String get backupRestore_channelsData => 'Channels';
@override
String get backupRestore_channelFilters => 'Message Filter Settings';
@override
String get backupRestore_channelSettings => 'Channel Settings';
@override
String get backupRestore_communities => 'Communities';
@override
String get backupRestore_channelHistory => 'Channel History';
@override
String get backupRestore_locationSettings => 'Location Settings';
@@ -427,6 +482,12 @@ class AppLocalizationsZh extends AppLocalizations {
String get backupRestore_appSettingsDescription =>
'App preferences and appearance settings';
@override
String get backupRestore_ipfsKey => 'IPFS API Key (sensitive)';
@override
String get backupRestore_stadiaMapKey => 'Stadia Maps API Key (sensitive)';
@override
String get backupRestore_contacts => 'Contacts';
+497
View File
@@ -0,0 +1,497 @@
import 'dart:async';
import 'dart:convert';
import 'dart:typed_data';
import 'package:file_selector/file_selector.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:share_plus/share_plus.dart';
import '../connector/meshcore_connector.dart';
import '../helpers/snack_bar_builder.dart';
import '../l10n/l10n.dart';
import '../services/app_settings_service.dart';
import '../services/backup_service.dart';
import '../services/message_filter/message_filter_service.dart';
import '../utils/platform_info.dart';
import '../utils/share_origin.dart';
import '../widgets/app_bar.dart';
import '../widgets/mesh_ui.dart';
import '../widgets/sync_progress_overlay.dart';
class BackupRestoreScreen extends StatefulWidget {
const BackupRestoreScreen({super.key});
@override
State<BackupRestoreScreen> createState() => _BackupRestoreScreenState();
}
class _BackupRestoreScreenState extends State<BackupRestoreScreen> {
static const int _maxImportBytes = 100 * 1024 * 1024;
static const _backupService = BackupService();
static const _fileType = XTypeGroup(
label: 'MeshCore backup',
extensions: ['json'],
mimeTypes: ['application/json'],
);
static const Set<BackupItem> _defaultUncheckedItems = {
BackupItem.privateKey,
BackupItem.ipfsKey,
BackupItem.stadiaMapKey,
};
static const Set<BackupItem> _deviceStoredItems = {
BackupItem.deviceName,
BackupItem.publicKey,
BackupItem.radioSettings,
BackupItem.location,
BackupItem.contactSettings,
BackupItem.privacySettings,
};
static const Set<BackupItem> _defaultUncheckedOnRestore = {
..._defaultUncheckedItems,
..._deviceStoredItems,
};
final _passwordController = TextEditingController();
final Set<BackupItem> _selectedItems = BackupItem.values
.where((item) => !_defaultUncheckedItems.contains(item))
.toSet();
Set<BackupItem>? _availableItems;
String? _importContents;
String? _importFileName;
Timer? _inspectionTimer;
int _inspectionGeneration = 0;
bool _hasInitializedImportSelection = false;
bool _busy = false;
@override
void dispose() {
_inspectionTimer?.cancel();
_passwordController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
return Scaffold(
appBar: AppBar(
title: AppBarTitle(
l10n.backupRestore_title,
indicators: false,
subtitle: false,
),
centerTitle: true,
bottom: const SyncProgressAppBarBottom(),
),
body: SafeArea(
top: false,
child: ListView(
padding: const EdgeInsets.fromLTRB(0, 8, 0, 24),
children: [
SectionHeader(l10n.backupRestore_import),
MeshCard(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
OutlinedButton.icon(
onPressed: _busy ? null : _selectImportFile,
icon: const Icon(Icons.upload_file_outlined),
label: Text(
_importFileName ?? l10n.backupRestore_selectImportFile,
),
),
const SizedBox(height: 12),
TextField(
controller: _passwordController,
obscureText: true,
autocorrect: false,
enableSuggestions: false,
onChanged: (_) => _scheduleImportInspection(),
decoration: InputDecoration(
labelText: l10n.backupRestore_password,
helperText:
_importContents != null &&
_availableItems?.isEmpty == true
? l10n.backupRestore_importUnavailable
: l10n.backupRestore_passwordHelp,
border: const OutlineInputBorder(),
),
),
],
),
),
SectionHeader(l10n.backupRestore_items),
MeshCard(
padding: EdgeInsets.zero,
child: Column(
children: [
_groupTile(
title: l10n.backupRestore_nodeSettings,
icon: Icons.router_outlined,
items: [
(BackupItem.deviceName, l10n.backupRestore_deviceName),
(BackupItem.privateKey, l10n.backupRestore_privateKey),
(BackupItem.publicKey, l10n.backupRestore_publicKey),
(
BackupItem.radioSettings,
l10n.backupRestore_radioSettings,
),
(BackupItem.regions, l10n.backupRestore_regions),
],
),
const Divider(height: 1, indent: 16),
_groupTile(
title: l10n.backupRestore_locationSettings,
icon: Icons.location_on_outlined,
items: [
(BackupItem.location, l10n.backupRestore_location),
(
BackupItem.contactSettings,
l10n.backupRestore_contactSettings,
),
(
BackupItem.privacySettings,
l10n.backupRestore_privacySettings,
),
],
),
const Divider(height: 1, indent: 16),
_groupTile(
title: l10n.backupRestore_appSettings,
icon: Icons.settings_outlined,
items: [
(BackupItem.appSettings, l10n.backupRestore_appSettings),
(BackupItem.ipfsKey, l10n.backupRestore_ipfsKey),
(
BackupItem.stadiaMapKey,
l10n.backupRestore_stadiaMapKey,
),
],
),
const Divider(height: 1, indent: 16),
_groupTile(
title: l10n.backupRestore_contacts,
icon: Icons.contacts_outlined,
items: [
(BackupItem.contacts, l10n.backupRestore_contactsData),
(
BackupItem.perContactSettings,
l10n.backupRestore_perContactSettings,
),
(
BackupItem.contactGroups,
l10n.backupRestore_contactGroups,
),
(
BackupItem.contactHistory,
l10n.backupRestore_contactHistory,
),
],
),
const Divider(height: 1, indent: 16),
_itemTile(
BackupItem.discoveredContacts,
l10n.backupRestore_discoveredContacts,
Icons.person_search_outlined,
),
const Divider(height: 1, indent: 16),
_groupTile(
title: l10n.backupRestore_channels,
icon: Icons.forum_outlined,
items: [
(BackupItem.channels, l10n.backupRestore_channelsData),
(
BackupItem.channelFilters,
l10n.backupRestore_channelFilters,
),
(
BackupItem.channelSettings,
l10n.backupRestore_channelSettings,
),
(BackupItem.communities, l10n.backupRestore_communities),
(
BackupItem.channelHistory,
l10n.backupRestore_channelHistory,
),
],
),
],
),
),
Padding(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 0),
child: FilledButton.icon(
onPressed:
_busy ||
_selectedItems.isEmpty ||
(_importContents != null && _availableItems == null)
? null
: _runAction,
icon: _busy
? const SizedBox.square(
dimension: 18,
child: CircularProgressIndicator(strokeWidth: 2),
)
: Icon(
_importContents == null
? Icons.backup_outlined
: Icons.restore_outlined,
),
label: Text(
_importContents == null
? l10n.backupRestore_backup
: l10n.backupRestore_restore,
),
),
),
],
),
),
);
}
Widget _groupTile({
required String title,
required IconData icon,
required List<(BackupItem, String)> items,
}) {
return ExpansionTile(
leading: Icon(icon),
title: Text(title),
tilePadding: const EdgeInsets.symmetric(horizontal: 16),
childrenPadding: EdgeInsets.zero,
initiallyExpanded: true,
visualDensity: VisualDensity.compact,
children: [for (final item in items) _itemTile(item.$1, item.$2)],
);
}
Widget _itemTile(BackupItem item, String title, [IconData? icon]) {
final available =
_availableItems == null || _availableItems!.contains(item);
return CheckboxListTile(
value: _selectedItems.contains(item),
dense: true,
visualDensity: VisualDensity.compact,
onChanged: _busy || !available
? null
: (selected) => setState(() {
if (selected == true) {
_selectedItems.add(item);
} else {
_selectedItems.remove(item);
}
}),
secondary: icon == null ? null : Icon(icon),
title: Text(title),
controlAffinity: ListTileControlAffinity.trailing,
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 2),
);
}
Future<void> _selectImportFile() async {
final l10n = context.l10n;
try {
final file = await openFile(acceptedTypeGroups: const [_fileType]);
if (file == null) return;
if (await file.length() > _maxImportBytes) {
_showMessage(l10n.backupRestore_fileTooLarge);
return;
}
final contents = utf8.decode(await file.readAsBytes());
if (!mounted) return;
setState(() {
_importContents = contents;
_importFileName = file.name;
_availableItems = null;
_selectedItems.clear();
_hasInitializedImportSelection = false;
});
await _inspectImport();
} catch (error) {
if (mounted) {
_showMessage(l10n.backupRestore_failed(error.toString()));
}
}
}
void _scheduleImportInspection() {
_inspectionTimer?.cancel();
_inspectionTimer = Timer(const Duration(milliseconds: 350), _inspectImport);
}
Future<void> _inspectImport() async {
final contents = _importContents;
if (contents == null) return;
final generation = ++_inspectionGeneration;
try {
final info = await _backupService.inspectImport(
contents: contents,
password: _passwordController.text,
);
if (!mounted || generation != _inspectionGeneration) return;
setState(() {
_availableItems = info.availableItems;
if (!_hasInitializedImportSelection) {
_selectedItems
..clear()
..addAll(
info.availableItems.where(
(item) => !_defaultUncheckedOnRestore.contains(item),
),
);
_hasInitializedImportSelection = true;
} else {
_selectedItems.retainAll(info.availableItems);
}
});
} catch (_) {
if (!mounted || generation != _inspectionGeneration) return;
setState(() {
_availableItems = <BackupItem>{};
_selectedItems.clear();
});
}
}
Future<void> _runAction() async {
if (_selectedItems.isEmpty) {
_showMessage(context.l10n.backupRestore_selectAtLeastOne);
return;
}
if (_importContents != null) {
await _restore();
} else {
await _createBackup();
}
}
Future<void> _createBackup() async {
final l10n = context.l10n;
final connector = context.read<MeshCoreConnector>();
final shareOrigin = shareOriginOf(context);
setState(() => _busy = true);
try {
final contents = await _backupService.createBackup(
items: Set<BackupItem>.of(_selectedItems),
connector: connector,
settings: context.read<AppSettingsService>().settings,
password: _passwordController.text,
);
if (!mounted) return;
final filename =
'meshcore-open_backup_${DateTime.now().millisecondsSinceEpoch}.json';
final file = XFile.fromData(
Uint8List.fromList(utf8.encode(contents)),
name: filename,
mimeType: 'application/json',
);
if (PlatformInfo.isWeb) {
await file.saveTo(filename);
} else if (PlatformInfo.isDesktop) {
final location = await getSaveLocation(
suggestedName: filename,
acceptedTypeGroups: const [_fileType],
);
if (location == null) return;
await file.saveTo(location.path);
} else {
final result = await SharePlus.instance.share(
ShareParams(
files: [file],
fileNameOverrides: [filename],
sharePositionOrigin: shareOrigin,
),
);
if (result.status == ShareResultStatus.dismissed) return;
}
if (mounted) _showMessage(l10n.backupRestore_backupComplete);
} catch (error) {
if (mounted) {
_showMessage(l10n.backupRestore_failed(error.toString()));
}
} finally {
if (mounted) setState(() => _busy = false);
}
}
Future<void> _restore() async {
final l10n = context.l10n;
final connector = context.read<MeshCoreConnector>();
final appSettingsService = context.read<AppSettingsService>();
final messageFilterService = context.read<MessageFilterService>();
final needsKeyConfirmation = _selectedItems.contains(BackupItem.privateKey);
if (needsKeyConfirmation && !await _confirmIdentityReplacement()) return;
setState(() => _busy = true);
try {
await _backupService.restoreBackup(
contents: _importContents!,
password: _passwordController.text,
items: Set<BackupItem>.of(_selectedItems),
connector: connector,
appSettingsService: appSettingsService,
);
if (_selectedItems.any(
(item) =>
item == BackupItem.appSettings ||
item == BackupItem.ipfsKey ||
item == BackupItem.stadiaMapKey,
)) {
await appSettingsService.loadSettings();
}
if (_selectedItems.contains(BackupItem.channelFilters)) {
await messageFilterService.load();
}
if (mounted) {
_showMessage(l10n.backupRestore_restoreComplete);
setState(() {
_importContents = null;
_importFileName = null;
_availableItems = null;
_selectedItems
..clear()
..addAll(
BackupItem.values.where(
(item) => !_defaultUncheckedItems.contains(item),
),
);
_hasInitializedImportSelection = false;
});
}
} catch (error) {
if (mounted) {
_showMessage(l10n.backupRestore_failed(error.toString()));
}
} finally {
if (mounted) setState(() => _busy = false);
}
}
Future<bool> _confirmIdentityReplacement() async {
final l10n = context.l10n;
return await showDialog<bool>(
context: context,
builder: (dialogContext) => AlertDialog(
title: Text(l10n.backupRestore_replaceIdentityTitle),
content: Text(l10n.backupRestore_replaceIdentityMessage),
actions: [
TextButton(
onPressed: () => Navigator.pop(dialogContext, false),
child: Text(l10n.common_cancel),
),
FilledButton(
onPressed: () => Navigator.pop(dialogContext, true),
child: Text(l10n.backupRestore_restore),
),
],
),
) ??
false;
}
void _showMessage(String message) {
if (!mounted) return;
showDismissibleSnackBar(context, content: Text(message));
}
}
+123
View File
@@ -0,0 +1,123 @@
import 'package:flutter/material.dart';
import 'package:meshcore_open/utils/gpx_export.dart';
import 'package:provider/provider.dart';
import '../connector/meshcore_connector.dart';
import '../helpers/snack_bar_builder.dart';
import '../l10n/l10n.dart';
import '../utils/share_origin.dart';
import '../widgets/app_bar.dart';
import '../widgets/mesh_ui.dart';
import '../widgets/mesh_nav_tile.dart';
import '../widgets/sync_progress_overlay.dart';
class ExportScreen extends StatelessWidget {
const ExportScreen({super.key});
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final connector = context.read<MeshCoreConnector>();
return Scaffold(
appBar: AppBar(
title: AppBarTitle(
l10n.settings_export,
indicators: false,
subtitle: false,
),
centerTitle: true,
bottom: const SyncProgressAppBarBottom(),
),
body: SafeArea(
top: false,
child: ListView(
padding: const EdgeInsets.fromLTRB(0, 8, 0, 24),
children: [
SectionHeader(l10n.settings_export),
MeshCard(
padding: EdgeInsets.zero,
child: Column(
children: [
MeshNavTile(
icon: Icons.download_outlined,
title: l10n.settings_gpxExportRepeaters,
subtitle: l10n.settings_gpxExportRepeatersSubtitle,
onTap: () {
final exporter = GpxExport(connector)..addRepeaters();
_gpxExport(
context,
exporter,
l10n.map_repeater,
l10n.settings_gpxExportRepeatersRoom,
'meshcore_repeaters_',
);
},
),
const Divider(height: 1, indent: 16),
MeshNavTile(
icon: Icons.download_outlined,
title: l10n.settings_gpxExportContacts,
subtitle: l10n.settings_gpxExportContactsSubtitle,
onTap: () {
final exporter = GpxExport(connector)..addContacts();
_gpxExport(
context,
exporter,
l10n.map_repeater,
l10n.settings_gpxExportChat,
'meshcore_contacts_',
);
},
),
const Divider(height: 1, indent: 16),
MeshNavTile(
icon: Icons.download_outlined,
title: l10n.settings_gpxExportAll,
subtitle: l10n.settings_gpxExportAllSubtitle,
onTap: () {
final exporter = GpxExport(connector)..addAll();
_gpxExport(
context,
exporter,
l10n.map_repeater,
l10n.settings_gpxExportAllContacts,
'meshcore_all_',
);
},
),
],
),
),
],
),
),
);
}
Future<void> _gpxExport(
BuildContext context,
GpxExport exporter,
String name,
String description,
String filename,
) async {
final l10n = context.l10n;
final result = await exporter.exportGPX(
name,
description,
filename,
l10n.settings_gpxExportShareText,
l10n.settings_gpxExportShareSubject,
sharePositionOrigin: shareOriginOf(context),
);
if (!context.mounted) return;
final message = switch (result) {
gpxExportSuccess => l10n.settings_gpxExportSuccess,
gpxExportNoContacts => l10n.settings_gpxExportNoContacts,
gpxExportNotAvailable => l10n.settings_gpxExportNotAvailable,
gpxExportFailed => l10n.settings_gpxExportError,
_ => l10n.settings_gpxExportError,
};
showDismissibleSnackBar(context, content: Text(message));
}
}
-112
View File
@@ -597,33 +597,10 @@ class _SettingsScreenState extends State<SettingsScreen> {
? () => pushSelfTelemetryScreen(context)
: null,
),
const Divider(height: 1, indent: 16),
MeshNavTile(
icon: Icons.route_outlined,
title: l10n.repeater_pathHashMode,
subtitle: !connected
? offline
: !connector.supportsPathHashMode
? l10n.settings_requiresFirmware('v1.14')
: _pathHashModeSubtitle(context, connector.pathHashByteWidth),
onTap: connector.isConnected && connector.supportsPathHashMode
? () => _editPathHashMode(context, connector)
: null,
),
],
);
}
String _pathHashModeSubtitle(BuildContext context, int pathHashByteWidth) {
final l10n = context.l10n;
return switch (pathHashByteWidth.clamp(1, 4).toInt()) {
1 => l10n.repeater_pathHashModeOption0,
2 => l10n.repeater_pathHashModeOption1,
3 => l10n.repeater_pathHashModeOption2,
_ => l10n.repeater_pathHashModeOption3,
};
}
Widget _buildLocationCardContent(
BuildContext context,
MeshCoreConnector connector,
@@ -773,95 +750,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
);
}
void _editPathHashMode(BuildContext context, MeshCoreConnector connector) {
final l10n = context.l10n;
var selectedMode = (connector.pathHashByteWidth - 1).clamp(0, 2).toInt();
showDialog(
context: context,
builder: (dialogContext) => StatefulBuilder(
builder: (builderContext, setDialogState) => AlertDialog(
scrollable: true,
title: Text(l10n.repeater_pathHashMode),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DropdownButtonFormField<int>(
isExpanded: true,
initialValue: selectedMode,
decoration: InputDecoration(
labelText: l10n.repeater_pathHashMode,
border: const OutlineInputBorder(),
),
items: [
DropdownMenuItem(
value: 0,
child: Text(
l10n.repeater_pathHashModeOption0,
overflow: TextOverflow.ellipsis,
),
),
DropdownMenuItem(
value: 1,
child: Text(
l10n.repeater_pathHashModeOption1,
overflow: TextOverflow.ellipsis,
),
),
DropdownMenuItem(
value: 2,
child: Text(
l10n.repeater_pathHashModeOption2,
overflow: TextOverflow.ellipsis,
),
),
],
onChanged: (value) {
if (value == null) return;
setDialogState(() => selectedMode = value);
},
),
const SizedBox(height: 12),
Text(
l10n.settings_pathHashModeHelper,
style: Theme.of(builderContext).textTheme.bodyMedium,
),
],
),
actions: [
TextButton(
onPressed: () => Navigator.pop(dialogContext),
child: Text(l10n.common_cancel),
),
FilledButton(
onPressed: () async {
Navigator.pop(dialogContext);
if (!_ensureConnected(context, connector)) return;
try {
await connector.setPathHashMode(selectedMode);
await connector.refreshDeviceInfo();
if (!context.mounted) return;
showDismissibleSnackBar(
context,
content: Text(l10n.repeater_settingsSaved),
);
} catch (e) {
if (!context.mounted) return;
showDismissibleSnackBar(
context,
content: Text(l10n.settings_error(e.toString())),
);
}
},
child: Text(l10n.common_save),
),
],
),
),
);
}
Future<void> _editLocation(
BuildContext context,
MeshCoreConnector connector,
File diff suppressed because it is too large. Load diff