mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2026-06-04 14:35:05 -06:00
macos: Add warning dialog when launching azahar executable directly
This commit is contained in:
parent
6715959382
commit
56a563c239
@ -116,6 +116,7 @@
|
|||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include "common/apple_authorization.h"
|
#include "common/apple_authorization.h"
|
||||||
|
#include "common/apple_utils.h"
|
||||||
Q_IMPORT_PLUGIN(QDarwinCameraPermissionPlugin);
|
Q_IMPORT_PLUGIN(QDarwinCameraPermissionPlugin);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -424,6 +425,19 @@ GMainWindow::GMainWindow(Core::System& system_)
|
|||||||
|
|
||||||
show();
|
show();
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
if (AppleUtils::IsRunningFromTerminal()) {
|
||||||
|
QMessageBox::warning(
|
||||||
|
this, tr("Warning"),
|
||||||
|
tr("The `azahar` executable is being run directly rather than via the Azahar.app "
|
||||||
|
"bundle.\n\n"
|
||||||
|
"When run this way, the app may be missing certain functionality such as camera "
|
||||||
|
"emulation.\n\n"
|
||||||
|
"It is recommended to instead run Azahar using the `open` command, e.g.:\n"
|
||||||
|
"`open ./Azahar.app`"));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_QT_UPDATE_CHECKER
|
#ifdef ENABLE_QT_UPDATE_CHECKER
|
||||||
if (UISettings::values.check_for_update_on_start) {
|
if (UISettings::values.check_for_update_on_start) {
|
||||||
update_future = QtConcurrent::run([]() -> QString {
|
update_future = QtConcurrent::run([]() -> QString {
|
||||||
|
|||||||
@ -120,6 +120,7 @@ if (APPLE AND NOT ENABLE_LIBRETRO)
|
|||||||
target_sources(citra_common PUBLIC
|
target_sources(citra_common PUBLIC
|
||||||
apple_authorization.h
|
apple_authorization.h
|
||||||
apple_authorization.cpp
|
apple_authorization.cpp
|
||||||
|
apple_utils.cpp
|
||||||
apple_utils.h
|
apple_utils.h
|
||||||
apple_utils.mm
|
apple_utils.mm
|
||||||
)
|
)
|
||||||
|
|||||||
13
src/common/apple_utils.cpp
Normal file
13
src/common/apple_utils.cpp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
namespace AppleUtils {
|
||||||
|
|
||||||
|
bool IsRunningFromTerminal() {
|
||||||
|
return (getppid() != 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace AppleUtils
|
||||||
@ -6,5 +6,6 @@ namespace AppleUtils {
|
|||||||
|
|
||||||
float GetRefreshRate();
|
float GetRefreshRate();
|
||||||
int IsLowPowerModeEnabled();
|
int IsLowPowerModeEnabled();
|
||||||
|
bool IsRunningFromTerminal();
|
||||||
|
|
||||||
} // namespace AppleUtils
|
} // namespace AppleUtils
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user