mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 04:08:55 +00:00
QtGui: Handle file open events
Handle file open events received by Dolphin. This allows Wii/GC files to be opened when double-clicked or dropped on the Dolphin application on macOS.
This commit is contained in:
parent
c34388f75b
commit
2f63b71bde
5 changed files with 56 additions and 0 deletions
|
@ -84,6 +84,7 @@
|
|||
#include "DolphinQt/NetPlay/NetPlayBrowser.h"
|
||||
#include "DolphinQt/NetPlay/NetPlayDialog.h"
|
||||
#include "DolphinQt/NetPlay/NetPlaySetupDialog.h"
|
||||
#include "DolphinQt/QtUtils/FileOpenEventFilter.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/QtUtils/QueueOnObject.h"
|
||||
#include "DolphinQt/QtUtils/RunOnObject.h"
|
||||
|
@ -336,6 +337,12 @@ void MainWindow::InitCoreCallbacks()
|
|||
});
|
||||
installEventFilter(this);
|
||||
m_render_widget->installEventFilter(this);
|
||||
|
||||
// Handle file open events
|
||||
auto* filter = new FileOpenEventFilter(QGuiApplication::instance());
|
||||
connect(filter, &FileOpenEventFilter::fileOpened, this, [=](const QString& file_name) {
|
||||
StartGame(BootParameters::GenerateFromFile(file_name.toStdString()));
|
||||
});
|
||||
}
|
||||
|
||||
static void InstallHotkeyFilter(QWidget* dialog)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue