2026-11-25 13:44:02 +01:00
|
|
|
|
#nullable enable
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.ObjectModel;
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
using System.Collections.Specialized;
|
|
|
|
|
|
using System.ComponentModel;
|
2026-11-25 13:44:02 +01:00
|
|
|
|
using System.Linq;
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
using System.Text;
|
2026-11-25 13:44:02 +01:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Windows;
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
using System.Windows.Data;
|
2026-11-25 13:44:02 +01:00
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
|
using System.Windows.Threading;
|
|
|
|
|
|
using ReminderOrganizer.Core;
|
|
|
|
|
|
using ReminderOrganizer.Models;
|
|
|
|
|
|
using ReminderOrganizer.Services;
|
|
|
|
|
|
|
|
|
|
|
|
namespace ReminderOrganizer.ViewModels
|
|
|
|
|
|
{
|
|
|
|
|
|
public class MainViewModel : ViewModelBase
|
|
|
|
|
|
{
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
public const string DiscordUrl = "https://discord.gg/Ej4JPmCZva";
|
|
|
|
|
|
|
2026-11-25 13:44:02 +01:00
|
|
|
|
private readonly IDataService _dataService;
|
|
|
|
|
|
private readonly INotificationService _notificationService;
|
|
|
|
|
|
private readonly ILocalizationService _localizationService;
|
|
|
|
|
|
private readonly IAutostartService _autostartService;
|
|
|
|
|
|
private readonly DispatcherTimer _reminderTimer;
|
|
|
|
|
|
|
|
|
|
|
|
private AppData _appData = new();
|
|
|
|
|
|
private Folder? _selectedFolder;
|
|
|
|
|
|
private ReminderTask? _selectedTask;
|
|
|
|
|
|
private bool _isLoading;
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
private ICollectionView? _selectedFolderTasksView;
|
2026-11-25 13:44:02 +01:00
|
|
|
|
|
|
|
|
|
|
public bool IsLoading
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _isLoading;
|
|
|
|
|
|
set => SetProperty(ref _isLoading, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ObservableCollection<Folder> Folders => _appData.Folders;
|
|
|
|
|
|
|
|
|
|
|
|
public Folder? SelectedFolder
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _selectedFolder;
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
var old = _selectedFolder;
|
2026-11-25 13:44:02 +01:00
|
|
|
|
if (SetProperty(ref _selectedFolder, value))
|
|
|
|
|
|
{
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
if (old != null) old.Tasks.CollectionChanged -= OnSelectedTasksChanged;
|
|
|
|
|
|
if (value != null) value.Tasks.CollectionChanged += OnSelectedTasksChanged;
|
|
|
|
|
|
_selectedFolderTasksView = CreateSortedView(value);
|
2026-11-25 13:44:02 +01:00
|
|
|
|
OnPropertyChanged(nameof(SelectedFolderTasks));
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
OnPropertyChanged(nameof(SelectedFolderTasksView));
|
2026-11-25 13:44:02 +01:00
|
|
|
|
OnPropertyChanged(nameof(SelectedFolderName));
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
OnPropertyChanged(nameof(TaskCountText));
|
|
|
|
|
|
OnPropertyChanged(nameof(HasSelectedFolder));
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
private void OnSelectedTasksChanged(object? sender, NotifyCollectionChangedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
OnPropertyChanged(nameof(TaskCountText));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static ICollectionView? CreateSortedView(Folder? folder)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (folder == null) return null;
|
|
|
|
|
|
var view = new ListCollectionView(folder.Tasks);
|
|
|
|
|
|
view.SortDescriptions.Add(new SortDescription(nameof(ReminderTask.IsNotified), ListSortDirection.Ascending));
|
|
|
|
|
|
view.SortDescriptions.Add(new SortDescription(nameof(ReminderTask.ReminderDate), ListSortDirection.Ascending));
|
|
|
|
|
|
view.IsLiveSorting = true;
|
|
|
|
|
|
view.LiveSortingProperties.Add(nameof(ReminderTask.IsNotified));
|
|
|
|
|
|
view.LiveSortingProperties.Add(nameof(ReminderTask.ReminderDate));
|
|
|
|
|
|
return view;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-25 13:44:02 +01:00
|
|
|
|
public ReminderTask? SelectedTask
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _selectedTask;
|
|
|
|
|
|
set => SetProperty(ref _selectedTask, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ObservableCollection<ReminderTask>? SelectedFolderTasks => SelectedFolder?.Tasks;
|
|
|
|
|
|
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
/// <summary>Tasks of the selected folder: open first, then by date.</summary>
|
|
|
|
|
|
public ICollectionView? SelectedFolderTasksView => _selectedFolderTasksView;
|
|
|
|
|
|
|
|
|
|
|
|
public bool HasSelectedFolder => SelectedFolder != null;
|
|
|
|
|
|
|
2026-11-25 13:44:02 +01:00
|
|
|
|
public string SelectedFolderName => SelectedFolder?.Name ?? L("Welcome");
|
|
|
|
|
|
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
public string TaskCountText => $"{SelectedFolder?.Tasks.Count ?? 0} {L("Tasks")}";
|
|
|
|
|
|
|
2026-11-25 13:44:02 +01:00
|
|
|
|
public string AddFolderText => L("AddFolder");
|
|
|
|
|
|
public string AddTaskText => L("AddTask");
|
|
|
|
|
|
public string AutostartText => L("Autostart");
|
|
|
|
|
|
public string ExitText => L("Exit");
|
|
|
|
|
|
public string FileText => L("File");
|
|
|
|
|
|
public string SettingsText => L("Settings");
|
|
|
|
|
|
public string LanguageText => L("Language");
|
|
|
|
|
|
public string GermanText => L("German");
|
|
|
|
|
|
public string EnglishText => L("English");
|
|
|
|
|
|
public string DeleteText => L("Delete");
|
|
|
|
|
|
public string RenameText => L("Rename");
|
|
|
|
|
|
public string ViewText => L("View");
|
|
|
|
|
|
public string DarkModeText => L("DarkMode");
|
|
|
|
|
|
public string LightModeText => L("LightMode");
|
|
|
|
|
|
public string AddTaskToFolderText => L("AddTaskToFolder");
|
|
|
|
|
|
public string MinimizeTooltip => L("Minimize");
|
|
|
|
|
|
public string MaximizeTooltip => L("Maximize");
|
|
|
|
|
|
public string CloseTooltip => L("Close");
|
|
|
|
|
|
public string CreateTaskHint => L("CreateTaskHint");
|
|
|
|
|
|
public string NoTasks => L("NoTasks");
|
|
|
|
|
|
public string FoldersText => L("Folders");
|
|
|
|
|
|
public string NameColumnText => L("Name");
|
|
|
|
|
|
public string DateColumnText => L("Date");
|
|
|
|
|
|
public string EditTaskTooltip => L("EditTaskTooltip");
|
|
|
|
|
|
public string DeleteTaskTooltip => L("DeleteTaskTooltip");
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
public string DoneTooltip => L("DoneTooltip");
|
2026-11-25 13:44:02 +01:00
|
|
|
|
public string InfoText => L("Info");
|
|
|
|
|
|
public string DiscordText => L("Discord");
|
|
|
|
|
|
public string ImportText => L("Import");
|
|
|
|
|
|
public string ExportText => L("Export");
|
|
|
|
|
|
public string ImportCsvText => L("ImportCsv");
|
|
|
|
|
|
public string ExportCsvText => L("ExportCsv");
|
|
|
|
|
|
public string TestNotificationText => L("TestNotification");
|
|
|
|
|
|
public string AppTitleText => L("AppTitle");
|
|
|
|
|
|
public string RecurringTaskTooltipText => L("RecurringTaskTooltip");
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
public string CopyrightText => $"© {DateTime.Now.Year} Michael Media";
|
|
|
|
|
|
public string VersionText => "v" + (typeof(MainViewModel).Assembly.GetName().Version?.ToString(3) ?? "");
|
2026-11-25 13:44:02 +01:00
|
|
|
|
|
|
|
|
|
|
public bool IsGerman => _localizationService.CurrentLanguage == "de";
|
|
|
|
|
|
public bool IsEnglish => _localizationService.CurrentLanguage == "en";
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
public bool IsAutostartEnabled => _autostartService.IsAutostartEnabled;
|
2026-11-25 13:44:02 +01:00
|
|
|
|
|
|
|
|
|
|
private bool _isDarkMode = true;
|
|
|
|
|
|
public bool IsDarkMode
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _isDarkMode;
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (SetProperty(ref _isDarkMode, value))
|
|
|
|
|
|
{
|
|
|
|
|
|
ThemeChanged?.Invoke(this, value);
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
_appData.IsDarkMode = value;
|
|
|
|
|
|
_ = SaveAsync();
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public event EventHandler<bool>? ThemeChanged;
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
public event EventHandler<ReminderTask?>? EditTaskRequested;
|
2026-11-25 13:44:02 +01:00
|
|
|
|
|
|
|
|
|
|
public ICommand AddFolderCommand { get; }
|
|
|
|
|
|
public ICommand AddTaskCommand { get; }
|
|
|
|
|
|
public ICommand AddTaskToFolderCommand { get; }
|
|
|
|
|
|
public ICommand DeleteTaskCommand { get; }
|
|
|
|
|
|
public ICommand EditTaskCommand { get; }
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
public ICommand ToggleDoneCommand { get; }
|
2026-11-25 13:44:02 +01:00
|
|
|
|
public ICommand ToggleAutostartCommand { get; }
|
|
|
|
|
|
public ICommand ExitCommand { get; }
|
|
|
|
|
|
public ICommand DeleteFolderCommand { get; }
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
public ICommand RenameFolderCommand { get; }
|
2026-11-25 13:44:02 +01:00
|
|
|
|
public ICommand SaveFolderCommand { get; }
|
|
|
|
|
|
public ICommand SetLanguageDeCommand { get; }
|
|
|
|
|
|
public ICommand SetLanguageEnCommand { get; }
|
|
|
|
|
|
public ICommand ToggleDarkModeCommand { get; }
|
|
|
|
|
|
public ICommand MoveTaskToFolderCommand { get; }
|
|
|
|
|
|
public ICommand TestNotificationCommand { get; }
|
|
|
|
|
|
public ICommand ImportCsvCommand { get; }
|
|
|
|
|
|
public ICommand ExportCsvCommand { get; }
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
public ICommand OpenDiscordCommand { get; }
|
2026-11-25 13:44:02 +01:00
|
|
|
|
|
|
|
|
|
|
public MainViewModel(
|
|
|
|
|
|
IDataService dataService,
|
|
|
|
|
|
INotificationService notificationService,
|
|
|
|
|
|
ILocalizationService localizationService,
|
|
|
|
|
|
IAutostartService autostartService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_dataService = dataService;
|
|
|
|
|
|
_notificationService = notificationService;
|
|
|
|
|
|
_localizationService = localizationService;
|
|
|
|
|
|
_autostartService = autostartService;
|
|
|
|
|
|
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
// Empty name = refresh every binding (all texts depend on the language).
|
|
|
|
|
|
_localizationService.StringsChanged += (s, e) => OnPropertyChanged(string.Empty);
|
2026-11-25 13:44:02 +01:00
|
|
|
|
|
|
|
|
|
|
AddFolderCommand = new RelayCommand(AddFolder);
|
|
|
|
|
|
AddTaskCommand = new RelayCommand(AddTask, () => SelectedFolder != null);
|
|
|
|
|
|
AddTaskToFolderCommand = new RelayCommand<Folder>(AddTaskToFolder);
|
|
|
|
|
|
DeleteTaskCommand = new RelayCommand<ReminderTask>(DeleteTask);
|
|
|
|
|
|
EditTaskCommand = new RelayCommand<ReminderTask>(EditTask);
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
ToggleDoneCommand = new RelayCommand<ReminderTask>(t => { _ = SaveAsync(); });
|
2026-11-25 13:44:02 +01:00
|
|
|
|
DeleteFolderCommand = new RelayCommand(DeleteFolder, () => SelectedFolder != null);
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
RenameFolderCommand = new RelayCommand(RenameFolder, () => SelectedFolder != null);
|
2026-11-25 13:44:02 +01:00
|
|
|
|
SaveFolderCommand = new RelayCommand(async () => await SaveAsync());
|
|
|
|
|
|
ToggleAutostartCommand = new RelayCommand(ToggleAutostart);
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
SetLanguageDeCommand = new RelayCommand(() => _localizationService.SetLanguage("de"));
|
|
|
|
|
|
SetLanguageEnCommand = new RelayCommand(() => _localizationService.SetLanguage("en"));
|
2026-11-25 13:44:02 +01:00
|
|
|
|
ToggleDarkModeCommand = new RelayCommand(() => IsDarkMode = !IsDarkMode);
|
|
|
|
|
|
ExitCommand = new RelayCommand(() => Application.Current.Shutdown());
|
|
|
|
|
|
MoveTaskToFolderCommand = new RelayCommand<(ReminderTask, Folder)>(MoveTaskToFolder);
|
|
|
|
|
|
TestNotificationCommand = new RelayCommand(TestNotification);
|
|
|
|
|
|
ImportCsvCommand = new RelayCommand(ImportCsv);
|
|
|
|
|
|
ExportCsvCommand = new RelayCommand(ExportCsv);
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
OpenDiscordCommand = new RelayCommand(OpenDiscord);
|
2026-11-25 13:44:02 +01:00
|
|
|
|
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
_reminderTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(30) };
|
2026-11-25 13:44:02 +01:00
|
|
|
|
_reminderTimer.Tick += (s, e) => CheckReminders();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async Task InitializeAsync()
|
|
|
|
|
|
{
|
|
|
|
|
|
IsLoading = true;
|
|
|
|
|
|
_appData = await _dataService.LoadAsync();
|
2026-11-25 14:52:25 +01:00
|
|
|
|
bool firstRun = string.IsNullOrEmpty(_appData.Language) || _appData.IsDarkMode == null || _appData.Folders.Count == 0;
|
|
|
|
|
|
_appData.IsDarkMode ??= SystemPrefs.IsDarkMode();
|
|
|
|
|
|
_localizationService.Initialize(_appData); // fills Language from Windows if empty
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
|
2026-11-25 13:44:02 +01:00
|
|
|
|
if (_appData.Folders.Count == 0)
|
|
|
|
|
|
_appData.Folders.Add(new Folder(L("MyTasks")));
|
2026-11-25 14:52:25 +01:00
|
|
|
|
if (firstRun)
|
2026-11-25 13:44:02 +01:00
|
|
|
|
await SaveAsync();
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
|
2026-11-25 14:52:25 +01:00
|
|
|
|
_isDarkMode = _appData.IsDarkMode.Value;
|
2026-11-25 13:44:02 +01:00
|
|
|
|
OnPropertyChanged(nameof(IsDarkMode));
|
|
|
|
|
|
OnPropertyChanged(nameof(Folders));
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
SelectedFolder = _appData.Folders.FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
|
|
CheckReminders(); // catch up on reminders missed while the app was closed
|
2026-11-25 13:44:02 +01:00
|
|
|
|
_reminderTimer.Start();
|
|
|
|
|
|
IsLoading = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string L(string key) => _localizationService.GetString(key);
|
|
|
|
|
|
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
private bool Confirm(string message) =>
|
|
|
|
|
|
MessageBox.Show(Application.Current.MainWindow, message, L("AppTitle"),
|
|
|
|
|
|
MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes;
|
|
|
|
|
|
|
|
|
|
|
|
private string? AskName(string title, string current)
|
|
|
|
|
|
{
|
|
|
|
|
|
var dialog = new InputDialog(title, L("NewName"), current, IsDarkMode) { Owner = Application.Current.MainWindow };
|
|
|
|
|
|
if (dialog.ShowDialog() != true) return null;
|
|
|
|
|
|
var name = dialog.ResponseText?.Trim();
|
|
|
|
|
|
return string.IsNullOrEmpty(name) ? null : name;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-25 13:44:02 +01:00
|
|
|
|
private void AddFolder()
|
|
|
|
|
|
{
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
var name = AskName(L("NewFolder"), L("NewFolder"));
|
|
|
|
|
|
if (name == null) return;
|
|
|
|
|
|
var folder = new Folder(name);
|
2026-11-25 13:44:02 +01:00
|
|
|
|
_appData.Folders.Add(folder);
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
SelectedFolder = folder;
|
|
|
|
|
|
_ = SaveAsync();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void RenameFolder()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (SelectedFolder == null) return;
|
|
|
|
|
|
var name = AskName(L("RenameFolder"), SelectedFolder.Name);
|
|
|
|
|
|
if (name == null) return;
|
|
|
|
|
|
SelectedFolder.Name = name;
|
|
|
|
|
|
OnPropertyChanged(nameof(SelectedFolderName));
|
2026-11-25 13:44:02 +01:00
|
|
|
|
_ = SaveAsync();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void DeleteFolder()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (SelectedFolder == null) return;
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
if (SelectedFolder.Tasks.Count > 0 &&
|
|
|
|
|
|
!Confirm(string.Format(L("ConfirmDeleteFolder"), SelectedFolder.Name, SelectedFolder.Tasks.Count)))
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
2026-11-25 13:44:02 +01:00
|
|
|
|
_appData.Folders.Remove(SelectedFolder);
|
|
|
|
|
|
SelectedFolder = _appData.Folders.FirstOrDefault();
|
|
|
|
|
|
_ = SaveAsync();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
private void AddTask() => AddTaskInternal(SelectedFolder);
|
2026-11-25 13:44:02 +01:00
|
|
|
|
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
private void AddTaskToFolder(Folder? folder) => AddTaskInternal(folder);
|
2026-11-25 13:44:02 +01:00
|
|
|
|
|
|
|
|
|
|
private void AddTaskInternal(Folder? folder)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (folder == null)
|
|
|
|
|
|
{
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
MessageBox.Show(L("NoFolderSelectFirst"), L("AppTitle"), MessageBoxButton.OK, MessageBoxImage.Information);
|
2026-11-25 13:44:02 +01:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
var taskWindow = new TaskWindow(null, IsDarkMode) { Owner = Application.Current.MainWindow };
|
2026-11-25 13:44:02 +01:00
|
|
|
|
if (taskWindow.ShowDialog() == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
folder.Tasks.Add(taskWindow.TaskResult);
|
|
|
|
|
|
_ = SaveAsync();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void DeleteTask(ReminderTask? task)
|
|
|
|
|
|
{
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
if (task == null) return;
|
|
|
|
|
|
var folder = _appData.Folders.FirstOrDefault(f => f.Tasks.Contains(task));
|
|
|
|
|
|
if (folder == null) return;
|
|
|
|
|
|
if (!Confirm(string.Format(L("ConfirmDeleteTask"), task.Name))) return;
|
|
|
|
|
|
folder.Tasks.Remove(task);
|
2026-11-25 13:44:02 +01:00
|
|
|
|
_ = SaveAsync();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void MoveTaskToFolder((ReminderTask Task, Folder TargetFolder) args)
|
|
|
|
|
|
{
|
|
|
|
|
|
var (task, targetFolder) = args;
|
|
|
|
|
|
if (task == null || targetFolder == null) return;
|
|
|
|
|
|
|
|
|
|
|
|
var sourceFolder = _appData.Folders.FirstOrDefault(f => f.Tasks.Contains(task));
|
|
|
|
|
|
if (sourceFolder == null || sourceFolder == targetFolder) return;
|
|
|
|
|
|
|
|
|
|
|
|
sourceFolder.Tasks.Remove(task);
|
|
|
|
|
|
targetFolder.Tasks.Add(task);
|
|
|
|
|
|
_ = SaveAsync();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void EditTask(ReminderTask? task)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (task == null) return;
|
|
|
|
|
|
SelectedTask = task;
|
|
|
|
|
|
EditTaskRequested?.Invoke(this, task);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ToggleAutostart()
|
|
|
|
|
|
{
|
|
|
|
|
|
_autostartService.ToggleAutostart();
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
OnPropertyChanged(nameof(IsAutostartEnabled));
|
|
|
|
|
|
_notificationService.ShowNotification(L("AppTitle"),
|
|
|
|
|
|
_autostartService.IsAutostartEnabled ? L("AutostartEnabled") : L("AutostartDisabled"));
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void CheckReminders()
|
|
|
|
|
|
{
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
var due = ReminderTask.ProcessDue(_appData.Folders, DateTime.Now);
|
|
|
|
|
|
foreach (var task in due)
|
2026-11-25 13:44:02 +01:00
|
|
|
|
{
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
var body = string.IsNullOrWhiteSpace(task.Description) ? L("Reminder") : task.Description;
|
|
|
|
|
|
_notificationService.ShowNotification($"🔔 {task.Name}", body);
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
if (due.Count > 0) _ = SaveAsync();
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void TestNotification()
|
|
|
|
|
|
{
|
|
|
|
|
|
_notificationService.ShowNotification(L("TestNotificationTitle"), L("TestNotificationMessage"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
private void OpenDiscord()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
FileName = DiscordUrl,
|
|
|
|
|
|
UseShellExecute = true
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
System.Diagnostics.Debug.WriteLine($"[OpenDiscord] {ex.Message}");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-25 13:44:02 +01:00
|
|
|
|
private void ImportCsv()
|
|
|
|
|
|
{
|
|
|
|
|
|
var dialog = new Microsoft.Win32.OpenFileDialog
|
|
|
|
|
|
{
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
Filter = "CSV (*.csv)|*.csv|All Files (*.*)|*.*",
|
|
|
|
|
|
Title = L("ImportCsv")
|
2026-11-25 13:44:02 +01:00
|
|
|
|
};
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
if (dialog.ShowDialog() != true) return;
|
2026-11-25 13:44:02 +01:00
|
|
|
|
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
try
|
2026-11-25 13:44:02 +01:00
|
|
|
|
{
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
var (imported, skipped) = TaskCsv.Import(System.IO.File.ReadAllText(dialog.FileName), _appData);
|
|
|
|
|
|
_ = SaveAsync();
|
|
|
|
|
|
OnPropertyChanged(nameof(TaskCountText));
|
|
|
|
|
|
|
|
|
|
|
|
var msg = string.Format(L("ImportSuccess"), imported);
|
|
|
|
|
|
if (skipped > 0) msg += " " + string.Format(L("ImportSkipped"), skipped);
|
|
|
|
|
|
MessageBox.Show(msg, L("AppTitle"));
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
MessageBox.Show(string.Format(L("ImportError"), ex.Message), L("AppTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ExportCsv()
|
|
|
|
|
|
{
|
|
|
|
|
|
var dialog = new Microsoft.Win32.SaveFileDialog
|
|
|
|
|
|
{
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
Filter = "CSV (*.csv)|*.csv",
|
|
|
|
|
|
Title = L("ExportCsv"),
|
2026-11-25 13:44:02 +01:00
|
|
|
|
FileName = "tasks.csv"
|
|
|
|
|
|
};
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
if (dialog.ShowDialog() != true) return;
|
2026-11-25 13:44:02 +01:00
|
|
|
|
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
try
|
2026-11-25 13:44:02 +01:00
|
|
|
|
{
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
// UTF-8 with BOM so Excel shows umlauts correctly.
|
|
|
|
|
|
System.IO.File.WriteAllText(dialog.FileName, TaskCsv.Export(_appData), new UTF8Encoding(true));
|
|
|
|
|
|
MessageBox.Show(L("ExportSuccess"), L("AppTitle"));
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
catch (Exception ex)
|
2026-11-25 13:44:02 +01:00
|
|
|
|
{
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
MessageBox.Show(string.Format(L("ExportError"), ex.Message), L("AppTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async Task SaveAsync()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
await _dataService.SaveAsync(_appData);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update),
atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:08:53 +01:00
|
|
|
|
MessageBox.Show($"{L("SaveError")}: {ex.Message}", L("AppTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Cleanup()
|
|
|
|
|
|
{
|
|
|
|
|
|
_reminderTimer.Stop();
|
|
|
|
|
|
}
|
2026-11-25 14:52:25 +01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>Synchronous last save on exit – an async save still running would be cut off.</summary>
|
|
|
|
|
|
public void FlushSave()
|
|
|
|
|
|
{
|
|
|
|
|
|
try { _dataService.Save(_appData); }
|
|
|
|
|
|
catch (Exception ex) { System.Diagnostics.Debug.WriteLine($"[FlushSave] {ex.Message}"); }
|
|
|
|
|
|
}
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|