Skip to content

Commit

Permalink
SImulator sound view model refactoring. Allow to erase the sound
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirKhil committed Jan 11, 2025
1 parent 804ffa5 commit 0e41980
Show file tree
Hide file tree
Showing 20 changed files with 376 additions and 563 deletions.
10 changes: 5 additions & 5 deletions deploy/SIQuester.Setup/SIQuester.Setup.wixproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="WixToolset.Sdk/4.0.5">
<Project Sdk="WixToolset.Sdk/5.0.2">
<PropertyGroup>
<OutputName>SIQuester.$(Platform)</OutputName>
<DefineConstants>ProductVersion=$(MsiProductVersion)</DefineConstants>
<SuppressIces>ICE38;ICE57;ICE60;ICE91</SuppressIces>
<SuppressIces>ICE38;ICE57;ICE60;ICE91</SuppressIces>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>Debug</DefineConstants>
<DefineConstants>Debug</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\SIQuester\SIQuester\SIQuester.csproj">
Expand All @@ -18,7 +18,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.5" />
<PackageReference Include="WixToolset.UI.wixext" Version="4.0.5" />
<PackageReference Include="WixToolset.Util.wixext" Version="5.0.2" />
<PackageReference Include="WixToolset.UI.wixext" Version="5.0.2" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ public QuestionTypesNamesNew()
{
this[QuestionTypes.Simple] = Resources.SimpleQuestion;
this[QuestionTypes.Stake] = Resources.StakeQuestion;
this[QuestionTypes.StakeAll] = Resources.StakeAllQuestion;
this[QuestionTypes.Secret] = Resources.SecretQuestion;
this[QuestionTypes.SecretPublicPrice] = Resources.SecretPublicPrice;
this[QuestionTypes.SecretNoQuestion] = Resources.SecretNoQuestion;
this[QuestionTypes.NoRisk] = Resources.NoRiskQuestion;
this[QuestionTypes.ForAll] = Resources.QuestionForAll;
this[QuestionTypes.StakeAll] = Resources.StakeAllQuestion;
this[""] = Resources.OtherTypeQuestion;
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/SIQuester/SIQuester.ViewModel/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,10 @@ Humor</value>
<value>Error searching for questions</value>
</data>
<data name="StakeAllQuestion" xml:space="preserve">
<value>Stake question for all</value>
<value>Question with stake for all</value>
</data>
<data name="StakeQuestion" xml:space="preserve">
<value>Stake question</value>
<value>Question with stake</value>
</data>
<data name="Start" xml:space="preserve">
<value>Start</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@
<value>Ошибка при поиске вопросов</value>
</data>
<data name="StakeAllQuestion" xml:space="preserve">
<value>Вопрос со ставкой для всех</value>
<value>Вопрос для всех со ставкой</value>
</data>
<data name="StakeQuestion" xml:space="preserve">
<value>Вопрос со ставкой</value>
Expand Down
45 changes: 20 additions & 25 deletions src/SIQuester/SIQuester/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,13 @@ public partial class App : Application

private readonly Implementation.DesktopManager _manager = new();

private static bool IsWindows8_1OrLater = Environment.OSVersion.Version > new Version(6, 2);
private static readonly bool IsWindows8_1OrLater = Environment.OSVersion.Version > new Version(6, 2);

/// <summary>
/// Имя приложения
/// </summary>
public static string ProductName => Assembly.GetExecutingAssembly().GetName().Name ?? "SIQuester";

/// <summary>
/// Директория приложения
/// </summary>
public static string StartupPath => AppDomain.CurrentDomain.BaseDirectory;

private MainViewModel? _mainViewModel;

private bool _hasError = false;
Expand All @@ -82,16 +77,6 @@ private async void Application_Startup(object sender, StartupEventArgs e)
_settings.SpellChecking = false;
}

if (_settings.Language != null)
{
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(_settings.Language);
}
else
{
var currentLanguage = Thread.CurrentThread.CurrentUICulture.Name;
_settings.Language = currentLanguage == "ru-RU" ? currentLanguage : "en-US";
}

Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);

_host = new HostBuilder()
Expand All @@ -115,15 +100,6 @@ private async void Application_Startup(object sender, StartupEventArgs e)

_manager.ServiceProvider = _host.Services;

#if UPDATE
if (_settings.SearchForUpdates)
{
SearchForUpdatesAsync();
}

SendDelayedReports();
#endif

_logger = _host.Services.GetRequiredService<ILogger<App>>();
_logger.LogInformation("Application started. Version: {version}", Assembly.GetExecutingAssembly().GetName().Version);
}
Expand All @@ -134,6 +110,25 @@ protected override void OnStartup(StartupEventArgs e)

try
{
if (_settings.Language != null)
{
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(_settings.Language);
}
else
{
var currentLanguage = Thread.CurrentThread.CurrentUICulture.Name;
_settings.Language = currentLanguage == "ru-RU" ? currentLanguage : "en-US";
}

#if UPDATE
if (_settings.SearchForUpdates)
{
SearchForUpdatesAsync();
}

SendDelayedReports();
#endif

var siStorageClient = _host.Services.GetRequiredService<ISIStorageServiceClient>();
var clipboardService = _host.Services.GetRequiredService<IClipboardService>();
var options = _host.Services.GetRequiredService<IOptions<AppOptions>>();
Expand Down
110 changes: 109 additions & 1 deletion src/SImulator/SImulator.ViewModel/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0e41980

Please sign in to comment.