Add auto-update check and DDC/CI timeout fix
- Auto-update checker on startup via Gitea API - Balloon notification when update available, click to download - 5-second timeout on DDC/CI commands to prevent hangs - Simplified version scheme to match release tags - Workflow auto-updates version in csproj from tag 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,13 +7,42 @@ namespace DellMonitorControl
|
||||
{
|
||||
private TaskbarIcon? _trayIcon;
|
||||
private MainWindow? _mainWindow;
|
||||
private UpdateInfo? _pendingUpdate;
|
||||
|
||||
private void Application_Startup(object sender, StartupEventArgs e)
|
||||
private async void Application_Startup(object sender, StartupEventArgs e)
|
||||
{
|
||||
_trayIcon = (TaskbarIcon)FindResource("TrayIcon");
|
||||
_trayIcon.TrayLeftMouseUp += TrayIcon_Click;
|
||||
_trayIcon.TrayBalloonTipClicked += TrayIcon_BalloonTipClicked;
|
||||
|
||||
_mainWindow = new MainWindow();
|
||||
|
||||
// Check for updates in background
|
||||
await CheckForUpdatesAsync();
|
||||
}
|
||||
|
||||
private async System.Threading.Tasks.Task CheckForUpdatesAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_pendingUpdate = await UpdateChecker.CheckForUpdateAsync();
|
||||
if (_pendingUpdate != null && _trayIcon != null)
|
||||
{
|
||||
_trayIcon.ShowBalloonTip(
|
||||
"Update Available",
|
||||
$"Monitor Control v{_pendingUpdate.LatestVersion} is available.\nClick to download.",
|
||||
BalloonIcon.Info);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void TrayIcon_BalloonTipClicked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_pendingUpdate != null && !string.IsNullOrEmpty(_pendingUpdate.DownloadUrl))
|
||||
{
|
||||
UpdateChecker.OpenDownloadPage(_pendingUpdate.DownloadUrl);
|
||||
}
|
||||
}
|
||||
|
||||
private async void TrayIcon_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user