Merge pull request #5786 from vitor-k/macos-perms
Request Camera Permission on MacOS
This commit is contained in:
commit
e3804a4c06
9 changed files with 220 additions and 5 deletions
|
@ -15,6 +15,10 @@
|
|||
#include "core/settings.h"
|
||||
#include "ui_configure_audio.h"
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include "citra_qt/macos_authorization.h"
|
||||
#endif
|
||||
|
||||
constexpr int DEFAULT_INPUT_DEVICE_INDEX = 0;
|
||||
|
||||
ConfigureAudio::ConfigureAudio(QWidget* parent)
|
||||
|
@ -148,6 +152,11 @@ void ConfigureAudio::UpdateAudioOutputDevices(int sink_index) {
|
|||
}
|
||||
|
||||
void ConfigureAudio::UpdateAudioInputDevices(int index) {
|
||||
#if defined(__APPLE__)
|
||||
if (index == 1) {
|
||||
AppleAuthorization::CheckAuthorizationForMicrophone();
|
||||
}
|
||||
#endif
|
||||
if (Settings::values.mic_input_device != Frontend::Mic::default_device_name) {
|
||||
ui->input_device_combo_box->setCurrentText(
|
||||
QString::fromStdString(Settings::values.mic_input_device));
|
||||
|
|
|
@ -17,6 +17,10 @@
|
|||
#include "core/settings.h"
|
||||
#include "ui_configure_camera.h"
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include "citra_qt/macos_authorization.h"
|
||||
#endif
|
||||
|
||||
const std::array<std::string, 3> ConfigureCamera::Implementations = {
|
||||
"blank", /* Blank */
|
||||
"image", /* Image */
|
||||
|
@ -46,9 +50,15 @@ ConfigureCamera::~ConfigureCamera() {
|
|||
|
||||
void ConfigureCamera::ConnectEvents() {
|
||||
connect(ui->image_source,
|
||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this] {
|
||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||
[this](int index) {
|
||||
StopPreviewing();
|
||||
UpdateImageSourceUI();
|
||||
#if defined(__APPLE__)
|
||||
if (index == 2) {
|
||||
AppleAuthorization::CheckAuthorizationForCamera();
|
||||
}
|
||||
#endif
|
||||
});
|
||||
connect(ui->camera_selection,
|
||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue