chore: 优化界面布局与翻译

This commit is contained in:
uye
2025-02-09 16:57:39 +08:00
parent 73867bfe80
commit f611efce31
10 changed files with 66 additions and 22 deletions

View File

@@ -197,8 +197,8 @@ namespace MaaWpfGui.Constants
public const string ProxyType = "VersionUpdate.ProxyType";
public const string VersionType = "VersionUpdate.VersionType";
// public const string ResourceUpdateSource = "VersionUpdate.ResourceUpdateSource";
// MirrorChyanCdk 迁到新配置的话就不用加 ResourceUpdateSource 了,现在本体更新也加上了 MirrorChyan
// MirrorChyanCdk 迁到新配置的话就直接叫 UpdateSource现在本体更新也加上了 MirrorChyan
public const string UpdateSource = "VersionUpdate.ResourceUpdateSource";
public const string MirrorChyanCdk = "VersionUpdate.ResourceUpdateSource.MirrorChyanCdk";
public const string UpdateCheck = "VersionUpdate.UpdateCheck";
public const string UpdateAutoCheck = "VersionUpdate.ScheduledUpdateCheck";

View File

@@ -654,13 +654,18 @@ namespace MaaWpfGui.Models
return ret;
}
if (!string.IsNullOrEmpty(SettingsViewModel.VersionUpdateSettings.MirrorChyanCdk))
switch (SettingsViewModel.VersionUpdateSettings.UpdateSource)
{
if (await DownloadFromMirrorChyanAsync(uri))
{
SettingsViewModel.VersionUpdateSettings.IsCheckingForUpdates = false;
return CheckUpdateRetT.OnlyGameResourceUpdated;
}
case "Github":
break;
case "MirrorChyan":
if (await DownloadFromMirrorChyanAsync(uri))
{
SettingsViewModel.VersionUpdateSettings.IsCheckingForUpdates = false;
return CheckUpdateRetT.OnlyGameResourceUpdated;
}
break;
}
SettingsViewModel.VersionUpdateSettings.IsCheckingForUpdates = false;

View File

@@ -235,11 +235,12 @@ Please note:
4. Do not share the method to enable nightly updates with non-developer users to avoid unnecessary confusion and risk.
You can cancel this popup by clicking the Settings - About Us - Issue Reporting link. Thank you for your understanding and cooperation!</system:String>
<system:String x:Key="UpdateCheck">Update Version</system:String>
<system:String x:Key="UpdateCheck">Update Channel</system:String>
<system:String x:Key="DownloadWithAria2">Download via aria2</system:String>
<system:String x:Key="UpdateCheckNow">Check update</system:String>
<system:String x:Key="UpdateCheckNow">Software update</system:String>
<system:String x:Key="ShowChangelog">Changelog</system:String>
<system:String x:Key="ResourceUpdate">Resource update</system:String>
<system:String x:Key="UpdateSource">Update Source</system:String>
<system:String x:Key="MirrorChyan">Mirror-Chyan</system:String>
<system:String x:Key="MirrorChyanResourceUpdateTip">Mirror-chan has detected a resource version update. Please go to 'Settings - Software Update' to configure CDK or update the resource version using the GitHub source</system:String>
<system:String x:Key="NewVersionFoundTitle">New Version Found</system:String>

View File

