From 31a2ccb041b99dba77187372c0cf4c3226394bf3 Mon Sep 17 00:00:00 2001 From: Dayo Lawal Date: Tue, 15 Jun 2021 12:40:54 -0500 Subject: [PATCH] Addressing change requests for pull request Signed-off-by: Dayo Lawal --- .../Application/AzQtApplication.cpp | 16 +++---- .../Application/AzQtApplication.h | 45 ++++++------------- .../Code/Source/MaterialEditorApplication.cpp | 20 +-------- .../Code/Source/MaterialEditorApplication.h | 7 --- 4 files changed, 20 insertions(+), 68 deletions(-) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Application/AzQtApplication.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Application/AzQtApplication.cpp index 1e3e559675..6b01954b23 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Application/AzQtApplication.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Application/AzQtApplication.cpp @@ -28,15 +28,12 @@ namespace AzQtComponents } AzQtApplication* m_app; - bool OnOutput(const char* window, const char* message) override; + ////////////////////////////////////////////////////////////////////////// + // AZ::Debug::TraceMessageBus::Handler overrides... + bool OnOutput(const char* window, const char* message) override; + ////////////////////////////////////////////////////////////////////////// protected: - struct LogMessage - { - AZStd::string window; - AZStd::string message; - }; - AZStd::vector m_startupLogSink; AZStd::unique_ptr m_logFile; @@ -58,8 +55,8 @@ namespace AzQtComponents QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates)); - // Must be set before QApplication is initialized, so that we support HighDpi monitors, like the Retina displays - // on Windows 10 + // Must be set before QApplication is initialized, so that we support HighDpi monitors, like the Retina displays + // on Windows 10 QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); @@ -69,7 +66,6 @@ namespace AzQtComponents m_impl->AZ::Debug::TraceMessageBus::Handler::BusConnect(); - } AzQtApplication::~AzQtApplication() diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Application/AzQtApplication.h b/Code/Framework/AzQtComponents/AzQtComponents/Application/AzQtApplication.h index c5d205bbec..426f4cd78c 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Application/AzQtApplication.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Application/AzQtApplication.h @@ -14,41 +14,13 @@ #pragma once #include -#include -#include #include - -#include -#include -#include -#include -#include -#include -#include - - -#include -#include -#include - -#include #include -#include -#include +#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include namespace AzQtComponents { @@ -58,13 +30,22 @@ namespace AzQtComponents public: AzQtApplication(int& argc, char** argv); ~AzQtApplication(); - + + private: AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING class Impl; AZStd::unique_ptr m_impl; AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING }; + + class LogMessage + { + public: + AZStd::string window; + AZStd::string message; + }; } // namespace AzQtComponents + diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.cpp index 5681f45feb..14661b442b 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.cpp @@ -88,7 +88,7 @@ namespace MaterialEditor { AzToolsFramework::AssetDatabase::AssetDatabaseRequestsBus::Handler::BusDisconnect(); MaterialEditorWindowNotificationBus::Handler::BusDisconnect(); - AZ::Debug::TraceMessageBus::Handler::BusDisconnect(); + AzToolsFramework::EditorPythonConsoleNotificationBus::Handler::BusDisconnect(); } void MaterialEditorApplication::CreateReflectionManager() @@ -281,24 +281,6 @@ namespace MaterialEditor } } - bool MaterialEditorApplication::OnOutput(const char* window, const char* message) - { - // Suppress spam from the Source Control system - if (0 == strncmp(window, AzToolsFramework::SCC_WINDOW, AZ_ARRAY_SIZE(AzToolsFramework::SCC_WINDOW))) - { - return true; - } - - if (m_logFile) - { - m_logFile->AppendLog(AzFramework::LogFile::SEV_NORMAL, window, message); - } - else - { - m_startupLogSink.push_back({ window, message }); - } - return false; - } void MaterialEditorApplication::ProcessCommandLine(const AZ::CommandLine& commandLine) { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.h index a3767a58fb..337bef47ec 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.h @@ -96,11 +96,6 @@ namespace MaterialEditor void SaveSettings() override; ////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// - // AZ::Debug::TraceMessageBus::Handler overrides... - bool OnOutput(const char* window, const char* message) override; - ////////////////////////////////////////////////////////////////////////// - void CompileCriticalAssets(); void ProcessCommandLine(const AZ::CommandLine& commandLine); @@ -121,8 +116,6 @@ namespace MaterialEditor AZStd::string message; }; - AZStd::vector m_startupLogSink; - AZStd::unique_ptr m_logFile; //! Local user settings are used to store material browser tree expansion state AZ::UserSettingsProvider m_localUserSettings;