Skip to content

Commit

Permalink
chore: 修复 Magpie 项目的警告等级
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinue committed Dec 20, 2024
1 parent e3badf8 commit 07e143b
Show file tree
Hide file tree
Showing 24 changed files with 12 additions and 92 deletions.
1 change: 0 additions & 1 deletion src/Common.Pre.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@
<IsDebug>$(Configuration.StartsWith('Debug'))</IsDebug>
<IsPackaged>$(Configuration.EndsWith('Packaged'))</IsPackaged>
<DefaultLanguage>en-US</DefaultLanguage>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Magpie.Core/Magpie.Core.vcxproj
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -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>
Expand Down
8 changes: 4 additions & 4 deletions src/Magpie/AboutViewModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ bool App::_CheckSingleInstance() noexcept {
return true;
}

void App::_AppSettings_ThemeChanged(AppTheme theme) {
void App::_AppSettings_ThemeChanged(AppTheme) {
_UpdateColorValuesChangedRevoker();
_UpdateTheme();
}
Expand Down
31 changes: 0 additions & 31 deletions src/Magpie/AppSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions src/Magpie/Magpie.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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')" />
Expand All @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-de.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-en-US.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-es.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-fr.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-hu.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-id.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-it.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-ja.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-ko.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-pl.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-pt-BR.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-ru.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-tr.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-uk.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-vi.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-zh-Hans.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions src/Magpie/Resources.language-zh-Hant.resw
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions src/Magpie/XamlWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,9 @@ class XamlWindowT : public WindowBaseT<T> {
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;
Expand Down

0 comments on commit 07e143b

Please sign in to comment.