This commit is contained in:
Nayla Hanegan 2023-05-26 15:52:58 -04:00
parent 7d8fe0f105
commit 871da4e307
No known key found for this signature in database
GPG key ID: BAFE9001DA16CFA2
275 changed files with 33002 additions and 27474 deletions

View file

@ -14,6 +14,7 @@
#include <QIcon>
#include <QMimeData>
#include <QStackedWidget>
#include <QStyleHints>
#include <QVBoxLayout>
#include <QWindow>
@ -94,6 +95,7 @@
#include "DolphinQt/GameList/GameList.h"
#include "DolphinQt/Host.h"
#include "DolphinQt/HotkeyScheduler.h"
#include "DolphinQt/InfinityBase/InfinityBaseWindow.h"
#include "DolphinQt/MenuBar.h"
#include "DolphinQt/NKitWarningDialog.h"
#include "DolphinQt/NetPlay/NetPlayBrowser.h"
@ -238,6 +240,13 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters,
ConnectMenuBar();
ConnectHotkeys();
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged, this,
[](Qt::ColorScheme colorScheme) {
Settings::Instance().SetCurrentUserStyle(Settings::Instance().GetCurrentUserStyle());
});
#endif
connect(m_cheats_manager, &CheatsManager::OpenGeneralSettings, this,
&MainWindow::ShowGeneralWindow);
@ -530,6 +539,7 @@ void MainWindow::ConnectMenuBar()
connect(m_menu_bar, &MenuBar::BootWiiSystemMenu, this, &MainWindow::BootWiiSystemMenu);
connect(m_menu_bar, &MenuBar::ShowFIFOPlayer, this, &MainWindow::ShowFIFOPlayer);
connect(m_menu_bar, &MenuBar::ShowSkylanderPortal, this, &MainWindow::ShowSkylanderPortal);
connect(m_menu_bar, &MenuBar::ShowInfinityBase, this, &MainWindow::ShowInfinityBase);
connect(m_menu_bar, &MenuBar::ConnectWiiRemote, this, &MainWindow::OnConnectWiiRemote);
// Movie
@ -1378,10 +1388,8 @@ void MainWindow::ShowGraphicsWindow()
"display", windowHandle())),
winId());
}
m_graphics_window = new GraphicsWindow(m_xrr_config.get(), this);
#else
m_graphics_window = new GraphicsWindow(nullptr, this);
#endif
m_graphics_window = new GraphicsWindow(this);
InstallHotkeyFilter(m_graphics_window);
}
@ -1423,7 +1431,7 @@ void MainWindow::ShowSkylanderPortal()
{
if (!m_skylander_window)
{
m_skylander_window = new SkylanderPortalWindow;
m_skylander_window = new SkylanderPortalWindow();
}
m_skylander_window->show();
@ -1431,12 +1439,25 @@ void MainWindow::ShowSkylanderPortal()
m_skylander_window->activateWindow();
}
void MainWindow::ShowInfinityBase()
{
if (!m_infinity_window)
{
m_infinity_window = new InfinityBaseWindow();
}
m_infinity_window->show();
m_infinity_window->raise();
m_infinity_window->activateWindow();
}
void MainWindow::StateLoad()
{
QString path =
DolphinFileDialog::getOpenFileName(this, tr("Select a File"), QDir::currentPath(),
tr("All Save States (*.sav *.s##);; All Files (*)"));
State::LoadAs(path.toStdString());
if (!path.isEmpty())
State::LoadAs(path.toStdString());
}
void MainWindow::StateSave()
@ -1444,7 +1465,8 @@ void MainWindow::StateSave()
QString path =
DolphinFileDialog::getSaveFileName(this, tr("Select a File"), QDir::currentPath(),
tr("All Save States (*.sav *.s##);; All Files (*)"));
State::SaveAs(path.toStdString());
if (!path.isEmpty())
State::SaveAs(path.toStdString());
}
void MainWindow::StateLoadSlot()