diff --git a/Source/Core/DolphinQt/Config/GraphicsModListWidget.cpp b/Source/Core/DolphinQt/Config/GraphicsModListWidget.cpp index ac01158b2f..eaa8d4a05b 100644 --- a/Source/Core/DolphinQt/Config/GraphicsModListWidget.cpp +++ b/Source/Core/DolphinQt/Config/GraphicsModListWidget.cpp @@ -4,15 +4,18 @@ #include "DolphinQt/Config/GraphicsModListWidget.h" #include +#include #include #include #include #include +#include #include #include #include +#include "Common/FileUtil.h" #include "Core/ConfigManager.h" #include "Core/Core.h" #include "DolphinQt/Config/GraphicsModWarningWidget.h" @@ -59,9 +62,10 @@ void GraphicsModListWidget::CreateWidgets() m_mod_list->setSelectionRectVisible(true); m_mod_list->setDragDropMode(QAbstractItemView::InternalMove); + m_open_directory_button = new QPushButton(tr("Open Directory...")); m_refresh = new QPushButton(tr("&Refresh List")); QHBoxLayout* hlayout = new QHBoxLayout; - hlayout->addStretch(); + hlayout->addWidget(m_open_directory_button); hlayout->addWidget(m_refresh); left_v_layout->addWidget(m_mod_list); @@ -99,6 +103,9 @@ void GraphicsModListWidget::ConnectWidgets() connect(m_mod_list->model(), &QAbstractItemModel::rowsMoved, this, &GraphicsModListWidget::SaveModList); + connect(m_open_directory_button, &QPushButton::clicked, this, + &GraphicsModListWidget::OpenGraphicsModDir); + connect(m_refresh, &QPushButton::clicked, this, &GraphicsModListWidget::RefreshModList); connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, @@ -274,3 +281,9 @@ void GraphicsModListWidget::CalculateGameRunning(Core::State state) m_loaded_game_is_running = state == Core::State::Running ? m_game_id == SConfig::GetInstance().GetGameID() : false; } + +void GraphicsModListWidget::OpenGraphicsModDir() +{ + QDesktopServices::openUrl( + QUrl::fromLocalFile(QString::fromStdString(File::GetUserPath(D_GRAPHICSMOD_IDX)))); +} diff --git a/Source/Core/DolphinQt/Config/GraphicsModListWidget.h b/Source/Core/DolphinQt/Config/GraphicsModListWidget.h index b2ea082f12..970a160980 100644 --- a/Source/Core/DolphinQt/Config/GraphicsModListWidget.h +++ b/Source/Core/DolphinQt/Config/GraphicsModListWidget.h @@ -58,6 +58,8 @@ private: void ClearLayoutRecursively(QLayout* layout); + void OpenGraphicsModDir(); + void CalculateGameRunning(Core::State state); bool m_loaded_game_is_running = false; bool m_needs_save = false; @@ -67,6 +69,7 @@ private: QLabel* m_selected_mod_name; QVBoxLayout* m_mod_meta_layout; + QPushButton* m_open_directory_button; QPushButton* m_refresh; GraphicsModWarningWidget* m_warning;