|
|
|
@@ -38,6 +38,11 @@ public partial class MainWindow : Window
|
|
|
|
|
Logger.Log("Loading settings...");
|
|
|
|
|
Global.Load();
|
|
|
|
|
Settings.Load();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(Global._instance.config_path))
|
|
|
|
|
TbConfigPath.Text = PathUtilities.NormalizeFileSystemPath(Global._instance.config_path);
|
|
|
|
|
|
|
|
|
|
LoadPdfExportOptions();
|
|
|
|
|
HookPdfExportOptionEvents();
|
|
|
|
|
|
|
|
|
@@ -132,6 +137,8 @@ public partial class MainWindow : Window
|
|
|
|
|
|
|
|
|
|
private void MnuExit_OnClick(object? sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Settings.Save();
|
|
|
|
|
Global.Save();
|
|
|
|
|
Environment.Exit(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -212,6 +219,11 @@ public partial class MainWindow : Window
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private async void NavTree_SelectionChanged(object? sender, SelectionChangedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
ReloadWikiItem();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async void ReloadWikiItem()
|
|
|
|
|
{
|
|
|
|
|
if (NavTree.SelectedItem is TreeViewItem t && t.Tag is WikiItem item && !item.IsFolder)
|
|
|
|
|
{
|
|
|
|
@@ -255,6 +267,8 @@ public partial class MainWindow : Window
|
|
|
|
|
ExpandAndFindNode(nodes, selectPath, out var selectedNode) &&
|
|
|
|
|
selectedNode != null)
|
|
|
|
|
NavTree.SelectedItem = selectedNode;
|
|
|
|
|
|
|
|
|
|
ReloadWikiItem();
|
|
|
|
|
}catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Logger.Log($"Error while populating nav tree: {ex.Message}", Logger.LogType.Error);
|
|
|
|
@@ -444,6 +458,7 @@ public partial class MainWindow : Window
|
|
|
|
|
TbSettingsCustomerDescription.Text = "";
|
|
|
|
|
TbSettingsCustomerName.Text = "";
|
|
|
|
|
TbSettingsCustomerPatchInfo.Text = "";
|
|
|
|
|
TbSettingsCustomerName.Focus();
|
|
|
|
|
|
|
|
|
|
Settings.Save();
|
|
|
|
|
RefreshCustomerItems();
|
|
|
|
@@ -494,7 +509,13 @@ public partial class MainWindow : Window
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var editedWikiFilePath = _selectedWikiFilePath;
|
|
|
|
|
EditorWindow ew = new(_selectedWikiFilePath);
|
|
|
|
|
ew.Closed += (_, _) =>
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(editedWikiFilePath) && File.Exists(editedWikiFilePath))
|
|
|
|
|
PopulateNavTree(editedWikiFilePath, editedWikiFilePath);
|
|
|
|
|
};
|
|
|
|
|
ew.Show();
|
|
|
|
|
|
|
|
|
|
//await MessageBox.Show(this, "Edit feature is currently disabled.", "Edit Disabled");
|
|
|
|
|