WIP: Add iOS version #10

Draft
Deadpikle wants to merge 67 commits from feature/ios into main
5 changed files with 8 additions and 36 deletions
Showing only changes of commit c5e3276f34 - Show all commits
+3 -2
View File
@@ -5,11 +5,12 @@
-duplicate existing report with new name -duplicate existing report with new name
-cleanup empty uuid folders in case user gets an internal folder created but never saves -cleanup empty uuid folders in case user gets an internal folder created but never saves
-always save report data (file locations, title, etc.) to internal dir (might already be done?)
-add dropdown to Add Items button to have add items from folder and remove choose working folder option (data always saved internally) -add dropdown to Add Items button to have add items from folder and remove choose working folder option (data always saved internally)
-no more option to save data internally -> ALWAYS save report_data.json internally -always save report data (file locations, title, etc.) to internal dir (might already be done?)
-no more option to save data internally -> ALWAYS save report_data.json internally
-update project title -> should update recently used data -update project title -> should update recently used data
-this sort of works, something is wrong with the upgrade process where the UUID is not brought over properly; need to test and fix (maybe fixed already and my dataset is wrong?) -this sort of works, something is wrong with the upgrade process where the UUID is not brought over properly; need to test and fix (maybe fixed already and my dataset is wrong?)
-add option to backup added files to internal data directory
-make backup of last generated PDF -make backup of last generated PDF
-iOS-specific (MAUI essentials?) -iOS-specific (MAUI essentials?)
-Take picture -Take picture
-11
View File
@@ -17,7 +17,6 @@ class Settings : ChangeNotifier
private bool _saveOutputPdfInWorkingDir; private bool _saveOutputPdfInWorkingDir;
private string _outputPdfDir; private string _outputPdfDir;
private decimal _imageResizeThreshold; private decimal _imageResizeThreshold;
private bool _saveReportJsonDataInInternalDir;
private Dictionary<string, string> _workingFolderToInternalFolderName; // obsolete private Dictionary<string, string> _workingFolderToInternalFolderName; // obsolete
private List<PDFReportInfo> _allReportInfo; private List<PDFReportInfo> _allReportInfo;
public string _dataGridDateFormat; public string _dataGridDateFormat;
@@ -31,7 +30,6 @@ class Settings : ChangeNotifier
_saveOutputPdfInWorkingDir = true; _saveOutputPdfInWorkingDir = true;
_outputPdfDir = ""; _outputPdfDir = "";
_imageResizeThreshold = 1.5m; _imageResizeThreshold = 1.5m;
_saveReportJsonDataInInternalDir = false;
_workingFolderToInternalFolderName = []; _workingFolderToInternalFolderName = [];
_allReportInfo = []; _allReportInfo = [];
_settingsVersion = 2; _settingsVersion = 2;
@@ -46,7 +44,6 @@ class Settings : ChangeNotifier
_saveOutputPdfInWorkingDir = other.SaveOutputPdfInWorkingDir; _saveOutputPdfInWorkingDir = other.SaveOutputPdfInWorkingDir;
_outputPdfDir = other.OutputPdfDir; _outputPdfDir = other.OutputPdfDir;
_imageResizeThreshold = other.ImageResizeThreshold; _imageResizeThreshold = other.ImageResizeThreshold;
_saveReportJsonDataInInternalDir = other.SaveReportJsonDataInInternalDir;
_workingFolderToInternalFolderName = other.WorkingFolderToInternalFolderName; _workingFolderToInternalFolderName = other.WorkingFolderToInternalFolderName;
_settingsVersion = other.SettingsVersion; _settingsVersion = other.SettingsVersion;
_allReportInfo = other.AllReportInfo; _allReportInfo = other.AllReportInfo;
@@ -90,13 +87,6 @@ class Settings : ChangeNotifier
set { _imageResizeThreshold = value; NotifyPropertyChanged(); } set { _imageResizeThreshold = value; NotifyPropertyChanged(); }
} }
[JsonInclude]
public bool SaveReportJsonDataInInternalDir
{
get => _saveReportJsonDataInInternalDir;
set { _saveReportJsonDataInInternalDir = value; NotifyPropertyChanged(); }
}
[JsonInclude] [JsonInclude]
public Dictionary<string, string> WorkingFolderToInternalFolderName public Dictionary<string, string> WorkingFolderToInternalFolderName
{ {
@@ -217,7 +207,6 @@ class Settings : ChangeNotifier
} }
settings.AllReportInfo = list.OrderBy(x => x.Title).ToList(); settings.AllReportInfo = list.OrderBy(x => x.Title).ToList();
settings.WorkingFolderToInternalFolderName = []; // clear this list; it is no longer going to be used settings.WorkingFolderToInternalFolderName = []; // clear this list; it is no longer going to be used
settings.SaveReportJsonDataInInternalDir = true; // this is now always true
settings.SettingsVersion = 2; settings.SettingsVersion = 2;
settings.SaveSettingsNotAsync(); // saves all data; UUIDs should be in sync if user has toggled settings settings.SaveSettingsNotAsync(); // saves all data; UUIDs should be in sync if user has toggled settings
} }
@@ -270,8 +270,6 @@ class CreatePDFReportViewModel : BaseViewModel, ICanCheckShutdown, ILogger
} }
private string GetReportSavedDataPath(string workingFolder) private string GetReportSavedDataPath(string workingFolder)
{
if (_settings.SaveReportJsonDataInInternalDir)
{ {
var internalPath = Utilities.GetInternalDataPath(); var internalPath = Utilities.GetInternalDataPath();
var internalReportDataDir = Path.Combine(internalPath, _pdfReport.UUID); var internalReportDataDir = Path.Combine(internalPath, _pdfReport.UUID);
@@ -281,11 +279,6 @@ class CreatePDFReportViewModel : BaseViewModel, ICanCheckShutdown, ILogger
} }
return Path.Combine(internalReportDataDir, Constants.ReportSavedDataFileName); return Path.Combine(internalReportDataDir, Constants.ReportSavedDataFileName);
} }
else
{
return Path.Combine(workingFolder, Constants.ReportSavedDataFileName);
}
}
private void ScanFolder(string path) private void ScanFolder(string path)
{ {
@@ -113,16 +113,6 @@ class SettingsViewModel: ChangeNotifier
} }
} }
public bool SaveReportJsonDataInInternalDir
{
get => true; // _settings.SaveReportJsonDataInInternalDir;
//set
//{
// _settings.SaveReportJsonDataInInternalDir = value;
// NotifyPropertyChanged();
//}
}
public List<DateDisplayFormat> DateFormats public List<DateDisplayFormat> DateFormats
{ {
get => _dateFormats; get => _dateFormats;
@@ -72,7 +72,6 @@
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<!-- <CheckBox IsChecked="{Binding SaveReportJsonDataInInternalDir}">Save report data (names, notes, etc.) in MayShow settings directory (saves in working directory by default)</CheckBox> -->
<Button Command="{Binding OpenSettingsDir}"> <Button Command="{Binding OpenSettingsDir}">
<TextBlock> <TextBlock>
<Run Text="&#xf07c;" <Run Text="&#xf07c;"