@@ -235,11 +235,12 @@
4. 内部テスト版の更新方法を非開発ユーザーに共有しないでください。不要な混乱とリスクを避けるためです。
設定 - About us - フィードバックのリンクをクリックして、このポップアップをキャンセルできます。ご理解とご協力をお願いいたします!</system:String>
<system:String x:Key="UpdateCheck">更新バージョン</system:String>
<system:String x:Key="UpdateCheck">更新チャネル</system:String>
<system:String x:Key="DownloadWithAria2">aria2を使う</system:String>
<system:String x:Key="UpdateCheckNow">アップデートを確認する</system:String>
<system:String x:Key="UpdateCheckNow">ソフト更新</system:String>
<system:String x:Key="ShowChangelog">変更履歴</system:String>
<system:String x:Key="ResourceUpdate">リソース更新</system:String>
<system:String x:Key="UpdateSource">更新ソース</system:String>
<system:String x:Key="MirrorChyan">ミラーちゃん</system:String>
<system:String x:Key="MirrorChyanResourceUpdateTip">Mirrorちゃんがリソースのバージョン更新を検出しましたが。「設定-ソフトウェア更新」でCDKを設定するか、GitHubのソースを使用してリソースのバージョンを更新してください。</system:String>
<system:String x:Key="NewVersionFoundTitle">新しいバージョンが見つかりました</system:String>

View File

@@ -235,11 +235,12 @@
4. 비개발자 사용자에게 개발 버전 업데이트 방법을 공유하지 마세요. 불필요한 혼란과 위험을 피하기 위해서입니다.
설정 - 정보 - 이슈 제보 링크를 클릭하여 이 팝업을 취소할 수 있습니다. 이해와 협조에 감사드립니다!</system:String>
<system:String x:Key="UpdateCheck">업데이트할 버전</system:String>
<system:String x:Key="UpdateCheck">업데이트 채널</system:String>
<system:String x:Key="DownloadWithAria2">aria2로 다운로드</system:String>
<system:String x:Key="UpdateCheckNow">지금 업데이트</system:String>
<system:String x:Key="UpdateCheckNow">소프트웨어 업데이트</system:String>
<system:String x:Key="ShowChangelog">변경 내역</system:String>
<system:String x:Key="ResourceUpdate">리소스 업데이트</system:String>
<system:String x:Key="UpdateSource">업데이트 소스</system:String>
<system:String x:Key="MirrorChyan">미러짱</system:String>
<system:String x:Key="MirrorChyanResourceUpdateTip">Mirror-chan 리소스 버전 업데이트 확인. '설정-소프트웨어 업데이트'로 이동하여 CDK를 구성하거나 GitHub 소스를 사용하여 리소스 버전을 업데이트하세요.</system:String>
<system:String x:Key="NewVersionFoundTitle">새로운 버전 확인</system:String>

View File

@@ -238,11 +238,12 @@
4. 请勿将更新内测版的方法告知其他非开发用户,以避免对他们造成不必要的困扰和风险。
您可通过点击 设置-关于我们-问题反馈 链接来取消该弹窗,感谢您的理解与配合!</system:String>
<system:String x:Key="UpdateCheck">更新版本</system:String>
<system:String x:Key="UpdateCheck">更新渠道</system:String>
<system:String x:Key="DownloadWithAria2">使用 aria2 进行下载</system:String>
<system:String x:Key="UpdateCheckNow">检查更新</system:String>
<system:String x:Key="UpdateCheckNow">软件更新</system:String>
<system:String x:Key="ShowChangelog">更新日志</system:String>
<system:String x:Key="ResourceUpdate">资源更新</system:String>
<system:String x:Key="UpdateSource">更新源</system:String>
<system:String x:Key="MirrorChyan">Mirror 酱</system:String>
<system:String x:Key="MirrorChyanResourceUpdateTip">Mirror 酱检查到资源版本更新,可前往「设置-软件更新」配置 CDK 或使用 github 源进行资源版本更新</system:String>
<system:String x:Key="NewVersionFoundTitle">检测到新版本</system:String>

View File

