Skip to content

Commit

Permalink
#203 SIQuester: add option for default image duration; This is the fi…
Browse files Browse the repository at this point in the history
…nal SIQuester 6 commit

Add English help file.
Add tags selection dialog.
Force tags to be selected on package save.
Tag list is dependent on app language.
Fix new XSD scheme.
Add Polly license.
Settings are saved to file only if they has been changed.
Switch table export to new question format.
  • Loading branch information
VladimirKhil committed Feb 3, 2024
1 parent 66362f4 commit 1d6c913
Show file tree
Hide file tree
Showing 43 changed files with 3,098 additions and 2,779 deletions.
1,114 changes: 553 additions & 561 deletions assets/siq_5.xsd

Large diffs are not rendered by default.

49 changes: 48 additions & 1 deletion deploy/SIQuester.Setup/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
<ComponentGroupRef Id="ApplicationProgramMenu" />
<ComponentGroupRef Id="Licenses" />
<ComponentGroupRef Id="wwwroot" />
<ComponentGroupRef Id="native" />
<ComponentGroupRef Id="runtimes" />
<ComponentGroupRef Id="platform" />
</Feature>
</Product>

Expand All @@ -64,6 +67,11 @@
<Directory Id="INSTALLLOCATION" Name="$(var.ProductNameEn)">
<Directory Id="LicensesFolder" Name="Licenses" />
<Directory Id="WWWRootFolder" Name="wwwroot" />
<Directory Id="RuntimesFolder" Name="runtimes">
<Directory Id="PlatformFolder" Name="win-$(var.Platform)">
<Directory Id="NativeFolder" Name="native" />
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
Expand Down Expand Up @@ -106,6 +114,9 @@
<Component Guid="{BE062A3B-5687-4676-9F5B-710AFB837C5F}">
<File KeyPath="yes" Source="..\dlls\$(var.Platform)\api-ms-win-core-winrt-l1-1-0.dll" />
</Component>
<Component Guid="{35c2036e-b32a-4d84-b53a-39027e7eb66b}">
<File KeyPath="yes" Source="$(var.PublishFolder)runtimes\win-$(var.Platform)\native\WebView2Loader.dll" />
</Component>
<Component Guid="{9DDD698F-CC42-450B-A706-73F395AF1F74}">
<File KeyPath="yes" Source="$(var.PublishFolder)aspnetcorev2_inprocess.dll" />
</Component>
Expand All @@ -116,7 +127,10 @@
<File KeyPath="yes" Source="$(var.PublishFolder)appsettings.Production.json" />
</Component>
<Component Guid="52e158c9-4d0b-48e9-ba43-3c81c3799910">
<File KeyPath="yes" Source="$(var.PublishFolder)Help.pdf" />
<File KeyPath="yes" Source="$(var.PublishFolder)Help.ru-RU.pdf" />
</Component>
<Component Guid="3b169511-36e4-4d4a-b0d3-128175610b1f">
<File KeyPath="yes" Source="$(var.PublishFolder)Help.en-US.pdf" />
</Component>
<Component Guid="46306d8e-094a-4559-a541-df3cbf95b19a">
<File KeyPath="yes" Source="$(var.PublishFolder)ygpackagekey3.0.xslt" />
Expand Down Expand Up @@ -162,6 +176,9 @@
<Component Guid="{D24545DB-5745-4EFF-B17D-87EBFCAC2849}">
<File KeyPath="yes" Source="$(var.PublishFolder)licenses\YamlDotNet.LICENSE.txt" />
</Component>
<Component Guid="{b108abbc-642a-4b49-9f33-e11b3e071fd3}">
<File KeyPath="yes" Source="$(var.PublishFolder)licenses\Polly.LICENSE.txt" />
</Component>
<Component Guid="{321D8DBD-C9A0-4216-827C-563F95BF02B0}">
<File KeyPath="yes" Source="$(var.SolutionDir)LICENSE" />
</Component>
Expand Down Expand Up @@ -215,6 +232,36 @@
</ComponentGroup>
</Fragment>

<Fragment>
<ComponentGroup Id="runtimes" Directory="RuntimesFolder">
<Component Guid="{ead36f5b-feec-4a79-a93b-a0b5dbe28015}">
<RegistryValue Root="HKMU" Key="Software\$(var.ManufacturerEn)\$(var.ProductNameEn)" Name="runtimes" Type="integer" Value="1" KeyPath="yes" />
<RemoveFolder Id="RuntimesFolder" On="uninstall" />
</Component>
</ComponentGroup>
</Fragment>

<Fragment>
<ComponentGroup Id="platform" Directory="PlatformFolder">
<Component Guid="{9960fb88-6ad2-434e-902a-6c2765dfba21}">
<RemoveFolder Id="PlatformFolder" On="uninstall" />
<RegistryValue Root="HKMU" Key="Software\$(var.ManufacturerEn)\$(var.ProductNameEn)" Name="platform" Type="integer" Value="1" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>

