Merge pull request #808 from CookiePLMonster/fix-properties-dialog

Give GamePropertiesDialog a parent
This commit is contained in:
Connor McLaughlin 2020-08-30 00:02:12 +10:00 committed by GitHub
commit 3d3e552266
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -153,9 +153,9 @@ void GamePropertiesDialog::setupAdditionalUi()
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
} }
void GamePropertiesDialog::showForEntry(QtHostInterface* host_interface, const GameListEntry* ge) void GamePropertiesDialog::showForEntry(QtHostInterface* host_interface, const GameListEntry* ge, QWidget* parent)
{ {
GamePropertiesDialog* gpd = new GamePropertiesDialog(host_interface); GamePropertiesDialog* gpd = new GamePropertiesDialog(host_interface, parent);
gpd->populate(ge); gpd->populate(ge);
gpd->show(); gpd->show();
gpd->onResize(); gpd->onResize();

View file

@ -17,7 +17,7 @@ public:
GamePropertiesDialog(QtHostInterface* host_interface, QWidget* parent = nullptr); GamePropertiesDialog(QtHostInterface* host_interface, QWidget* parent = nullptr);
~GamePropertiesDialog(); ~GamePropertiesDialog();
static void showForEntry(QtHostInterface* host_interface, const GameListEntry* ge); static void showForEntry(QtHostInterface* host_interface, const GameListEntry* ge, QWidget* parent);
public Q_SLOTS: public Q_SLOTS:
void clear(); void clear();

View file

@ -406,7 +406,7 @@ void MainWindow::onGameListContextMenuRequested(const QPoint& point, const GameL
if (entry) if (entry)
{ {
connect(menu.addAction(tr("Properties...")), &QAction::triggered, connect(menu.addAction(tr("Properties...")), &QAction::triggered,
[this, entry]() { GamePropertiesDialog::showForEntry(m_host_interface, entry); }); [this, entry]() { GamePropertiesDialog::showForEntry(m_host_interface, entry, this); });
connect(menu.addAction(tr("Open Containing Directory...")), &QAction::triggered, [this, entry]() { connect(menu.addAction(tr("Open Containing Directory...")), &QAction::triggered, [this, entry]() {
const QFileInfo fi(QString::fromStdString(entry->path)); const QFileInfo fi(QString::fromStdString(entry->path));