@@ -235,11 +235,12 @@
4. 請勿將更新內測版的方法告知其他非開發用戶,以避免對他們造成不必要的困擾和風險。
您可通過點擊 設置-關於我們-問題反饋 鏈接來取消該彈窗,感謝您的理解與配合!</system:String>
<system:String x:Key="UpdateCheck">更新版本</system:String>
<system:String x:Key="UpdateCheck">更新通道</system:String>
<system:String x:Key="DownloadWithAria2">使用 aria2 進行下載</system:String>
<system:String x:Key="UpdateCheckNow">檢查更新</system:String>
<system:String x:Key="UpdateCheckNow">軟體更新</system:String>
<system:String x:Key="ShowChangelog">更新日誌</system:String>
<system:String x:Key="ResourceUpdate">資源更新</system:String>
<system:String x:Key="UpdateSource">更新來源</system:String>
<system:String x:Key="MirrorChyan">Mirror 醬</system:String>
<system:String x:Key="MirrorChyanResourceUpdateTip">Mirror 醬檢查到資源版本更新,可前往「設定-軟體更新」配置 CDK 或使用 github 源進行資源版本更新</system:String>
<system:String x:Key="NewVersionFoundTitle">檢測到新版本</system:String>

View File

@@ -784,7 +784,7 @@ public class VersionUpdateViewModel : Screen
if ((SettingsViewModel.VersionUpdateSettings.VersionType is
VersionUpdateSettingsUserControlModel.UpdateVersionType.Beta or
VersionUpdateSettingsUserControlModel.UpdateVersionType.Stable)
&& !string.IsNullOrEmpty(SettingsViewModel.VersionUpdateSettings.MirrorChyanCdk))
&& SettingsViewModel.VersionUpdateSettings.UpdateSource == "MirrorChyan")
{
try
{

View File

@@ -212,6 +212,26 @@ public class VersionUpdateSettingsUserControlModel : PropertyChangedBase
private bool _updateCheck = Convert.ToBoolean(ConfigurationHelper.GetGlobalValue(ConfigurationKeys.UpdateCheck, bool.TrueString));
public List<GenericCombinedData<string>> UpdateSourceList { get; } = [
new() { Display = "Github", Value = "Github" },
new() { Display = LocalizationHelper.GetString("MirrorChyan"), Value = "MirrorChyan" },
];
private string _updateSource = ConfigurationHelper.GetGlobalValue(ConfigurationKeys.UpdateSource, "Github");
/// <summary>
/// Gets or sets the type of version to update.
/// </summary>
public string UpdateSource
{
get => _updateSource;
set
{
SetAndNotify(ref _updateSource, value);
ConfigurationHelper.SetGlobalValue(ConfigurationKeys.UpdateSource, value);
}
}
private string _mirrorChyanCdk = SimpleEncryptionHelper.Decrypt(ConfigurationHelper.GetGlobalValue(ConfigurationKeys.MirrorChyanCdk, string.Empty));
public string MirrorChyanCdk
@@ -394,9 +414,12 @@ public class VersionUpdateSettingsUserControlModel : PropertyChangedBase
{
IsCheckingForUpdates = true;
var success = string.IsNullOrEmpty(MirrorChyanCdk)
? await ResourceUpdater.UpdateFromGithubAsync()
: await ResourceUpdater.UpdateFromMirrorChyanAsync();
bool success = UpdateSource switch
{
"Github" => await ResourceUpdater.UpdateFromGithubAsync(),
"MirrorChyan" => await ResourceUpdater.UpdateFromMirrorChyanAsync(),
_ => await ResourceUpdater.UpdateFromGithubAsync(),
};
if (success)
{

View File

@@ -74,11 +74,22 @@
SelectedValue="{Binding VersionType}"
SelectedValuePath="Value" />
<StackPanel>
<hc:ComboBox
Width="150"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
hc:TitleElement.Title="{DynamicResource UpdateSource}"
DisplayMemberPath="Display"
ItemsSource="{Binding UpdateSourceList}"
SelectedValue="{Binding UpdateSource}"
SelectedValuePath="Value" />
<hc:PasswordBox
Width="150"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
IsEnabled="{c:Binding 'UpdateSource == &quot;MirrorChyan&quot;'}"
IsSafeEnabled="False"
ShowEyeButton="True"
UnsafePassword="{Binding MirrorChyanCdk}">