mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 12:03:18 +02:00
misc: deploy and use ringtones on macOS
Gitlab: #1619 Change-Id: I7c19dfa4556f4f9dae827a1d0c967c9ebce7cc86
This commit is contained in:
parent
df3e76a1cf
commit
3225f90ce8
2 changed files with 27 additions and 4 deletions
|
@ -819,12 +819,20 @@ else()
|
||||||
"-framework Security"
|
"-framework Security"
|
||||||
compression
|
compression
|
||||||
resolv
|
resolv
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(APP_CONTAINER "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app/Contents")
|
||||||
|
|
||||||
|
# ringtones. Copy the entire directory to the app bundle.
|
||||||
|
# daemon/ringtones -> Jami.app/Contents/Resources/ringtones
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
|
${DAEMON_DIR}/ringtones
|
||||||
|
${APP_CONTAINER}/Resources/ringtones
|
||||||
|
)
|
||||||
|
|
||||||
# translations
|
# translations
|
||||||
if(Qt${QT_VERSION_MAJOR}LinguistTools_FOUND)
|
if(Qt${QT_VERSION_MAJOR}LinguistTools_FOUND)
|
||||||
set(APP_CONTAINER
|
|
||||||
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app/Contents")
|
|
||||||
file(GLOB TS_FILES ${PROJECT_SOURCE_DIR}/translations/*.ts)
|
file(GLOB TS_FILES ${PROJECT_SOURCE_DIR}/translations/*.ts)
|
||||||
|
|
||||||
# Generate lproj folders.
|
# Generate lproj folders.
|
||||||
|
@ -864,7 +872,6 @@ else()
|
||||||
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME TRUE)
|
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME TRUE)
|
||||||
endif()
|
endif()
|
||||||
if(DEPLOY)
|
if(DEPLOY)
|
||||||
message("Qt deploying in dir " ${QML_SRC_DIR})
|
|
||||||
execute_process(COMMAND
|
execute_process(COMMAND
|
||||||
"${CMAKE_PREFIX_PATH}/bin/macdeployqt"
|
"${CMAKE_PREFIX_PATH}/bin/macdeployqt"
|
||||||
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app"
|
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app"
|
||||||
|
|
|
@ -24,11 +24,27 @@
|
||||||
#ifdef ENABLE_VIDEO
|
#ifdef ENABLE_VIDEO
|
||||||
#include "videomanager.h"
|
#include "videomanager.h"
|
||||||
#endif // ENABLE_VIDEO
|
#endif // ENABLE_VIDEO
|
||||||
|
#include <QDir>
|
||||||
|
|
||||||
static int ringFlags = 0;
|
static int ringFlags = 0;
|
||||||
|
|
||||||
InstanceManagerInterface::InstanceManagerInterface(bool muteDaemon)
|
InstanceManagerInterface::InstanceManagerInterface(bool muteDaemon)
|
||||||
{
|
{
|
||||||
|
// The following code is used to set the resource directory for libjami, and is required
|
||||||
|
// for the ringtones to work properly on platforms where the resource directory path is not
|
||||||
|
// fixed (e.g. macOS).
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
|
// On Windows, the resource directory is set to the application's directory.
|
||||||
|
libjami::setResourceDirPath(QCoreApplication::applicationDirPath().toStdString());
|
||||||
|
#elif defined(Q_OS_MAC)
|
||||||
|
// On macOS, the resource directory is set to the application bundle's path + "/Resources".
|
||||||
|
// The application bundle's path is the application's directory.
|
||||||
|
QDir execDir(qApp->applicationDirPath()); // executable directory points to the app bundle + /Contents/MacOS/
|
||||||
|
execDir.cdUp(); // navigate up to add resources to /Contents
|
||||||
|
auto resourceDir = execDir.absolutePath() + QDir::separator() + "Resources";
|
||||||
|
libjami::setResourceDirPath(resourceDir.toStdString());
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace std::placeholders;
|
using namespace std::placeholders;
|
||||||
|
|
||||||
using std::bind;
|
using std::bind;
|
||||||
|
|
Loading…
Add table
Reference in a new issue