Keep the files in N1MM's folders
The folders under the user's own directory are N1MM's now, with N1MM's names, read out of N1MMLibrary.dll: Databases, SupportFiles, UserDefinedContests, FunctionKeyMessages, CallHistoryFiles, ExportFiles, GoalFiles, LettersFiles, QsoRecording, SkinsAndLayouts, SystemFiles, TransactionLogFiles, Diagnostics and Wav. A station that runs both programs keeps its files in one shape. An operator's recordings go in Wav/<his callsign>, which is where N1MM plays them from, and the folder is made when he takes the radio. Cabrillo and ADIF start in ExportFiles, call history files in CallHistoryFiles, and the .mc function key files in FunctionKeyMessages. N1MM's three *DDL folders and its Piper folders are left out: they hold the migrations for N1MM's own admin databases and the program it speaks with. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD
This commit is contained in:
@@ -33,9 +33,19 @@ public sealed partial class MessagesDialog : Window
|
||||
|
||||
private readonly ModeCategory mode;
|
||||
|
||||
public MessagesDialog(ModeCategory mode, string text, string what = "Function key messages")
|
||||
/// The folder import and export start in: `FunctionKeyMessages`, which is
|
||||
/// where N1MM keeps its `.mc` files. Null leaves the picker wherever it was
|
||||
/// last.
|
||||
private readonly string? folder;
|
||||
|
||||
public MessagesDialog(
|
||||
ModeCategory mode,
|
||||
string text,
|
||||
string what = "Function key messages",
|
||||
string? folder = null)
|
||||
{
|
||||
this.mode = mode;
|
||||
this.folder = folder;
|
||||
InitializeComponent();
|
||||
Title = $"{what} — {(mode == ModeCategory.Phone ? "phone" : "CW")}";
|
||||
TextArea.Text = text.Trim().Length > 0 ? text : Messages.DefaultFor(mode);
|
||||
@@ -105,6 +115,7 @@ public sealed partial class MessagesDialog : Window
|
||||
Title = "Import a function key file",
|
||||
AllowMultiple = false,
|
||||
FileTypeFilter = [MessageFiles],
|
||||
SuggestedStartLocation = await Start(),
|
||||
});
|
||||
if (files.FirstOrDefault()?.TryGetLocalPath() is not { } path)
|
||||
{
|
||||
@@ -126,6 +137,7 @@ public sealed partial class MessagesDialog : Window
|
||||
{
|
||||
Title = "Export the function key file",
|
||||
SuggestedFileName = mode == ModeCategory.Phone ? "phone.mc" : "cw.mc",
|
||||
SuggestedStartLocation = await Start(),
|
||||
DefaultExtension = "mc",
|
||||
FileTypeChoices = [MessageFiles],
|
||||
});
|
||||
@@ -149,4 +161,7 @@ public sealed partial class MessagesDialog : Window
|
||||
private void OnSave(object? sender, RoutedEventArgs e) => Close(TextArea.Text ?? "");
|
||||
|
||||
private void OnCancel(object? sender, RoutedEventArgs e) => Close(null);
|
||||
|
||||
private async Task<IStorageFolder?> Start() =>
|
||||
folder is null ? null : await StorageProvider.TryGetFolderFromPathAsync(folder);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user