Merge branch 'upstream/development' into genewalt/gitflow_210628
Signed-off-by: Gene Walters <genewalt@amazon.com>
This commit is contained in:
+10
-4
@@ -24,16 +24,22 @@ namespace AzToolsFramework
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! executes a Python script using a string, prints the result if printResult is true and script is an expression
|
||||
virtual void ExecuteByString(AZStd::string_view script, bool printResult) { AZ_UNUSED(script); AZ_UNUSED(printResult); }
|
||||
virtual void ExecuteByString([[maybe_unused]] AZStd::string_view script, [[maybe_unused]] bool printResult) {}
|
||||
|
||||
//! executes a Python script using a filename
|
||||
virtual void ExecuteByFilename(AZStd::string_view filename) { AZ_UNUSED(filename); }
|
||||
virtual void ExecuteByFilename([[maybe_unused]] AZStd::string_view filename) {}
|
||||
|
||||
//! executes a Python script using a filename and args
|
||||
virtual void ExecuteByFilenameWithArgs(AZStd::string_view filename, const AZStd::vector<AZStd::string_view>& args) { AZ_UNUSED(filename); AZ_UNUSED(args); }
|
||||
virtual void ExecuteByFilenameWithArgs(
|
||||
[[maybe_unused]] AZStd::string_view filename, [[maybe_unused]] const AZStd::vector<AZStd::string_view>& args) {}
|
||||
|
||||
//! executes a Python script as a test
|
||||
virtual void ExecuteByFilenameAsTest(AZStd::string_view filename, const AZStd::vector<AZStd::string_view>& args) { AZ_UNUSED(filename); AZ_UNUSED(args); }
|
||||
virtual void ExecuteByFilenameAsTest(
|
||||
[[maybe_unused]] AZStd::string_view filename,
|
||||
[[maybe_unused]] AZStd::string_view testCase,
|
||||
[[maybe_unused]] const AZStd::vector<AZStd::string_view>& args)
|
||||
{
|
||||
}
|
||||
};
|
||||
using EditorPythonRunnerRequestBus = AZ::EBus<EditorPythonRunnerRequests>;
|
||||
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
//! Provides a bus to notify when Python scripts are about to run.
|
||||
class EditorPythonScriptNotifications
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// EBusTraits overrides
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! Notifies the start of execution of a Python script using a string.
|
||||
virtual void OnStartExecuteByString([[maybe_unused]] AZStd::string_view script) {}
|
||||
|
||||
//! Notifies the start of execution of a Python script using a filename.
|
||||
virtual void OnStartExecuteByFilename([[maybe_unused]] AZStd::string_view filename) {}
|
||||
|
||||
//! Notifies the start of execution of a Python script using a filename and args.
|
||||
virtual void OnStartExecuteByFilenameWithArgs(
|
||||
[[maybe_unused]] AZStd::string_view filename, [[maybe_unused]] const AZStd::vector<AZStd::string_view>& args) {}
|
||||
|
||||
//! Notifies the start of execution of a Python script as a test.
|
||||
virtual void OnStartExecuteByFilenameAsTest(
|
||||
[[maybe_unused]] AZStd::string_view filename, [[maybe_unused]] AZStd::string_view testCase, [[maybe_unused]] const AZStd::vector<AZStd::string_view>& args) {}
|
||||
};
|
||||
using EditorPythonScriptNotificationsBus = AZ::EBus<EditorPythonScriptNotifications>;
|
||||
}
|
||||
+12
-3
@@ -180,10 +180,11 @@ namespace AzToolsFramework
|
||||
|
||||
void AssetBrowserTreeView::rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end)
|
||||
{
|
||||
// if selected entry is being removed, clear selection so not to select (and attempt to preview) other entries potentially marked for deletion
|
||||
if (selectionModel() && selectionModel()->selectedIndexes().size() == 1)
|
||||
// if selected entry is being removed, clear selection so not to select (and attempt to preview) other entries potentially
|
||||
// marked for deletion
|
||||
if (selectionModel() && selectedIndexes().size() == 1)
|
||||
{
|
||||
QModelIndex selectedIndex = selectionModel()->selectedIndexes().first();
|
||||
QModelIndex selectedIndex = selectedIndexes().first();
|
||||
QModelIndex parentSelectedIndex = selectedIndex.parent();
|
||||
if (parentSelectedIndex == parent && selectedIndex.row() >= start && selectedIndex.row() <= end)
|
||||
{
|
||||
@@ -193,6 +194,14 @@ namespace AzToolsFramework
|
||||
QTreeView::rowsAboutToBeRemoved(parent, start, end);
|
||||
}
|
||||
|
||||
// Item data for hidden columns normally isn't copied by Qt during drag-and-drop (see QTBUG-30242).
|
||||
// However, for the AssetBrowser, the hidden columns should get copied. By overriding selectedIndexes() to
|
||||
// include all selected indices, not just the visible ones, we can get the behavior we're looking for.
|
||||
QModelIndexList AssetBrowserTreeView::selectedIndexes() const
|
||||
{
|
||||
return selectionModel()->selectedIndexes();
|
||||
}
|
||||
|
||||
void AssetBrowserTreeView::SetThumbnailContext(const char* thumbnailContext) const
|
||||
{
|
||||
m_delegate->SetThumbnailContext(thumbnailContext);
|
||||
|
||||
+3
@@ -90,6 +90,9 @@ namespace AzToolsFramework
|
||||
void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected) override;
|
||||
void rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end) override;
|
||||
|
||||
protected:
|
||||
QModelIndexList selectedIndexes() const override;
|
||||
|
||||
private:
|
||||
QPointer<AssetBrowserModel> m_assetBrowserModel = nullptr;
|
||||
QPointer<AssetBrowserFilterModel> m_assetBrowserSortFilterProxyModel = nullptr;
|
||||
|
||||
@@ -37,6 +37,7 @@ set(FILES
|
||||
API/EditorVegetationRequestsBus.h
|
||||
API/EditorPythonConsoleBus.h
|
||||
API/EditorPythonRunnerRequestsBus.h
|
||||
API/EditorPythonScriptNotificationsBus.h
|
||||
API/EntityPropertyEditorRequestsBus.h
|
||||
API/EditorWindowRequestBus.h
|
||||
API/EntityCompositionRequestBus.h
|
||||
|
||||
@@ -532,6 +532,7 @@ public:
|
||||
QString m_appRoot;
|
||||
QString m_logFile;
|
||||
QString m_pythonArgs;
|
||||
QString m_pythontTestCase;
|
||||
QString m_execFile;
|
||||
QString m_execLineCmd;
|
||||
|
||||
@@ -578,6 +579,7 @@ public:
|
||||
const std::vector<std::pair<CommandLineStringOption, QString&> > stringOptions = {
|
||||
{{"logfile", "File name of the log file to write out to.", "logfile"}, m_logFile},
|
||||
{{"runpythonargs", "Command-line argument string to pass to the python script if --runpython or --runpythontest was used.", "runpythonargs"}, m_pythonArgs},
|
||||
{{"pythontestcase", "Test case name of python test script if --runpythontest was used.", "pythontestcase"}, m_pythontTestCase},
|
||||
{{"exec", "cfg file to run on startup, used for systems like automation", "exec"}, m_execFile},
|
||||
{{"rhi", "Command-line argument to force which rhi to use", "dummyString"}, dummyString },
|
||||
{{"rhi-device-validation", "Command-line argument to configure rhi validation", "dummyString"}, dummyString },
|
||||
@@ -1516,7 +1518,13 @@ void CCryEditApp::RunInitPythonScript(CEditCommandLineInfo& cmdInfo)
|
||||
std::transform(tokens.begin(), tokens.end(), std::back_inserter(pythonArgs), [](auto& tokenData) { return tokenData.c_str(); });
|
||||
if (cmdInfo.m_bRunPythonTestScript)
|
||||
{
|
||||
EditorPythonRunnerRequestBus::Broadcast(&EditorPythonRunnerRequestBus::Events::ExecuteByFilenameAsTest, cmdInfo.m_strFileName.toUtf8().constData(), pythonArgs);
|
||||
AZStd::string pythonTestCase;
|
||||
if (!cmdInfo.m_pythontTestCase.isEmpty())
|
||||
{
|
||||
pythonTestCase = cmdInfo.m_pythontTestCase.toUtf8().constData();
|
||||
}
|
||||
|
||||
EditorPythonRunnerRequestBus::Broadcast(&EditorPythonRunnerRequestBus::Events::ExecuteByFilenameAsTest, cmdInfo.m_strFileName.toUtf8().constData(), pythonTestCase, pythonArgs);
|
||||
|
||||
// Close the editor gracefully as the test has completed
|
||||
GetIEditor()->GetDocument()->SetModifiedFlag(false);
|
||||
|
||||
@@ -15,6 +15,9 @@ ly_add_target(
|
||||
Include
|
||||
PRIVATE
|
||||
Source
|
||||
COMPILE_DEFINITIONS
|
||||
PRIVATE
|
||||
${LY_TEST_IMPACT_CONFIG_FILE_PATH_DEFINITION}
|
||||
BUILD_DEPENDENCIES
|
||||
PUBLIC
|
||||
AZ::TestImpact.Runtime.Static
|
||||
|
||||
Reference in New Issue
Block a user