Qt: Add controller (overview) window

This commit is contained in:
spycrab
2017-05-09 18:49:10 +02:00
parent a11775396f
commit c8d0b647ac
14 changed files with 708 additions and 27 deletions

View File

@ -12,9 +12,11 @@
#include "Core/Core.h"
#include "Core/HW/ProcessorInterface.h"
#include "Core/Movie.h"
#include "Core/NetPlayProto.h"
#include "Core/State.h"
#include "DolphinQt2/AboutDialog.h"
#include "DolphinQt2/Config/ControllersWindow.h"
#include "DolphinQt2/Config/PathDialog.h"
#include "DolphinQt2/Config/SettingsWindow.h"
#include "DolphinQt2/Host.h"
@ -51,6 +53,7 @@ void MainWindow::CreateComponents()
m_render_widget = new RenderWidget;
m_stack = new QStackedWidget(this);
m_paths_dialog = new PathDialog(this);
m_controllers_window = new ControllersWindow(this);
m_settings_window = new SettingsWindow(this);
}
@ -90,6 +93,11 @@ void MainWindow::ConnectMenuBar()
connect(this, &MainWindow::EmulationStarted, m_menu_bar, &MenuBar::EmulationStarted);
connect(this, &MainWindow::EmulationPaused, m_menu_bar, &MenuBar::EmulationPaused);
connect(this, &MainWindow::EmulationStopped, m_menu_bar, &MenuBar::EmulationStopped);
connect(this, &MainWindow::EmulationStarted, this,
[=]() { m_controllers_window->OnEmulationStateChanged(true); });
connect(this, &MainWindow::EmulationStopped, this,
[=]() { m_controllers_window->OnEmulationStateChanged(false); });
}
void MainWindow::ConnectToolBar()
@ -103,6 +111,7 @@ void MainWindow::ConnectToolBar()
connect(m_tool_bar, &ToolBar::ScreenShotPressed, this, &MainWindow::ScreenShot);
connect(m_tool_bar, &ToolBar::PathsPressed, this, &MainWindow::ShowPathsDialog);
connect(m_tool_bar, &ToolBar::SettingsPressed, this, &MainWindow::ShowSettingsWindow);
connect(m_tool_bar, &ToolBar::ControllersPressed, this, &MainWindow::ShowControllersWindow);
connect(this, &MainWindow::EmulationStarted, m_tool_bar, &ToolBar::EmulationStarted);
connect(this, &MainWindow::EmulationPaused, m_tool_bar, &ToolBar::EmulationPaused);
@ -324,6 +333,13 @@ void MainWindow::ShowPathsDialog()
m_paths_dialog->activateWindow();
}
void MainWindow::ShowControllersWindow()
{
m_controllers_window->show();
m_controllers_window->raise();
m_controllers_window->activateWindow();
}
void MainWindow::ShowSettingsWindow()
{
m_settings_window->show();