2
0
Эх сурвалжийг харах

Remove legacy Keyboard Customization classes.

Signed-off-by: Danilo Aimini <[email protected]>
Danilo Aimini 2 жил өмнө
parent
commit
e173df6af0

+ 0 - 2
Code/Editor/CryEdit.cpp

@@ -1012,8 +1012,6 @@ void CCryEditApp::InitLevel(const CEditCommandLineInfo& cmdInfo)
 
     if (m_bPreviewMode)
     {
-        GetIEditor()->EnableAcceleratos(false);
-
         // Load geometry object.
         if (!cmdInfo.m_strFileName.isEmpty())
         {

+ 0 - 5
Code/Editor/GameEngine.cpp

@@ -531,8 +531,6 @@ void CGameEngine::SwitchToInGame()
     m_pISystem->GetIMovieSystem()->EnablePhysicsEvents(true);
     m_bInGameMode = true;
 
-    // Disable accelerators.
-    GetIEditor()->EnableAcceleratos(false);
     //! Send event to switch into game.
     GetIEditor()->GetObjectManager()->SendEvent(EVENT_INGAME);
 
@@ -568,9 +566,6 @@ void CGameEngine::SwitchToInEditor()
 
     m_pISystem->GetIMovieSystem()->EnablePhysicsEvents(m_bSimulationMode);
 
-    // Enable accelerators.
-    GetIEditor()->EnableAcceleratos(true);
-
     // [Anton] - order changed, see comments for CGameEngine::SetSimulationMode
     //! Send event to switch out of game.
     GetIEditor()->GetObjectManager()->SendEvent(EVENT_OUTOFGAME);

+ 0 - 2
Code/Editor/IEditor.h

@@ -454,8 +454,6 @@ struct IEditor
     virtual bool IsInMatEditMode() = 0;
     //! Enable/Disable updates of editor.
     virtual void EnableUpdate(bool enable) = 0;
-    //! Enable/Disable accelerator table, (Enabled by default).
-    virtual void EnableAcceleratos(bool bEnable) = 0;
     virtual SFileVersion GetFileVersion() = 0;
     virtual SFileVersion GetProductVersion() = 0;
     //! Retrieve pointer to game engine instance

+ 0 - 6
Code/Editor/IEditorImpl.cpp

@@ -40,7 +40,6 @@
 #include "PluginManager.h"
 #include "ViewManager.h"
 #include "DisplaySettings.h"
-#include "KeyboardCustomizationSettings.h"
 #include "LevelIndependentFileMan.h"
 #include "TrackView/TrackViewSequenceManager.h"
 #include "AnimationContext.h"
@@ -845,11 +844,6 @@ bool CEditorImpl::IsInPreviewMode()
     return CCryEditApp::instance()->IsInPreviewMode();
 }
 
-void CEditorImpl::EnableAcceleratos(bool bEnable)
-{
-    KeyboardCustomizationSettings::EnableShortcutsGlobally(bEnable);
-}
-
 static AZStd::string SafeGetStringFromDocument(rapidjson::Document& projectCfg, const char* memberName)
 {
     if (projectCfg.HasMember(memberName) && projectCfg[memberName].IsString())

+ 2 - 5
Code/Editor/IEditorImpl.h

@@ -70,7 +70,6 @@ public:
     void OnEarlyExitShutdownSequence();
     void Uninitialize();
 
-
     void SetGameEngine(CGameEngine* ge);
     void DeleteThis() override { delete this; };
     IEditorClassFactory* GetClassFactory() override;
@@ -89,7 +88,7 @@ public:
     bool IsModified() override;
     bool IsInitialized() const override{ return m_bInitialized; }
     bool SaveDocument() override;
-    ISystem*    GetSystem() override;
+    ISystem* GetSystem() override;
     void WriteToConsole(const char* string) override { CLogFile::WriteLine(string); };
     void WriteToConsole(const QString& string) override { CLogFile::WriteLine(string); };
     // Change the message in the status bar
@@ -127,10 +126,8 @@ public:
 
     //! Enables/Disable updates of editor.
     void EnableUpdate(bool enable) override { m_bUpdates = enable; };
-    //! Enable/Disable accelerator table, (Enabled by default).
-    void EnableAcceleratos(bool bEnable) override;
     CGameEngine* GetGameEngine() override { return m_pGameEngine; };
-    CDisplaySettings*   GetDisplaySettings() override { return m_pDisplaySettings; };
+    CDisplaySettings* GetDisplaySettings() override { return m_pDisplaySettings; };
     CBaseObject* NewObject(const char* typeName, const char* fileName = "", const char* name = "", float x = 0.0f, float y = 0.0f, float z = 0.0f, bool modifyDoc = true) override;
     void DeleteObject(CBaseObject* obj) override;
     IObjectManager* GetObjectManager() override;

+ 0 - 1
Code/Editor/Lib/Tests/IEditorMock.h

@@ -67,7 +67,6 @@ public:
     MOCK_METHOD0(IsInLevelLoadTestMode, bool());
     MOCK_METHOD0(IsInMatEditMode, bool());
     MOCK_METHOD1(EnableUpdate, void(bool));
-    MOCK_METHOD1(EnableAcceleratos, void(bool));
     MOCK_METHOD0(GetFileVersion, SFileVersion());
     MOCK_METHOD0(GetProductVersion, SFileVersion());
     MOCK_METHOD0(GetGameEngine , CGameEngine* ());

+ 0 - 28
Code/Editor/MainWindow.cpp

@@ -77,8 +77,6 @@
 #include "UndoDropDown.h"
 #include "EditorViewportSettings.h"
 
-#include "KeyboardCustomizationSettings.h"
-#include "CustomizeKeyboardDialog.h"
 #include "QtViewPaneManager.h"
 #include "ViewPane.h"
 #include "Include/IObjectManager.h"
@@ -290,7 +288,6 @@ MainWindow::MainWindow(QWidget* parent)
     , m_oldMainFrame(nullptr)
     , m_viewPaneManager(QtViewPaneManager::instance())
     , m_undoStateAdapter(new UndoStackStateAdapter(this))
-    , m_keyboardCustomization(nullptr)
     , m_activeView(nullptr)
     , m_settings("O3DE", "O3DE")
     , m_assetImporterManager(new AssetImporterManager(this))
@@ -442,8 +439,6 @@ void MainWindow::Initialize()
     AzToolsFramework::SourceControlNotificationBus::Handler::BusConnect();
     m_sourceControlNotifHandler->Init();
 
-    m_keyboardCustomization = new KeyboardCustomizationSettings(QStringLiteral("Main Window"), this);
-
     if (!IsPreview())
     {
         RegisterOpenWndCommands();
@@ -510,7 +505,6 @@ void MainWindow::closeEvent(QCloseEvent* event)
         return;
     }
 
-    KeyboardCustomizationSettings::EnableShortcutsGlobally(true);
     SaveConfig();
 
     // Some of the panes may ask for confirmation to save changes before closing.
@@ -556,23 +550,6 @@ void MainWindow::SaveConfig()
     }
 }
 