<Fragment>
<ComponentGroup Id="native" Directory="NativeFolder">
<Component Guid="{fcc45238-44fe-4310-a8d3-ce1c94185eb5}">
<File KeyPath="yes" Id="runtimeLoader" Source="$(var.PublishFolder)runtimes\win-$(var.Platform)\native\WebView2Loader.dll" />
</Component>
<Component Id="NativeReg" Guid="{25579643-4b1e-4de4-9135-40d79f16d7e6}">
<RegistryValue Root="HKMU" Key="Software\$(var.ManufacturerEn)\$(var.ProductNameEn)" Name="native" Type="integer" Value="1" KeyPath="yes" />
<RemoveFolder Id="NativeFolder" On="uninstall" />
</Component>
</ComponentGroup>
</Fragment>

<Fragment>
<ComponentGroup Id="Manufacturer" Directory="ManufacturerFolder">
<Component Guid="{D25F3F12-BFB4-447B-959B-276F4CB6C931}">
Expand Down
2 changes: 1 addition & 1 deletion src/Common/AppService.Client/AppService.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<Company>Khil-soft</Company>
<Copyright>Copyright © Khil-soft 2022 - 2023</Copyright>
<Copyright>Copyright © Khil-soft 2022 - 2024</Copyright>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<DebugType>none</DebugType>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Notions/Notions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Description>String processing functions</Description>
<Company>Khil-soft</Company>
<Version>7.6.0</Version>
<Copyright>Copyright © Khil-soft 2007 - 2023</Copyright>
<Copyright>Copyright © Khil-soft 2007 - 2024</Copyright>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/SIEngine.Core/SIEngine.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<Company>Khil-soft</Company>
<Copyright>Copyright © Khil-soft 2022</Copyright>
<Copyright>Copyright © Khil-soft 2022 - 2024</Copyright>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<DebugType>none</DebugType>
Expand Down
4 changes: 4 additions & 0 deletions src/Common/SIPackages/Core/QuestionTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public static class QuestionTypes
/// <summary>
/// Stake question type.
/// </summary>
[Obsolete("Use Stake question type")]
public const string Auction = "auction";

/// <summary>
Expand All @@ -33,6 +34,7 @@ public static class QuestionTypes
/// <summary>
/// Secret question type.
/// </summary>
[Obsolete("Use Secret question type")]
public const string Cat = "cat";

/// <summary>
Expand All @@ -53,11 +55,13 @@ public static class QuestionTypes
/// <summary>
/// Extended secret question type.
/// </summary>
[Obsolete("Use Secret question type")]
public const string BagCat = "bagcat";

