Add missing configuration for Windows desktop notifications. Part of #6728
This commit is contained in:
parent
5f2958ba9d
commit
bf123f308a
|
@ -10,7 +10,11 @@ include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
|
||||||
|
|
||||||
set(SN_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/SnoreNotify_ep-prefix/src/SnoreNotify_ep)
|
set(SN_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/SnoreNotify_ep-prefix/src/SnoreNotify_ep)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set(SnoreNotify_CMAKE_ARGS -DMINGW=1 -DBUILD_osxnotificationcenter=OFF -DBUILD_sound=OFF -DBUILD_speech=OFF -DBUILD_toasty=OFF -DBUILD_snoretoast=OFF
|
set(SnoreNotifyWindowsToast_STATIC_LIB ${SN_PREFIX}/lib${SN_LIBPATHSUFFIX}/${CMAKE_STATIC_LIBRARY_PREFIX}snore_backend_windowstoast${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||||
|
|
||||||
|
set(SnoreNotify_LIBS ${SnoreNotifyWindowsToast_STATIC_LIB})
|
||||||
|
|
||||||
|
set(SnoreNotify_CMAKE_ARGS -DMINGW=1 -DBUILD_osxnotificationcenter=OFF -DBUILD_sound=OFF -DBUILD_speech=OFF -DBUILD_toasty=OFF
|
||||||
-DBUILD_freedesktop_backend=OFF -DBUILD_snarl=OFF -DBUILD_growl=OFF -DBUILD_trayicon=OFF -DBUILD_pushover_backend=OFF)
|
-DBUILD_freedesktop_backend=OFF -DBUILD_snarl=OFF -DBUILD_growl=OFF -DBUILD_trayicon=OFF -DBUILD_pushover_backend=OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -66,7 +70,7 @@ ExternalProject_Add(SnoreNotify_ep
|
||||||
GIT_REPOSITORY https://github.com/status-im/snorenotify.git
|
GIT_REPOSITORY https://github.com/status-im/snorenotify.git
|
||||||
CMAKE_ARGS ${SnoreNotify_CMAKE_ARGS}
|
CMAKE_ARGS ${SnoreNotify_CMAKE_ARGS}
|
||||||
BUILD_BYPRODUCTS ${SnoreNotify_STATIC_LIB} ${SnoreNotify_LIBS} ${SnoreNotifyBackend_STATIC_LIB}
|
BUILD_BYPRODUCTS ${SnoreNotify_STATIC_LIB} ${SnoreNotify_LIBS} ${SnoreNotifyBackend_STATIC_LIB}
|
||||||
${SnoreNotifyBackendSettings_STATIC_LIB} ${SnoreNotifySettings_STATIC_LIB}
|
${SnoreNotifyBackendSettings_STATIC_LIB} ${SnoreNotifySettings_STATIC_LIB}
|
||||||
LOG_DOWNLOAD 1
|
LOG_DOWNLOAD 1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -24,12 +24,16 @@
|
||||||
|
|
||||||
Q_LOGGING_CATEGORY(NOTIFICATION, "RCTNotification")
|
Q_LOGGING_CATEGORY(NOTIFICATION, "RCTNotification")
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#if defined(Q_OS_LINUX) || defined(Q_OS_WIN)
|
||||||
namespace SnorePlugin {}
|
namespace SnorePlugin {}
|
||||||
|
|
||||||
|
|
||||||
using namespace SnorePlugin;
|
using namespace SnorePlugin;
|
||||||
|
#if defined(Q_OS_LINUX)
|
||||||
Q_IMPORT_PLUGIN(Freedesktop)
|
Q_IMPORT_PLUGIN(Freedesktop)
|
||||||
|
#elif defined(Q_OS_WIN)
|
||||||
|
Q_IMPORT_PLUGIN(WindowsToast)
|
||||||
|
#endif
|
||||||
Q_IMPORT_PLUGIN(Snore)
|
Q_IMPORT_PLUGIN(Snore)
|
||||||
|
|
||||||
static void loadSnoreResources()
|
static void loadSnoreResources()
|
||||||
|
@ -43,7 +47,7 @@ static void loadSnoreResources()
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_COREAPP_STARTUP_FUNCTION(loadSnoreResources)
|
Q_COREAPP_STARTUP_FUNCTION(loadSnoreResources)
|
||||||
#endif // Q_OS_LINUX
|
#endif // defined(Q_OS_LINUX) || defined(Q_OS_WIN)
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct RegisterQMLMetaType {
|
struct RegisterQMLMetaType {
|
||||||
|
@ -74,6 +78,7 @@ DesktopNotification::DesktopNotification(QObject *parent)
|
||||||
|
|
||||||
Snore::Icon icon(":/icon.png");
|
Snore::Icon icon(":/icon.png");
|
||||||
d_ptr->snoreApp = Snore::Application(QCoreApplication::applicationName(), icon);
|
d_ptr->snoreApp = Snore::Application(QCoreApplication::applicationName(), icon);
|
||||||
|
d_ptr->snoreApp.hints().setValue("windows-app-id", "StatusIm.Status.Desktop.1");
|
||||||
d_ptr->snoreApp.addAlert(Snore::Alert(NewMessageAlert, icon));
|
d_ptr->snoreApp.addAlert(Snore::Alert(NewMessageAlert, icon));
|
||||||
|
|
||||||
Snore::SnoreCore::instance().registerApplication(d_ptr->snoreApp);
|
Snore::SnoreCore::instance().registerApplication(d_ptr->snoreApp);
|
||||||
|
|
|
@ -228,10 +228,8 @@ function bundleWindows() {
|
||||||
pushd Windows
|
pushd Windows
|
||||||
cp $STATUSREACTPATH/.env .
|
cp $STATUSREACTPATH/.env .
|
||||||
mkdir -p assets/resources notifier
|
mkdir -p assets/resources notifier
|
||||||
cp $STATUSREACTPATH/node_modules/node-notifier/vendor/notifu/*.exe \
|
cp $STATUSREACTPATH/node_modules/node-notifier/vendor/snoreToast/SnoreToast.exe .
|
||||||
notifier/
|
cp $STATUSREACTPATH/node_modules/node-notifier/vendor/notifu/*.exe notifier/
|
||||||
cp $STATUSREACTPATH/node_modules/node-notifier/vendor/snoreToast/SnoreToast.exe \
|
|
||||||
.
|
|
||||||
cp -r $STATUSREACTPATH/resources/fonts \
|
cp -r $STATUSREACTPATH/resources/fonts \
|
||||||
$STATUSREACTPATH/resources/icons \
|
$STATUSREACTPATH/resources/icons \
|
||||||
$STATUSREACTPATH/resources/images \
|
$STATUSREACTPATH/resources/images \
|
||||||
|
|
Loading…
Reference in New Issue