mirror of
https://github.com/ckaczor/WorldClockStatusWindow.git
synced 2026-01-22 09:45:39 -05:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5631bc87be | |||
| 3a87285e58 | |||
| 14ac34f27f | |||
| 72644ef84f | |||
| e732fe9d91 | |||
| 3a189986da | |||
| adab62394b |
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
@@ -5,6 +5,8 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-to-github-releases:
|
deploy-to-github-releases:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
@@ -24,11 +26,11 @@ jobs:
|
|||||||
dotnet-version: 8.0.x
|
dotnet-version: 8.0.x
|
||||||
|
|
||||||
- name: Publish Application
|
- name: Publish Application
|
||||||
run: dotnet publish WorldClockStatusWindow.csproj -c Release -o publish -r win-x64 --self-contained true
|
run: dotnet publish WorldClockStatusWindow.csproj -c Release -o publish
|
||||||
|
|
||||||
- name: Create Velopack Release
|
- name: Create Velopack Release
|
||||||
run: |
|
run: |
|
||||||
dotnet tool install -g vpk
|
dotnet tool install -g vpk
|
||||||
vpk download github --repoUrl https://github.com/ckaczor/WorldClockStatusWindow
|
vpk download github --repoUrl https://github.com/ckaczor/WorldClockStatusWindow
|
||||||
vpk pack -u WorldClockStatusWindow -v ${{ steps.version.outputs.version }} -p publish
|
vpk pack -u WorldClockStatusWindow -v ${{ steps.version.outputs.version }} -p publish --packTitle "World Clock Status Window" --shortcuts StartMenuRoot --framework net8.0-x64-desktop
|
||||||
vpk upload github --repoUrl https://github.com/ckaczor/WorldClockStatusWindow --publish --releaseName "WorldClockStatusWindow ${{ steps.version.outputs.version }}" --tag v${{ steps.version.outputs.version }} --token ${{ secrets.GITHUB_TOKEN }}
|
vpk upload github --repoUrl https://github.com/ckaczor/WorldClockStatusWindow --publish --releaseName "${{ steps.version.outputs.version }}" --tag v${{ steps.version.outputs.version }} --token ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -1,12 +1,16 @@
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using NuGet.Versioning;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using System;
|
using System;
|
||||||
using Velopack;
|
using Velopack;
|
||||||
|
using Velopack.Sources;
|
||||||
|
|
||||||
namespace WorldClockStatusWindow;
|
namespace WorldClockStatusWindow;
|
||||||
|
|
||||||
internal class Program
|
internal class Program
|
||||||
{
|
{
|
||||||
|
private static UpdateManager _updateManager;
|
||||||
|
|
||||||
[STAThread]
|
[STAThread]
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
@@ -24,4 +28,8 @@ internal class Program
|
|||||||
|
|
||||||
Log.Logger.Information("End");
|
Log.Logger.Information("End");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static UpdateManager UpdateManager => _updateManager ??= new UpdateManager(new GithubSource("https://github.com/ckaczor/WorldClockStatusWindow", null, false));
|
||||||
|
|
||||||
|
public static string LocalVersion => (UpdateManager.CurrentVersion ?? new SemanticVersion(0, 0, 0)).ToString();
|
||||||
}
|
}
|
||||||
84
Properties/Resources.Designer.cs
generated
84
Properties/Resources.Designer.cs
generated
@@ -1,7 +1,7 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:4.0.30319.34014
|
// Runtime Version:4.0.30319.42000
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
@@ -19,10 +19,10 @@ namespace WorldClockStatusWindow.Properties {
|
|||||||
// class via a tool like ResGen or Visual Studio.
|
// class via a tool like ResGen or Visual Studio.
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
// with the /str option, or rebuild your VS project.
|
// with the /str option, or rebuild your VS project.
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Resources {
|
public class Resources {
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ namespace WorldClockStatusWindow.Properties {
|
|||||||
/// Returns the cached ResourceManager instance used by this class.
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
public static global::System.Resources.ResourceManager ResourceManager {
|
||||||
get {
|
get {
|
||||||
if (object.ReferenceEquals(resourceMan, null)) {
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WorldClockStatusWindow.Properties.Resources", typeof(Resources).Assembly);
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WorldClockStatusWindow.Properties.Resources", typeof(Resources).Assembly);
|
||||||
@@ -51,7 +51,7 @@ namespace WorldClockStatusWindow.Properties {
|
|||||||
/// resource lookups using this strongly typed resource class.
|
/// resource lookups using this strongly typed resource class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Globalization.CultureInfo Culture {
|
public static global::System.Globalization.CultureInfo Culture {
|
||||||
get {
|
get {
|
||||||
return resourceCulture;
|
return resourceCulture;
|
||||||
}
|
}
|
||||||
@@ -63,11 +63,83 @@ namespace WorldClockStatusWindow.Properties {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Icon ApplicationIcon {
|
public static System.Drawing.Icon ApplicationIcon {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("ApplicationIcon", resourceCulture);
|
object obj = ResourceManager.GetObject("ApplicationIcon", resourceCulture);
|
||||||
return ((System.Drawing.Icon)(obj));
|
return ((System.Drawing.Icon)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to World Clock Status Window.
|
||||||
|
/// </summary>
|
||||||
|
public static string ApplicationName {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ApplicationName", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to _Check for Update.
|
||||||
|
/// </summary>
|
||||||
|
public static string CheckUpdate {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("CheckUpdate", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Close.
|
||||||
|
/// </summary>
|
||||||
|
public static string CloseButtonText {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("CloseButtonText", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to About.
|
||||||
|
/// </summary>
|
||||||
|
public static string optionCategoryAbout {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("optionCategoryAbout", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to General.
|
||||||
|
/// </summary>
|
||||||
|
public static string optionCategoryGeneral {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("optionCategoryGeneral", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Settings.
|
||||||
|
/// </summary>
|
||||||
|
public static string SettingsTitle {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("SettingsTitle", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to _Start when Windows starts.
|
||||||
|
/// </summary>
|
||||||
|
public static string startWithWindowsCheckBox {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("startWithWindowsCheckBox", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Version {0}.
|
||||||
|
/// </summary>
|
||||||
|
public static string Version {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Version", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,4 +121,28 @@
|
|||||||
<data name="ApplicationIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="ApplicationIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\Application.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\Application.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ApplicationName" xml:space="preserve">
|
||||||
|
<value>World Clock Status Window</value>
|
||||||
|
</data>
|
||||||
|
<data name="optionCategoryAbout" xml:space="preserve">
|
||||||
|
<value>About</value>
|
||||||
|
</data>
|
||||||
|
<data name="CheckUpdate" xml:space="preserve">
|
||||||
|
<value>_Check for Update</value>
|
||||||
|
</data>
|
||||||
|
<data name="startWithWindowsCheckBox" xml:space="preserve">
|
||||||
|
<value>_Start when Windows starts</value>
|
||||||
|
</data>
|
||||||
|
<data name="optionCategoryGeneral" xml:space="preserve">
|
||||||
|
<value>General</value>
|
||||||
|
</data>
|
||||||
|
<data name="SettingsTitle" xml:space="preserve">
|
||||||
|
<value>Settings</value>
|
||||||
|
</data>
|
||||||
|
<data name="CloseButtonText" xml:space="preserve">
|
||||||
|
<value>Close</value>
|
||||||
|
</data>
|
||||||
|
<data name="Version" xml:space="preserve">
|
||||||
|
<value>Version {0}</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 198 KiB |
21
SettingsWindow/AboutSettingsPanel.xaml
Normal file
21
SettingsWindow/AboutSettingsPanel.xaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<windows:CategoryPanelBase x:Class="WorldClockStatusWindow.SettingsWindow.AboutSettingsPanel"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:properties="clr-namespace:WorldClockStatusWindow.Properties"
|
||||||
|
xmlns:worldClockStatusWindow="clr-namespace:WorldClockStatusWindow"
|
||||||
|
xmlns:windows="clr-namespace:ChrisKaczor.Wpf.Windows;assembly=ChrisKaczor.Wpf.Windows.CategoryWindow"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="150"
|
||||||
|
d:DesignWidth="300">
|
||||||
|
<Grid>
|
||||||
|
<StackPanel windows:Spacing.Vertical="10">
|
||||||
|
<TextBlock Text="{x:Static properties:Resources.ApplicationName}"
|
||||||
|
FontWeight="Bold" />
|
||||||
|
<TextBlock Text="{Binding Source={x:Static worldClockStatusWindow:Program.LocalVersion}, StringFormat={x:Static properties:Resources.Version}}"
|
||||||
|
Name="VersionLabel" />
|
||||||
|
<TextBlock Text="Chris Kaczor" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</windows:CategoryPanelBase>
|
||||||
12
SettingsWindow/AboutSettingsPanel.xaml.cs
Normal file
12
SettingsWindow/AboutSettingsPanel.xaml.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
namespace WorldClockStatusWindow.SettingsWindow
|
||||||
|
{
|
||||||
|
public partial class AboutSettingsPanel
|
||||||
|
{
|
||||||
|
public AboutSettingsPanel()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string CategoryName => Properties.Resources.optionCategoryAbout;
|
||||||
|
}
|
||||||
|
}
|
||||||
16
SettingsWindow/GeneralSettingsPanel.xaml
Normal file
16
SettingsWindow/GeneralSettingsPanel.xaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<windows:CategoryPanelBase x:Class="WorldClockStatusWindow.SettingsWindow.GeneralSettingsPanel"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:properties="clr-namespace:WorldClockStatusWindow.Properties"
|
||||||
|
xmlns:windows="clr-namespace:ChrisKaczor.Wpf.Windows;assembly=ChrisKaczor.Wpf.Windows.CategoryWindow"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="300"
|
||||||
|
d:DesignWidth="300">
|
||||||
|
<StackPanel windows:Spacing.Vertical="10">
|
||||||
|
<CheckBox Content="{x:Static properties:Resources.startWithWindowsCheckBox}"
|
||||||
|
IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=AutoStart}"
|
||||||
|
Click="OnSaveSettings" />
|
||||||
|
</StackPanel>
|
||||||
|
</windows:CategoryPanelBase>
|
||||||
36
SettingsWindow/GeneralSettingsPanel.xaml.cs
Normal file
36
SettingsWindow/GeneralSettingsPanel.xaml.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using ChrisKaczor.Wpf.Application;
|
||||||
|
using System.Windows;
|
||||||
|
using WorldClockStatusWindow.Properties;
|
||||||
|
|
||||||
|
namespace WorldClockStatusWindow.SettingsWindow;
|
||||||
|
|
||||||
|
public partial class GeneralSettingsPanel
|
||||||
|
{
|
||||||
|
public GeneralSettingsPanel()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string CategoryName => Properties.Resources.optionCategoryGeneral;
|
||||||
|
|
||||||
|
public override void LoadPanel(Window parentWindow)
|
||||||
|
{
|
||||||
|
base.LoadPanel(parentWindow);
|
||||||
|
|
||||||
|
MarkLoaded();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnSaveSettings(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
SaveSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SaveSettings()
|
||||||
|
{
|
||||||
|
if (!HasLoaded) return;
|
||||||
|
|
||||||
|
Settings.Default.Save();
|
||||||
|
|
||||||
|
Application.Current.SetStartWithWindows(Settings.Default.AutoStart);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using ChrisKaczor.Wpf.Windows.FloatingStatusWindow;
|
using ChrisKaczor.Wpf.Windows.FloatingStatusWindow;
|
||||||
|
using Serilog;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -8,11 +9,8 @@ using System.Text.Json;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using Serilog;
|
using ChrisKaczor.Wpf.Windows;
|
||||||
using Serilog.Core;
|
using WorldClockStatusWindow.SettingsWindow;
|
||||||
using Velopack;
|
|
||||||
using Velopack.Sources;
|
|
||||||
using WorldClockStatusWindow.Properties;
|
|
||||||
|
|
||||||
namespace WorldClockStatusWindow;
|
namespace WorldClockStatusWindow;
|
||||||
|
|
||||||
@@ -33,32 +31,36 @@ internal class WindowSource : IWindowSource, IDisposable
|
|||||||
|
|
||||||
_timer = new Timer(1000);
|
_timer = new Timer(1000);
|
||||||
|
|
||||||
Task.Factory.StartNew(UpdateApp).ContinueWith(_ => Start());
|
Task.Factory.StartNew(UpdateApp).ContinueWith(task => Start(task.Result.Result));
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<bool> UpdateApp()
|
private async Task<bool> UpdateApp()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var updateManager = new UpdateManager(new GithubSource("https://github.com/ckaczor/WorldClockStatusWindow", null, false));
|
if (!Program.UpdateManager.IsInstalled)
|
||||||
|
|
||||||
if (!updateManager.IsInstalled)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
_dispatcher.Invoke(() => _floatingStatusWindow.SetText("Checking for update..."));
|
Log.Logger.Information("Checking for update");
|
||||||
|
|
||||||
var newVersion = await updateManager.CheckForUpdatesAsync();
|
await _dispatcher.InvokeAsync(() => _floatingStatusWindow.SetText("Checking for update..."));
|
||||||
|
|
||||||
|
var newVersion = await Program.UpdateManager.CheckForUpdatesAsync();
|
||||||
|
|
||||||
if (newVersion == null)
|
if (newVersion == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
_dispatcher.Invoke(() => _floatingStatusWindow.SetText("Downloading update..."));
|
Log.Logger.Information("Downloading update");
|
||||||
|
|
||||||
await updateManager.DownloadUpdatesAsync(newVersion);
|
await _dispatcher.InvokeAsync(() => _floatingStatusWindow.SetText("Downloading update..."));
|
||||||
|
|
||||||
_dispatcher.Invoke(() => _floatingStatusWindow.SetText("Installing update..."));
|
await Program.UpdateManager.DownloadUpdatesAsync(newVersion);
|
||||||
|
|
||||||
updateManager.ApplyUpdatesAndRestart(newVersion);
|
Log.Logger.Information("Installing update");
|
||||||
|
|
||||||
|
await _dispatcher.InvokeAsync(() => _floatingStatusWindow.SetText("Installing update..."));
|
||||||
|
|
||||||
|
Program.UpdateManager.ApplyUpdatesAndRestart(newVersion);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -68,10 +70,19 @@ internal class WindowSource : IWindowSource, IDisposable
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Start()
|
private void Start(bool hasUpdate)
|
||||||
{
|
{
|
||||||
|
Log.Logger.Information($"Start: hasUpdate={hasUpdate}");
|
||||||
|
|
||||||
|
if (hasUpdate)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Log.Logger.Information("Load");
|
||||||
|
|
||||||
Load();
|
Load();
|
||||||
|
|
||||||
|
Log.Logger.Information("Starting timer");
|
||||||
|
|
||||||
_timer.Elapsed += HandleTimerElapsed;
|
_timer.Elapsed += HandleTimerElapsed;
|
||||||
_timer.Enabled = true;
|
_timer.Enabled = true;
|
||||||
}
|
}
|
||||||
@@ -144,6 +155,18 @@ internal class WindowSource : IWindowSource, IDisposable
|
|||||||
|
|
||||||
public void ShowSettings()
|
public void ShowSettings()
|
||||||
{
|
{
|
||||||
|
var categoryPanels = new List<CategoryPanelBase>
|
||||||
|
{
|
||||||
|
new GeneralSettingsPanel(),
|
||||||
|
new AboutSettingsPanel()
|
||||||
|
};
|
||||||
|
|
||||||
|
var settingsWindow = new CategoryWindow(categoryPanels, Properties.Resources.SettingsTitle, Properties.Resources.CloseButtonText);
|
||||||
|
|
||||||
|
var dialogResult = settingsWindow.ShowDialog();
|
||||||
|
|
||||||
|
if (!dialogResult.GetValueOrDefault(false))
|
||||||
|
return;
|
||||||
|
|
||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,40 +1,56 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0-windows7.0</TargetFramework>
|
<TargetFramework>net8.0-windows7.0</TargetFramework>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
||||||
<StartupObject>WorldClockStatusWindow.Program</StartupObject>
|
<StartupObject>WorldClockStatusWindow.Program</StartupObject>
|
||||||
</PropertyGroup>
|
<ApplicationIcon>Resources\Application.ico</ApplicationIcon>
|
||||||
<ItemGroup>
|
</PropertyGroup>
|
||||||
<AppDesigner Include="Properties\" />
|
<ItemGroup>
|
||||||
</ItemGroup>
|
<AppDesigner Include="Properties\" />
|
||||||
<ItemGroup>
|
</ItemGroup>
|
||||||
<PackageReference Include="ChrisKaczor.Wpf.Application.StartWithWindows" Version="1.0.5" />
|
<ItemGroup>
|
||||||
<PackageReference Include="ChrisKaczor.Wpf.Windows.FloatingStatusWindow" Version="2.0.0.5" />
|
<Content Include="Resources\Application.ico" />
|
||||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
</ItemGroup>
|
||||||
<PackageReference Include="Serilog" Version="4.0.1" />
|
<ItemGroup>
|
||||||
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
|
<PackageReference Include="ChrisKaczor.Wpf.Application.StartWithWindows" Version="1.0.5" />
|
||||||
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
<PackageReference Include="ChrisKaczor.Wpf.Windows.CategoryWindow" Version="1.0.2" />
|
||||||
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
|
<PackageReference Include="ChrisKaczor.Wpf.Windows.FloatingStatusWindow" Version="2.0.0.5" />
|
||||||
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
|
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||||
<PackageReference Include="Velopack" Version="0.0.626" />
|
<PackageReference Include="Serilog" Version="4.0.2" />
|
||||||
</ItemGroup>
|
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
|
||||||
<ItemGroup>
|
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
||||||
<Compile Update="Properties\Settings.Designer.cs">
|
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
|
||||||
<AutoGen>True</AutoGen>
|
<PackageReference Include="Velopack" Version="0.0.626" />
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
</ItemGroup>
|
||||||
</Compile>
|
<ItemGroup>
|
||||||
</ItemGroup>
|
<Compile Update="Properties\Resources.Designer.cs">
|
||||||
<ItemGroup>
|
<DesignTime>True</DesignTime>
|
||||||
<None Update="Properties\Settings.settings">
|
<AutoGen>True</AutoGen>
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
</Compile>
|
||||||
</None>
|
<Compile Update="Properties\Settings.Designer.cs">
|
||||||
</ItemGroup>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
<ItemGroup>
|
<AutoGen>True</AutoGen>
|
||||||
<None Include=".github\workflows\main.yml" />
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
</ItemGroup>
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Update="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include=".github\workflows\main.yml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Update="Properties\Resources.resx">
|
||||||
|
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
Reference in New Issue
Block a user