mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-14 18:58:36 +12:00
Move check_microphone_permissions to emu callbacks
This commit is contained in:
parent
d33d3a9f57
commit
87db82cacd
5 changed files with 34 additions and 33 deletions
|
@ -86,11 +86,6 @@
|
|||
#include <QEventLoop>
|
||||
#include <QTimer>
|
||||
|
||||
#if QT_CONFIG(permissions)
|
||||
#include <QGuiApplication>
|
||||
#include <QPermissions>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "raw_mouse_settings_dialog.h"
|
||||
#endif
|
||||
|
@ -168,32 +163,6 @@ extern void qt_events_aware_op(int repeat_duration_ms, std::function<bool()> wra
|
|||
}
|
||||
}
|
||||
|
||||
extern void check_microphone_permissions()
|
||||
{
|
||||
#if QT_CONFIG(permissions)
|
||||
Emu.BlockingCallFromMainThread([]()
|
||||
{
|
||||
const QMicrophonePermission permission;
|
||||
switch (qApp->checkPermission(permission))
|
||||
{
|
||||
case Qt::PermissionStatus::Undetermined:
|
||||
gui_log.notice("Requesting microphone permission");
|
||||
qApp->requestPermission(permission, []()
|
||||
{
|
||||
check_microphone_permissions();
|
||||
});
|
||||
break;
|
||||
case Qt::PermissionStatus::Denied:
|
||||
gui_log.error("RPCS3 has no permissions to access microphones on this device.");
|
||||
break;
|
||||
case Qt::PermissionStatus::Granted:
|
||||
gui_log.notice("Microphone permission granted");
|
||||
break;
|
||||
}
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
main_window::main_window(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, std::shared_ptr<persistent_settings> persistent_settings, QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
, ui(new Ui::main_window)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue