4 Commits

Author SHA1 Message Date
mbabienco d90cd1354f Bump version 2026-03-13 08:18:32 +09:00
mbabienco f4dd498d22 Shortcut to view settings dir 2026-03-13 08:14:50 +09:00
mbabienco cd71df8a8e Add yyyy.MM.dd to acceptable formats 2026-03-13 08:10:11 +09:00
mbabienco de621fe9dc Add another file name date parsing format
Also redid code so more formats would be easy
2026-03-13 08:05:11 +09:00
9 changed files with 46 additions and 15 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
; Non-commercial use only ; Non-commercial use only
#define MyAppName "MayShow" #define MyAppName "MayShow"
#define MyAppVersion "1.4.1" #define MyAppVersion "1.4.2"
#define MyAppPublisher "Quickity Quack Productions" #define MyAppPublisher "Quickity Quack Productions"
#define MyAppExeName "MayShow.exe" #define MyAppExeName "MayShow.exe"
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
VERSION="1.4.1" VERSION="1.4.2"
SRC_DIR="src" # user ran script from main folder SRC_DIR="src" # user ran script from main folder
if [ ! -d "$SRC_DIR" ]; then if [ ! -d "$SRC_DIR" ]; then
SRC_DIR= "../src" # try SRC_DIR= "../src" # try
+1 -1
View File
@@ -3,7 +3,7 @@ namespace MayShow.Helpers;
class Constants class Constants
{ {
public static string AppVersion = "1.4.1"; public static string AppVersion = "1.4.2";
public static string[] AllowedFileExtensionPatterns = [ "*.png", "*.jpg", "*.jpeg", "*.gif", "*.bmp", "*.webp", "*.pdf", "*.heic", ]; public static string[] AllowedFileExtensionPatterns = [ "*.png", "*.jpg", "*.jpeg", "*.gif", "*.bmp", "*.webp", "*.pdf", "*.heic", ];
public static string[] AllowedFileExtensionsNoStar = [ "png", "jpg", "jpeg", "gif", "bmp", "webp", "pdf", "heic", ]; public static string[] AllowedFileExtensionsNoStar = [ "png", "jpg", "jpeg", "gif", "bmp", "webp", "pdf", "heic", ];
+22 -9
View File
@@ -1,10 +1,12 @@
using System; using System;
using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Text.Json; using System.Text.Json;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Tmds.DBus.Protocol;
namespace MayShows.Helpers; namespace MayShows.Helpers;
@@ -23,16 +25,27 @@ class Utilities
public static DateOnly? CheckValidDateInString(string str) public static DateOnly? CheckValidDateInString(string str)
{ {
// https://stackoverflow.com/a/14918404/3938401 // https://stackoverflow.com/a/14918404/3938401
var rgx = new Regex(@"\d{4}-\d{2}-\d{2}"); // formats = regex format -> DateTime parsing format
var mat = rgx.Match(str); var formats = new Dictionary<string, string>
if (mat.Success)
{ {
var dtStr = mat.ToString(); {@"\d{4}-\d{2}-\d{2}", "yyyy-MM-dd"},
string[] formats = ["yyyy-MM-dd"]; {@"\d{4}.d{2}.d{2}", "yyyy.MM.dd"},
DateTime parsedDateTime; {@"\d{8}", "yyyyMMdd"}
var didWork = DateTime.TryParseExact(dtStr, formats, CultureInfo.InvariantCulture, };
DateTimeStyles.None, out parsedDateTime); foreach (var data in formats)
return didWork ? DateOnly.FromDateTime(parsedDateTime) : null; {
var rgx = new Regex(data.Key);
var mat = rgx.Match(str);
if (mat.Success)
{
var dtStr = mat.ToString();
var didWork = DateTime.TryParseExact(dtStr, [data.Value], CultureInfo.InvariantCulture,
DateTimeStyles.None, out var parsedDateTime);
if (didWork)
{
return DateOnly.FromDateTime(parsedDateTime);
}
}
} }
return null; return null;
} }
+1 -1
View File
@@ -12,7 +12,7 @@
<PublishTrimmed>true</PublishTrimmed> <PublishTrimmed>true</PublishTrimmed>
<PublishAot>true</PublishAot> <PublishAot>true</PublishAot>
<AssemblyName>MayShow</AssemblyName> <AssemblyName>MayShow</AssemblyName>
<AssemblyVersion>1.4.1</AssemblyVersion> <!-- Also update Constants version --> <AssemblyVersion>1.4.2</AssemblyVersion> <!-- Also update Constants version -->
<ApplicationIcon>MayShow-icon.ico</ApplicationIcon> <ApplicationIcon>MayShow-icon.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
+13
View File
@@ -18,6 +18,7 @@ using PdfSharp.Snippets.Font;
using MayShow.Interfaces; using MayShow.Interfaces;
using MayShow.Models; using MayShow.Models;
using MayShow.Helpers; using MayShow.Helpers;
using MayShows.Helpers;
namespace MayShow.ViewModels; namespace MayShow.ViewModels;
@@ -126,6 +127,18 @@ class SettingsViewModel: ChangeNotifier
} }
} }
public void OpenSettingsDir()
{
var topLevel = _topLevelGrabber?.GetTopLevel();
Console.WriteLine(Utilities.GetInternalDataPath());
var dirName = Utilities.GetInternalDataPath();
if (topLevel is not null && dirName != null)
{
var launcher = topLevel.Launcher;
launcher.LaunchUriAsync(new Uri(dirName));
}
}
public void Cancel() public void Cancel()
{ {
DialogHost.Close("DialogHost", null); DialogHost.Close("DialogHost", null);
+1 -1
View File
@@ -11,7 +11,7 @@
MaxWidth="450"> MaxWidth="450">
<StackPanel Orientation="Vertical" <StackPanel Orientation="Vertical"
Spacing="4"> Spacing="4">
<TextBlock Text="MayShow 1.4.1" <TextBlock Text="MayShow 1.4.2"
HorizontalAlignment="Center" HorizontalAlignment="Center"
TextWrapping="Wrap" TextWrapping="Wrap"
FontSize="18" FontSize="18"
+5
View File
@@ -47,6 +47,11 @@
VerticalAlignment="Top"/> VerticalAlignment="Top"/>
</Grid> </Grid>
<CheckBox IsChecked="{Binding SaveReportJsonDataInInternalDir}">Save report data (names, notes, etc.) in MayShow settings directory (saves in working directory by default)</CheckBox> <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}">
<TextBlock>
<Run Text="&#xf07c;"
FontFamily="{StaticResource FontAwesomeSolid}" /> Open MayShow Settings Directory</TextBlock>
</Button>
<TextBlock TextWrapping="Wrap" <TextBlock TextWrapping="Wrap"
Foreground="Red" Foreground="Red"
Text="{Binding ErrorMessage}" Text="{Binding ErrorMessage}"
+1 -1
View File
@@ -3,7 +3,7 @@
<!-- This manifest is used on Windows only. <!-- This manifest is used on Windows only.
Don't remove it as it might cause problems with window transparency and embedded controls. Don't remove it as it might cause problems with window transparency and embedded controls.
For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests --> For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests -->
<assemblyIdentity version="1.4.1.0" name="MayShow.Desktop"/> <assemblyIdentity version="1.4.2.0" name="MayShow.Desktop"/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application> <application>