chore: 修复 Magpie 项目的警告等级

This commit is contained in:
Xu 2024-12-20 21:46:51 +08:00
commit 07e143be7a
24 changed files with 12 additions and 92 deletions

View file

@ -23,6 +23,5 @@
<IsDebug>$(Configuration.StartsWith('Debug'))</IsDebug>
<IsPackaged>$(Configuration.EndsWith('Packaged'))</IsPackaged>
<DefaultLanguage>en-US</DefaultLanguage>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
</Project>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props')" />
<Import Project="..\Common.Pre.props" />
<PropertyGroup Label="Globals">
<CppWinRTFastAbi>true</CppWinRTFastAbi>
<CppWinRTOptimized>true</CppWinRTOptimized>
@ -16,7 +17,6 @@
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="..\Common.Pre.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>

View file

@ -103,12 +103,12 @@ void AboutViewModel::IsCheckForPreviewUpdates(bool value) {
}
bool AboutViewModel::IsCheckForUpdatesButtonEnabled() const noexcept {
#ifndef MAGPIE_VERSION_TAG
// 只有正式版本才能检查更新
// 只有发布的版本才能检查更新
#ifdef MAGPIE_VERSION_TAG
return !IsCheckingForUpdates() && !IsDownloadingOrLater();
#else
return false;
#endif
return !IsCheckingForUpdates() && !IsDownloadingOrLater();
}
bool AboutViewModel::IsAutoCheckForUpdates() const noexcept {

View file

@ -307,7 +307,7 @@ bool App::_CheckSingleInstance() noexcept {
return true;
}
void App::_AppSettings_ThemeChanged(AppTheme theme) {
void App::_AppSettings_ThemeChanged(AppTheme) {
_UpdateColorValuesChangedRevoker();
_UpdateTheme();
}

View file

@ -184,37 +184,6 @@ static void ShowErrorMessage(const wchar_t* mainInstruction, const wchar_t* cont
TaskDialogIndirect(&tdc, nullptr, nullptr, nullptr);
}
static bool ShowOkCancelWarningMessage(
const wchar_t* mainInstruction,
const wchar_t* content,
const wchar_t* okText,
const wchar_t* cancelText
) noexcept {
const hstring warningStr = ResourceLoader::GetForCurrentView(CommonSharedConstants::APP_RESOURCE_MAP_ID)
.GetString(L"AppSettings_Dialog_Warning");
TASKDIALOG_BUTTON buttons[]{
{IDOK, okText},
{IDCANCEL, cancelText}
};
TASKDIALOGCONFIG tdc{
.cbSize = sizeof(TASKDIALOGCONFIG),
.dwFlags = TDF_SIZE_TO_CONTENT,
.pszWindowTitle = warningStr.c_str(),
.pszMainIcon = TD_WARNING_ICON,
.pszMainInstruction = mainInstruction,
.pszContent = content,
.cButtons = (UINT)std::size(buttons),
.pButtons = buttons,
.pfCallback = TaskDialogCallback
};
int button = 0;
TaskDialogIndirect(&tdc, &button, nullptr, nullptr);
return button == IDOK;
}
AppSettings::~AppSettings() {}
bool AppSettings::Initialize() noexcept {

View file

@ -43,6 +43,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsDesktop, Version=10.0.22621.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsDesktop.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsDesktop, Version=10.0.22621.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsDesktop.props')" />
@ -56,6 +57,8 @@
<!-- 删除用于 XAML 设计器的几个导出函数,编译为 exe 不需要它们。 -->
<!-- 另外这些导出函数不支持 ARM64所以即使编译为 dll 也应禁用它们,然后自己导出 DllGetActivationFactory。 -->
<PreprocessorDefinitions>_VSDESIGNER_DONT_LOAD_AS_DLL;DISABLE_XAML_GENERATED_MAIN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- 不知为何 Directory.Build.props 中的不起作用 -->
<WarningLevel>Level4</WarningLevel>
<AdditionalIncludeDirectories>..\Magpie.Core\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>

View file

@ -321,9 +321,6 @@
<data name="AppSettings_Dialog_Error" xml:space="preserve">
<value>Fehler</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>Warnung</value>
</data>
<data name="About_Version_UpdateCard_ReleaseNotes.Content" xml:space="preserve">
<value>Versionshinweise</value>
</data>

View file

@ -663,9 +663,6 @@
<data name="AppSettings_Dialog_Error" xml:space="preserve">
<value>Error</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>Warning</value>
</data>
<data name="Home_Advanced_DeveloperOptions.Description" xml:space="preserve">
<value>These settings are for development use only</value>
</data>

View file

@ -489,9 +489,6 @@
<data name="AppSettings_Dialog_Error" xml:space="preserve">
<value>Error</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>Advertencia</value>
</data>
<data name="Home_Advanced_DeveloperOptions_DebugMode.Content" xml:space="preserve">
<value>Modo de depuración</value>
</data>

View file

@ -739,9 +739,6 @@
<data name="Profile_Cursor_DrawCursor_Interpolation_NearestNeighbor.Content" xml:space="preserve">
<value>Nearest-neighbor</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>Avertissement</value>
</data>
<data name="ScalingModes_DragNotSupported.Text" xml:space="preserve">
<value>Le glisser-déposer n'est pas pris en charge lorsque l'utilisateur est un administrateur</value>
</data>

View file

@ -343,9 +343,6 @@
<data name="About_OtherLinks_FAQ.Text" xml:space="preserve">
<value>GYIK</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>Figyelmeztetés</value>
</data>
<data name="About_Version_UpdateSettings.Header" xml:space="preserve">
<value>Beállítások frissítése</value>
</data>

View file

@ -684,9 +684,6 @@
<data name="AppSettings_Dialog_Error" xml:space="preserve">
<value>Eror</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>Peringatan</value>
</data>
<data name="NotifyIcon_Exit" xml:space="preserve">
<value>Keluar</value>
</data>

View file

@ -754,9 +754,6 @@
<data name="AppSettings_Dialog_Error" xml:space="preserve">
<value>Errore</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>Attenzione</value>
</data>
<data name="Home_Advanced_DeveloperOptions.Header" xml:space="preserve">
<value>Impostazioni sviluppatore</value>
</data>

View file

@ -522,9 +522,6 @@
<data name="AppSettings_Dialog_Error" xml:space="preserve">
<value>エラー</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>警告</value>
</data>
<data name="Home_Advanced_DeveloperOptions_WarningsAreErrors.Content" xml:space="preserve">
<value>エフェクトのコンパイル時に警告をエラーとして扱う</value>
</data>

View file

@ -468,9 +468,6 @@
<data name="Profile_SourceWindow.Header" xml:space="preserve">
<value>소스 창</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>경고</value>
</data>
<data name="AppSettings_Dialog_Exit" xml:space="preserve">
<value>끝내기</value>
</data>

View file

@ -268,9 +268,6 @@
<data name="AppSettings_Dialog_Error" xml:space="preserve">
<value>Błąd</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>Ostrzeżenie</value>
</data>
<data name="Home_Advanced_DeveloperOptions.Description" xml:space="preserve">
<value>Ustawienia te są przeznaczone wyłącznie do użytku programistycznego</value>
</data>

View file

@ -600,9 +600,6 @@
<data name="AppSettings_Dialog_Error" xml:space="preserve">
<value>Erro</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>Aviso</value>
</data>
<data name="ScalingModes_HasUnkownEffects.Title" xml:space="preserve">
<value>Não foi possível analisar alguns efeitos</value>
</data>

View file

@ -672,9 +672,6 @@
<data name="AppSettings_Dialog_Error" xml:space="preserve">
<value>Ошибка</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>Предупреждение</value>
</data>
<data name="Home_Advanced_DeveloperOptions.Description" xml:space="preserve">
<value>Эти настройки предназначены только для разработчиков</value>
</data>

View file

@ -618,9 +618,6 @@
<data name="AppSettings_Dialog_Error" xml:space="preserve">
<value>Hata</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>Uyarı</value>
</data>
<data name="Home_Advanced_DeveloperOptions.Description" xml:space="preserve">
<value>Bu ayarlar yalnızca geliştirme amaçlı kullanım içindir</value>
</data>

View file

@ -697,9 +697,6 @@
<data name="ExportDialog_Title" xml:space="preserve">
<value>Експорт режимів масштабування</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>Попередження</value>
</data>
<data name="Home_Advanced_DeveloperOptions_SaveEffectSources.Content" xml:space="preserve">
<value>Збереження вихідного коду під час синтаксичного аналізу ефектів</value>
</data>

View file

@ -201,9 +201,6 @@
<data name="AppSettings_Dialog_Exit" xml:space="preserve">
<value>Thoát</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>Cảnh báo</value>
</data>
<data name="AppSettings_ErrorDialog_ConfigLocation" xml:space="preserve">
<value>Vị trí file cấu hình:
{}</value>

View file

@ -663,9 +663,6 @@
<data name="AppSettings_Dialog_Error" xml:space="preserve">
<value>错误</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>警告</value>
</data>
<data name="Home_Advanced_DeveloperOptions.Description" xml:space="preserve">
<value>这些设置仅供开发使用</value>
</data>

View file

@ -712,9 +712,6 @@
<data name="Profile_SourceWindow_CaptureTitleBar.Header" xml:space="preserve">
<value>擷取標題欄</value>
</data>
<data name="AppSettings_Dialog_Warning" xml:space="preserve">
<value>警告</value>
</data>
<data name="Profile_Cursor_DrawCursor_Interpolation_Bilinear.Content" xml:space="preserve">
<value>雙線性</value>
</data>

View file

@ -397,9 +397,9 @@ protected:
LRESULT ret = base_type::_MessageHandler(msg, wParam, lParam);
// 关闭 DesktopWindowXamlSource 后应清空消息队列以确保 RootPage 析构
MSG msg;
while (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) {
DispatchMessage(&msg);
MSG msg1;
while (PeekMessage(&msg1, nullptr, 0, 0, PM_REMOVE)) {
DispatchMessage(&msg1);
}
return ret;