diff --git a/Source/Core/DolphinQt2/CMakeLists.txt b/Source/Core/DolphinQt2/CMakeLists.txt index 1e71a266ef..42a42bfaa8 100644 --- a/Source/Core/DolphinQt2/CMakeLists.txt +++ b/Source/Core/DolphinQt2/CMakeLists.txt @@ -32,7 +32,6 @@ set(SRCS Config/Mapping/WiimoteEmuExtension.cpp Config/Mapping/WiimoteEmuGeneral.cpp Config/Mapping/WiimoteEmuMotionControl.cpp - Config/PathDialog.cpp Config/PropertiesDialog.cpp Config/SettingsWindow.cpp GameList/GameFile.cpp @@ -44,6 +43,7 @@ set(SRCS QtUtils/ElidedButton.cpp Settings/GeneralPane.cpp Settings/InterfacePane.cpp + Settings/PathPane.cpp ) list(APPEND LIBS core uicommon) diff --git a/Source/Core/DolphinQt2/Config/SettingsWindow.cpp b/Source/Core/DolphinQt2/Config/SettingsWindow.cpp index 0e765b4a3a..7993925d25 100644 --- a/Source/Core/DolphinQt2/Config/SettingsWindow.cpp +++ b/Source/Core/DolphinQt2/Config/SettingsWindow.cpp @@ -6,6 +6,7 @@ #include "DolphinQt2/Settings.h" #include "DolphinQt2/Settings/GeneralPane.h" #include "DolphinQt2/Settings/InterfacePane.h" +#include "DolphinQt2/Settings/PathPane.h" SettingsWindow::SettingsWindow(QWidget* parent) : QDialog(parent) { @@ -53,6 +54,7 @@ void SettingsWindow::SetupSettingsWidget() // Panes initalised here m_settings_outer->addWidget(new GeneralPane); m_settings_outer->addWidget(new InterfacePane); + m_settings_outer->addWidget(new PathPane); } void SettingsWindow::MakeUnfinishedWarning() @@ -87,6 +89,7 @@ void SettingsWindow::MakeCategoryList() AddCategoryToList(tr("General"), QStringLiteral("config.png")); AddCategoryToList(tr("Interface"), QStringLiteral("browse.png")); + AddCategoryToList(tr("Paths"), QStringLiteral("browse.png")); connect(m_categories, &QListWidget::currentItemChanged, this, &SettingsWindow::changePage); } diff --git a/Source/Core/DolphinQt2/DolphinQt2.vcxproj b/Source/Core/DolphinQt2/DolphinQt2.vcxproj index 3c17f53b28..3e5ba69f0e 100644 --- a/Source/Core/DolphinQt2/DolphinQt2.vcxproj +++ b/Source/Core/DolphinQt2/DolphinQt2.vcxproj @@ -75,7 +75,6 @@ - @@ -113,7 +112,6 @@ - @@ -135,7 +133,6 @@ - @@ -155,6 +152,7 @@ + diff --git a/Source/Core/DolphinQt2/DolphinQt2.vcxproj.filters b/Source/Core/DolphinQt2/DolphinQt2.vcxproj.filters index f051b6a93f..e2947829f6 100644 --- a/Source/Core/DolphinQt2/DolphinQt2.vcxproj.filters +++ b/Source/Core/DolphinQt2/DolphinQt2.vcxproj.filters @@ -60,12 +60,6 @@ - - Generated Files - - - Config - Generated Files @@ -106,6 +100,9 @@ Settings + + Settings + @@ -148,9 +145,6 @@ GameList - - Config - diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp index 92fb9b826d..bf35b867bc 100644 --- a/Source/Core/DolphinQt2/MainWindow.cpp +++ b/Source/Core/DolphinQt2/MainWindow.cpp @@ -22,7 +22,6 @@ #include "DolphinQt2/AboutDialog.h" #include "DolphinQt2/Config/ControllersWindow.h" -#include "DolphinQt2/Config/PathDialog.h" #include "DolphinQt2/Config/SettingsWindow.h" #include "DolphinQt2/Host.h" #include "DolphinQt2/MainWindow.h" @@ -82,7 +81,6 @@ void MainWindow::CreateComponents() m_game_list = new GameList(this); 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); } @@ -139,7 +137,6 @@ void MainWindow::ConnectToolBar() connect(m_tool_bar, &ToolBar::StopPressed, this, &MainWindow::Stop); connect(m_tool_bar, &ToolBar::FullScreenPressed, this, &MainWindow::FullScreen); 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); @@ -345,13 +342,6 @@ void MainWindow::HideRenderWidget() m_render_widget->hide(); } -void MainWindow::ShowPathsDialog() -{ - m_paths_dialog->show(); - m_paths_dialog->raise(); - m_paths_dialog->activateWindow(); -} - void MainWindow::ShowControllersWindow() { m_controllers_window->show(); diff --git a/Source/Core/DolphinQt2/MainWindow.h b/Source/Core/DolphinQt2/MainWindow.h index 0d7964cccb..5e089c2572 100644 --- a/Source/Core/DolphinQt2/MainWindow.h +++ b/Source/Core/DolphinQt2/MainWindow.h @@ -14,7 +14,6 @@ #include "DolphinQt2/RenderWidget.h" #include "DolphinQt2/ToolBar.h" -class PathDialog; class SettingsWindow; class ControllersWindow; @@ -71,7 +70,6 @@ private: void ShowRenderWidget(); void HideRenderWidget(); - void ShowPathsDialog(); void ShowSettingsWindow(); void ShowControllersWindow(); void ShowAboutDialog(); @@ -84,7 +82,6 @@ private: bool m_rendering_to_main; int m_state_slot = 1; - PathDialog* m_paths_dialog; ControllersWindow* m_controllers_window; SettingsWindow* m_settings_window; }; diff --git a/Source/Core/DolphinQt2/Config/PathDialog.cpp b/Source/Core/DolphinQt2/Settings/PathPane.cpp similarity index 79% rename from Source/Core/DolphinQt2/Config/PathDialog.cpp rename to Source/Core/DolphinQt2/Settings/PathPane.cpp index 0ca2e05004..afd58b535f 100644 --- a/Source/Core/DolphinQt2/Config/PathDialog.cpp +++ b/Source/Core/DolphinQt2/Settings/PathPane.cpp @@ -2,22 +2,18 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. -#include -#include -#include #include -#include +#include #include #include #include #include -#include #include -#include "DolphinQt2/Config/PathDialog.h" #include "DolphinQt2/Settings.h" +#include "DolphinQt2/Settings/PathPane.h" -PathDialog::PathDialog(QWidget* parent) : QDialog(parent) +PathPane::PathPane(QWidget* parent) : QWidget(parent) { setWindowTitle(tr("Paths")); @@ -25,14 +21,10 @@ PathDialog::PathDialog(QWidget* parent) : QDialog(parent) layout->addWidget(MakeGameFolderBox()); layout->addLayout(MakePathsLayout()); - QDialogButtonBox* ok_box = new QDialogButtonBox(QDialogButtonBox::Ok); - connect(ok_box, &QDialogButtonBox::accepted, this, &PathDialog::accept); - layout->addWidget(ok_box); - setLayout(layout); } -void PathDialog::Browse() +void PathPane::Browse() { QString dir = QFileDialog::getExistingDirectory(this, tr("Select a Directory"), QDir::currentPath()); @@ -40,7 +32,7 @@ void PathDialog::Browse() Settings::Instance().AddPath(dir); } -void PathDialog::BrowseDefaultGame() +void PathPane::BrowseDefaultGame() { QString file = QFileDialog::getOpenFileName( this, tr("Select a Game"), QDir::currentPath(), @@ -53,7 +45,7 @@ void PathDialog::BrowseDefaultGame() } } -void PathDialog::BrowseDVDRoot() +void PathPane::BrowseDVDRoot() { QString dir = QFileDialog::getExistingDirectory(this, tr("Select DVD Root"), QDir::currentPath()); if (!dir.isEmpty()) @@ -63,7 +55,7 @@ void PathDialog::BrowseDVDRoot() } } -void PathDialog::BrowseApploader() +void PathPane::BrowseApploader() { QString file = QFileDialog::getOpenFileName(this, tr("Select an Apploader"), QDir::currentPath(), tr("Apploaders (*.img)")); @@ -74,7 +66,7 @@ void PathDialog::BrowseApploader() } } -void PathDialog::BrowseWiiNAND() +void PathPane::BrowseWiiNAND() { QString dir = QFileDialog::getExistingDirectory(this, tr("Select Wii NAND Root"), QDir::currentPath()); @@ -85,7 +77,7 @@ void PathDialog::BrowseWiiNAND() } } -QGroupBox* PathDialog::MakeGameFolderBox() +QGroupBox* PathPane::MakeGameFolderBox() { QGroupBox* game_box = new QGroupBox(tr("Game Folders")); game_box->setMinimumSize(QSize(400, 250)); @@ -112,14 +104,14 @@ QGroupBox* PathDialog::MakeGameFolderBox() hlayout->addWidget(remove); vlayout->addLayout(hlayout); - connect(add, &QPushButton::clicked, this, &PathDialog::Browse); - connect(remove, &QPushButton::clicked, this, &PathDialog::RemovePath); + connect(add, &QPushButton::clicked, this, &PathPane::Browse); + connect(remove, &QPushButton::clicked, this, &PathPane::RemovePath); game_box->setLayout(vlayout); return game_box; } -QGridLayout* PathDialog::MakePathsLayout() +QGridLayout* PathPane::MakePathsLayout() { auto& settings = Settings::Instance(); QGridLayout* layout = new QGridLayout; @@ -129,7 +121,7 @@ QGridLayout* PathDialog::MakePathsLayout() connect(m_game_edit, &QLineEdit::editingFinished, [=, &settings] { settings.SetDefaultGame(m_game_edit->text()); }); QPushButton* game_open = new QPushButton; - connect(game_open, &QPushButton::clicked, this, &PathDialog::BrowseDefaultGame); + connect(game_open, &QPushButton::clicked, this, &PathPane::BrowseDefaultGame); layout->addWidget(new QLabel(tr("Default Game")), 0, 0); layout->addWidget(m_game_edit, 0, 1); layout->addWidget(game_open, 0, 2); @@ -138,7 +130,7 @@ QGridLayout* PathDialog::MakePathsLayout() connect(m_dvd_edit, &QLineEdit::editingFinished, [=, &settings] { settings.SetDVDRoot(m_dvd_edit->text()); }); QPushButton* dvd_open = new QPushButton; - connect(dvd_open, &QPushButton::clicked, this, &PathDialog::BrowseDVDRoot); + connect(dvd_open, &QPushButton::clicked, this, &PathPane::BrowseDVDRoot); layout->addWidget(new QLabel(tr("DVD Root")), 1, 0); layout->addWidget(m_dvd_edit, 1, 1); layout->addWidget(dvd_open, 1, 2); @@ -147,7 +139,7 @@ QGridLayout* PathDialog::MakePathsLayout() connect(m_app_edit, &QLineEdit::editingFinished, [=, &settings] { settings.SetApploader(m_app_edit->text()); }); QPushButton* app_open = new QPushButton; - connect(app_open, &QPushButton::clicked, this, &PathDialog::BrowseApploader); + connect(app_open, &QPushButton::clicked, this, &PathPane::BrowseApploader); layout->addWidget(new QLabel(tr("Apploader")), 2, 0); layout->addWidget(m_app_edit, 2, 1); layout->addWidget(app_open, 2, 2); @@ -156,7 +148,7 @@ QGridLayout* PathDialog::MakePathsLayout() connect(m_nand_edit, &QLineEdit::editingFinished, [=, &settings] { settings.SetWiiNAND(m_nand_edit->text()); }); QPushButton* nand_open = new QPushButton; - connect(nand_open, &QPushButton::clicked, this, &PathDialog::BrowseWiiNAND); + connect(nand_open, &QPushButton::clicked, this, &PathPane::BrowseWiiNAND); layout->addWidget(new QLabel(tr("Wii NAND Root")), 3, 0); layout->addWidget(m_nand_edit, 3, 1); layout->addWidget(nand_open, 3, 2); @@ -164,7 +156,7 @@ QGridLayout* PathDialog::MakePathsLayout() return layout; } -void PathDialog::RemovePath() +void PathPane::RemovePath() { auto item = m_path_list->currentItem(); if (!item) diff --git a/Source/Core/DolphinQt2/Config/PathDialog.h b/Source/Core/DolphinQt2/Settings/PathPane.h similarity index 68% rename from Source/Core/DolphinQt2/Config/PathDialog.h rename to Source/Core/DolphinQt2/Settings/PathPane.h index 9c8f7fbc5f..753c5001c4 100644 --- a/Source/Core/DolphinQt2/Config/PathDialog.h +++ b/Source/Core/DolphinQt2/Settings/PathPane.h @@ -4,26 +4,24 @@ #pragma once -#include -#include -#include -#include -#include +#include -class PathDialog final : public QDialog +class QGridLayout; +class QGroupBox; +class QLineEdit; +class QListWidget; + +class PathPane final : public QWidget { - Q_OBJECT public: - explicit PathDialog(QWidget* parent = nullptr); + explicit PathPane(QWidget* parent = nullptr); -public slots: +private: void Browse(); void BrowseDefaultGame(); void BrowseDVDRoot(); void BrowseApploader(); void BrowseWiiNAND(); - -private: QGroupBox* MakeGameFolderBox(); QGridLayout* MakePathsLayout(); void RemovePath(); diff --git a/Source/Core/DolphinQt2/ToolBar.cpp b/Source/Core/DolphinQt2/ToolBar.cpp index adb344a2a3..d1e075e500 100644 --- a/Source/Core/DolphinQt2/ToolBar.cpp +++ b/Source/Core/DolphinQt2/ToolBar.cpp @@ -79,9 +79,6 @@ void ToolBar::MakeActions() addSeparator(); - m_paths_action = addAction(tr("Paths"), this, SIGNAL(PathsPressed())); - widgetForAction(m_paths_action)->setMinimumWidth(button_width); - m_config_action = addAction(tr("Settings"), this, SIGNAL(SettingsPressed())); widgetForAction(m_config_action)->setMinimumWidth(button_width); @@ -93,7 +90,6 @@ void ToolBar::MakeActions() void ToolBar::UpdateIcons() { m_open_action->setIcon(Resources::GetScaledThemeIcon("open")); - m_paths_action->setIcon(Resources::GetScaledThemeIcon("browse")); m_play_action->setIcon(Resources::GetScaledThemeIcon("play")); m_pause_action->setIcon(Resources::GetScaledThemeIcon("pause")); m_stop_action->setIcon(Resources::GetScaledThemeIcon("stop")); diff --git a/Source/Core/DolphinQt2/ToolBar.h b/Source/Core/DolphinQt2/ToolBar.h index 275afb4038..1150a26f81 100644 --- a/Source/Core/DolphinQt2/ToolBar.h +++ b/Source/Core/DolphinQt2/ToolBar.h @@ -28,7 +28,6 @@ signals: void FullScreenPressed(); void ScreenShotPressed(); - void PathsPressed(); void SettingsPressed(); void ControllersPressed(); @@ -42,7 +41,6 @@ private: QAction* m_stop_action; QAction* m_fullscreen_action; QAction* m_screenshot_action; - QAction* m_paths_action; QAction* m_config_action; QAction* m_controllers_action; };