AtomTools: moved more startup code from main cpp files into the base application class
Deleted a bunch of unused headers Signed-off-by: Guthrie Adams <guthadam@amazon.com>
This commit is contained in:
+3
@@ -19,6 +19,7 @@
|
||||
#include <AzFramework/Asset/AssetSystemBus.h>
|
||||
|
||||
#include <AzQtComponents/Application/AzQtApplication.h>
|
||||
#include <AzQtComponents/Components/StyleManager.h>
|
||||
|
||||
#include <AzToolsFramework/API/AssetDatabaseBus.h>
|
||||
#include <AzToolsFramework/API/EditorPythonConsoleBus.h>
|
||||
@@ -113,6 +114,8 @@ namespace AtomToolsFramework
|
||||
|
||||
AzToolsFramework::TraceLogger m_traceLogger;
|
||||
|
||||
AZStd::unique_ptr<AzQtComponents::StyleManager> m_styleManager;
|
||||
|
||||
//! Local user settings are used to store material browser tree expansion state
|
||||
AZ::UserSettingsProvider m_localUserSettings;
|
||||
|
||||
|
||||
+16
-2
@@ -21,6 +21,8 @@
|
||||
#include <AzFramework/Network/AssetProcessorConnection.h>
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
|
||||
#include <AzQtComponents/Components/GlobalEventFilter.h>
|
||||
|
||||
#include <AzToolsFramework/API/EditorPythonConsoleBus.h>
|
||||
#include <AzToolsFramework/API/EditorPythonRunnerRequestsBus.h>
|
||||
#include <AzToolsFramework/Asset/AssetSystemComponent.h>
|
||||
@@ -61,14 +63,26 @@ namespace AtomToolsFramework
|
||||
: Application(argc, argv)
|
||||
, AzQtApplication(*argc, *argv)
|
||||
{
|
||||
// Suppress spam from the Source Control system
|
||||
m_traceLogger.AddWindowFilter(AzToolsFramework::SCC_WINDOW);
|
||||
|
||||
installEventFilter(new AzQtComponents::GlobalEventFilter(this));
|
||||
|
||||
AZ::IO::FixedMaxPath engineRootPath;
|
||||
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
|
||||
{
|
||||
settingsRegistry->Get(engineRootPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_EngineRootFolder);
|
||||
}
|
||||
|
||||
m_styleManager.reset(new AzQtComponents::StyleManager(this));
|
||||
m_styleManager->initialize(this, engineRootPath);
|
||||
|
||||
connect(&m_timer, &QTimer::timeout, this, [&]()
|
||||
{
|
||||
this->PumpSystemEventLoopUntilEmpty();
|
||||
this->Tick();
|
||||
});
|
||||
|
||||
// Suppress spam from the Source Control system
|
||||
m_traceLogger.AddWindowFilter(AzToolsFramework::SCC_WINDOW);
|
||||
}
|
||||
|
||||
AtomToolsApplication ::~AtomToolsApplication()
|
||||
|
||||
@@ -6,46 +6,19 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <MaterialEditorApplication.h>
|
||||
|
||||
#include <AzCore/IO/Path/Path.h>
|
||||
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
|
||||
#include <AzQtComponents/Components/GlobalEventFilter.h>
|
||||
#include <AzQtComponents/Components/O3DEStylesheet.h>
|
||||
#include <AzQtComponents/Components/StyleManager.h>
|
||||
#include <AzQtComponents/Components/StyledDockWidget.h>
|
||||
#include <AzQtComponents/Components/WindowDecorationWrapper.h>
|
||||
#include <AzQtComponents/Utilities/HandleDpiAwareness.h>
|
||||
#include <AzQtComponents/Utilities/QtPluginPaths.h>
|
||||
|
||||
#include <QtGui/private/qhighdpiscaling_p.h>
|
||||
#include <QtWidgets/QApplication>
|
||||
#endif
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
AzQtComponents::AzQtApplication::InitializeDpiScaling();
|
||||
|
||||
MaterialEditor::MaterialEditorApplication app(&argc, &argv);
|
||||
if (!app.LaunchLocalServer())
|
||||
if (app.LaunchLocalServer())
|
||||
{
|
||||
return 0;
|
||||
app.Start(AZ::ComponentApplication::Descriptor{});
|
||||
app.exec();
|
||||
app.Stop();
|
||||
}
|
||||
|
||||
app.installEventFilter(new AzQtComponents::GlobalEventFilter(&app));
|
||||
|
||||
AZ::IO::FixedMaxPath engineRootPath;
|
||||
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
|
||||
{
|
||||
settingsRegistry->Get(engineRootPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_EngineRootFolder);
|
||||
}
|
||||
|
||||
AzQtComponents::StyleManager styleManager(&app);
|
||||
styleManager.initialize(&app, engineRootPath);
|
||||
|
||||
app.Start(AZ::ComponentApplication::Descriptor{});
|
||||
app.exec();
|
||||
app.Stop();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -6,46 +6,19 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/IO/Path/Path.h>
|
||||
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
|
||||
#include <AzQtComponents/Components/StyleManager.h>
|
||||
#include <AzQtComponents/Utilities/QtPluginPaths.h>
|
||||
#include <AzQtComponents/Components/GlobalEventFilter.h>
|
||||
#include <AzQtComponents/Components/StyledDockWidget.h>
|
||||
#include <AzQtComponents/Components/O3DEStylesheet.h>
|
||||
#include <AzQtComponents/Utilities/QtPluginPaths.h>
|
||||
#include <AzQtComponents/Utilities/HandleDpiAwareness.h>
|
||||
#include <AzQtComponents/Components/WindowDecorationWrapper.h>
|
||||
#include <AzQtComponents/Application/AzQtApplication.h>
|
||||
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtGui/private/qhighdpiscaling_p.h>
|
||||
|
||||
#include <Source/ShaderManagementConsoleApplication.h>
|
||||
#include <ShaderManagementConsoleApplication.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
AzQtComponents::AzQtApplication::InitializeDpiScaling();
|
||||
|
||||
ShaderManagementConsole::ShaderManagementConsoleApplication app(&argc, &argv);
|
||||
if (!app.LaunchLocalServer())
|
||||
if (app.LaunchLocalServer())
|
||||
{
|
||||
return 0;
|
||||
app.Start(AZ::ComponentApplication::Descriptor{});
|
||||
app.exec();
|
||||
app.Stop();
|
||||
}
|
||||
|
||||
app.installEventFilter(new AzQtComponents::GlobalEventFilter(&app));
|
||||
|
||||
AZ::IO::FixedMaxPath engineRootPath;
|
||||
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
|
||||
{
|
||||
settingsRegistry->Get(engineRootPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_EngineRootFolder);
|
||||
}
|
||||
|
||||
AzQtComponents::StyleManager styleManager(&app);
|
||||
styleManager.initialize(&app, engineRootPath);
|
||||
|
||||
app.Start(AZ::ComponentApplication::Descriptor{});
|
||||
app.exec();
|
||||
app.Stop();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user