Rearrange files to shared project
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="MayShow.Views.AboutView"
|
||||
xmlns:models="clr-namespace:MayShow.Models"
|
||||
xmlns:vm="clr-namespace:MayShow.ViewModels"
|
||||
xmlns:dialogHost="clr-namespace:DialogHostAvalonia;assembly=DialogHost.Avalonia"
|
||||
x:DataType="vm:AboutViewModel"
|
||||
MaxWidth="450">
|
||||
<StackPanel Orientation="Vertical"
|
||||
Spacing="4">
|
||||
<TextBlock Text="MayShow 1.4.0"
|
||||
HorizontalAlignment="Center"
|
||||
TextWrapping="Wrap"
|
||||
FontSize="18"
|
||||
FontWeight="Bold"/>
|
||||
<TextBlock Text="MayShow (an intentional misspelling of 明証, pronounced may-shō, a Japanese word meaning proof, evidence, or corroboration) is a PDF report creation tool. It was built by MB for A in 2026. May the quacking of ducks always be in your favor. Thanks for using our software!"
|
||||
TextWrapping="Wrap"
|
||||
FontSize="14"/>
|
||||
<TextBlock Text="App icon made using https://gauger.me/fonticon/ with FontAwesome icon 'file-invoice-dollar' and the macOS software Icon Composer."
|
||||
TextWrapping="Wrap"
|
||||
FontSize="14"/>
|
||||
<Label Content="Open Source Licenses:"/>
|
||||
<ScrollViewer Margin="2"
|
||||
Grid.Row="4"
|
||||
x:Name="LogScrollView"
|
||||
VerticalScrollBarVisibility="Visible"
|
||||
AllowAutoHide="False"
|
||||
MaxHeight="250">
|
||||
<SelectableTextBlock Margin="2"
|
||||
TextWrapping="Wrap"
|
||||
FontSize="10"
|
||||
x:Name="LicenseTextBlock"/>
|
||||
</ScrollViewer>
|
||||
<TextBlock Text="Copyright 2026 - Quickity Quack Productions"
|
||||
TextWrapping="Wrap"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,4,0,4"
|
||||
FontSize="12"/>
|
||||
<Button Command="{Binding Close}"
|
||||
Classes="accent"
|
||||
Content="Close"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,4,4"/>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace MayShow.Views;
|
||||
|
||||
public partial class AboutView : UserControl
|
||||
{
|
||||
public AboutView()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
// set license text
|
||||
var processDir = Path.GetDirectoryName(Environment.ProcessPath) ?? "";
|
||||
var licenseFileName = Path.Combine(processDir, "Assets", "LICENSES.txt");
|
||||
var licenseText = "";
|
||||
if (File.Exists(licenseFileName))
|
||||
{
|
||||
licenseText = File.ReadAllText(licenseFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
licenseFileName = Path.Combine(processDir, "../Resources/Assets/LICENSES.txt");
|
||||
if (File.Exists(licenseFileName))
|
||||
{
|
||||
licenseText = File.ReadAllText(licenseFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
licenseText = "Error: Unable to find license file!";
|
||||
}
|
||||
}
|
||||
LicenseTextBlock.Text = licenseText.Trim();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="MayShow.Views.ConfirmView"
|
||||
xmlns:models="clr-namespace:MayShow.Models"
|
||||
xmlns:vm="clr-namespace:MayShow.ViewModels"
|
||||
x:DataType="vm:ConfirmViewModel">
|
||||
<StackPanel Orientation="Vertical"
|
||||
Spacing="4">
|
||||
<TextBlock TextAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
FontSize="18"
|
||||
Text="{Binding Title}"/>
|
||||
<TextBlock TextAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
TextWrapping="Wrap"
|
||||
FontSize="14"
|
||||
MaxWidth="350"
|
||||
Text="{Binding Message}"/>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Spacing="12"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="4">
|
||||
<Button Command="{Binding Decline}"
|
||||
Content="{Binding DeclineTitle}"
|
||||
HorizontalAlignment="Right"/>
|
||||
<Button Command="{Binding Confirm}"
|
||||
Classes="accent"
|
||||
Content="{Binding ConfirmTitle}"
|
||||
HorizontalAlignment="Right"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace MayShow.Views;
|
||||
|
||||
public partial class ConfirmView : UserControl
|
||||
{
|
||||
public ConfirmView()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
d:DesignWidth="800"
|
||||
d:DesignHeight="450"
|
||||
x:Class="MayShow.Views.EditFile"
|
||||
xmlns:models="clr-namespace:MayShow.Models"
|
||||
xmlns:vm="clr-namespace:MayShow.ViewModels"
|
||||
xmlns:dialogHost="clr-namespace:DialogHostAvalonia;assembly=DialogHost.Avalonia"
|
||||
x:DataType="vm:EditFileViewModel"
|
||||
MaxWidth="350">
|
||||
<ScrollViewer AllowAutoHide="False">
|
||||
<StackPanel Orientation="Vertical"
|
||||
Spacing="4"
|
||||
Margin="12,4,12,0">
|
||||
<Label Content="Edit File Details"
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="16"
|
||||
FontWeight="Bold" />
|
||||
<Label Content="Title" />
|
||||
<TextBox Watermark="Title"
|
||||
Text="{Binding ClonedFile.Title}"
|
||||
VerticalAlignment="Stretch"
|
||||
TextWrapping="Wrap" />
|
||||
<Label Content="Notes" />
|
||||
<TextBox Watermark="Notes"
|
||||
Text="{Binding ClonedFile.Notes}"
|
||||
VerticalAlignment="Stretch"
|
||||
AcceptsReturn="True"
|
||||
ScrollViewer.AllowAutoHide="False"
|
||||
Height="75" />
|
||||
<Label Content="Receipt Date" />
|
||||
<Calendar SelectionMode="SingleDate"
|
||||
SelectedDate="{Binding ClonedFile.ReceiptDateTime}"
|
||||
DisplayDate="{Binding ClonedFile.ReceiptDateTime}"
|
||||
IsTodayHighlighted="False" />
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Spacing="12"
|
||||
Margin="0,4,0,0"
|
||||
HorizontalAlignment="Right">
|
||||
<Button Command="{Binding Cancel}">
|
||||
<TextBlock>
|
||||
<Run Text=""
|
||||
FontFamily="{StaticResource FontAwesomeSolid}" /> Cancel</TextBlock>
|
||||
</Button>
|
||||
<Button Command="{Binding Save}"
|
||||
Classes="accent">
|
||||
<TextBlock>
|
||||
<Run Text=""
|
||||
FontFamily="{StaticResource FontAwesomeSolid}" /> Save</TextBlock>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace MayShow.Views;
|
||||
|
||||
public partial class EditFile : UserControl
|
||||
{
|
||||
public EditFile()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,295 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="MayShow.Views.MainView"
|
||||
xmlns:helpers="clr-namespace:MayShow.Helpers"
|
||||
xmlns:models="clr-namespace:MayShow.Models"
|
||||
xmlns:views="clr-namespace:MayShow.Views"
|
||||
xmlns:vm="clr-namespace:MayShow.ViewModels"
|
||||
xmlns:progRing="clr-namespace:AvaloniaProgressRing;assembly=AvaloniaProgressRing"
|
||||
x:DataType="vm:MainViewModel">
|
||||
<Grid ColumnDefinitions="*"
|
||||
RowDefinitions="Auto, 2*, Auto, Auto, *">
|
||||
<Button Command="{Binding ShowSettings}"
|
||||
Grid.Row="0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Margin="4,4,0,4">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Settings</TextBlock>
|
||||
</Button>
|
||||
<Button Command="{Binding ShowAbout}"
|
||||
Grid.Row="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Margin="0,4,4,4">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> About</TextBlock>
|
||||
</Button>
|
||||
<StackPanel Orientation="Vertical"
|
||||
Spacing="2"
|
||||
Margin="0,4,0,0">
|
||||
<Label Content="MayShow: Report Builder"
|
||||
FontSize="20"
|
||||
FontWeight="Bold"
|
||||
HorizontalAlignment="Center"/>
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
Margin="4,0,0,0">
|
||||
<Button Content="Choose Receipt Folder"
|
||||
Command="{Binding ChooseFolder}"
|
||||
IsEnabled="{Binding !IsCreatingPDF}"
|
||||
Grid.Column="0" />
|
||||
<TextBlock Text="{Binding WorkingFolder}"
|
||||
VerticalAlignment="Center"
|
||||
TextWrapping="NoWrap"
|
||||
Margin="4,0,4,0"
|
||||
TextTrimming="PrefixCharacterEllipsis"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
<Label Content="Report Title"
|
||||
IsVisible="{Binding IsTitleBoxVisible}" />
|
||||
<TextBox Text="{Binding ReportTitle}"
|
||||
IsVisible="{Binding IsTitleBoxVisible}"
|
||||
Watermark="Receipts December 2024"
|
||||
Margin="2,0,2,4"
|
||||
Classes="clearButton"
|
||||
Name="TitleTextBox">
|
||||
<TextBox.KeyBindings>
|
||||
<KeyBinding Command="{Binding $parent[views:MainView].UnfocusTextbox}" Gesture="Enter" />
|
||||
</TextBox.KeyBindings>
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
<DataGrid x:Name="FilesGrid"
|
||||
Classes="DragAndDrop ItemsDragAndDrop"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="2"
|
||||
ItemsSource="{Binding ReportFiles}"
|
||||
AutoGenerateColumns="False"
|
||||
IsReadOnly="False"
|
||||
GridLinesVisibility="All"
|
||||
CanUserReorderColumns="False"
|
||||
CanUserResizeColumns="True"
|
||||
CanUserSortColumns="False"
|
||||
BorderThickness="1"
|
||||
VerticalScrollBarVisibility="Visible"
|
||||
ScrollViewer.AllowAutoHide="False"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
HeadersVisibility="All"
|
||||
BorderBrush="Gray">
|
||||
<DataGrid.Styles>
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="NoWrap" />
|
||||
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
|
||||
</Style>
|
||||
<Style Selector="TextBox">
|
||||
<Setter Property="TextWrapping" Value="NoWrap" />
|
||||
</Style>
|
||||
<Style Selector="ToolTip">
|
||||
<Setter Property="MaxWidth" Value="1000" />
|
||||
</Style>
|
||||
</DataGrid.Styles>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Header="Title"
|
||||
IsReadOnly="False"
|
||||
Width="*">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Grid ColumnDefinitions="Auto, *">
|
||||
<Button Command="{Binding $parent[DataGrid].((vm:MainViewModel)DataContext).LocateFile}"
|
||||
CommandParameter="{Binding}"
|
||||
IsVisible="{Binding !IsFileFoundOnDisk}"
|
||||
Margin="2"
|
||||
Content=""
|
||||
VerticalContentAlignment="Center"
|
||||
Background="Transparent"
|
||||
Grid.Column="0"
|
||||
FontFamily="{StaticResource FontAwesomeSolid}"
|
||||
ToolTip.Tip="File not found; click to locate..."
|
||||
IsEnabled="{Binding !$parent[DataGrid].((vm:MainViewModel)DataContext).IsCreatingPDF}"/>
|
||||
<TextBlock Text="{Binding Title}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
TextWrapping="NoWrap"
|
||||
ToolTip.Tip="{Binding Title}"
|
||||
Grid.Column="1"
|
||||
Margin="8,0,4,0"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate DataType="models:ReportFile">
|
||||
<TextBox Text="{Binding Title}"
|
||||
Watermark="Title"
|
||||
ToolTip.Tip="{Binding Title}"
|
||||
Classes="clearButton">
|
||||
<TextBox.KeyBindings>
|
||||
<KeyBinding Command="{Binding $parent[views:MainView].UnfocusTextbox}" Gesture="Enter" />
|
||||
</TextBox.KeyBindings>
|
||||
</TextBox>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Receipt Date"
|
||||
IsReadOnly="False"
|
||||
Width="125">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding ReceiptDate}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="8,0,8,0"
|
||||
HorizontalAlignment="Left"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate DataType="models:ReportFile">
|
||||
<CalendarDatePicker SelectedDate="{Binding ReceiptDateTime}"
|
||||
DisplayDate="{Binding ReceiptDateTime}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="File Name"
|
||||
IsReadOnly="True"
|
||||
Width="*">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding FileName}"
|
||||
VerticalAlignment="Center"
|
||||
ToolTip.Tip="{Binding FileName}"
|
||||
Margin="8,0,8,0"
|
||||
HorizontalAlignment="Left"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header=""
|
||||
IsReadOnly="True"
|
||||
Width="*">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Spacing="4">
|
||||
<Button Command="{Binding $parent[DataGrid].((vm:MainViewModel)DataContext).EditFileProperties}"
|
||||
CommandParameter="{Binding}"
|
||||
Classes="accent"
|
||||
Margin="2"
|
||||
IsEnabled="{Binding !$parent[DataGrid].((vm:MainViewModel)DataContext).IsCreatingPDF}">
|
||||
<Button.Content>
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Edit</TextBlock>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Command="{Binding $parent[DataGrid].((vm:MainViewModel)DataContext).RemoveFile}"
|
||||
CommandParameter="{Binding}"
|
||||
Classes="Danger"
|
||||
Margin="2"
|
||||
IsEnabled="{Binding !$parent[DataGrid].((vm:MainViewModel)DataContext).IsCreatingPDF}">
|
||||
<Button.Content>
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Remove</TextBlock>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
<DataGrid.RowDetailsTemplate>
|
||||
<DataTemplate x:DataType="models:ReportFile">
|
||||
<Grid ColumnDefinitions="*"
|
||||
RowDefinitions="Auto, Auto, Auto">
|
||||
<TextBlock TextWrapping="Wrap" Margin="4" Grid.Row="0">
|
||||
<Run FontWeight="Bold" Text="File Path"/>: <Run Text="{Binding FilePath}"/>
|
||||
</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap" Margin="4" Grid.Row="1">
|
||||
<Run FontWeight="Bold" Text="Notes"/>: <Run Text="{Binding Notes}"/>
|
||||
</TextBlock>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Spacing="8"
|
||||
Margin="4"
|
||||
Grid.Row="2">
|
||||
<Button Command="{Binding $parent[DataGrid].((vm:MainViewModel)DataContext).OpenFileLocation}"
|
||||
CommandParameter="{Binding}">
|
||||
<Button.Content>
|
||||
<TextBlock FontSize="12"><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Open File Location</TextBlock>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Command="{Binding $parent[DataGrid].((vm:MainViewModel)DataContext).OpenFile}"
|
||||
CommandParameter="{Binding}">
|
||||
<Button.Content>
|
||||
<TextBlock FontSize="12"><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Open File</TextBlock>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</DataGrid.RowDetailsTemplate>
|
||||
</DataGrid>
|
||||
<StackPanel Orientation="Vertical"
|
||||
HorizontalAlignment="Center"
|
||||
Spacing="4"
|
||||
Grid.Row="2"
|
||||
Margin="4">
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Spacing="4">
|
||||
<Button Command="{Binding AddItem}"
|
||||
IsEnabled="{Binding CanAddItem}">
|
||||
<TextBlock><Run Text="+" FontFamily="{StaticResource FontAwesomeSolid}"/> Add Item(s)</TextBlock>
|
||||
</Button>
|
||||
<Button Command="{Binding RemoveAllItems}"
|
||||
IsEnabled="{Binding IsCreatePDFButtonEnabled}"
|
||||
Classes="Danger">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Remove All Items</TextBlock>
|
||||
</Button>
|
||||
<Button Command="{Binding ResortPDFItemsByDate}"
|
||||
IsEnabled="{Binding IsCreatePDFButtonEnabled}">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Re-sort PDF Items</TextBlock>
|
||||
</Button>
|
||||
<Button Command="{Binding SaveInterimReportInfo}"
|
||||
IsEnabled="{Binding HasWorkingFolderAndNotMakingPDF}">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Save Report Info</TextBlock>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Spacing="6"
|
||||
HorizontalAlignment="Center">
|
||||
<Button Command="{Binding BuildPDF}"
|
||||
Classes="accent"
|
||||
IsEnabled="{Binding IsCreatePDFButtonEnabled}">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Create Report PDF</TextBlock>
|
||||
</Button>
|
||||
<Label Content="Creating PDF..."
|
||||
IsVisible="{Binding IsCreatingPDF}"
|
||||
VerticalAlignment="Center"/>
|
||||
<progRing:ProgressRing Width="30"
|
||||
Height="30"
|
||||
IsActive="{Binding IsCreatingPDF}"
|
||||
Foreground="{DynamicResource SystemAccentColor}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical"
|
||||
HorizontalAlignment="Stretch"
|
||||
Spacing="2"
|
||||
Grid.Row="3">
|
||||
<Rectangle Fill="Gray" Height="3" HorizontalAlignment="Stretch"/>
|
||||
<Grid ColumnDefinitions="Auto, *">
|
||||
<Label Content="Program Log" FontSize="14" FontWeight="Bold" Grid.Column="0"/>
|
||||
<Button Command="{Binding CopyLogToClipboard}"
|
||||
FontSize="10"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,2,8,2">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Copy Program Log to Clipboard</TextBlock>
|
||||
</Button>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<ScrollViewer Margin="2"
|
||||
Grid.Row="4"
|
||||
x:Name="LogScrollView"
|
||||
VerticalScrollBarVisibility="Visible"
|
||||
AllowAutoHide="False">
|
||||
<SelectableTextBlock Text="{Binding ProgramLog}"
|
||||
Margin="2"
|
||||
TextWrapping="Wrap"
|
||||
x:Name="LogBlock"/>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using MayShow.ViewModels;
|
||||
|
||||
namespace MayShow.Views;
|
||||
|
||||
public partial class MainView : UserControl
|
||||
{
|
||||
public MainView()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
LogBlock.PropertyChanged += LogBlock_PropertyChanged;
|
||||
FilesGrid.CellEditEnded += FileCellEditEnded;
|
||||
}
|
||||
|
||||
private void LogBlock_PropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.Property.ToString() == "Text")
|
||||
{
|
||||
LogScrollView.ScrollToEnd();
|
||||
}
|
||||
}
|
||||
|
||||
public void UnfocusTextbox()
|
||||
{
|
||||
var topLevel = TopLevel.GetTopLevel(this);
|
||||
topLevel?.FocusManager?.ClearFocus();
|
||||
if (DataContext is MainViewModel mvm)
|
||||
{
|
||||
mvm?.HasUnsavedWork = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void FileCellEditEnded(object? sender, DataGridCellEditEndedEventArgs args)
|
||||
{
|
||||
if (args.EditAction == DataGridEditAction.Commit && DataContext is MainViewModel mvm)
|
||||
{
|
||||
mvm?.HasUnsavedWork = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
d:DesignWidth="800"
|
||||
d:DesignHeight="450"
|
||||
x:Class="MayShow.Views.SettingsView"
|
||||
xmlns:models="clr-namespace:MayShow.Models"
|
||||
xmlns:vm="clr-namespace:MayShow.ViewModels"
|
||||
x:DataType="vm:SettingsViewModel"
|
||||
MaxWidth="450">
|
||||
<ScrollViewer AllowAutoHide="False">
|
||||
<StackPanel Orientation="Vertical"
|
||||
Spacing="8"
|
||||
Margin="12,4,12,4">
|
||||
<Label Content="Settings"
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="16"
|
||||
FontWeight="Bold" />
|
||||
<TextBlock TextWrapping="Wrap"
|
||||
HorizontalAlignment="Left"
|
||||
Width="350">
|
||||
Always reduce size of images if above this file size in megabytes (MB):
|
||||
</TextBlock>
|
||||
<NumericUpDown Value="{Binding ImageResizeThreshold}"
|
||||
Increment="0.1"
|
||||
Minimum="0.5"
|
||||
FormatString="0.00"
|
||||
Maximum="10"
|
||||
Width="150"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,0,0,4" />
|
||||
<CheckBox IsChecked="{Binding !UseDocnetPDFImageRendering}">Use legacy PDF handling (does not work with macOS annotations)</CheckBox>
|
||||
<CheckBox IsChecked="{Binding SaveOutputPdfInWorkingDir}">Always save report PDF in working directory</CheckBox>
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
IsVisible="{Binding !SaveOutputPdfInWorkingDir}">
|
||||
<Button Content="Choose report output folder..."
|
||||
Grid.Column="0"
|
||||
Command="{Binding ChooseOutputFolder}"
|
||||
VerticalAlignment="Top"/>
|
||||
<TextBlock Text="{Binding OutputPdfDirPath}"
|
||||
Margin="4,0,0,0"
|
||||
TextWrapping="Wrap"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"/>
|
||||
</Grid>
|
||||
<CheckBox IsChecked="{Binding SaveReportJsonDataInInternalDir}">Save report data (names, notes, etc.) in MayShow settings directory (saves in working directory by default)</CheckBox>
|
||||
<TextBlock TextWrapping="Wrap"
|
||||
Foreground="Red"
|
||||
Text="{Binding ErrorMessage}"
|
||||
IsVisible="{Binding HasErrorMessage}"/>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Spacing="12"
|
||||
Margin="0,4,0,0"
|
||||
HorizontalAlignment="Right">
|
||||
<Button Command="{Binding Cancel}">
|
||||
<TextBlock>
|
||||
<Run Text=""
|
||||
FontFamily="{StaticResource FontAwesomeSolid}" /> Cancel</TextBlock>
|
||||
</Button>
|
||||
<Button Command="{Binding Save}"
|
||||
Classes="accent">
|
||||
<TextBlock>
|
||||
<Run Text=""
|
||||
FontFamily="{StaticResource FontAwesomeSolid}" /> Save</TextBlock>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace MayShow.Views;
|
||||
|
||||
public partial class SettingsView : UserControl
|
||||
{
|
||||
public SettingsView()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="MayShow.Views.ShutdownCheckView"
|
||||
xmlns:models="clr-namespace:MayShow.Models"
|
||||
xmlns:vm="clr-namespace:MayShow.ViewModels"
|
||||
xmlns:dialogHost="clr-namespace:DialogHostAvalonia;assembly=DialogHost.Avalonia"
|
||||
x:DataType="vm:ShutdownCheckViewModel">
|
||||
<StackPanel Orientation="Vertical"
|
||||
Spacing="4">
|
||||
<TextBlock TextAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
FontSize="18"
|
||||
Text="Warning: You have unsaved report data!"/>
|
||||
<TextBlock TextAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
TextWrapping="Wrap"
|
||||
FontSize="14"
|
||||
Text="Do you want to save your data before the program is closed?"/>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Button Command="{Binding SaveAndShutdown}"
|
||||
Classes="accent"
|
||||
Content="Save Data and Close"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,4,0,4"/>
|
||||
<Button Command="{Binding DoNotSaveAndShutdown}"
|
||||
Content="Do NOT Save Data and Close"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,4,0,4"/>
|
||||
<Button Command="{Binding CancelShutdown}"
|
||||
Content="Cancel Program Shutdown"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,4,0,4"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace MayShow.Views;
|
||||
|
||||
public partial class ShutdownCheckView : UserControl
|
||||
{
|
||||
public ShutdownCheckView()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="MayShow.Views.WarningDeleteItem"
|
||||
xmlns:models="clr-namespace:MayShow.Models"
|
||||
xmlns:vm="clr-namespace:MayShow.ViewModels"
|
||||
xmlns:dialogHost="clr-namespace:DialogHostAvalonia;assembly=DialogHost.Avalonia"
|
||||
x:DataType="vm:WarningDeleteItemViewModel">
|
||||
<StackPanel HorizontalAlignment="Center"
|
||||
Margin="6"
|
||||
Spacing="8">
|
||||
<TextBlock TextAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
TextWrapping="Wrap"
|
||||
FontSize="16"
|
||||
MaxWidth="350">Are you sure you want to remove the item "<Run Text="{Binding File.Title}"/>"?</TextBlock>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Center"
|
||||
Spacing="8">
|
||||
<Button Command="{Binding KeepItem}"
|
||||
Classes="accent">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Keep Item</TextBlock>
|
||||
</Button>
|
||||
<Button Command="{Binding RemoveItem}"
|
||||
Classes="Danger">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Remove Item</TextBlock>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace MayShow.Views;
|
||||
|
||||
public partial class WarningDeleteItem : UserControl
|
||||
{
|
||||
public WarningDeleteItem()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="MayShow.Views.WarningView"
|
||||
xmlns:models="clr-namespace:MayShow.Models"
|
||||
xmlns:vm="clr-namespace:MayShow.ViewModels"
|
||||
xmlns:dialogHost="clr-namespace:DialogHostAvalonia;assembly=DialogHost.Avalonia"
|
||||
x:DataType="vm:WarningViewModel">
|
||||
<StackPanel Orientation="Vertical"
|
||||
Spacing="4">
|
||||
<TextBlock TextAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
FontSize="18"
|
||||
Text="Error!"/>
|
||||
<TextBlock TextAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
TextWrapping="Wrap"
|
||||
FontSize="14"
|
||||
MaxWidth="400"
|
||||
Text="{Binding Error}"/>
|
||||
<Button Command="{Binding Close}"
|
||||
Classes="accent"
|
||||
Content="Close"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,4,4,4"/>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace MayShow.Views;
|
||||
|
||||
public partial class WarningView : UserControl
|
||||
{
|
||||
public WarningView()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user