blob: 2dd257eaa99e12fa065288a0c14b2af7819eb59c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
Version: 11.17
Date: 2022-02-06
Author: bgstack15
Message: Add support for building with desktop notification support.
diff -aur 11.9-1/FreeFileSync/Source/Makefile 11.9-2/FreeFileSync/Source/Makefile
--- 11.9-1/FreeFileSync/Source/Makefile 2021-05-06 16:24:53.987902373 -0400
+++ 11.9-2/FreeFileSync/Source/Makefile 2021-05-06 17:09:31.512474440 -0400
@@ -21,6 +22,13 @@
#treat as system headers so that warnings are hidden:
cxxFlags += -isystem/usr/include/gtk-3.0
+with_notifications ?= NO
+ifeq ($(with_notifications),YES)
+# package libglibmm-2.4-dev or glibmm24-devel
+cxxFlags += `pkg-config --cflags giomm-2.4` -Dwith_notifications
+linkFlags += `pkg-config --libs giomm-2.4`
+endif
+
#support for SELinux (optional)
SELINUX_EXISTING=$(shell pkg-config --exists libselinux && echo YES)
ifeq ($(SELINUX_EXISTING),YES)
diff -aur 11.9-1/FreeFileSync/Source/ui/progress_indicator.cpp 11.9-2/FreeFileSync/Source/ui/progress_indicator.cpp
--- 11.17-0/FreeFileSync/Source/ui/progress_indicator.cpp 2022-02-06 16:30:56.883997654 -0500
+++ 11.17-1/FreeFileSync/Source/ui/progress_indicator.cpp 2022-02-06 17:05:57.763911330 -0500
@@ -31,6 +31,9 @@
#include "../icon_buffer.h"
#include "../base/speed_test.h"
+#ifdef with_notifications
+#include<giomm-2.4/giomm.h>
+#endif
using namespace zen;
using namespace fff;
@@ -1372,6 +1375,22 @@
pnl_.m_staticTextPhase->SetLabelText(getSyncResultLabel(syncResult));
//pnl_.m_bitmapStatus->SetToolTip(); -> redundant
+#ifdef with_notifications
+ // Desktop notification for Linux
+ char title[] = "FreeFileSync";
+ // from https://stackoverflow.com/a/12097772
+ std::wstring ssR {getSyncResultLabel(syncResult)};
+ std::string body;
+ std::transform(ssR.begin(), ssR.end(), std::back_inserter(body), [] (wchar_t c){ return (char)c;});
+ char icon[] = "freefilesync";
+ auto Application = Gio::Application::create("org.zenju.freefilesync", Gio::APPLICATION_FLAGS_NONE);
+ Application->register_application();
+ auto Notification = Gio::Notification::create(title);
+ Notification->set_body(body);
+ auto Icon = Gio::ThemedIcon::create(icon);
+ Notification->set_icon (Icon);
+ Application->send_notification(Notification);
+#endif
//show status on Windows 7 taskbar
if (taskbar_.get())
switch (syncResult)
|