Skip to content

Commit

Permalink
fix(core): menu items don't show response (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsee authored May 26, 2024
1 parent 82db197 commit ab1486c
Show file tree
Hide file tree
Showing 5 changed files with 294 additions and 242 deletions.
11 changes: 11 additions & 0 deletions src/BSH.Main/BSH.Main.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
<Compile Update="Dialogs\frmMainTabs\ucOverview.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
Expand Down Expand Up @@ -98,6 +103,12 @@
<Version>1.0.118</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand Down
6 changes: 4 additions & 2 deletions src/BSH.Main/Dialogs/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ private void HilfeUndSupportToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
Process.Start("https://www.brightbits.de/?pk_campaign=software_link&pk_kwd=menu_help&pk_source=bsh-3");
var url = "https://www.brightbits.de/?pk_campaign=software_link&pk_kwd=menu_help&pk_source=bsh-3";
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
}
catch
{
Expand Down Expand Up @@ -315,7 +316,8 @@ private void EreignisprotokollAnzeigenToolStripMenuItem_Click(object sender, Eve
try
{
var d = DateTime.Now.ToString("yyyyMMdd");
Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\\Alexosoft\\Backup Service Home 3\\log" + d + ".txt");
var logFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\\Alexosoft\\Backup Service Home 3\\log" + d + ".txt";
Process.Start(new ProcessStartInfo(logFile) { UseShellExecute = true });
}
catch
{
Expand Down
17 changes: 16 additions & 1 deletion src/BSH.Main/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Serilog;
using System;
using System.Reflection;
using System.Resources;
using System.Windows.Forms;

namespace Brightbits.BSH.Main;
Expand All @@ -35,7 +36,7 @@ static class Program
public static void Main(string[] args)
{
Log.Logger = new LoggerConfiguration().ReadFrom.AppSettings().CreateLogger();
Log.Information($"{APP_TITLE} {CurrentVersion} started.");
Log.Information("{APP_TITLE} {CurrentVersion} started.", APP_TITLE, CurrentVersion);

// set current culture
Application.EnableVisualStyles();
Expand Down Expand Up @@ -68,6 +69,7 @@ public static void Main(string[] args)
AutoUpdater.ApplicationExitEvent += AutoUpdater_ApplicationExitEvent;
AutoUpdater.HttpUserAgent = $"{APP_TITLE}/{CurrentVersion} {uniqueUserId}";
AutoUpdater.TopMost = true;
AutoUpdater.CheckForUpdateEvent += AutoUpdater_CheckForUpdateEvent;

// start backup engine
BackupLogic.StartupAsync().Wait();
Expand All @@ -89,6 +91,19 @@ public static void Main(string[] args)
}
}

private static void AutoUpdater_CheckForUpdateEvent(UpdateInfoEventArgs args)
{
if (!args.IsUpdateAvailable)
{
Log.Information("No updates founds; Current version: {CurrentVersion}", CurrentVersion);

MessageBox.Show(Resources.MSG_NO_UPDATE_FOUND_TEXT, Resources.MSG_NO_UPDATE_FOUND_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}

AutoUpdater.ShowUpdateForm(args);
}

private static void AutoUpdater_ApplicationExitEvent()
{
// close application
Expand Down
Loading

0 comments on commit ab1486c

Please sign in to comment.