-void MainWindow::ShowKeyboardCustomization()
-{
-    CustomizeKeyboardDialog dialog(*m_keyboardCustomization, this);
-    dialog.exec();
-}
-
-void MainWindow::ExportKeyboardShortcuts()
-{
-    KeyboardCustomizationSettings::ExportToFile(this);
-}
-
-void MainWindow::ImportKeyboardShortcuts()
-{
-    KeyboardCustomizationSettings::ImportFromFile(this);
-    KeyboardCustomizationSettings::SaveGlobally();
-}
-
 void MainWindow::OnEscapeAction()
 {
     if (!CCryEditApp::instance()->IsInAutotestMode())
@@ -618,11 +595,6 @@ MainStatusBar* MainWindow::StatusBar() const
     return static_cast<MainStatusBar*>(statusBar());
 }
 
-KeyboardCustomizationSettings* MainWindow::GetShortcutManager() const
-{
-    return m_keyboardCustomization;
-}
-
 void MainWindow::OpenViewPane(int paneId)
 {
     OpenViewPane(QtViewPaneManager::instance()->GetPane(paneId));

+ 0 - 17
Code/Editor/MainWindow.h

@@ -38,10 +38,8 @@ class CLayoutViewPane;
 class CLayoutWnd;
 class CMainFrame;
 class EngineConnectionListener;
-class KeyboardCustomizationSettings;
 class LevelEditorMenuHandler;
 class MainStatusBar;
-class ShortcutDispatcher;
 class UndoStackStateAdapter;
 
 class QComboBox;
@@ -123,15 +121,11 @@ public:
     MainStatusBar* StatusBar() const;
     CLayoutWnd* GetLayout() const;
 
-    KeyboardCustomizationSettings* GetShortcutManager() const;
-
     void OpenViewPane(int paneId);
     void OpenViewPane(QtViewPane* pane);
 
     void SetActiveView(CLayoutViewPane* vp);
 
-    bool IsCustomizingToolbars() const;
-
     /**
      * Returns the active view layout (Perspective, Top, Bottom, or Left, etc).
      * This particularly useful when in multi-layout mode, it represents the default viewport to use
@@ -177,14 +171,11 @@ protected:
     bool focusNextPrevChild(bool next) override;
 
 private:
-    QWidget* CreateToolbarWidget(int id);
-    void ShowCustomizeToolbarDialog();
     void OnGotoSelected();
 
     void ToggleConsole();
     void RegisterOpenWndCommands();
     void InitCentralWidget();
-    void InitToolBars();
     void InitStatusBar();
 
     template <class TValue>
@@ -198,12 +189,7 @@ private:
 
     QWidget* CreateSpacerRightWidget();
 
-    QToolButton* CreateUndoRedoButton(int command);
-
 private Q_SLOTS:
-    void ShowKeyboardCustomization();
-    void ExportKeyboardShortcuts();
-    void ImportKeyboardShortcuts();
     void OnStopAllSounds();
     void OnRefreshAudioSystem();
     void SaveLayout();
@@ -230,11 +216,8 @@ private:
     void RegisterStdViewClasses();
     CMainFrame* m_oldMainFrame;
     QtViewPaneManager* m_viewPaneManager;
-    ShortcutDispatcher* m_shortcutDispatcher = nullptr;
-    ActionManager* m_actionManager = nullptr;
     UndoStackStateAdapter* m_undoStateAdapter;
 
-    KeyboardCustomizationSettings* m_keyboardCustomization;
     CLayoutViewPane* m_activeView;
     QSettings m_settings;
 

+ 0 - 82
Code/Editor/ToolsConfigPage.cpp

@@ -25,7 +25,6 @@
 #include "Settings.h"
 #include "MainWindow.h"
 #include "ToolBox.h"
-#include "KeyboardCustomizationSettings.h"
 
 
 AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
@@ -488,25 +487,6 @@ CToolsConfigPage::CToolsConfigPage(QWidget* parent)
 
     m_ui->m_macroCmd->setCompleter(new QCompleter(m_completionModel));
 
-    connect(m_ui->m_macroShortcutKey, &QKeySequenceEdit::keySequenceChanged, this, [&]([[maybe_unused]] const QKeySequence &keySequence) {
-        int numOfShortcuts = m_ui->m_macroShortcutKey->keySequence().count() - 1;
-        if (numOfShortcuts >= 1)
-        {
-            int value = m_ui->m_macroShortcutKey->keySequence()[numOfShortcuts];
-            QKeySequence shortcut(value);
-            m_ui->m_macroShortcutKey->setKeySequence(shortcut);
-        }
-
-        if (m_ui->m_macroShortcutKey->keySequence().count() >= 1)
-        {
-            m_ui->m_assignShortcut->setEnabled(true);
-        }
-        else
-        {
-            m_ui->m_assignShortcut->setEnabled(false);
-        }
-    });
-
     OnInitDialog();
 }
 
@@ -521,7 +501,6 @@ void CToolsConfigPage::OnInitDialog()
     m_ui->m_commandList->setModel(m_commandModel);
 
     connect(m_ui->m_assignCommand, &QPushButton::clicked, this, &CToolsConfigPage::OnAssignCommand);
-    connect(m_ui->m_assignShortcut, &QPushButton::clicked, this, &CToolsConfigPage::OnAssignMacroShortcut);
     connect(m_ui->m_selectIcon, &QPushButton::clicked, this, &CToolsConfigPage::OnSelectMacroIcon);
     connect(m_ui->m_clearIcon, &QPushButton::clicked, this, &CToolsConfigPage::OnClearMacroIcon);
     connect(m_ui->m_console, &QRadioButton::clicked, this, &CToolsConfigPage::OnConsoleCmd);
@@ -550,24 +529,11 @@ void CToolsConfigPage::OnInitDialog()
 void CToolsConfigPage::OnOK()
 {
     GetIEditor()->GetToolBoxManager()->Save();
-    MainWindow* pMainFrame = MainWindow::instance();
-
-    auto pShortcutMgr = pMainFrame->GetShortcutManager();
-    if (pShortcutMgr)
-    {
-        pShortcutMgr->Save();
-    }
 }
 
 //////////////////////////////////////////////////////////////////////////
 void CToolsConfigPage::OnCancel()
 {
-    auto pShortcutMgr = MainWindow::instance()->GetShortcutManager();
-    if (pShortcutMgr)
-    {
-        pShortcutMgr->Load();
-    }
-
     // Revert to the original.
     GetIEditor()->GetToolBoxManager()->Load();
 }
@@ -581,26 +547,15 @@ void CToolsConfigPage::OnSelchangeMacroList()
 
     if (m_ui->m_macroList->currentIndex().isValid())
     {
-        // Update the shortcut.
-        auto pShortcutMgr = MainWindow::instance()->GetShortcutManager();
-        m_ui->m_macroShortcutKey->clear();
-        if (pShortcutMgr && macro)
-        {
-            m_ui->m_macroShortcutKey->setKeySequence(macro->GetShortcutName());
-        }
-
         /// Update the icon.
         const QPixmap icon(macro != nullptr ? macro->GetIconPath() : QString());
         m_ui->m_macroIcon->setPixmap(icon);
 
-        m_ui->m_macroShortcutKey->setEnabled(true);
         m_ui->m_selectIcon->setEnabled(true);
         m_ui->m_clearIcon->setEnabled(true);
     }
     else
     {
-        m_ui->m_macroShortcutKey->setEnabled(false);
-        m_ui->m_assignShortcut->setEnabled(false);
         m_ui->m_selectIcon->setEnabled(false);
         m_ui->m_clearIcon->setEnabled(false);
     }
@@ -696,43 +651,6 @@ void CToolsConfigPage::OnAssignCommand()
     }
 }
 
-//////////////////////////////////////////////////////////////////////////
-void CToolsConfigPage::OnAssignMacroShortcut()
-{
-    auto pShortcutMgr = MainWindow::instance()->GetShortcutManager();
-
-    if (pShortcutMgr  == nullptr)
-    {
-        return;
-    }
-
-    auto macroIndex = m_ui->m_macroList->currentIndex();
-
-    if (!macroIndex.isValid())
-    {
-        return;
-    }
-
-    QKeySequence editorAccel = m_ui->m_macroShortcutKey->keySequence();
-    CToolBoxMacro* pMacro = macroIndex.data(Qt::UserRole).value<CToolBoxMacro*>();
-
-    QAction* action = pShortcutMgr->FindActionForShortcut(editorAccel);
-    bool bReassign = false;
-
-    if (action != nullptr)
-    {
-        if (!bReassign && QMessageBox::question(this, QString(), tr("This shortcut is currently assigned.\nDo you want to re - assign this shortcut ?")) != QMessageBox::Yes)
-        {
-            m_ui->m_macroShortcutKey->setKeySequence(pMacro->GetShortcutName());
-            return;
-        }
-        bReassign = true;
-        action->setShortcut(QKeySequence());
-    }
-
-    pMacro->SetShortcutName(m_ui->m_macroShortcutKey->keySequence());
-}
-
 //////////////////////////////////////////////////////////////////////////
 void CToolsConfigPage::OnMoveMacroItemUp()
 {

+ 0 - 1
Code/Editor/ToolsConfigPage.h

@@ -75,7 +75,6 @@ protected:
     void OnSelchangeCommandList();
 
     void OnAssignCommand();
-    void OnAssignMacroShortcut();
     void OnSelectMacroIcon();
     void OnClearMacroIcon();
 

+ 1 - 23
Code/Editor/ToolsConfigPage.ui

@@ -236,29 +236,7 @@
     </widget>
    </item>
    <item>
-    <layout class="QHBoxLayout" name="horizontalLayout_6" stretch="7,6">
-     <item>
-      <widget class="QGroupBox" name="groupBox_2">
-       <property name="title">
-        <string>Shortcut</string>
-       </property>
-       <layout class="QHBoxLayout" name="horizontalLayout_2">
-        <item>
-         <widget class="QKeySequenceEdit" name="m_macroShortcutKey"/>
-        </item>
-        <item>
-         <widget class="QPushButton" name="m_assignShortcut">
-          <property name="enabled">
-           <bool>false</bool>
-          </property>
-          <property name="text">
-           <string>Assign</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </widget>
-     </item>
+    <layout class="QHBoxLayout" name="horizontalLayout_6" stretch="7">
      <item>
       <widget class="QGroupBox" name="groupBox_3">
        <property name="title">

+ 0 - 5
Code/Editor/editor_lib_files.cmake

@@ -438,11 +438,6 @@ set(FILES
     PythonEditorFuncs.h
     QtUI/WaitCursor.h
     QtUI/WaitCursor.cpp
-    CustomizeKeyboardDialog.h
-    CustomizeKeyboardDialog.cpp
-    CustomizeKeyboardDialog.ui
-    KeyboardCustomizationSettings.h
-    KeyboardCustomizationSettings.cpp
     Settings.cpp
     SettingsManager.cpp
     SettingsManagerDialog.cpp