mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-11-17 19:24:05 +01:00
RMG: add 'Open ROM Directory' to ROM Browser
This commit is contained in:
1 parent
bf5b3d3c99
commit
6aabc4eca8
2 files changed
+21
-2
No files matched your search
@@ -20,6 +20,7 @@
|
||||
#include <vector>
|
||||
#include <QList>
|
||||
#include <QScrollBar>
|
||||
#include <QDesktopServices>
|
||||
|
||||
using namespace UserInterface::Widget;
|
||||
|
||||
@@ -145,6 +146,7 @@ RomBrowserWidget::RomBrowserWidget(QWidget *parent) : QStackedWidget(parent)
|
||||
this->action_PlayGame = new QAction(this);
|
||||
this->action_PlayGameWith = new QAction(this);
|
||||
this->action_RefreshRomList = new QAction(this);
|
||||
this->action_OpenRomDirectory = new QAction(this);
|
||||
this->action_ChangeRomDirectory = new QAction(this);
|
||||
this->action_RomInformation = new QAction(this);
|
||||
this->action_EditGameSettings = new QAction(this);
|
||||
@@ -154,6 +156,7 @@ RomBrowserWidget::RomBrowserWidget(QWidget *parent) : QStackedWidget(parent)
|
||||
this->action_PlayGame->setText("Play Game");
|
||||
this->action_PlayGameWith->setText("Play Game with Disk");
|
||||
this->action_RefreshRomList->setText("Refresh ROM List");
|
||||
this->action_OpenRomDirectory->setText("Open ROM Directory");
|
||||
this->action_ChangeRomDirectory->setText("Change ROM Directory...");
|
||||
this->action_RomInformation->setText("ROM Information");
|
||||
this->action_EditGameSettings->setText("Edit Game Settings");
|
||||
@@ -163,8 +166,8 @@ RomBrowserWidget::RomBrowserWidget(QWidget *parent) : QStackedWidget(parent)
|
||||
connect(this->action_PlayGame, &QAction::triggered, this, &RomBrowserWidget::on_Action_PlayGame);
|
||||
connect(this->action_PlayGameWith, &QAction::triggered, this, &RomBrowserWidget::on_Action_PlayGameWith);
|
||||
connect(this->action_RefreshRomList, &QAction::triggered, this, &RomBrowserWidget::on_Action_RefreshRomList);
|
||||
connect(this->action_ChangeRomDirectory, &QAction::triggered, this,
|
||||
&RomBrowserWidget::on_Action_ChangeRomDirectory);
|
||||
connect(this->action_OpenRomDirectory, &QAction::triggered, this, &RomBrowserWidget::on_Action_OpenRomDirectory);
|
||||
connect(this->action_ChangeRomDirectory, &QAction::triggered, this, &RomBrowserWidget::on_Action_ChangeRomDirectory);
|
||||
connect(this->action_RomInformation, &QAction::triggered, this, &RomBrowserWidget::on_Action_RomInformation);
|
||||
connect(this->action_EditGameSettings, &QAction::triggered, this, &RomBrowserWidget::on_Action_EditGameSettings);
|
||||
connect(this->action_EditCheats, &QAction::triggered, this, &RomBrowserWidget::on_Action_EditCheats);
|
||||
@@ -177,6 +180,8 @@ RomBrowserWidget::RomBrowserWidget(QWidget *parent) : QStackedWidget(parent)
|
||||
this->contextMenu->addAction(this->action_PlayGameWith);
|
||||
this->contextMenu->addSeparator();
|
||||
this->contextMenu->addAction(this->action_RefreshRomList);
|
||||
this->contextMenu->addSeparator();
|
||||
this->contextMenu->addAction(this->action_OpenRomDirectory);
|
||||
this->contextMenu->addAction(this->action_ChangeRomDirectory);
|
||||
this->contextMenu->addSeparator();
|
||||
this->contextMenu->addAction(this->action_RomInformation);
|
||||
@@ -634,6 +639,18 @@ void RomBrowserWidget::on_Action_RefreshRomList(void)
|
||||
this->RefreshRomList();
|
||||
}
|
||||
|
||||
void RomBrowserWidget::on_Action_OpenRomDirectory(void)
|
||||
{
|
||||
QString directory = QString::fromStdString(CoreSettingsGetStringValue(SettingsID::RomBrowser_Directory));
|
||||
|
||||
if (directory.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QDesktopServices::openUrl(QUrl(directory));
|
||||
}
|
||||
|
||||
void RomBrowserWidget::on_Action_ChangeRomDirectory(void)
|
||||
{
|
||||
emit this->ChangeRomDirectory();
|
||||
|
||||
@@ -74,6 +74,7 @@ class RomBrowserWidget : public QStackedWidget
|
||||
QAction* action_PlayGame;
|
||||
QAction* action_PlayGameWith;
|
||||
QAction* action_RefreshRomList;
|
||||
QAction* action_OpenRomDirectory;
|
||||
QAction* action_ChangeRomDirectory;
|
||||
QAction* action_RomInformation;
|
||||
QAction* action_EditGameSettings;
|
||||
@@ -112,6 +113,7 @@ class RomBrowserWidget : public QStackedWidget
|
||||
void on_Action_PlayGame(void);
|
||||
void on_Action_PlayGameWith(void);
|
||||
void on_Action_RefreshRomList(void);
|
||||
void on_Action_OpenRomDirectory(void);
|
||||
void on_Action_ChangeRomDirectory(void);
|
||||
void on_Action_RomInformation(void);
|
||||
void on_Action_EditGameSettings(void);
|
||||
|
||||
Reference in new issue
Block a user