/// <summary>
/// No-risk question.
/// </summary>
[Obsolete("Use NoRisk question type")]
public const string Sponsored = "sponsored";

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/SIPackages/SIPackages.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Company>Khil-soft</Company>
<Version>7.10.0</Version>
<Authors>Vladimir Khil</Authors>
<Copyright>Copyright © Khil-soft 2007 - 2023</Copyright>
<Copyright>Copyright © Khil-soft 2007 - 2024</Copyright>
<PackageProjectUrl>https://github.com/VladimirKhil/SI</PackageProjectUrl>
<RepositoryUrl>https://github.com/VladimirKhil/SI</RepositoryUrl>
<PackageTags>SIGame</PackageTags>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/SIPackages/Theme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public Question CreateQuestion(int price = -1, bool isFinal = false, bool upgrad
Type = StepParameterTypes.Content,
ContentValue = new List<ContentItem>
{
new ContentItem { Type = AtomTypes.Text, Value = "" },
new() { Type = ContentTypes.Text, Value = "" },
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Company>Khil-soft</Company>
<Copyright>Copyright © Khil-soft 2021 - 2023</Copyright>
<Copyright>Copyright © Khil-soft 2021 - 2024</Copyright>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Utils.Wpf/Utils.Wpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Description>Common WPF content</Description>
<Copyright>Copyright © Khil-soft 2023</Copyright>
<Copyright>Copyright © Khil-soft 2023 - 2024</Copyright>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Utils/Utils.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Copyright>Copyright © Khil-soft 2022 - 2023</Copyright>
<Copyright>Copyright © Khil-soft 2022 - 2024</Copyright>
<Version>7.6.0</Version>
<Company>Khil-soft</Company>
<Product>Utils</Product>
Expand Down
Binary file removed src/SIQuester/Help.docx
Binary file not shown.
2 changes: 1 addition & 1 deletion src/SIQuester/QTxtConverter/QTxtConverter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Product>QTxtConverter</Product>
<Description>Text to questions converter</Description>
<Version>$(SIQuesterVersion)</Version>
<Copyright>Copyright © Khil-soft 2009 - 2023</Copyright>
<Copyright>Copyright © Khil-soft 2009 - 2024</Copyright>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
21 changes: 20 additions & 1 deletion src/SIQuester/SIQuester.ViewModel/Items/PackageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using SIPackages.Core;
using SIQuester.Model;
using SIQuester.ViewModel.Helpers;
using SIQuester.ViewModel.PlatformSpecific;
using SIQuester.ViewModel.Properties;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
Expand Down Expand Up @@ -188,8 +189,26 @@ private void AddRestrictions_Executed(object? arg)

private void AddTags_Executed(object? arg)
{
var tags = PlatformManager.Instance.AskTags(Document.StorageContext.Tags);

if (tags == null)
{
return;
}

QDocument.ActivatedObject = Tags;
Tags.Add("");

if (tags.Length > 0)
{
foreach (var tag in tags)
{
Tags.Add(tag);
}
}
else
{
Tags.Add("");
}
}

private void SelectLogo_Executed(object? arg)
Expand Down
46 changes: 40 additions & 6 deletions src/SIQuester/SIQuester.ViewModel/Model/AppSettings.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Specialized;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Text.Json.Serialization;
using System.Xml.Serialization;

namespace SIQuester.Model;
Expand Down Expand Up @@ -56,12 +57,13 @@ public sealed class AppSettings : INotifyPropertyChanged
/// </summary>
public static readonly TimeSpan AutoSaveInterval = TimeSpan.FromSeconds(20);

public static AppSettings Default { get; set; }

/// <summary>
/// Is current Windows version a Windows Vista or a later version.
/// Has the setting been changed.
/// </summary>
public static readonly bool IsVistaOrLater = Environment.OSVersion.Version.Major >= 6;

public static AppSettings Default { get; set; }
[JsonIgnore]
public bool HasChanges { get; set; }

private bool _searchForUpdates = true;

Expand Down Expand Up @@ -245,7 +247,9 @@ public CostSetterList CostSetters
{
if (_costSetters != value)
{
_costSetters.CollectionChanged -= CostSetters_CollectionChanged;
_costSetters = value;
_costSetters.CollectionChanged += CostSetters_CollectionChanged;
OnPropertyChanged();
}
}
Expand Down Expand Up @@ -458,6 +462,25 @@ public bool SetRightAnswerFromFileName
}
}

private bool _askToSetTagsOnSave = true;

/// <summary>
/// Ask to set tags on save if they are missing.
/// </summary>
[DefaultValue(true)]
public bool AskToSetTagsOnSave
{
get => _askToSetTagsOnSave;
set
{
if (_askToSetTagsOnSave != value)
{
_askToSetTagsOnSave = value;
OnPropertyChanged();
}
}
}

private string? _language = null;

/// <summary>
Expand Down Expand Up @@ -568,9 +591,16 @@ public static AppSettings Load(Stream stream)
return Create();
}

public AppSettings()
{
_costSetters.CollectionChanged += CostSetters_CollectionChanged;
}

private void CostSetters_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) => HasChanges = true;

public static AppSettings Create()
{
var newSettings = new AppSettings();
var newSettings = new AppSettings { HasChanges = true };
newSettings.Initialize();
return newSettings;
}
Expand All @@ -590,8 +620,11 @@ public void Save(Stream stream)
serializer.Serialize(stream, this);
}

private void OnPropertyChanged([CallerMemberName] string? propertyName = null) =>
private void OnPropertyChanged([CallerMemberName] string? propertyName = null)
{
HasChanges = true;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}

public event PropertyChangedEventHandler? PropertyChanged;

Expand Down Expand Up @@ -624,6 +657,7 @@ internal void Reset()
SelectOptionCount = DefaultSelectOptionCount;
CheckFileSize = defaultSettings.CheckFileSize;
SetRightAnswerFromFileName = defaultSettings.SetRightAnswerFromFileName;
AskToSetTagsOnSave = defaultSettings.AskToSetTagsOnSave;
UseImageDuration = defaultSettings.UseImageDuration;
ImageDurationSeconds = defaultSettings.ImageDurationSeconds;
}
Expand Down
3 changes: 1 addition & 2 deletions src/SIQuester/SIQuester.ViewModel/Model/CostSetterList.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using SIQuester.ViewModel;
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using System.Windows.Input;
using Utils.Commands;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public abstract bool ShowSaveUI(

public abstract string? AskText(string title, bool multiline = false);

public abstract string[]? AskTags(string[] possibleTags);

public abstract IFlowDocumentWrapper BuildDocument(SIDocument doc, ExportFormats format);

public abstract void ExportTable(SIDocument doc, string filename);
Expand Down
Loading

0 comments on commit 1d6c913

Please sign in to comment.