You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Code/Tools/AssetBundler/source/ui/MainWindow.h

106 lines
3.3 KiB
C++

/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#if !defined(Q_MOC_RUN)
#include <source/ui/AssetListTabWidget.h>
#include <source/ui/SeedTabWidget.h>
#include <source/ui/BundleListTabWidget.h>
#include <source/ui/RulesTabWidget.h>
#include <AzCore/Debug/TraceMessageBus.h>
#include <AzToolsFramework/UI/Logging/LogLine.h>
#include <AzToolsFramework/UI/Logging/LogTableModel.h>
#include <QMainWindow>
#include <QMessageBox>
#include <QSharedPointer>
#endif
namespace Ui
{
class MainWindow;
}
namespace AssetBundler
{
class GUIApplicationManager;
class MainWindow
: public QMainWindow
, public AZ::Debug::TraceMessageBus::Handler
{
Q_OBJECT
public:
explicit MainWindow(AssetBundler::GUIApplicationManager* guiApplicationManager, QWidget* parent = 0);
virtual ~MainWindow();
void Activate();
void ApplyConfig();
void WriteToLog(const AZStd::string& message, AzToolsFramework::Logging::LogLine::LogType logType);
void WriteToLog(const QString& message, AzToolsFramework::Logging::LogLine::LogType logType);
void WriteToLog(const char* message, AzToolsFramework::Logging::LogLine::LogType logType);
void WriteToLog(const char* message, const char* window, AzToolsFramework::Logging::LogLine::LogType logType);
/////////////////////////////////////////////////////////
// TraceMessageBus overrides
bool OnPreError(const char* window, const char* fileName, int line, const char* func, const char* message) override;
bool OnPreWarning(const char* window, const char* fileName, int line, const char* func, const char* message) override;
bool OnPrintf(const char* window, const char* message) override;
/////////////////////////////////////////////////////////
public Q_SLOTS:
void ShowWindow();
protected:
void closeEvent(QCloseEvent* event) override;
private:
QSharedPointer<Ui::MainWindow> m_ui;
// Tabs
QSharedPointer<AssetListTabWidget> m_assetListTab;
QSharedPointer<SeedTabWidget> m_seedListTab;
QSharedPointer<RulesTabWidget> m_rulesTab;
QSharedPointer<BundleListTabWidget> m_bundleListTab;
enum TabIndex
{
Seeds,
AssetLists,
Rules,
Bundles,
MAX
};
void OnSupportClicked();
// Log
QSharedPointer<AzToolsFramework::Logging::LogTableModel> m_logModel;
void ShowLogContextMenu(const QPoint& pos);
// Detecting Unsaved Changes
QSharedPointer<QMessageBox> m_unsavedChangesMsgBox;
bool HasUnsavedChanges();
void SaveCurrentSelection();
void SaveAll();
AssetBundler::GUIApplicationManager* m_guiApplicationManager = nullptr;
};
} // namespace AssetBundler