Merge pull request #7212 from Techjar/netplay-unparent-dialog

Qt: Unparent NetPlay dialog from main window
This commit is contained in:
spycrab 2018-07-05 22:49:58 +02:00 committed by GitHub
commit 14317c8a0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -156,6 +156,7 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters) : QMainW
MainWindow::~MainWindow() MainWindow::~MainWindow()
{ {
m_render_widget->deleteLater(); m_render_widget->deleteLater();
m_netplay_dialog->deleteLater();
ShutdownControllers(); ShutdownControllers();
QSettings& settings = Settings::GetQSettings(); QSettings& settings = Settings::GetQSettings();
@ -1037,7 +1038,7 @@ void MainWindow::BootWiiSystemMenu()
void MainWindow::NetPlayInit() void MainWindow::NetPlayInit()
{ {
m_netplay_setup_dialog = new NetPlaySetupDialog(this); m_netplay_setup_dialog = new NetPlaySetupDialog(this);
m_netplay_dialog = new NetPlayDialog(this); m_netplay_dialog = new NetPlayDialog;
connect(m_netplay_dialog, &NetPlayDialog::Boot, this, connect(m_netplay_dialog, &NetPlayDialog::Boot, this,
[this](const QString& path) { StartGame(path); }); [this](const QString& path) { StartGame(path); });

View File

@ -42,6 +42,7 @@
#include "DolphinQt2/NetPlay/PadMappingDialog.h" #include "DolphinQt2/NetPlay/PadMappingDialog.h"
#include "DolphinQt2/QtUtils/QueueOnObject.h" #include "DolphinQt2/QtUtils/QueueOnObject.h"
#include "DolphinQt2/QtUtils/RunOnObject.h" #include "DolphinQt2/QtUtils/RunOnObject.h"
#include "DolphinQt2/Resources.h"
#include "DolphinQt2/Settings.h" #include "DolphinQt2/Settings.h"
#include "VideoCommon/VideoConfig.h" #include "VideoCommon/VideoConfig.h"
@ -52,6 +53,7 @@ NetPlayDialog::NetPlayDialog(QWidget* parent)
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("NetPlay")); setWindowTitle(tr("NetPlay"));
setWindowIcon(Resources::GetAppIcon());
m_pad_mapping = new PadMappingDialog(this); m_pad_mapping = new PadMappingDialog(this);
m_md5_dialog = new MD5Dialog(this); m_md5_dialog = new MD5Dialog(this);

View File

@ -30,7 +30,7 @@ class NetPlayDialog : public QDialog, public NetPlayUI
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit NetPlayDialog(QWidget* parent); explicit NetPlayDialog(QWidget* parent = nullptr);
~NetPlayDialog(); ~NetPlayDialog();
void show(std::string nickname, bool use_traversal); void show(std::string nickname, bool use_traversal);