Compare commits
4 Commits
e2d5ae2a70
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 75b6b1dc4d | |||
| 1161a437c4 | |||
| 605ba95848 | |||
| eb38bafd23 |
+1
-1
@@ -78,7 +78,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</MenuItem.Header>
|
</MenuItem.Header>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem x:Name="MnIAdSetDelete" Click="MnIAdSetRename_OnClick" IsEnabled="False">
|
<MenuItem x:Name="MnIAdSetDelete" Click="MnIAdSetDelete_OnClick" IsEnabled="True">
|
||||||
<MenuItem.Header>
|
<MenuItem.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<LucideIcon Kind="Trash" Width="12" Height="12" Size="12" />
|
<LucideIcon Kind="Trash" Width="12" Height="12" Size="12" />
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ public partial class MainWindow : Window
|
|||||||
Logger.Log("Loading settings...");
|
Logger.Log("Loading settings...");
|
||||||
Global.Load();
|
Global.Load();
|
||||||
Settings.Load();
|
Settings.Load();
|
||||||
|
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(Global._instance.config_path))
|
||||||
|
TbConfigPath.Text = PathUtilities.NormalizeFileSystemPath(Global._instance.config_path);
|
||||||
|
|
||||||
LoadPdfExportOptions();
|
LoadPdfExportOptions();
|
||||||
HookPdfExportOptionEvents();
|
HookPdfExportOptionEvents();
|
||||||
|
|
||||||
@@ -132,6 +137,8 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
private void MnuExit_OnClick(object? sender, RoutedEventArgs e)
|
private void MnuExit_OnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Settings.Save();
|
||||||
|
Global.Save();
|
||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,6 +219,11 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
|
|
||||||
private async void NavTree_SelectionChanged(object? sender, SelectionChangedEventArgs e)
|
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)
|
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) &&
|
ExpandAndFindNode(nodes, selectPath, out var selectedNode) &&
|
||||||
selectedNode != null)
|
selectedNode != null)
|
||||||
NavTree.SelectedItem = selectedNode;
|
NavTree.SelectedItem = selectedNode;
|
||||||
|
|
||||||
|
ReloadWikiItem();
|
||||||
}catch (Exception ex)
|
}catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.Log($"Error while populating nav tree: {ex.Message}", Logger.LogType.Error);
|
Logger.Log($"Error while populating nav tree: {ex.Message}", Logger.LogType.Error);
|
||||||
@@ -444,6 +458,7 @@ public partial class MainWindow : Window
|
|||||||
TbSettingsCustomerDescription.Text = "";
|
TbSettingsCustomerDescription.Text = "";
|
||||||
TbSettingsCustomerName.Text = "";
|
TbSettingsCustomerName.Text = "";
|
||||||
TbSettingsCustomerPatchInfo.Text = "";
|
TbSettingsCustomerPatchInfo.Text = "";
|
||||||
|
TbSettingsCustomerName.Focus();
|
||||||
|
|
||||||
Settings.Save();
|
Settings.Save();
|
||||||
RefreshCustomerItems();
|
RefreshCustomerItems();
|
||||||
@@ -494,7 +509,13 @@ public partial class MainWindow : Window
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var editedWikiFilePath = _selectedWikiFilePath;
|
||||||
EditorWindow ew = new(_selectedWikiFilePath);
|
EditorWindow ew = new(_selectedWikiFilePath);
|
||||||
|
ew.Closed += (_, _) =>
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(editedWikiFilePath) && File.Exists(editedWikiFilePath))
|
||||||
|
PopulateNavTree(editedWikiFilePath, editedWikiFilePath);
|
||||||
|
};
|
||||||
ew.Show();
|
ew.Show();
|
||||||
|
|
||||||
//await MessageBox.Show(this, "Edit feature is currently disabled.", "Edit Disabled");
|
//await MessageBox.Show(this, "Edit feature is currently disabled.", "Edit Disabled");
|
||||||
@@ -1237,4 +1258,29 @@ public partial class MainWindow : Window
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void MnIAdSetDelete_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if(await MessageBox.Show(this,"Wirklich löschen?","",MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
var cus_id = ((Customer)LstCustomers.SelectedItems[0]).ID;
|
||||||
|
var id = (LstCustomerAdressSets.SelectedItems[0] as KasAddressList).ID;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach (var set in Settings._instance.addressSets.addresses)
|
||||||
|
if (set.ID == id)
|
||||||
|
{
|
||||||
|
Settings._instance.addressSets.addresses.Remove(set);
|
||||||
|
Settings.Save();
|
||||||
|
RefreshAddressSetListItems(cus_id);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(this, ex.StackTrace, "Fehler");
|
||||||
|
Logger.Log($"Error while deleting address set: {ex.Message}", Logger.LogType.Error);
|
||||||
|
}}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d" SizeToContent="WidthAndHeight"
|
mc:Ignorable="d" SizeToContent="WidthAndHeight" WindowStartupLocation="CenterScreen"
|
||||||
x:Class="Logof_Client.MessageBox" Icon="assets/icon.ico"
|
x:Class="Logof_Client.MessageBox" Icon="assets/icon.ico"
|
||||||
Title="MessageBox">
|
Title="MessageBox">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public partial class EditorWindow : Window
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
File.WriteAllText(filename, TbContent.Text);
|
File.WriteAllText(filename, TbContent.Text);
|
||||||
MainWindow._instance.PopulateNavTree();
|
MainWindow._instance.PopulateNavTree(filename, filename);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user