mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-07-11 01:24:01 +02:00
RMG: don't allow drag & drop events while ROM is being opened
This commit is contained in:
@@ -680,7 +680,7 @@ void MainWindow::launchEmulationThread(QString cartRom, QString address, int por
|
||||
this->launchEmulationThread(cartRom, "", false, -1, true);
|
||||
}
|
||||
|
||||
void MainWindow::launchEmulationThread(QString cartRom, QString diskRom, bool refreshRomListAfterEmulation, int slot, bool netplay)
|
||||
void MainWindow::launchEmulationThread(QString cartRom, QString diskRom, bool refreshRomListAfterEmulation, int slot, bool netplay, bool dragdrop)
|
||||
{
|
||||
#ifdef NETPLAY
|
||||
if (this->netplaySessionDialog != nullptr && !netplay)
|
||||
@@ -690,7 +690,7 @@ void MainWindow::launchEmulationThread(QString cartRom, QString diskRom, bool re
|
||||
}
|
||||
#endif // NETPLAY
|
||||
|
||||
if (this->emulationThread->isRunning())
|
||||
if (!dragdrop && this->emulationThread->isRunning())
|
||||
{
|
||||
this->showErrorMessage("EmulationThread::run Failed", "Cannot start emulation when emulation is already running or being started");
|
||||
return;
|
||||
@@ -1435,6 +1435,13 @@ void MainWindow::on_EventFilter_FileDropped(QDropEvent *event)
|
||||
bool refreshRomList = false;
|
||||
QString file;
|
||||
|
||||
// when we're still opening the ROM while emulation is running,
|
||||
// ignore the event
|
||||
if (this->emulationThread->isRunning() && !CoreHasRomOpen())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (inEmulation && confirmDragDrop)
|
||||
{
|
||||
QMessageBox::StandardButton reply = QMessageBox::question(this, "",
|
||||
@@ -1460,7 +1467,7 @@ void MainWindow::on_EventFilter_FileDropped(QDropEvent *event)
|
||||
refreshRomList = this->ui_RefreshRomListAfterEmulation;
|
||||
}
|
||||
|
||||
this->launchEmulationThread(file, "", refreshRomList);
|
||||
this->launchEmulationThread(file, "", refreshRomList, -1, false, true);
|
||||
#endif // DRAG_DROP
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ class MainWindow : public QMainWindow, private Ui::MainWindow
|
||||
void initializeEmulationThread(void);
|
||||
void connectEmulationThreadSignals(void);
|
||||
void launchEmulationThread(QString cartRom, QString address, int port, int player);
|
||||
void launchEmulationThread(QString cartRom, QString diskRom = "", bool refreshRomListAfterEmulation = false, int slot = -1, bool netplay = false);
|
||||
void launchEmulationThread(QString cartRom, QString diskRom = "", bool refreshRomListAfterEmulation = false, int slot = -1, bool netplay = false, bool dragdrop = false);
|
||||
|
||||
QString getSaveStateSlotDateTimeText(QAction* action);
|
||||
QString getSaveStateSlotText(QAction* action, int slot);
|
||||
|
||||
Reference in New Issue
Block a user