mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-11 09:18:40 +12:00
sceNp: implement sceNpBasicAbortGui
This commit is contained in:
parent
e13a671f86
commit
8bc3a39586
7 changed files with 84 additions and 5 deletions
|
@ -2,7 +2,11 @@
|
|||
#include <QHBoxLayout>
|
||||
#include <QPushButton>
|
||||
#include <QMessageBox>
|
||||
#include <QTimer>
|
||||
|
||||
#include "sendmessage_dialog_frame.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/System.h"
|
||||
|
||||
#include "util/logs.hpp"
|
||||
|
||||
|
@ -91,6 +95,31 @@ error_code sendmessage_dialog_frame::Exec(message_data& msg_data, std::set<std::
|
|||
}
|
||||
}
|
||||
|
||||
auto& nps = g_fxo->get<np_state>();
|
||||
|
||||
QTimer timer;
|
||||
connect(&timer, &QTimer::timeout, this, [this, &nps, &timer]()
|
||||
{
|
||||
bool abort = Emu.IsStopped();
|
||||
|
||||
if (!abort && nps.abort_gui_flag.exchange(false))
|
||||
{
|
||||
sendmessage_dlg_log.warning("Aborted by sceNp!");
|
||||
abort = true;
|
||||
}
|
||||
|
||||
if (abort)
|
||||
{
|
||||
if (m_dialog)
|
||||
{
|
||||
m_dialog->close();
|
||||
}
|
||||
|
||||
timer.stop();
|
||||
}
|
||||
});
|
||||
timer.start(10ms);
|
||||
|
||||
m_dialog->exec();
|
||||
|
||||
m_rpcn->remove_friend_cb(sendmessage_friend_callback, this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue