Add missing configuration for Windows desktop notifications. Part of #6728

This commit is contained in:
Pedro Pombeiro 2018-11-15 08:19:57 +01:00
parent 5f2958ba9d
commit bf123f308a
No known key found for this signature in database
GPG Key ID: A65DEB11E4BBC647
3 changed files with 15 additions and 8 deletions

View File

@ -10,7 +10,11 @@ include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
set(SN_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/SnoreNotify_ep-prefix/src/SnoreNotify_ep)
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)
endif()
@ -66,7 +70,7 @@ ExternalProject_Add(SnoreNotify_ep
GIT_REPOSITORY https://github.com/status-im/snorenotify.git
CMAKE_ARGS ${SnoreNotify_CMAKE_ARGS}
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
)

View File

@ -24,12 +24,16 @@
Q_LOGGING_CATEGORY(NOTIFICATION, "RCTNotification")
#ifdef Q_OS_LINUX
#if defined(Q_OS_LINUX) || defined(Q_OS_WIN)
namespace SnorePlugin {}
using namespace SnorePlugin;
#if defined(Q_OS_LINUX)
Q_IMPORT_PLUGIN(Freedesktop)
#elif defined(Q_OS_WIN)
Q_IMPORT_PLUGIN(WindowsToast)
#endif
Q_IMPORT_PLUGIN(Snore)
static void loadSnoreResources()
@ -43,7 +47,7 @@ static void loadSnoreResources()
}
Q_COREAPP_STARTUP_FUNCTION(loadSnoreResources)
#endif // Q_OS_LINUX
#endif // defined(Q_OS_LINUX) || defined(Q_OS_WIN)
namespace {
struct RegisterQMLMetaType {
@ -74,6 +78,7 @@ DesktopNotification::DesktopNotification(QObject *parent)
Snore::Icon icon(":/icon.png");
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));
Snore::SnoreCore::instance().registerApplication(d_ptr->snoreApp);

View File

@ -228,10 +228,8 @@ function bundleWindows() {
pushd Windows
cp $STATUSREACTPATH/.env .
mkdir -p assets/resources notifier
cp $STATUSREACTPATH/node_modules/node-notifier/vendor/notifu/*.exe \
notifier/
cp $STATUSREACTPATH/node_modules/node-notifier/vendor/snoreToast/SnoreToast.exe \
.
cp $STATUSREACTPATH/node_modules/node-notifier/vendor/snoreToast/SnoreToast.exe .
cp $STATUSREACTPATH/node_modules/node-notifier/vendor/notifu/*.exe notifier/
cp -r $STATUSREACTPATH/resources/fonts \
$STATUSREACTPATH/resources/icons \
$STATUSREACTPATH/resources/images \