ConsoleDialog.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "EditorDefs.h"
  9. #include "ConsoleDialog.h"
  10. // Qt
  11. #include <QVBoxLayout>
  12. // Editor
  13. #include "Controls/ConsoleSCB.h" // For CConsoleSCB
  14. #include "LyViewPaneNames.h" // for LyViewPane::
  15. CConsoleDialog::CConsoleDialog(QWidget* parent)
  16. : QDialog(parent)
  17. , m_consoleWidget(new CConsoleSCB(this))
  18. {
  19. QVBoxLayout* outterLayout = new QVBoxLayout(this);
  20. outterLayout->addWidget(m_consoleWidget);
  21. outterLayout->setMargin(0);
  22. setWindowTitle(LyViewPane::Console);
  23. setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
  24. resize(842, 480);
  25. }
  26. void CConsoleDialog::SetInfoText(const char* text)
  27. {
  28. if (gEnv && gEnv->pLog) // before log system was initialized
  29. {
  30. CryLogAlways("%s", text);
  31. }
  32. }
  33. void CConsoleDialog::closeEvent(QCloseEvent* ev)
  34. {
  35. if (GetISystem())
  36. {
  37. GetISystem()->Quit();
  38. }
  39. QDialog::closeEvent(ev);
  40. }
  41. #include <moc_ConsoleDialog.cpp>