Merge lp:~victor-jon/indicator-datetime/drop-phone-code into lp:indicator-datetime
- drop-phone-code
- Merge into trunk.16.10
Status: | Work in progress |
---|---|
Proposed branch: | lp:~victor-jon/indicator-datetime/drop-phone-code |
Merge into: | lp:indicator-datetime |
Diff against target: |
27216 lines (+6098/-19975) 180 files modified
.bzrignore (+11/-8) CMakeLists.txt (+29/-37) README (+8/-69) cmake/FindIntltool.cmake (+23/-0) cmake/GCov.cmake (+50/-0) cmake/Translations.cmake (+41/-0) data/com.canonical.indicator.datetime (+1/-4) data/com.canonical.indicator.datetime.gschema.xml.in.in (+0/-46) data/indicator-datetime.conf.in (+2/-3) debian/control (+12/-38) debian/rules (+0/-1) include/CMakeLists.txt (+0/-2) include/datetime/CMakeLists.txt (+0/-2) include/datetime/actions-live.h (+0/-69) include/datetime/actions.h (+0/-77) include/datetime/alarm-queue-simple.h (+0/-57) include/datetime/alarm-queue.h (+0/-59) include/datetime/appointment.h (+0/-75) include/datetime/clock-mock.h (+0/-69) include/datetime/clock.h (+0/-94) include/datetime/date-time.h (+0/-93) include/datetime/dbus-shared.h (+0/-66) include/datetime/engine-eds.h (+0/-77) include/datetime/engine-mock.h (+0/-71) include/datetime/engine.h (+0/-69) include/datetime/exporter.h (+0/-63) include/datetime/formatter.h (+0/-138) include/datetime/locations-settings.h (+0/-55) include/datetime/locations.h (+0/-79) include/datetime/menu.h (+0/-91) include/datetime/myself.h (+0/-62) include/datetime/planner-aggregate.h (+0/-52) include/datetime/planner-month.h (+0/-56) include/datetime/planner-range.h (+0/-84) include/datetime/planner-snooze.h (+0/-55) include/datetime/planner-upcoming.h (+0/-56) include/datetime/planner.h (+0/-52) include/datetime/settings-live.h (+0/-88) include/datetime/settings-shared.h (+0/-65) include/datetime/settings.h (+0/-77) include/datetime/snap.h (+0/-65) include/datetime/state.h (+0/-81) include/datetime/timezone-geoclue.h (+0/-53) include/datetime/timezone-timedated.h (+0/-56) include/datetime/timezone.h (+0/-45) include/datetime/timezones-live.h (+0/-55) include/datetime/timezones.h (+0/-59) include/datetime/utils.h (+0/-54) include/datetime/wakeup-timer-mainloop.h (+0/-62) include/datetime/wakeup-timer-powerd.h (+0/-62) include/datetime/wakeup-timer.h (+0/-55) include/notifications/awake.h (+0/-57) include/notifications/dbus-shared.h (+0/-36) include/notifications/haptic.h (+0/-60) include/notifications/notifications.h (+0/-130) include/notifications/sound.h (+0/-82) po/CMakeLists.txt (+3/-13) po/LINGUAS (+31/-0) po/Makevars (+7/-0) po/POTFILES.in (+3/-0) po/indicator-datetime.pot (+113/-59) src/CMakeLists.txt (+31/-65) src/actions-live.cpp (+0/-312) src/actions.cpp (+0/-273) src/alarm-queue-simple.cpp (+0/-190) src/appointment.cpp (+0/-64) src/awake.cpp (+0/-151) src/clock-live.c (+273/-0) src/clock-live.cpp (+0/-216) src/clock-live.h (+73/-0) src/clock.c (+110/-0) src/clock.cpp (+0/-232) src/clock.h (+76/-0) src/com.ubuntu.touch.AccountsService.Sound.xml (+0/-47) src/date-time.cpp (+0/-302) src/dbus-shared.h (+24/-0) src/engine-eds.cpp (+0/-1238) src/exporter.cpp (+0/-264) src/formatter-desktop.cpp (+0/-190) src/formatter.cpp (+0/-267) src/haptic.cpp (+0/-176) src/locations-settings.cpp (+0/-92) src/locations.cpp (+0/-59) src/main.c (+78/-0) src/main.cpp (+0/-188) src/menu.cpp (+0/-680) src/myself.cpp (+0/-76) src/notifications.cpp (+0/-549) src/planner-aggregate.cpp (+0/-106) src/planner-eds.c (+728/-0) src/planner-eds.h (+58/-0) src/planner-month.cpp (+0/-61) src/planner-range.cpp (+0/-110) src/planner-snooze.cpp (+0/-119) src/planner-upcoming.cpp (+0/-61) src/planner.c (+288/-0) src/planner.cpp (+0/-54) src/planner.h (+177/-0) src/service.c (+2067/-0) src/service.h (+84/-0) src/settings-live.cpp (+0/-445) src/settings-shared.h (+50/-0) src/snap.cpp (+0/-341) src/sound.cpp (+0/-167) src/timezone-file.c (+208/-0) src/timezone-file.h (+58/-0) src/timezone-geoclue.cpp (+0/-291) src/timezone-timedated.cpp (+0/-216) src/timezone.c (+130/-0) src/timezone.h (+72/-0) src/timezones-live.cpp (+0/-74) src/utils.c (+467/-366) src/utils.h (+68/-0) src/wakeup-timer-mainloop.cpp (+0/-138) src/wakeup-timer-powerd.cpp (+0/-311) tests/CMakeLists.txt (+19/-102) tests/Makefile.am.strings (+38/-0) tests/actions-mock.h (+0/-92) tests/data/applications/org.gnome.Calendar.desktop (+0/-13) tests/geoclue-fixture.h (+0/-154) tests/glib-fixture.h (+72/-180) tests/libdbusmock-fixture.h (+0/-148) tests/manual (+0/-149) tests/manual-test-snap.cpp (+0/-106) tests/notification-fixture.h (+0/-342) tests/planner-mock.c (+174/-0) tests/planner-mock.h (+39/-37) tests/print-to.h (+0/-88) tests/run-eds-ics-test.sh (+0/-76) tests/state-fixture.h (+0/-82) tests/state-mock.h (+0/-67) tests/test-actions.cpp (+0/-331) tests/test-alarm-queue.cpp (+0/-168) tests/test-clock.cpp (+0/-216) tests/test-datetime.cpp (+0/-143) tests/test-dbus-fixture.h (+0/-108) tests/test-eds-ics-all-day-events.cpp (+0/-92) tests/test-eds-ics-all-day-events.ics.in (+0/-19) tests/test-eds-ics-config-files/.config/evolution/sources/system-proxy.source (+0/-21) tests/test-eds-ics-missing-trigger.cpp (+0/-116) tests/test-eds-ics-missing-trigger.ics.in (+0/-45) tests/test-eds-ics-non-attending-alarms.cpp (+0/-79) tests/test-eds-ics-non-attending-alarms.ics.in (+0/-53) tests/test-eds-ics-non-selected-source.cpp (+0/-94) tests/test-eds-ics-non-selected-source.ics.in (+0/-28) tests/test-eds-ics-nonrepeating-events.cpp (+0/-94) tests/test-eds-ics-nonrepeating-events.ics.in (+0/-27) tests/test-eds-ics-repeating-events-with-individual-change.cpp (+0/-101) tests/test-eds-ics-repeating-events-with-individual-change.ics.in (+0/-969) tests/test-eds-ics-repeating-events.cpp (+0/-101) tests/test-eds-ics-repeating-events.ics.in (+0/-28) tests/test-eds-ics-repeating-valarms.cpp (+0/-102) tests/test-eds-ics-repeating-valarms.ics.in (+0/-47) tests/test-eds-ics-tzids-2.cpp (+0/-89) tests/test-eds-ics-tzids-2.ics.in (+0/-38) tests/test-eds-ics-tzids-utc.cpp (+0/-88) tests/test-eds-ics-tzids-utc.ics.in (+0/-15) tests/test-eds-ics-tzids.cpp (+0/-88) tests/test-eds-ics-tzids.ics.in (+0/-56) tests/test-exporter.cpp (+0/-249) tests/test-formatter.cc (+98/-0) tests/test-formatter.cpp (+0/-238) tests/test-indicator.cc (+92/-0) tests/test-live-actions.cpp (+0/-319) tests/test-locations.cpp (+0/-168) tests/test-menu-appointments.cpp (+0/-263) tests/test-menus.cpp (+0/-545) tests/test-notification-response.cpp (+0/-144) tests/test-notification.cpp (+0/-198) tests/test-planner.cpp (+0/-68) tests/test-settings.cpp (+0/-241) tests/test-sound.cpp (+0/-182) tests/test-timezone-geoclue.cpp (+0/-48) tests/test-timezone-timedated.cpp (+0/-87) tests/test-timezones.cpp (+0/-124) tests/test-utils.cc (+112/-0) tests/test-utils.cpp (+0/-98) tests/timedated-fixture.h (+0/-158) tests/timezone-mock.h (+0/-41) tests/wakeup-timer-mock.h (+0/-78) |
To merge this branch: | bzr merge lp:~victor-jon/indicator-datetime/drop-phone-code |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Khurshid Alam | Pending | ||
Review via email:
|
Commit message
Drop phone code
* Rebase on top of revision 297
* Drop phone related code
* Cherry-pick evolution-
* Drop libnotify dependency, on desktop eds handles notifications
* Drop geclue-1.0 integration. Geoclue 2.0 doesn't provide on same functionality as geoclue 1.0. On desktop it doesn't hamper functionality since indicator-datetime is already aware of org.freedesktop
* Backport systemd integration
* Cherry pick support for MATE desktop
Description of the change

Khurshid Alam (khurshid-alam) wrote : | # |
Ok, from quick overview,
1) In planner-eds.c, line 185
> /* Appointment has alarm ? */
Is this necessary ?
in line 176,
> /* Get source color */
We don't use source color anymore.
in 163,
> /* Get summary. We are using empty string,
Wouldn't null check be better ? With new > libecal-1.2 we have to use null to prevent leak.
2) Also include the bug numbers in the commit message, it fixes like LP:#1633319
3) Why keep /data/com.

Victor Jonathon (victor-jon) wrote : | # |
1.
> /* Appointment has alarm ? */
>>Is this necessary ?
Yes, we add a alarm icon if a appointment has alarm.
> /* Get source color */
>>We don't use source color anymore.
We don't. But we have a open bug about this. It comes down to alarm-icon vs color-code-block. icon was default in rev 297.
>text.value = "";
>>Wouldn't null check be better ? With new > libecal-1.2 we have to use null to prevent leak.
If we set it to null then we also need to do this
if (appt->summary)
g_free (appt->summary);
2. Ok, I will.
3. You said that you may implement notification in the datetime itself after libecal port. So I kept it thinking it may become useful. But I can remove it.

Khurshid Alam (khurshid-alam) wrote : | # |
1)
>We don't. But we have a open bug about this. It comes down to alarm-icon vs color-code-block. icon was default in rev 297.
Can't we have them both ? But if not alarm-icon is ok.
>If we set it to null then we also need to do this
>if (appt->summary)
>g_free (appt->summary);
g_free is null safe though. Just make sure you are not freeing it twice.
4. In planner-eds.c, line 556,
>e_cal_
>g_object_unref (view);
>p->views = g_slist_remove (p->views, view);
No. First remove the view from slist, then unref.
Unmerged revisions
- 499. By Victor Jonathon
-
Drop phone code
* Rebase on top of revision 297
* Drop phone related code
* Cherry-pick evolution-data-server >=3.16 fixes
* Drop libnotify dependency, on desktop eds handles notifications
* Drop geclue-1.0 integration. Geoclue 2.0 doesn't provide on same functionality as geoclue 1.0. On desktop it doesn't hamper functionality since indicator-datetime is already aware of org.freedesktop.timedate1
* Backport systemd integration
* Cherry pick support for MATE desktop
Preview Diff
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2017-02-03 17:23:56 +0000 |
3 | +++ .bzrignore 2019-08-18 14:27:47 +0000 |
4 | @@ -1,16 +1,19 @@ |
5 | +compile |
6 | +m4 |
7 | +src/libdatetime.la |
8 | +src/libdatetime_la-indicator-datetime.lo |
9 | src/indicator-datetime-service |
10 | +po/indicator-datetime.pot |
11 | +indicator-datetime-[0-9].[0-9].[0-9].tar.gz |
12 | +indicator-datetime-[0-9].[0-9].[0-9].tar.xz |
13 | +indicator-datetime-[0-9].[0-9].[0-9].tar.gz.asc |
14 | +indicator-datetime-[0-9].[0-9].[0-9].tar.xz.asc |
15 | data/indicator-datetime.service |
16 | data/org.ayatana.indicator.datetime.gschema.valid |
17 | src/gen-datetime-service.xml.c |
18 | src/gen-datetime-service.xml.h |
19 | +build-aux |
20 | data/com.canonical.indicator.datetime.gschema.valid |
21 | +src/libdatetime_la-utils.lo |
22 | data/indicator-datetime.conf |
23 | data/indicator-datetime.desktop |
24 | -data/indicator-datetime.upstart.desktop |
25 | - |
26 | -build/ |
27 | -po/Makevars |
28 | -po/Makefile.in.in |
29 | -po/POTFILES.in |
30 | -po/LINGUAS |
31 | - |
32 | |
33 | === modified file 'CMakeLists.txt' |
34 | --- CMakeLists.txt 2017-08-04 13:56:13 +0000 |
35 | +++ CMakeLists.txt 2019-08-18 14:27:47 +0000 |
36 | @@ -9,20 +9,12 @@ |
37 | add_definitions (-DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}" |
38 | -DGNOMELOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}") |
39 | |
40 | -set(ALARM_DEFAULT_SOUND "/usr/share/sounds/ubuntu/ringtones/Alarm clock.ogg") |
41 | -set(CALENDAR_DEFAULT_SOUND "/usr/share/sounds/ubuntu/ringtones/Marimbach.ogg") |
42 | -add_definitions(-DALARM_DEFAULT_SOUND="${ALARM_DEFAULT_SOUND}" |
43 | - -DCALENDAR_DEFAULT_SOUND="${CALENDAR_DEFAULT_SOUND}") |
44 | - |
45 | - |
46 | -## |
47 | -## Always Be Testing |
48 | -## |
49 | -enable_testing() |
50 | +option (enable_tests "Build the package's automatic tests." ON) |
51 | +option (enable_lcov "Generate lcov code coverage reports." ON) |
52 | |
53 | ## |
54 | ## GNU standard installation directories |
55 | -## |
56 | +## |
57 | |
58 | include (GNUInstallDirs) |
59 | if (EXISTS "/etc/debian_version") # Workaround for libexecdir on debian |
60 | @@ -37,23 +29,16 @@ |
61 | ## |
62 | |
63 | find_package (PkgConfig REQUIRED) |
64 | -include (CheckIncludeFile) |
65 | include (FindPkgConfig) |
66 | |
67 | pkg_check_modules (SERVICE_DEPS REQUIRED |
68 | glib-2.0>=2.36 |
69 | gio-unix-2.0>=2.36 |
70 | libical>=0.48 |
71 | - libecal-1.2>=3.5 |
72 | + libecal-1.2>=3.16 |
73 | libedataserver-1.2>=3.5 |
74 | - gstreamer-1.0>=1.2 |
75 | - libnotify>=0.7.6 |
76 | - url-dispatcher-1>=1 |
77 | - properties-cpp>=0.0.1 |
78 | - libaccounts-glib>=1.18 |
79 | - messaging-menu>=12.10 |
80 | - uuid>=2.25) |
81 | -include_directories (SYSTEM ${SERVICE_DEPS_INCLUDE_DIRS}) |
82 | + json-glib-1.0>=0.16.2) |
83 | +include_directories (${SERVICE_INCLUDE_DIRS}) |
84 | |
85 | ## |
86 | ## custom targets |
87 | @@ -64,6 +49,9 @@ |
88 | COMMAND bzr export --root=${ARCHIVE_NAME} ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz |
89 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
90 | |
91 | +add_custom_target (clean-coverage |
92 | + COMMAND find ${CMAKE_BINARY_DIR} -name '*.gcda' | xargs rm -f) |
93 | + |
94 | add_custom_target (cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2 --inline-suppr |
95 | ${CMAKE_SOURCE_DIR}/src |
96 | ${CMAKE_SOURCE_DIR}/tests) |
97 | @@ -73,22 +61,26 @@ |
98 | ## |
99 | |
100 | set (CC_WARNING_ARGS " -Wall -Wshadow -Wextra -Wunused -Wformat=2 -Wno-missing-field-initializers") |
101 | -set (CXX_WARNING_ARGS " -Wall -Wextra -pedantic -Wno-missing-field-initializers") |
102 | - |
103 | -include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include) |
104 | -include_directories (${CMAKE_CURRENT_BINARY_DIR}/include) |
105 | + |
106 | +include_directories (${CMAKE_CURRENT_SOURCE_DIR}/src) |
107 | +include_directories (${CMAKE_CURRENT_BINARY_DIR}/src) |
108 | + |
109 | +# testing & coverage |
110 | +if (${enable_tests}) |
111 | + set (GTEST_SOURCE_DIR /usr/src/gtest/src) |
112 | + set (GTEST_INCLUDE_DIR ${GTEST_SOURCE_DIR}/..) |
113 | + set (GTEST_LIBS -lpthread) |
114 | + enable_testing () |
115 | + if (${enable_lcov}) |
116 | + include(GCov) |
117 | + endif () |
118 | +endif () |
119 | |
120 | # actually build things |
121 | -add_subdirectory(include) |
122 | -add_subdirectory(src) |
123 | -add_subdirectory(data) |
124 | -add_subdirectory(po) |
125 | -add_subdirectory(tests) |
126 | +add_subdirectory (src) |
127 | +add_subdirectory (data) |
128 | +add_subdirectory (po) |
129 | +if (${enable_tests}) |
130 | + add_subdirectory (tests) |
131 | +endif () |
132 | |
133 | -# testing & coverage |
134 | -find_package(CoverageReport) |
135 | -ENABLE_COVERAGE_REPORT( |
136 | - TARGETS indicatordatetimeservice indicator-datetime-service |
137 | - TESTS ${COVERAGE_TEST_TARGETS} |
138 | - FILTER /usr/include ${CMAKE_BINARY_DIR}/* |
139 | -) |
140 | |
141 | === modified file 'README' |
142 | --- README 2014-03-22 07:25:50 +0000 |
143 | +++ README 2019-08-18 14:27:47 +0000 |
144 | @@ -1,26 +1,18 @@ |
145 | ACTIONS |
146 | ======= |
147 | |
148 | - * "desktop.open-settings-app" |
149 | - * "phone.open-settings-app" |
150 | - Description: open the settings application. |
151 | - State: None |
152 | - Parameter: None |
153 | - |
154 | - * "desktop.open-alarm-app" |
155 | - * "phone.open-alarm-app" |
156 | - Description: open the application for creating new alarms. |
157 | - State: None |
158 | - Parameter: None |
159 | - |
160 | - * "desktop.open-calendar-app" |
161 | - * "phone.open-calendar-app" |
162 | + * "activate-settings" |
163 | + Description: opens a page for changing indicator-datetime's settings |
164 | + State: None |
165 | + Parameter: None |
166 | + |
167 | + * "activate-planner" |
168 | + Description: opens an appointment editor. |
169 | State: None |
170 | Parameter: int64, a time_t hinting which day/time to show in the planner, |
171 | or 0 for the current day |
172 | |
173 | - * "desktop.open-appointment" |
174 | - * "phone.open-appointment" |
175 | + * "activate-appointment" |
176 | Description: opens an appointment editor to the specified appointment. |
177 | State: None |
178 | Parameter: string, an opaque uid to specify which appointment to use. |
179 | @@ -76,56 +68,3 @@ |
180 | - x-canonical-time-format s strftime format string |
181 | |
182 | |
183 | - |
184 | -CODE |
185 | -==== |
186 | - |
187 | -Model |
188 | - |
189 | - The app's model is represented by the "State" class, and "Menu" objects |
190 | - are the corresponding views. "State" is a simple container for various |
191 | - properties, and menus connect to those properties' changed() signals to |
192 | - know when the view needs to be refreshed. |
193 | - |
194 | - As one can see in main.c, the app's very simple flow is to instantiate |
195 | - a state and its properties, build menus that correspond to the state, |
196 | - and export the menus on DBus. |
197 | - |
198 | - Because State is a simple aggregate of its components (such as a "Clock" |
199 | - or "Planner" object to get the current time and upcoming appointments, |
200 | - respectively), one can plug in live components for production and mock |
201 | - components for unit tests. The entire backend can be mix-and-matched by |
202 | - adding the desired test-or-production components. |
203 | - |
204 | - Start with: |
205 | - include/datetime/state.h |
206 | - include/datetime/clock.h |
207 | - include/datetime/locations.h |
208 | - include/datetime/planner.h |
209 | - include/datetime/settings.h |
210 | - include/datetime/timezones.h |
211 | - |
212 | - Implementations: |
213 | - include/datetime/settings-live.h |
214 | - include/datetime/locations-settings.h |
215 | - include/datetime/planner-eds.h |
216 | - include/datetime/timezones-live.h |
217 | - |
218 | -View |
219 | - |
220 | - Menu is a mostly-opaque class to wrap GMenu code. Its subclasses contain |
221 | - the per-profile logic of which sections/menuitems to show and which to hide. |
222 | - Menus are instantiated via the MenuFactory, which takes a state and profile. |
223 | - |
224 | - Actions is a mostly-opaque class to wrap our GActionGroup. Its subclasses |
225 | - contain the code that actually executed when an action is triggered (ie, |
226 | - LiveActions for production and MockActions for testing). |
227 | - |
228 | - Exporter exports the Actions and Menus onto the DBus, and also emits a |
229 | - signal if/when the busname is lost so indicator-datetime-service knows |
230 | - when to exit. |
231 | - |
232 | - include/datetime/menu.h |
233 | - include/datetime/actions.h |
234 | - include/datetime/exporter.h |
235 | - |
236 | |
237 | === added file 'cmake/FindIntltool.cmake' |
238 | --- cmake/FindIntltool.cmake 1970-01-01 00:00:00 +0000 |
239 | +++ cmake/FindIntltool.cmake 2019-08-18 14:27:47 +0000 |
240 | @@ -0,0 +1,23 @@ |
241 | +# FindIntltool.cmake |
242 | +# |
243 | +# Jim Nelson <jim@yorba.org> |
244 | +# Copyright 2012 Yorba Foundation |
245 | + |
246 | +find_program (INTLTOOL_MERGE_EXECUTABLE intltool-merge) |
247 | + |
248 | +if (INTLTOOL_MERGE_EXECUTABLE) |
249 | + set (INTLTOOL_MERGE_FOUND TRUE) |
250 | +else (INTLTOOL_MERGE_EXECUTABLE) |
251 | + set (INTLTOOL_MERGE_FOUND FALSE) |
252 | +endif (INTLTOOL_MERGE_EXECUTABLE) |
253 | + |
254 | +if (INTLTOOL_MERGE_FOUND) |
255 | + macro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir) |
256 | + add_custom_target (geary.desktop ALL |
257 | + ${INTLTOOL_MERGE_EXECUTABLE} --desktop-style ${CMAKE_SOURCE_DIR}/${po_dir} |
258 | + ${CMAKE_CURRENT_SOURCE_DIR}/${desktop_id}.desktop.in ${desktop_id}.desktop |
259 | + ) |
260 | + install (FILES ${CMAKE_CURRENT_BINARY_DIR}/geary.desktop DESTINATION /usr/share/applications) |
261 | + endmacro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir) |
262 | +endif (INTLTOOL_MERGE_FOUND) |
263 | + |
264 | |
265 | === added file 'cmake/GCov.cmake' |
266 | --- cmake/GCov.cmake 1970-01-01 00:00:00 +0000 |
267 | +++ cmake/GCov.cmake 2019-08-18 14:27:47 +0000 |
268 | @@ -0,0 +1,50 @@ |
269 | +if (CMAKE_BUILD_TYPE MATCHES coverage) |
270 | + set(GCOV_FLAGS "${GCOV_FLAGS} --coverage") |
271 | + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCOV_FLAGS}") |
272 | + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${GCOV_FLAGS}") |
273 | + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GCOV_FLAGS}") |
274 | + set(GCOV_LIBS ${GCOV_LIBS} gcov) |
275 | + |
276 | + find_program(GCOVR_EXECUTABLE gcovr HINTS ${GCOVR_ROOT} "${GCOVR_ROOT}/bin") |
277 | + if (NOT GCOVR_EXECUTABLE) |
278 | + message(STATUS "Gcovr binary was not found, can not generate XML coverage info.") |
279 | + else () |
280 | + message(STATUS "Gcovr found, can generate XML coverage info.") |
281 | + add_custom_target (coverage-xml |
282 | + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
283 | + COMMAND "${GCOVR_EXECUTABLE}" --exclude="test.*" -x -r "${CMAKE_SOURCE_DIR}" |
284 | + --object-directory=${CMAKE_BINARY_DIR} -o coverage.xml) |
285 | + endif() |
286 | + |
287 | + find_program(LCOV_EXECUTABLE lcov HINTS ${LCOV_ROOT} "${GCOVR_ROOT}/bin") |
288 | + find_program(GENHTML_EXECUTABLE genhtml HINTS ${GENHTML_ROOT}) |
289 | + if (NOT LCOV_EXECUTABLE) |
290 | + message(STATUS "Lcov binary was not found, can not generate HTML coverage info.") |
291 | + else () |
292 | + if(NOT GENHTML_EXECUTABLE) |
293 | + message(STATUS "Genthml binary not found, can not generate HTML coverage info.") |
294 | + else() |
295 | + message(STATUS "Lcov and genhtml found, can generate HTML coverage info.") |
296 | + add_custom_target (coverage-html |
297 | + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
298 | + COMMAND "${CMAKE_CTEST_COMMAND}" --force-new-ctest-process --verbose |
299 | + COMMAND "${LCOV_EXECUTABLE}" --directory ${CMAKE_BINARY_DIR} --capture | ${CMAKE_SOURCE_DIR}/trim-lcov.py > dconf-lcov.info |
300 | + COMMAND LANG=C "${GENHTML_EXECUTABLE}" --prefix ${CMAKE_BINARY_DIR} --output-directory lcov-html --legend --show-details dconf-lcov.info |
301 | + COMMAND ${CMAKE_COMMAND} -E echo "" |
302 | + COMMAND ${CMAKE_COMMAND} -E echo "file://${CMAKE_BINARY_DIR}/lcov-html/index.html" |
303 | + COMMAND ${CMAKE_COMMAND} -E echo "") |
304 | + #COMMAND "${LCOV_EXECUTABLE}" --directory ${CMAKE_BINARY_DIR} --capture --output-file coverage.info --no-checksum |
305 | + #COMMAND "${GENHTML_EXECUTABLE}" --prefix ${CMAKE_BINARY_DIR} --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info |
306 | + #COMMAND ${CMAKE_COMMAND} -E echo "\\#define foo \\\"bar\\\"" |
307 | + #) |
308 | + endif() |
309 | + endif() |
310 | +endif() |
311 | + |
312 | + |
313 | + #$(MAKE) $(AM_MAKEFLAGS) check |
314 | + #lcov --directory $(top_builddir) --capture --test-name dconf | $(top_srcdir)/trim-lcov.py > dconf-lcov.info |
315 | + #LANG=C genhtml --prefix $(top_builddir) --output-directory lcov-html --legend --show-details dconf-lcov.info |
316 | + #@echo |
317 | + #@echo " file://$(abs_top_builddir)/lcov-html/index.html" |
318 | + #@echo |
319 | |
320 | === added file 'cmake/Translations.cmake' |
321 | --- cmake/Translations.cmake 1970-01-01 00:00:00 +0000 |
322 | +++ cmake/Translations.cmake 2019-08-18 14:27:47 +0000 |
323 | @@ -0,0 +1,41 @@ |
324 | +# Translations.cmake, CMake macros written for Marlin, feel free to re-use them |
325 | + |
326 | +macro(add_translations_directory NLS_PACKAGE) |
327 | + add_custom_target (i18n ALL) |
328 | + find_program (MSGFMT_EXECUTABLE msgfmt) |
329 | + file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po) |
330 | + foreach (PO_INPUT ${PO_FILES}) |
331 | + get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE) |
332 | + set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo) |
333 | + add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT}) |
334 | + |
335 | + install (FILES ${MO_OUTPUT} DESTINATION |
336 | + ${CMAKE_INSTALL_LOCALEDIR}/${PO_INPUT_BASE}/LC_MESSAGES |
337 | + RENAME ${NLS_PACKAGE}.mo) |
338 | + endforeach (PO_INPUT ${PO_FILES}) |
339 | +endmacro(add_translations_directory) |
340 | + |
341 | + |
342 | +macro(add_translations_catalog NLS_PACKAGE) |
343 | + add_custom_target (pot COMMENT “Building translation catalog.”) |
344 | + find_program (XGETTEXT_EXECUTABLE xgettext) |
345 | + |
346 | + |
347 | + set(C_SOURCE "") |
348 | + |
349 | + foreach(FILES_INPUT ${ARGN}) |
350 | + file (GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.c) |
351 | + foreach(C_FILE ${SOURCE_FILES}) |
352 | + set(C_SOURCE ${C_SOURCE} ${C_FILE}) |
353 | + endforeach() |
354 | + file (GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.vala) |
355 | + foreach(C_FILE ${SOURCE_FILES}) |
356 | + set(C_SOURCE ${C_SOURCE} ${C_FILE}) |
357 | + endforeach() |
358 | + endforeach() |
359 | + |
360 | + add_custom_command (TARGET pot COMMAND |
361 | + ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot |
362 | + ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --keyword="N_" --from-code=UTF-8 |
363 | + ) |
364 | +endmacro() |
365 | |
366 | === modified file 'data/com.canonical.indicator.datetime' |
367 | --- data/com.canonical.indicator.datetime 2014-03-21 19:02:46 +0000 |
368 | +++ data/com.canonical.indicator.datetime 2019-08-18 14:27:47 +0000 |
369 | @@ -9,12 +9,9 @@ |
370 | [desktop_greeter] |
371 | ObjectPath=/com/canonical/indicator/datetime/desktop_greeter |
372 | |
373 | -[desktop_lockscreen] |
374 | -ObjectPath=/com/canonical/indicator/datetime/desktop_greeter |
375 | - |
376 | [phone] |
377 | ObjectPath=/com/canonical/indicator/datetime/phone |
378 | |
379 | [phone_greeter] |
380 | -ObjectPath=/com/canonical/indicator/datetime/phone_greeter |
381 | +ObjectPath=/com/canonical/indicator/datetime/desktop_greeter |
382 | |
383 | |
384 | === modified file 'data/com.canonical.indicator.datetime.gschema.xml.in.in' |
385 | --- data/com.canonical.indicator.datetime.gschema.xml.in.in 2015-10-13 19:46:12 +0000 |
386 | +++ data/com.canonical.indicator.datetime.gschema.xml.in.in 2019-08-18 14:27:47 +0000 |
387 | @@ -123,51 +123,5 @@ |
388 | Some timezones can be known by many different cities or names. This setting describes how the current zone prefers to be named. Format is "TIMEZONE NAME" (e.g. "America/New_York Boston" to name the New_York zone Boston). |
389 | </_description> |
390 | </key> |
391 | - <key name="alarm-haptic-feedback" type="s"> |
392 | - <default>'pulse'</default> |
393 | - <_summary>What kind of haptic feedback, if any, to trigger with an alarm.</_summary> |
394 | - <_description> |
395 | - What kind of haptic feedback, if any, to trigger with an alarm. |
396 | - Two modes are currently supported: 'pulse', 'none'. |
397 | - </_description> |
398 | - </key> |
399 | - <key name="calendar-default-sound" type="s"> |
400 | - <default>'@CALENDAR_DEFAULT_SOUND@'</default> |
401 | - <_summary>The calendar's default sound file.</_summary> |
402 | - <_description> |
403 | - If a calendar or reminder event doesn't specify its own sound file, this file will be used as the fallback sound. |
404 | - </_description> |
405 | - </key> |
406 | - <key name="alarm-default-sound" type="s"> |
407 | - <default>'@ALARM_DEFAULT_SOUND@'</default> |
408 | - <_summary>The alarm's default sound file.</_summary> |
409 | - <_description> |
410 | - If an alarm doesn't specify its own sound file, this file will be used as the fallback sound. |
411 | - </_description> |
412 | - </key> |
413 | - <key name="alarm-default-volume" type="u"> |
414 | - <range min="1" max="100"/> |
415 | - <default>50</default> |
416 | - <_summary>The alarm's default volume level.</_summary> |
417 | - <_description> |
418 | - The volume at which alarms will be played. |
419 | - </_description> |
420 | - </key> |
421 | - <key name="alarm-duration-minutes" type="u"> |
422 | - <range min="1" max="60"/> |
423 | - <default>10</default> |
424 | - <_summary>The alarm's duration.</_summary> |
425 | - <_description> |
426 | - How long the alarm's sound will be looped if its snap decision is not dismissed by the user. |
427 | - </_description> |
428 | - </key> |
429 | - <key name="snooze-duration-minutes" type="u"> |
430 | - <range min="1" max="20"/> |
431 | - <default>5</default> |
432 | - <_summary>The snooze duration.</_summary> |
433 | - <_description> |
434 | - How long to wait when the user hits the Snooze button. |
435 | - </_description> |
436 | - </key> |
437 | </schema> |
438 | </schemalist> |
439 | |
440 | === modified file 'data/indicator-datetime.conf.in' |
441 | --- data/indicator-datetime.conf.in 2016-10-11 18:01:07 +0000 |
442 | +++ data/indicator-datetime.conf.in 2019-08-18 14:27:47 +0000 |
443 | @@ -1,9 +1,8 @@ |
444 | description "Indicator Date & Time Backend" |
445 | |
446 | -start on indicator-services-start |
447 | +start on indicators-loaded or indicator-services-start |
448 | stop on desktop-end or indicator-services-end |
449 | |
450 | respawn |
451 | -respawn limit 2 10 |
452 | |
453 | -exec $SNAP@pkglibexecdir@/indicator-datetime-service |
454 | +exec @pkglibexecdir@/indicator-datetime-service |
455 | |
456 | === modified file 'debian/control' |
457 | --- debian/control 2019-05-18 06:49:18 +0000 |
458 | +++ debian/control 2019-08-18 14:27:47 +0000 |
459 | @@ -2,63 +2,37 @@ |
460 | Section: misc |
461 | Priority: optional |
462 | Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com> |
463 | +# language-pack-en-base is for the unit tests s.t. we can test in 12h and 24h locales |
464 | Build-Depends: cmake, |
465 | - cmake-extras (>= 1.1), |
466 | dbus, |
467 | - debhelper (>= 9), |
468 | + debhelper (>= 9), |
469 | dh-translations, |
470 | - gcovr, |
471 | - intltool, |
472 | - lcov, |
473 | + intltool (>= 0.35.0), |
474 | + language-pack-en-base, |
475 | + libgtest-dev, |
476 | libglib2.0-dev (>= 2.35.4), |
477 | - libnotify-dev (>= 0.7.6), |
478 | - libgstreamer1.0-dev, |
479 | - libecal1.2-dev (>= 3.5), |
480 | - libical-dev, |
481 | + libecal1.2-dev (>= 3.16), |
482 | + libical-dev (>= 1.0), |
483 | + libjson-glib-dev, |
484 | libedataserver1.2-dev (>= 3.5), |
485 | - liburl-dispatcher1-dev, |
486 | - libproperties-cpp-dev, |
487 | -# for com.ubuntu.notifications.hub schema to pick up blacklist of apps that can't show notifications |
488 | - gsettings-ubuntu-schemas (>= 0.0.7), |
489 | -# for the test harness: |
490 | - googletest | google-mock, |
491 | - libdbustest1-dev, |
492 | - dbus-test-runner, |
493 | - python3-dbusmock, |
494 | -# for 12h/24h locale unit tests: |
495 | locales, |
496 | - language-pack-en-base, |
497 | -# for running live EDS tests: |
498 | - evolution-data-server, |
499 | - gvfs-daemons, |
500 | -# for phone alarm/calendar notification sound tests: |
501 | - ubuntu-touch-sounds, |
502 | -# for query user e-mails based on accounts |
503 | - libaccounts-glib-dev, |
504 | -# messaging menu integration |
505 | - libmessaging-menu-dev, |
506 | - uuid-dev, |
507 | -# to locate the place to put systemd files |
508 | - systemd, |
509 | Standards-Version: 3.9.3 |
510 | Homepage: https://launchpad.net/indicator-datetime |
511 | # If you aren't a member of ~indicator-applet-developers but need to upload |
512 | # packaging changes, just go ahead. ~indicator-applet-developers will notice |
513 | # and sync up the code again. |
514 | -Vcs-Bzr: https://code.launchpad.net/~indicator-applet-developers/indicator-datetime/trunk.16.10 |
515 | -Vcs-Browser: https://bazaar.launchpad.net/~indicator-applet-developers/indicator-datetime/trunk.16.10/files |
516 | -X-Ubuntu-Use-Langpack: yes |
517 | +Vcs-Bzr: https://code.launchpad.net/~indicator-applet-developers/indicator-datetime/trunk.13.04 |
518 | +Vcs-Browser: https://bazaar.launchpad.net/~indicator-applet-developers/indicator-datetime/trunk.13.04/files |
519 | |
520 | Package: indicator-datetime |
521 | Architecture: any |
522 | -Depends: ${shlibs:Depends}, |
523 | +Depends: ${shlibs:Depends}, |
524 | ${misc:Depends}, |
525 | - gsettings-ubuntu-schemas (>= 0.0.7), |
526 | indicator-common, |
527 | systemd, |
528 | Recommends: indicator-applet | indicator-renderer, |
529 | evolution-data-server, |
530 | - unity-control-center (>= 14.04.3) | gnome-control-center | gnome-system-tools, |
531 | + unity-control-center (>= 14.04.3) | gnome-control-center, |
532 | ubuntu-touch-sounds, |
533 | Description: Simple clock |
534 | A simple clock appearing in the indicator bar |
535 | |
536 | === modified file 'debian/rules' |
537 | --- debian/rules 2015-07-15 18:24:13 +0000 |
538 | +++ debian/rules 2019-08-18 14:27:47 +0000 |
539 | @@ -8,4 +8,3 @@ |
540 | override_dh_install: |
541 | dh_install --fail-missing |
542 | |
543 | - |
544 | |
545 | === removed directory 'include' |
546 | === removed file 'include/CMakeLists.txt' |
547 | --- include/CMakeLists.txt 2014-07-27 04:35:38 +0000 |
548 | +++ include/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
549 | @@ -1,2 +0,0 @@ |
550 | -add_subdirectory(datetime) |
551 | -add_subdirectory(notifications) |
552 | |
553 | === removed directory 'include/datetime' |
554 | === removed file 'include/datetime/CMakeLists.txt' |
555 | --- include/datetime/CMakeLists.txt 2013-12-18 04:08:08 +0000 |
556 | +++ include/datetime/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
557 | @@ -1,2 +0,0 @@ |
558 | - |
559 | - |
560 | |
561 | === removed file 'include/datetime/actions-live.h' |
562 | --- include/datetime/actions-live.h 2019-05-18 06:48:53 +0000 |
563 | +++ include/datetime/actions-live.h 1970-01-01 00:00:00 +0000 |
564 | @@ -1,69 +0,0 @@ |
565 | -/* |
566 | - * Copyright 2013 Canonical Ltd. |
567 | - * |
568 | - * This program is free software: you can redistribute it and/or modify it |
569 | - * under the terms of the GNU General Public License version 3, as published |
570 | - * by the Free Software Foundation. |
571 | - * |
572 | - * This program is distributed in the hope that it will be useful, but |
573 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
574 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
575 | - * PURPOSE. See the GNU General Public License for more details. |
576 | - * |
577 | - * You should have received a copy of the GNU General Public License along |
578 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
579 | - * |
580 | - * Authors: |
581 | - * Charles Kerr <charles.kerr@canonical.com> |
582 | - */ |
583 | - |
584 | -#ifndef INDICATOR_DATETIME_ACTIONS_LIVE_H |
585 | -#define INDICATOR_DATETIME_ACTIONS_LIVE_H |
586 | - |
587 | -#include <datetime/actions.h> |
588 | - |
589 | -namespace unity { |
590 | -namespace indicator { |
591 | -namespace datetime { |
592 | - |
593 | -/** |
594 | - * \brief Production implementation of the Actions interface. |
595 | - * |
596 | - * Delegates URLs, sets the timezone via org.freedesktop.timedate1, etc. |
597 | - * |
598 | - * @see MockActions |
599 | - */ |
600 | -class LiveActions: public Actions |
601 | -{ |
602 | -public: |
603 | - enum Desktop { |
604 | - OTHER = 0, |
605 | - UNITY7, |
606 | - UNITY8, |
607 | - MATE, |
608 | - }; |
609 | - |
610 | - explicit LiveActions(const std::shared_ptr<State>& state_in); |
611 | - virtual ~LiveActions() =default; |
612 | - |
613 | - bool desktop_has_calendar_app() const override; |
614 | - void open_alarm_app() override; |
615 | - void open_appointment(const Appointment&, const DateTime&) override; |
616 | - void open_calendar_app(const DateTime&) override; |
617 | - void open_settings_app() override; |
618 | - |
619 | - void set_location(const std::string& zone, const std::string& name) override; |
620 | - |
621 | -protected: |
622 | - virtual Desktop get_desktop(); |
623 | - virtual void execute_command(const std::string& command); |
624 | - virtual void dispatch_url(const std::string& url); |
625 | - |
626 | - void unity8_open_appointment(const Appointment& appt, const DateTime& date); |
627 | -}; |
628 | - |
629 | -} // namespace datetime |
630 | -} // namespace indicator |
631 | -} // namespace unity |
632 | - |
633 | -#endif // INDICATOR_DATETIME_ACTIONS_H |
634 | |
635 | === removed file 'include/datetime/actions.h' |
636 | --- include/datetime/actions.h 2016-05-14 02:07:10 +0000 |
637 | +++ include/datetime/actions.h 1970-01-01 00:00:00 +0000 |
638 | @@ -1,77 +0,0 @@ |
639 | -/* |
640 | - * Copyright 2013 Canonical Ltd. |
641 | - * |
642 | - * This program is free software: you can redistribute it and/or modify it |
643 | - * under the terms of the GNU General Public License version 3, as published |
644 | - * by the Free Software Foundation. |
645 | - * |
646 | - * This program is distributed in the hope that it will be useful, but |
647 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
648 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
649 | - * PURPOSE. See the GNU General Public License for more details. |
650 | - * |
651 | - * You should have received a copy of the GNU General Public License along |
652 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
653 | - * |
654 | - * Authors: |
655 | - * Charles Kerr <charles.kerr@canonical.com> |
656 | - */ |
657 | - |
658 | -#ifndef INDICATOR_DATETIME_ACTIONS_H |
659 | -#define INDICATOR_DATETIME_ACTIONS_H |
660 | - |
661 | -#include <datetime/date-time.h> |
662 | -#include <datetime/state.h> |
663 | - |
664 | -#include <memory> // shared_ptr |
665 | -#include <string> |
666 | - |
667 | -#include <gio/gio.h> // GSimpleActionGroup |
668 | - |
669 | -namespace unity { |
670 | -namespace indicator { |
671 | -namespace datetime { |
672 | - |
673 | -/** |
674 | - * \brief Interface for all the actions that can be activated by users. |
675 | - * |
676 | - * This is a simple C++ wrapper around our GActionGroup that gets exported |
677 | - * onto the bus. Subclasses implement the actual code that should be run |
678 | - * when a particular action is triggered. |
679 | - */ |
680 | -class Actions |
681 | -{ |
682 | -public: |
683 | - |
684 | - virtual bool desktop_has_calendar_app() const =0; |
685 | - |
686 | - virtual void open_alarm_app() =0; |
687 | - virtual void open_appointment(const Appointment&, const DateTime&) =0; |
688 | - virtual void open_calendar_app(const DateTime&) =0; |
689 | - virtual void open_settings_app() =0; |
690 | - |
691 | - virtual void set_location(const std::string& zone, const std::string& name)=0; |
692 | - |
693 | - void set_calendar_date(const DateTime&); |
694 | - GActionGroup* action_group(); |
695 | - const std::shared_ptr<State> state() const; |
696 | - |
697 | -protected: |
698 | - explicit Actions(const std::shared_ptr<State>& state); |
699 | - virtual ~Actions(); |
700 | - |
701 | -private: |
702 | - std::shared_ptr<State> m_state; |
703 | - GSimpleActionGroup* m_actions = nullptr; |
704 | - void update_calendar_state(); |
705 | - |
706 | - // we've got raw pointers in here, so disable copying |
707 | - Actions(const Actions&) =delete; |
708 | - Actions& operator=(const Actions&) =delete; |
709 | -}; |
710 | - |
711 | -} // namespace datetime |
712 | -} // namespace indicator |
713 | -} // namespace unity |
714 | - |
715 | -#endif // INDICATOR_DATETIME_ACTIONS_H |
716 | |
717 | === removed file 'include/datetime/alarm-queue-simple.h' |
718 | --- include/datetime/alarm-queue-simple.h 2015-04-03 18:11:39 +0000 |
719 | +++ include/datetime/alarm-queue-simple.h 1970-01-01 00:00:00 +0000 |
720 | @@ -1,57 +0,0 @@ |
721 | -/* |
722 | - * Copyright 2014 Canonical Ltd. |
723 | - * |
724 | - * This program is free software: you can redistribute it and/or modify it |
725 | - * under the terms of the GNU General Public License version 3, as published |
726 | - * by the Free Software Foundation. |
727 | - * |
728 | - * This program is distributed in the hope that it will be useful, but |
729 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
730 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
731 | - * PURPOSE. See the GNU General Public License for more details. |
732 | - * |
733 | - * You should have received a copy of the GNU General Public License along |
734 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
735 | - * |
736 | - * Authors: |
737 | - * Charles Kerr <charles.kerr@canonical.com> |
738 | - */ |
739 | - |
740 | -#ifndef INDICATOR_DATETIME_ALARM_QUEUE_SIMPLE_H |
741 | -#define INDICATOR_DATETIME_ALARM_QUEUE_SIMPLE_H |
742 | - |
743 | -#include <memory> // std::shared_ptr |
744 | - |
745 | -#include <datetime/alarm-queue.h> |
746 | -#include <datetime/clock.h> |
747 | -#include <datetime/planner.h> |
748 | -#include <datetime/wakeup-timer.h> |
749 | - |
750 | -namespace unity { |
751 | -namespace indicator { |
752 | -namespace datetime { |
753 | - |
754 | -/** |
755 | - * \brief A #AlarmQueue implementation |
756 | - */ |
757 | -class SimpleAlarmQueue: public AlarmQueue |
758 | -{ |
759 | -public: |
760 | - SimpleAlarmQueue(const std::shared_ptr<Clock>& clock, |
761 | - const std::shared_ptr<Planner>& upcoming_planner, |
762 | - const std::shared_ptr<WakeupTimer>& timer); |
763 | - ~SimpleAlarmQueue(); |
764 | - core::Signal<const Appointment&, const Alarm&>& alarm_reached() override; |
765 | - |
766 | -private: |
767 | - class Impl; |
768 | - friend class Impl; |
769 | - std::unique_ptr<Impl> impl; |
770 | -}; |
771 | - |
772 | - |
773 | -} // namespace datetime |
774 | -} // namespace indicator |
775 | -} // namespace unity |
776 | - |
777 | -#endif // INDICATOR_DATETIME_ALARM_QUEUE_H |
778 | |
779 | === removed file 'include/datetime/alarm-queue.h' |
780 | --- include/datetime/alarm-queue.h 2015-04-03 18:11:39 +0000 |
781 | +++ include/datetime/alarm-queue.h 1970-01-01 00:00:00 +0000 |
782 | @@ -1,59 +0,0 @@ |
783 | -/* |
784 | - * Copyright 2014 Canonical Ltd. |
785 | - * |
786 | - * This program is free software: you can redistribute it and/or modify it |
787 | - * under the terms of the GNU General Public License version 3, as published |
788 | - * by the Free Software Foundation. |
789 | - * |
790 | - * This program is distributed in the hope that it will be useful, but |
791 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
792 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
793 | - * PURPOSE. See the GNU General Public License for more details. |
794 | - * |
795 | - * You should have received a copy of the GNU General Public License along |
796 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
797 | - * |
798 | - * Authors: |
799 | - * Charles Kerr <charles.kerr@canonical.com> |
800 | - */ |
801 | - |
802 | -#ifndef INDICATOR_DATETIME_ALARM_QUEUE_H |
803 | -#define INDICATOR_DATETIME_ALARM_QUEUE_H |
804 | - |
805 | -#include <datetime/appointment.h> |
806 | - |
807 | -#include <core/signal.h> |
808 | - |
809 | -#include <memory> |
810 | -#include <set> |
811 | -#include <string> |
812 | - |
813 | -namespace unity { |
814 | -namespace indicator { |
815 | -namespace datetime { |
816 | - |
817 | -/*** |
818 | -**** |
819 | -***/ |
820 | - |
821 | -/** |
822 | - * \brief Watches the clock and appointments to notify when an |
823 | - * appointment's time is reached. |
824 | - */ |
825 | -class AlarmQueue |
826 | -{ |
827 | -public: |
828 | - AlarmQueue() =default; |
829 | - virtual ~AlarmQueue() =default; |
830 | - virtual core::Signal<const Appointment&, const Alarm&>& alarm_reached() =0; |
831 | -}; |
832 | - |
833 | -/*** |
834 | -**** |
835 | -***/ |
836 | - |
837 | -} // namespace datetime |
838 | -} // namespace indicator |
839 | -} // namespace unity |
840 | - |
841 | -#endif // INDICATOR_DATETIME_ALARM_QUEUE_H |
842 | |
843 | === removed file 'include/datetime/appointment.h' |
844 | --- include/datetime/appointment.h 2016-05-14 02:07:10 +0000 |
845 | +++ include/datetime/appointment.h 1970-01-01 00:00:00 +0000 |
846 | @@ -1,75 +0,0 @@ |
847 | -/* |
848 | - * Copyright 2013 Canonical Ltd. |
849 | - * |
850 | - * This program is free software: you can redistribute it and/or modify it |
851 | - * under the terms of the GNU General Public License version 3, as published |
852 | - * by the Free Software Foundation. |
853 | - * |
854 | - * This program is distributed in the hope that it will be useful, but |
855 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
856 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
857 | - * PURPOSE. See the GNU General Public License for more details. |
858 | - * |
859 | - * You should have received a copy of the GNU General Public License along |
860 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
861 | - * |
862 | - * Authors: |
863 | - * Charles Kerr <charles.kerr@canonical.com> |
864 | - */ |
865 | - |
866 | -#ifndef INDICATOR_DATETIME_APPOINTMENT_H |
867 | -#define INDICATOR_DATETIME_APPOINTMENT_H |
868 | - |
869 | -#include <datetime/date-time.h> |
870 | - |
871 | -#include <string> |
872 | -#include <vector> |
873 | - |
874 | -namespace unity { |
875 | -namespace indicator { |
876 | -namespace datetime { |
877 | - |
878 | -/** |
879 | - * \brief Basic information required to raise a notification about some Appointment. |
880 | - */ |
881 | -struct Alarm |
882 | -{ |
883 | - std::string text; |
884 | - std::string audio_url; |
885 | - DateTime time; |
886 | - |
887 | - bool operator== (const Alarm& that) const; |
888 | - bool has_sound() const; |
889 | - bool has_text() const; |
890 | -}; |
891 | - |
892 | -/** |
893 | - * \brief An instance of an appointment; e.g. a calendar event or clock-app alarm |
894 | - * |
895 | - * @see Planner |
896 | - */ |
897 | -struct Appointment |
898 | -{ |
899 | -public: |
900 | - enum Type { EVENT, UBUNTU_ALARM }; |
901 | - Type type = EVENT; |
902 | - bool is_ubuntu_alarm() const { return type == UBUNTU_ALARM; } |
903 | - |
904 | - std::string uid; |
905 | - std::string source_uid; |
906 | - std::string color; |
907 | - std::string summary; |
908 | - std::string activation_url; |
909 | - DateTime begin; |
910 | - DateTime end; |
911 | - |
912 | - std::vector<Alarm> alarms; |
913 | - |
914 | - bool operator== (const Appointment& that) const; |
915 | -}; |
916 | - |
917 | -} // namespace datetime |
918 | -} // namespace indicator |
919 | -} // namespace unity |
920 | - |
921 | -#endif // INDICATOR_DATETIME_APPOINTMENT_H |
922 | |
923 | === removed file 'include/datetime/clock-mock.h' |
924 | --- include/datetime/clock-mock.h 2015-04-03 17:36:46 +0000 |
925 | +++ include/datetime/clock-mock.h 1970-01-01 00:00:00 +0000 |
926 | @@ -1,69 +0,0 @@ |
927 | -/* |
928 | - * Copyright 2013 Canonical Ltd. |
929 | - * |
930 | - * This program is free software: you can redistribute it and/or modify it |
931 | - * under the terms of the GNU General Public License version 3, as published |
932 | - * by the Free Software Foundation. |
933 | - * |
934 | - * This program is distributed in the hope that it will be useful, but |
935 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
936 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
937 | - * PURPOSE. See the GNU General Public License for more details. |
938 | - * |
939 | - * You should have received a copy of the GNU General Public License along |
940 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
941 | - * |
942 | - * Authors: |
943 | - * Charles Kerr <charles.kerr@canonical.com> |
944 | - */ |
945 | - |
946 | -#ifndef INDICATOR_DATETIME_CLOCK_MOCK_H |
947 | -#define INDICATOR_DATETIME_CLOCK_MOCK_H |
948 | - |
949 | -#include <datetime/clock.h> |
950 | - |
951 | -namespace unity { |
952 | -namespace indicator { |
953 | -namespace datetime { |
954 | - |
955 | -/*** |
956 | -**** |
957 | -***/ |
958 | - |
959 | -/** |
960 | - * \brief A clock that uses a client-provided time instead of the system time. |
961 | - */ |
962 | -class MockClock: public Clock |
963 | -{ |
964 | -public: |
965 | - explicit MockClock(const DateTime& dt): m_localtime(dt) {} |
966 | - ~MockClock() =default; |
967 | - |
968 | - DateTime localtime() const override { return m_localtime; } |
969 | - |
970 | - void set_localtime(const DateTime& dt) |
971 | - { |
972 | - const auto old = m_localtime; |
973 | - |
974 | - set_localtime_quietly(dt); |
975 | - |
976 | - if (!DateTime::is_same_minute(old, m_localtime)) |
977 | - minute_changed(); |
978 | - if (!DateTime::is_same_day(old, m_localtime)) |
979 | - date_changed(); |
980 | - } |
981 | - |
982 | - void set_localtime_quietly(const DateTime& dt) |
983 | - { |
984 | - m_localtime = dt; |
985 | - } |
986 | - |
987 | -private: |
988 | - DateTime m_localtime; |
989 | -}; |
990 | - |
991 | -} // namespace datetime |
992 | -} // namespace indicator |
993 | -} // namespace unity |
994 | - |
995 | -#endif // INDICATOR_DATETIME_CLOCK_MOCK_H |
996 | |
997 | === removed file 'include/datetime/clock.h' |
998 | --- include/datetime/clock.h 2015-04-03 17:36:46 +0000 |
999 | +++ include/datetime/clock.h 1970-01-01 00:00:00 +0000 |
1000 | @@ -1,94 +0,0 @@ |
1001 | -/* |
1002 | - * Copyright 2013 Canonical Ltd. |
1003 | - * |
1004 | - * This program is free software: you can redistribute it and/or modify it |
1005 | - * under the terms of the GNU General Public License version 3, as published |
1006 | - * by the Free Software Foundation. |
1007 | - * |
1008 | - * This program is distributed in the hope that it will be useful, but |
1009 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
1010 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1011 | - * PURPOSE. See the GNU General Public License for more details. |
1012 | - * |
1013 | - * You should have received a copy of the GNU General Public License along |
1014 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
1015 | - * |
1016 | - * Authors: |
1017 | - * Charles Kerr <charles.kerr@canonical.com> |
1018 | - */ |
1019 | - |
1020 | -#ifndef INDICATOR_DATETIME_CLOCK_H |
1021 | -#define INDICATOR_DATETIME_CLOCK_H |
1022 | - |
1023 | -#include <datetime/date-time.h> |
1024 | - |
1025 | -#include <core/property.h> |
1026 | -#include <core/signal.h> |
1027 | - |
1028 | -#include <memory> // std::shared_ptr, std::unique_ptr |
1029 | - |
1030 | -namespace unity { |
1031 | -namespace indicator { |
1032 | -namespace datetime { |
1033 | - |
1034 | -/** |
1035 | - * \brief A clock. |
1036 | - */ |
1037 | -class Clock |
1038 | -{ |
1039 | -public: |
1040 | - virtual ~Clock(); |
1041 | - virtual DateTime localtime() const =0; |
1042 | - |
1043 | - /** \brief A signal which fires when the clock's minute changes */ |
1044 | - core::Signal<> minute_changed; |
1045 | - |
1046 | - /** \brief A signal which fires when the clock's date changes */ |
1047 | - core::Signal<> date_changed; |
1048 | - |
1049 | -protected: |
1050 | - Clock(); |
1051 | - |
1052 | - /** \brief Compares old and new times, emits minute_changed() or date_changed() signals if appropriate */ |
1053 | - void maybe_emit (const DateTime& a, const DateTime& b); |
1054 | - |
1055 | -private: |
1056 | - class Impl; |
1057 | - friend class Impl; |
1058 | - std::unique_ptr<Impl> m_impl; |
1059 | - |
1060 | - // we've got raw pointers and GSignal tags in here, so disable copying |
1061 | - Clock(const Clock&) =delete; |
1062 | - Clock& operator=(const Clock&) =delete; |
1063 | -}; |
1064 | - |
1065 | -/*** |
1066 | -**** |
1067 | -***/ |
1068 | - |
1069 | -class Timezone; |
1070 | - |
1071 | -/** |
1072 | - * \brief A live #Clock that provides the actual system time. |
1073 | - */ |
1074 | -class LiveClock: public Clock |
1075 | -{ |
1076 | -public: |
1077 | - LiveClock (const std::shared_ptr<const Timezone>& zones); |
1078 | - virtual ~LiveClock(); |
1079 | - virtual DateTime localtime() const override; |
1080 | - |
1081 | -private: |
1082 | - class Impl; |
1083 | - std::unique_ptr<Impl> p; |
1084 | -}; |
1085 | - |
1086 | -/*** |
1087 | -**** |
1088 | -***/ |
1089 | - |
1090 | -} // namespace datetime |
1091 | -} // namespace indicator |
1092 | -} // namespace unity |
1093 | - |
1094 | -#endif // INDICATOR_DATETIME_CLOCK_H |
1095 | |
1096 | === removed file 'include/datetime/date-time.h' |
1097 | --- include/datetime/date-time.h 2016-05-14 02:07:10 +0000 |
1098 | +++ include/datetime/date-time.h 1970-01-01 00:00:00 +0000 |
1099 | @@ -1,93 +0,0 @@ |
1100 | -/* |
1101 | - * Copyright 2013 Canonical Ltd. |
1102 | - * |
1103 | - * This program is free software: you can redistribute it and/or modify it |
1104 | - * under the terms of the GNU General Public License version 3, as published |
1105 | - * by the Free Software Foundation. |
1106 | - * |
1107 | - * This program is distributed in the hope that it will be useful, but |
1108 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
1109 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1110 | - * PURPOSE. See the GNU General Public License for more details. |
1111 | - * |
1112 | - * You should have received a copy of the GNU General Public License along |
1113 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
1114 | - * |
1115 | - * Authors: |
1116 | - * Charles Kerr <charles.kerr@canonical.com> |
1117 | - */ |
1118 | - |
1119 | -#ifndef INDICATOR_DATETIME_DATETIME_H |
1120 | -#define INDICATOR_DATETIME_DATETIME_H |
1121 | - |
1122 | -#include <glib.h> // GDateTime |
1123 | - |
1124 | -#include <chrono> |
1125 | -#include <ctime> // time_t |
1126 | -#include <memory> // std::shared_ptr |
1127 | - |
1128 | -namespace unity { |
1129 | -namespace indicator { |
1130 | -namespace datetime { |
1131 | - |
1132 | -/** |
1133 | - * \brief A simple C++ wrapper for GDateTime to simplify ownership/refcounts |
1134 | - */ |
1135 | -class DateTime |
1136 | -{ |
1137 | -public: |
1138 | - static DateTime NowLocal(); |
1139 | - static DateTime Local(time_t); |
1140 | - static DateTime Local(int year, int month, int day, int hour, int minute, double seconds); |
1141 | - |
1142 | - DateTime(); |
1143 | - DateTime(GTimeZone* tz, time_t t); |
1144 | - DateTime(GTimeZone* tz, GDateTime* dt); |
1145 | - DateTime(GTimeZone* tz, int year, int month, int day, int hour, int minute, double seconds); |
1146 | - DateTime& operator=(const DateTime& in); |
1147 | - DateTime& operator+=(const std::chrono::minutes&); |
1148 | - DateTime& operator+=(const std::chrono::seconds&); |
1149 | - DateTime to_timezone(const std::string& zone) const; |
1150 | - DateTime start_of_month() const; |
1151 | - DateTime start_of_day() const; |
1152 | - DateTime start_of_minute() const; |
1153 | - DateTime end_of_day() const; |
1154 | - DateTime end_of_month() const; |
1155 | - DateTime add_days(int days) const; |
1156 | - DateTime add_full(int year, int month, int day, int hour, int minute, double seconds) const; |
1157 | - |
1158 | - GDateTime* get() const; |
1159 | - GDateTime* operator()() const {return get();} |
1160 | - |
1161 | - std::string format(const std::string& fmt) const; |
1162 | - void ymd(int& year, int& month, int& day) const; |
1163 | - int day_of_month() const; |
1164 | - int hour() const; |
1165 | - int minute() const; |
1166 | - double seconds() const; |
1167 | - int64_t to_unix() const; |
1168 | - |
1169 | - bool operator<(const DateTime& that) const; |
1170 | - bool operator>(const DateTime& that) const; |
1171 | - bool operator<=(const DateTime& that) const; |
1172 | - bool operator>=(const DateTime& that) const; |
1173 | - bool operator!=(const DateTime& that) const; |
1174 | - bool operator==(const DateTime& that) const; |
1175 | - int64_t operator- (const DateTime& that) const; |
1176 | - |
1177 | - static bool is_same_day(const DateTime& a, const DateTime& b); |
1178 | - static bool is_same_minute(const DateTime& a, const DateTime& b); |
1179 | - |
1180 | - bool is_set() const { return m_tz && m_dt; } |
1181 | - |
1182 | -private: |
1183 | - void reset(GTimeZone*, GDateTime*); |
1184 | - std::shared_ptr<GTimeZone> m_tz; |
1185 | - std::shared_ptr<GDateTime> m_dt; |
1186 | -}; |
1187 | - |
1188 | -} // namespace datetime |
1189 | -} // namespace indicator |
1190 | -} // namespace unity |
1191 | - |
1192 | -#endif // INDICATOR_DATETIME_DATETIME_H |
1193 | |
1194 | === removed file 'include/datetime/dbus-shared.h' |
1195 | --- include/datetime/dbus-shared.h 2016-04-10 00:07:04 +0000 |
1196 | +++ include/datetime/dbus-shared.h 1970-01-01 00:00:00 +0000 |
1197 | @@ -1,66 +0,0 @@ |
1198 | -/* |
1199 | - * Copyright 2013 Canonical Ltd. |
1200 | - * |
1201 | - * This program is free software: you can redistribute it and/or modify it |
1202 | - * under the terms of the GNU General Public License version 3, as published |
1203 | - * by the Free Software Foundation. |
1204 | - * |
1205 | - * This program is distributed in the hope that it will be useful, but |
1206 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
1207 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1208 | - * PURPOSE. See the GNU General Public License for more details. |
1209 | - * |
1210 | - * You should have received a copy of the GNU General Public License along |
1211 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
1212 | - * |
1213 | - * Authors: |
1214 | - * Ted Gould <ted@canonical.com> |
1215 | - * Charles Kerr <charles.kerr@canonical.com> |
1216 | - */ |
1217 | - |
1218 | -#ifndef INDICATOR_DATETIME_DBUS_SHARED_H |
1219 | -#define INDICATOR_DATETIME_DBUS_SHARED_H |
1220 | - |
1221 | -#define BUS_DATETIME_NAME "com.canonical.indicator.datetime" |
1222 | -#define BUS_DATETIME_PATH "/com/canonical/indicator/datetime" |
1223 | - |
1224 | -#define BUS_POWERD_NAME "com.canonical.powerd" |
1225 | -#define BUS_POWERD_PATH "/com/canonical/powerd" |
1226 | -#define BUS_POWERD_INTERFACE "com.canonical.powerd" |
1227 | - |
1228 | -namespace Bus |
1229 | -{ |
1230 | - namespace Timedate1 |
1231 | - { |
1232 | - static constexpr char const * BUSNAME {"org.freedesktop.timedate1"}; |
1233 | - static constexpr char const * ADDR {"/org/freedesktop/timedate1"}; |
1234 | - static constexpr char const * IFACE {"org.freedesktop.timedate1"}; |
1235 | - |
1236 | - namespace Properties |
1237 | - { |
1238 | - static constexpr char const * TIMEZONE {"Timezone"}; |
1239 | - } |
1240 | - |
1241 | - namespace Methods |
1242 | - { |
1243 | - static constexpr char const * SET_TIMEZONE {"SetTimezone"}; |
1244 | - } |
1245 | - } |
1246 | - |
1247 | - namespace Properties |
1248 | - { |
1249 | - static constexpr char const * IFACE {"org.freedesktop.DBus.Properties"}; |
1250 | - |
1251 | - namespace Methods |
1252 | - { |
1253 | - static constexpr char const * GET {"Get"}; |
1254 | - } |
1255 | - |
1256 | - namespace Signals |
1257 | - { |
1258 | - static constexpr char const * PROPERTIES_CHANGED {"PropertiesChanged"}; |
1259 | - } |
1260 | - } |
1261 | -} |
1262 | - |
1263 | -#endif /* INDICATOR_DATETIME_DBUS_SHARED_H */ |
1264 | |
1265 | === removed file 'include/datetime/engine-eds.h' |
1266 | --- include/datetime/engine-eds.h 2016-05-14 02:07:10 +0000 |
1267 | +++ include/datetime/engine-eds.h 1970-01-01 00:00:00 +0000 |
1268 | @@ -1,77 +0,0 @@ |
1269 | -/* |
1270 | - * Copyright 2014 Canonical Ltd. |
1271 | - * |
1272 | - * This program is free software: you can redistribute it and/or modify it |
1273 | - * under the terms of the GNU General Public License version 3, as published |
1274 | - * by the Free Software Foundation. |
1275 | - * |
1276 | - * This program is distributed in the hope that it will be useful, but |
1277 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
1278 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1279 | - * PURPOSE. See the GNU General Public License for more details. |
1280 | - * |
1281 | - * You should have received a copy of the GNU General Public License along |
1282 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
1283 | - * |
1284 | - * Authors: |
1285 | - * Charles Kerr <charles.kerr@canonical.com> |
1286 | - */ |
1287 | - |
1288 | -#ifndef INDICATOR_DATETIME_ENGINE_EDS_H |
1289 | -#define INDICATOR_DATETIME_ENGINE_EDS_H |
1290 | - |
1291 | -#include <datetime/engine.h> |
1292 | - |
1293 | -#include <datetime/appointment.h> |
1294 | -#include <datetime/date-time.h> |
1295 | -#include <datetime/timezone.h> |
1296 | - |
1297 | -#include <functional> |
1298 | -#include <vector> |
1299 | - |
1300 | -namespace unity { |
1301 | -namespace indicator { |
1302 | -namespace datetime { |
1303 | - |
1304 | -/**** |
1305 | -***** |
1306 | -****/ |
1307 | -class Myself; |
1308 | - |
1309 | -/** |
1310 | - * Class wrapper around EDS so multiple #EdsPlanners can share resources |
1311 | - * |
1312 | - * @see EdsPlanner |
1313 | - */ |
1314 | -class EdsEngine: public Engine |
1315 | -{ |
1316 | -public: |
1317 | - EdsEngine(const std::shared_ptr<Myself> &myself); |
1318 | - ~EdsEngine(); |
1319 | - |
1320 | - void get_appointments(const DateTime& begin, |
1321 | - const DateTime& end, |
1322 | - const Timezone& default_timezone, |
1323 | - std::function<void(const std::vector<Appointment>&)> appointment_func) override; |
1324 | - void disable_ubuntu_alarm(const Appointment&) override; |
1325 | - |
1326 | - core::Signal<>& changed() override; |
1327 | - |
1328 | -private: |
1329 | - class Impl; |
1330 | - std::unique_ptr<Impl> p; |
1331 | - |
1332 | - // we've got a unique_ptr here, disable copying... |
1333 | - EdsEngine(const EdsEngine&) =delete; |
1334 | - EdsEngine& operator=(const EdsEngine&) =delete; |
1335 | -}; |
1336 | - |
1337 | -/*** |
1338 | -**** |
1339 | -***/ |
1340 | - |
1341 | -} // namespace datetime |
1342 | -} // namespace indicator |
1343 | -} // namespace unity |
1344 | - |
1345 | -#endif // INDICATOR_DATETIME_ENGINE_EDS_H |
1346 | |
1347 | === removed file 'include/datetime/engine-mock.h' |
1348 | --- include/datetime/engine-mock.h 2014-12-08 02:52:50 +0000 |
1349 | +++ include/datetime/engine-mock.h 1970-01-01 00:00:00 +0000 |
1350 | @@ -1,71 +0,0 @@ |
1351 | -/* |
1352 | - * Copyright 2014 Canonical Ltd. |
1353 | - * |
1354 | - * This program is free software: you can redistribute it and/or modify it |
1355 | - * under the terms of the GNU General Public License version 3, as published |
1356 | - * by the Free Software Foundation. |
1357 | - * |
1358 | - * This program is distributed in the hope that it will be useful, but |
1359 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
1360 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1361 | - * PURPOSE. See the GNU General Public License for more details. |
1362 | - * |
1363 | - * You should have received a copy of the GNU General Public License along |
1364 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
1365 | - * |
1366 | - * Authors: |
1367 | - * Charles Kerr <charles.kerr@canonical.com> |
1368 | - */ |
1369 | - |
1370 | -#ifndef INDICATOR_DATETIME_ENGINE_MOCK_H |
1371 | -#define INDICATOR_DATETIME_ENGINE_MOCK_H |
1372 | - |
1373 | -#include <datetime/engine.h> |
1374 | - |
1375 | -namespace unity { |
1376 | -namespace indicator { |
1377 | -namespace datetime { |
1378 | - |
1379 | -/**** |
1380 | -***** |
1381 | -****/ |
1382 | - |
1383 | -/** |
1384 | - * A no-op #Engine |
1385 | - * |
1386 | - * @see Engine |
1387 | - */ |
1388 | -class MockEngine: public Engine |
1389 | -{ |
1390 | -public: |
1391 | - MockEngine() =default; |
1392 | - ~MockEngine() =default; |
1393 | - |
1394 | - void get_appointments(const DateTime& /*begin*/, |
1395 | - const DateTime& /*end*/, |
1396 | - const Timezone& /*default_timezone*/, |
1397 | - std::function<void(const std::vector<Appointment>&)> appointment_func) override { |
1398 | - appointment_func(m_appointments); |
1399 | - } |
1400 | - |
1401 | - core::Signal<>& changed() override { |
1402 | - return m_changed; |
1403 | - } |
1404 | - |
1405 | - void disable_ubuntu_alarm(const Appointment&) override { |
1406 | - } |
1407 | - |
1408 | -private: |
1409 | - core::Signal<> m_changed; |
1410 | - std::vector<Appointment> m_appointments; |
1411 | -}; |
1412 | - |
1413 | -/*** |
1414 | -**** |
1415 | -***/ |
1416 | - |
1417 | -} // namespace datetime |
1418 | -} // namespace indicator |
1419 | -} // namespace unity |
1420 | - |
1421 | -#endif // INDICATOR_DATETIME_ENGINE_MOCK_H |
1422 | |
1423 | === removed file 'include/datetime/engine.h' |
1424 | --- include/datetime/engine.h 2014-12-08 02:52:50 +0000 |
1425 | +++ include/datetime/engine.h 1970-01-01 00:00:00 +0000 |
1426 | @@ -1,69 +0,0 @@ |
1427 | -/* |
1428 | - * Copyright 2014 Canonical Ltd. |
1429 | - * |
1430 | - * This program is free software: you can redistribute it and/or modify it |
1431 | - * under the terms of the GNU General Public License version 3, as published |
1432 | - * by the Free Software Foundation. |
1433 | - * |
1434 | - * This program is distributed in the hope that it will be useful, but |
1435 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
1436 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1437 | - * PURPOSE. See the GNU General Public License for more details. |
1438 | - * |
1439 | - * You should have received a copy of the GNU General Public License along |
1440 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
1441 | - * |
1442 | - * Authors: |
1443 | - * Charles Kerr <charles.kerr@canonical.com> |
1444 | - */ |
1445 | - |
1446 | -#ifndef INDICATOR_DATETIME_ENGINE_H |
1447 | -#define INDICATOR_DATETIME_ENGINE_H |
1448 | - |
1449 | -#include <datetime/appointment.h> |
1450 | -#include <datetime/date-time.h> |
1451 | -#include <datetime/timezone.h> |
1452 | - |
1453 | -#include <functional> |
1454 | -#include <vector> |
1455 | - |
1456 | -namespace unity { |
1457 | -namespace indicator { |
1458 | -namespace datetime { |
1459 | - |
1460 | -/**** |
1461 | -***** |
1462 | -****/ |
1463 | - |
1464 | -/** |
1465 | - * Class wrapper around the backend that generates appointments |
1466 | - * |
1467 | - * @see EdsEngine |
1468 | - * @see EdsPlanner |
1469 | - */ |
1470 | -class Engine |
1471 | -{ |
1472 | -public: |
1473 | - virtual ~Engine() =default; |
1474 | - |
1475 | - virtual void get_appointments(const DateTime& begin, |
1476 | - const DateTime& end, |
1477 | - const Timezone& default_timezone, |
1478 | - std::function<void(const std::vector<Appointment>&)> appointment_func) =0; |
1479 | - virtual void disable_ubuntu_alarm(const Appointment&) =0; |
1480 | - |
1481 | - virtual core::Signal<>& changed() =0; |
1482 | - |
1483 | -protected: |
1484 | - Engine() =default; |
1485 | -}; |
1486 | - |
1487 | -/*** |
1488 | -**** |
1489 | -***/ |
1490 | - |
1491 | -} // namespace datetime |
1492 | -} // namespace indicator |
1493 | -} // namespace unity |
1494 | - |
1495 | -#endif // INDICATOR_DATETIME_ENGINE_H |
1496 | |
1497 | === removed file 'include/datetime/exporter.h' |
1498 | --- include/datetime/exporter.h 2014-09-17 16:51:51 +0000 |
1499 | +++ include/datetime/exporter.h 1970-01-01 00:00:00 +0000 |
1500 | @@ -1,63 +0,0 @@ |
1501 | -/* |
1502 | - * Copyright 2013 Canonical Ltd. |
1503 | - * |
1504 | - * This program is free software: you can redistribute it and/or modify it |
1505 | - * under the terms of the GNU General Public License version 3, as published |
1506 | - * by the Free Software Foundation. |
1507 | - * |
1508 | - * This program is distributed in the hope that it will be useful, but |
1509 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
1510 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1511 | - * PURPOSE. See the GNU General Public License for more details. |
1512 | - * |
1513 | - * You should have received a copy of the GNU General Public License along |
1514 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
1515 | - * |
1516 | - * Authors: |
1517 | - * Charles Kerr <charles.kerr@canonical.com> |
1518 | - */ |
1519 | - |
1520 | -#ifndef INDICATOR_DATETIME_EXPORTER_H |
1521 | -#define INDICATOR_DATETIME_EXPORTER_H |
1522 | - |
1523 | -#include <datetime/actions.h> |
1524 | -#include <datetime/menu.h> |
1525 | -#include <datetime/settings.h> |
1526 | - |
1527 | -#include <core/signal.h> |
1528 | - |
1529 | -#include <memory> // std::shared_ptr |
1530 | -#include <vector> |
1531 | - |
1532 | -namespace unity { |
1533 | -namespace indicator { |
1534 | -namespace datetime { |
1535 | - |
1536 | -/** |
1537 | - * \brief Exports actions and menus to DBus. |
1538 | - */ |
1539 | -class Exporter |
1540 | -{ |
1541 | -public: |
1542 | - explicit Exporter(const std::shared_ptr<Settings>&); |
1543 | - ~Exporter(); |
1544 | - |
1545 | - core::Signal<>& name_lost(); |
1546 | - |
1547 | - void publish(const std::shared_ptr<Actions>& actions, |
1548 | - const std::vector<std::shared_ptr<Menu>>& menus); |
1549 | - |
1550 | -private: |
1551 | - class Impl; |
1552 | - std::unique_ptr<Impl> p; |
1553 | - |
1554 | - // disable copying |
1555 | - Exporter(const Exporter&) =delete; |
1556 | - Exporter& operator=(const Exporter&) =delete; |
1557 | -}; |
1558 | - |
1559 | -} // namespace datetime |
1560 | -} // namespace indicator |
1561 | -} // namespace unity |
1562 | - |
1563 | -#endif // INDICATOR_DATETIME_EXPORTER_H |
1564 | |
1565 | === removed file 'include/datetime/formatter.h' |
1566 | --- include/datetime/formatter.h 2014-09-17 16:51:51 +0000 |
1567 | +++ include/datetime/formatter.h 1970-01-01 00:00:00 +0000 |
1568 | @@ -1,138 +0,0 @@ |
1569 | -/* |
1570 | - * Copyright 2013 Canonical Ltd. |
1571 | - * |
1572 | - * This program is free software: you can redistribute it and/or modify it |
1573 | - * under the terms of the GNU General Public License version 3, as published |
1574 | - * by the Free Software Foundation. |
1575 | - * |
1576 | - * This program is distributed in the hope that it will be useful, but |
1577 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
1578 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1579 | - * PURPOSE. See the GNU General Public License for more details. |
1580 | - * |
1581 | - * You should have received a copy of the GNU General Public License along |
1582 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
1583 | - * |
1584 | - * Authors: |
1585 | - * Charles Kerr <charles.kerr@canonical.com> |
1586 | - */ |
1587 | - |
1588 | -#ifndef INDICATOR_DATETIME_FORMATTER_H |
1589 | -#define INDICATOR_DATETIME_FORMATTER_H |
1590 | - |
1591 | -#include <core/property.h> |
1592 | -#include <core/signal.h> |
1593 | - |
1594 | -#include <datetime/clock.h> |
1595 | -#include <datetime/settings.h> |
1596 | -#include <datetime/utils.h> // is_locale_12h() |
1597 | - |
1598 | -#include <glib.h> |
1599 | - |
1600 | -#include <string> |
1601 | -#include <memory> |
1602 | - |
1603 | -namespace unity { |
1604 | -namespace indicator { |
1605 | -namespace datetime { |
1606 | - |
1607 | -class Clock; |
1608 | -class DateTime; |
1609 | - |
1610 | -/*** |
1611 | -**** |
1612 | -***/ |
1613 | - |
1614 | -/** |
1615 | - * \brief Provide the strftime() format strings |
1616 | - * |
1617 | - * This is a simple goal, but getting there has a lot of options and edge cases: |
1618 | - * |
1619 | - * - The default time format can change based on the locale. |
1620 | - * |
1621 | - * - The user's settings can change or completely override the format string. |
1622 | - * |
1623 | - * - The time formats are different on the Phone and Desktop profiles. |
1624 | - * |
1625 | - * - The time format string in the Locations' menuitems uses (mostly) |
1626 | - * the same time format as the header, except for some changes. |
1627 | - * |
1628 | - * - The 'current time' format string in the Locations' menuitems also |
1629 | - * prepends the string 'Yesterday' or 'Today' if it differs from the |
1630 | - * local time, so Formatter needs to have a Clock for its state. |
1631 | - * |
1632 | - * So the Formatter monitors system settings, the current timezone, etc. |
1633 | - * and upate its time format properties appropriately. |
1634 | - */ |
1635 | -class Formatter |
1636 | -{ |
1637 | -public: |
1638 | - |
1639 | - /** \brief The time format string for the menu header */ |
1640 | - core::Property<std::string> header_format; |
1641 | - |
1642 | - /** \brief The time string for the menu header. (eg, the header_format + the clock's time */ |
1643 | - core::Property<std::string> header; |
1644 | - |
1645 | - /** \brief Signal to denote when the relativeFormat has changed. |
1646 | - When this is emitted, clients will want to rebuild their |
1647 | - menuitems that contain relative time strings |
1648 | - (ie, the Appointments and Locations menuitems) */ |
1649 | - core::Signal<> relative_format_changed; |
1650 | - |
1651 | - /** \brief Generate a relative time format for some time (or time range) |
1652 | - from the current clock's value. For example, a full-day interval |
1653 | - starting at the end of the current clock's day yields "Tomorrow" */ |
1654 | - std::string relative_format(GDateTime* then, GDateTime* then_end=nullptr) const; |
1655 | - |
1656 | -protected: |
1657 | - explicit Formatter(const std::shared_ptr<const Clock>&); |
1658 | - virtual ~Formatter(); |
1659 | - |
1660 | - static const char* default_header_time_format(bool twelvehour, bool show_seconds); |
1661 | - |
1662 | -private: |
1663 | - |
1664 | - Formatter(const Formatter&) =delete; |
1665 | - Formatter& operator=(const Formatter&) =delete; |
1666 | - |
1667 | - class Impl; |
1668 | - std::unique_ptr<Impl> p; |
1669 | -}; |
1670 | - |
1671 | - |
1672 | -/** |
1673 | - * \brief A Formatter for the Desktop and DesktopGreeter profiles. |
1674 | - */ |
1675 | -class DesktopFormatter: public Formatter |
1676 | -{ |
1677 | -public: |
1678 | - DesktopFormatter(const std::shared_ptr<const Clock>&, const std::shared_ptr<const Settings>&); |
1679 | - |
1680 | -private: |
1681 | - std::shared_ptr<const Settings> m_settings; |
1682 | - |
1683 | - void rebuildHeaderFormat(); |
1684 | - const gchar* getFullTimeFormatString() const; |
1685 | - std::string getHeaderLabelFormatString() const; |
1686 | - const gchar* getDateFormat(bool show_day, bool show_date, bool show_year) const; |
1687 | - |
1688 | -}; |
1689 | - |
1690 | - |
1691 | -/** |
1692 | - * \brief A Formatter for Phone and PhoneGreeter profiles. |
1693 | - */ |
1694 | -class PhoneFormatter: public Formatter |
1695 | -{ |
1696 | -public: |
1697 | - explicit PhoneFormatter(const std::shared_ptr<const Clock>& clock): Formatter(clock) { |
1698 | - header_format.set(default_header_time_format(is_locale_12h(), false)); |
1699 | - } |
1700 | -}; |
1701 | - |
1702 | -} // namespace datetime |
1703 | -} // namespace indicator |
1704 | -} // namespace unity |
1705 | - |
1706 | -#endif // INDICATOR_DATETIME_CLOCK_H |
1707 | |
1708 | === removed file 'include/datetime/locations-settings.h' |
1709 | --- include/datetime/locations-settings.h 2014-01-30 19:44:12 +0000 |
1710 | +++ include/datetime/locations-settings.h 1970-01-01 00:00:00 +0000 |
1711 | @@ -1,55 +0,0 @@ |
1712 | -/* |
1713 | - * Copyright 2013 Canonical Ltd. |
1714 | - * |
1715 | - * This program is free software: you can redistribute it and/or modify it |
1716 | - * under the terms of the GNU General Public License version 3, as published |
1717 | - * by the Free Software Foundation. |
1718 | - * |
1719 | - * This program is distributed in the hope that it will be useful, but |
1720 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
1721 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1722 | - * PURPOSE. See the GNU General Public License for more details. |
1723 | - * |
1724 | - * You should have received a copy of the GNU General Public License along |
1725 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
1726 | - * |
1727 | - * Authors: |
1728 | - * Charles Kerr <charles.kerr@canonical.com> |
1729 | - */ |
1730 | - |
1731 | -#ifndef INDICATOR_DATETIME_SETTINGS_LOCATIONS_H |
1732 | -#define INDICATOR_DATETIME_SETTINGS_LOCATIONS_H |
1733 | - |
1734 | -#include <datetime/locations.h> // base class |
1735 | - |
1736 | -#include <datetime/settings.h> |
1737 | -#include <datetime/timezones.h> |
1738 | - |
1739 | -namespace unity { |
1740 | -namespace indicator { |
1741 | -namespace datetime { |
1742 | - |
1743 | -/** |
1744 | - * \brief #Locations implementation which builds its list from the #Settings. |
1745 | - */ |
1746 | -class SettingsLocations: public Locations |
1747 | -{ |
1748 | -public: |
1749 | - /** |
1750 | - * @param[in] settings the #Settings whose locations property is to be used |
1751 | - * @param[in] timezones the #Timezones to always show first in the list |
1752 | - */ |
1753 | - SettingsLocations (const std::shared_ptr<const Settings>& settings, |
1754 | - const std::shared_ptr<const Timezones>& timezones); |
1755 | - |
1756 | -private: |
1757 | - std::shared_ptr<const Settings> m_settings; |
1758 | - std::shared_ptr<const Timezones> m_timezones; |
1759 | - void reload(); |
1760 | -}; |
1761 | - |
1762 | -} // namespace datetime |
1763 | -} // namespace indicator |
1764 | -} // namespace unity |
1765 | - |
1766 | -#endif // INDICATOR_DATETIME_SETTINGS_LOCATIONS_H |
1767 | |
1768 | === removed file 'include/datetime/locations.h' |
1769 | --- include/datetime/locations.h 2014-01-30 19:00:22 +0000 |
1770 | +++ include/datetime/locations.h 1970-01-01 00:00:00 +0000 |
1771 | @@ -1,79 +0,0 @@ |
1772 | -/* |
1773 | - * Copyright 2013 Canonical Ltd. |
1774 | - * |
1775 | - * This program is free software: you can redistribute it and/or modify it |
1776 | - * under the terms of the GNU General Public License version 3, as published |
1777 | - * by the Free Software Foundation. |
1778 | - * |
1779 | - * This program is distributed in the hope that it will be useful, but |
1780 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
1781 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1782 | - * PURPOSE. See the GNU General Public License for more details. |
1783 | - * |
1784 | - * You should have received a copy of the GNU General Public License along |
1785 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
1786 | - * |
1787 | - * Authors: |
1788 | - * Charles Kerr <charles.kerr@canonical.com> |
1789 | - */ |
1790 | - |
1791 | -#ifndef INDICATOR_DATETIME_LOCATIONS_H |
1792 | -#define INDICATOR_DATETIME_LOCATIONS_H |
1793 | - |
1794 | -#include <datetime/date-time.h> |
1795 | - |
1796 | -#include <core/property.h> |
1797 | - |
1798 | -#include <string> |
1799 | -#include <vector> |
1800 | - |
1801 | -namespace unity { |
1802 | -namespace indicator { |
1803 | -namespace datetime { |
1804 | - |
1805 | -/** |
1806 | - * \brief A physical place and its timezone; eg, "America/Chicago" + "Oklahoma City" |
1807 | - * |
1808 | - * @see Locations |
1809 | - */ |
1810 | -class Location |
1811 | -{ |
1812 | -public: |
1813 | - Location (const std::string& zone, const std::string& name); |
1814 | - const std::string& zone() const; |
1815 | - const std::string& name() const; |
1816 | - bool operator== (const Location& that) const; |
1817 | - |
1818 | -private: |
1819 | - |
1820 | - /** timezone; eg, "America/Chicago" */ |
1821 | - std::string m_zone; |
1822 | - |
1823 | - /* human-readable location name; eg, "Oklahoma City" */ |
1824 | - std::string m_name; |
1825 | - |
1826 | - /** offset from UTC in microseconds */ |
1827 | - int64_t m_offset = 0; |
1828 | -}; |
1829 | - |
1830 | -/** |
1831 | - * Container which holds an ordered list of Locations |
1832 | - * |
1833 | - * @see Location |
1834 | - * @see State |
1835 | - */ |
1836 | -class Locations |
1837 | -{ |
1838 | -public: |
1839 | - Locations() =default; |
1840 | - virtual ~Locations() =default; |
1841 | - |
1842 | - /** \brief an ordered list of Location items */ |
1843 | - core::Property<std::vector<Location>> locations; |
1844 | -}; |
1845 | - |
1846 | -} // namespace datetime |
1847 | -} // namespace indicator |
1848 | -} // namespace unity |
1849 | - |
1850 | -#endif // INDICATOR_DATETIME_LOCATIONS_H |
1851 | |
1852 | === removed file 'include/datetime/menu.h' |
1853 | --- include/datetime/menu.h 2016-05-14 02:07:10 +0000 |
1854 | +++ include/datetime/menu.h 1970-01-01 00:00:00 +0000 |
1855 | @@ -1,91 +0,0 @@ |
1856 | -/* |
1857 | - * Copyright 2013 Canonical Ltd. |
1858 | - * |
1859 | - * This program is free software: you can redistribute it and/or modify it |
1860 | - * under the terms of the GNU General Public License version 3, as published |
1861 | - * by the Free Software Foundation. |
1862 | - * |
1863 | - * This program is distributed in the hope that it will be useful, but |
1864 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
1865 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1866 | - * PURPOSE. See the GNU General Public License for more details. |
1867 | - * |
1868 | - * You should have received a copy of the GNU General Public License along |
1869 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
1870 | - * |
1871 | - * Authors: |
1872 | - * Charles Kerr <charles.kerr@canonical.com> |
1873 | - */ |
1874 | - |
1875 | -#ifndef INDICATOR_DATETIME_MENU_H |
1876 | -#define INDICATOR_DATETIME_MENU_H |
1877 | - |
1878 | -#include <datetime/actions.h> |
1879 | -#include <datetime/appointment.h> |
1880 | -#include <datetime/state.h> |
1881 | - |
1882 | -#include <memory> // std::shared_ptr |
1883 | -#include <vector> |
1884 | - |
1885 | -#include <gio/gio.h> // GMenuModel |
1886 | - |
1887 | -namespace unity { |
1888 | -namespace indicator { |
1889 | -namespace datetime { |
1890 | - |
1891 | -/** |
1892 | - * \brief A menu for a specific profile; eg, Desktop or Phone. |
1893 | - * |
1894 | - * @see MenuFactory |
1895 | - * @see Exporter |
1896 | - */ |
1897 | -class Menu |
1898 | -{ |
1899 | -public: |
1900 | - enum Profile { Desktop, DesktopGreeter, Phone, PhoneGreeter, NUM_PROFILES }; |
1901 | - enum Section { Calendar, Appointments, Locations, Settings, NUM_SECTIONS }; |
1902 | - const std::string& name() const; |
1903 | - Profile profile() const; |
1904 | - GMenuModel* menu_model(); |
1905 | - |
1906 | - static std::vector<Appointment> get_display_appointments( |
1907 | - const std::vector<Appointment>&, |
1908 | - const DateTime& start, |
1909 | - unsigned int max_items=5); |
1910 | - |
1911 | -protected: |
1912 | - Menu (Profile profile_in, const std::string& name_in); |
1913 | - virtual ~Menu() =default; |
1914 | - GMenu* m_menu = nullptr; |
1915 | - |
1916 | -private: |
1917 | - const Profile m_profile; |
1918 | - const std::string m_name; |
1919 | - |
1920 | - // we've got raw pointers in here, so disable copying |
1921 | - Menu(const Menu&) =delete; |
1922 | - Menu& operator=(const Menu&) =delete; |
1923 | -}; |
1924 | - |
1925 | -/** |
1926 | - * \brief Builds a Menu for a given state and profile |
1927 | - * |
1928 | - * @see Menu |
1929 | - * @see Exporter |
1930 | - */ |
1931 | -class MenuFactory |
1932 | -{ |
1933 | -public: |
1934 | - MenuFactory (const std::shared_ptr<Actions>& actions, const std::shared_ptr<const State>& state); |
1935 | - std::shared_ptr<Menu> buildMenu(Menu::Profile profile); |
1936 | - |
1937 | -private: |
1938 | - std::shared_ptr<Actions> m_actions; |
1939 | - std::shared_ptr<const State> m_state; |
1940 | -}; |
1941 | - |
1942 | -} // namespace datetime |
1943 | -} // namespace indicator |
1944 | -} // namespace unity |
1945 | - |
1946 | -#endif // INDICATOR_DATETIME_MENU_H |
1947 | |
1948 | === removed file 'include/datetime/myself.h' |
1949 | --- include/datetime/myself.h 2016-05-14 12:09:01 +0000 |
1950 | +++ include/datetime/myself.h 1970-01-01 00:00:00 +0000 |
1951 | @@ -1,62 +0,0 @@ |
1952 | -/* |
1953 | - * Copyright 2016 Canonical Ltd. |
1954 | - * |
1955 | - * This program is free software: you can redistribute it and/or modify it |
1956 | - * under the terms of the GNU General Public License version 3, as published |
1957 | - * by the Free Software Foundation. |
1958 | - * |
1959 | - * This program is distributed in the hope that it will be useful, but |
1960 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
1961 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1962 | - * PURPOSE. See the GNU General Public License for more details. |
1963 | - * |
1964 | - * You should have received a copy of the GNU General Public License along |
1965 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
1966 | - * |
1967 | - * Authors: |
1968 | - * Renato Araujo Oliveira Filho <renato.filho@canonical.com> |
1969 | - */ |
1970 | - |
1971 | -#ifndef INDICATOR_DATETIME_MYSELF_H |
1972 | -#define INDICATOR_DATETIME_MYSELF_H |
1973 | - |
1974 | -#include <core/property.h> |
1975 | - |
1976 | -#include <string> |
1977 | -#include <set> |
1978 | -#include <memory.h> |
1979 | -#include <glib.h> |
1980 | - |
1981 | -typedef struct _AgManager AgManager; |
1982 | - |
1983 | -namespace unity { |
1984 | -namespace indicator { |
1985 | -namespace datetime { |
1986 | - |
1987 | -class Myself |
1988 | -{ |
1989 | -public: |
1990 | - Myself(); |
1991 | - |
1992 | - const core::Property<std::set<std::string>>& emails() |
1993 | - { |
1994 | - return m_emails; |
1995 | - } |
1996 | - |
1997 | - bool isMyEmail(const std::string &email); |
1998 | - |
1999 | -private: |
2000 | - std::shared_ptr<AgManager> m_accounts_manager; |
2001 | - core::Property<std::set<std::string> > m_emails; |
2002 | - |
2003 | - static void on_accounts_changed(AgManager*, guint, Myself*); |
2004 | - void reloadEmails(); |
2005 | - |
2006 | -}; |
2007 | - |
2008 | - |
2009 | -} // namespace datetime |
2010 | -} // namespace indicator |
2011 | -} // namespace unity |
2012 | - |
2013 | -#endif // INDICATOR_DATETIME_MYSELF_H |
2014 | |
2015 | === removed file 'include/datetime/planner-aggregate.h' |
2016 | --- include/datetime/planner-aggregate.h 2014-09-03 04:37:02 +0000 |
2017 | +++ include/datetime/planner-aggregate.h 1970-01-01 00:00:00 +0000 |
2018 | @@ -1,52 +0,0 @@ |
2019 | -/* |
2020 | - * Copyright 2014 Canonical Ltd. |
2021 | - * |
2022 | - * This program is free software: you can redistribute it and/or modify it |
2023 | - * under the terms of the GNU General Public License version 3, as published |
2024 | - * by the Free Software Foundation. |
2025 | - * |
2026 | - * This program is distributed in the hope that it will be useful, but |
2027 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2028 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2029 | - * PURPOSE. See the GNU General Public License for more details. |
2030 | - * |
2031 | - * You should have received a copy of the GNU General Public License along |
2032 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2033 | - * |
2034 | - * Authors: |
2035 | - * Charles Kerr <charles.kerr@canonical.com> |
2036 | - */ |
2037 | - |
2038 | -#ifndef INDICATOR_DATETIME_PLANNER_AGGREGATE_H |
2039 | -#define INDICATOR_DATETIME_PLANNER_AGGREGATE_H |
2040 | - |
2041 | -#include <datetime/planner.h> |
2042 | - |
2043 | -#include <memory> |
2044 | - |
2045 | -namespace unity { |
2046 | -namespace indicator { |
2047 | -namespace datetime { |
2048 | - |
2049 | -/** |
2050 | - * \brief Aggregates one or more Planners |
2051 | - */ |
2052 | -class AggregatePlanner: public Planner |
2053 | -{ |
2054 | -public: |
2055 | - AggregatePlanner(); |
2056 | - virtual ~AggregatePlanner(); |
2057 | - void add(const std::shared_ptr<Planner>&); |
2058 | - |
2059 | - core::Property<std::vector<Appointment>>& appointments() override; |
2060 | - |
2061 | -protected: |
2062 | - class Impl; |
2063 | - std::unique_ptr<Impl> impl; |
2064 | -}; |
2065 | - |
2066 | -} // namespace datetime |
2067 | -} // namespace indicator |
2068 | -} // namespace unity |
2069 | - |
2070 | -#endif // INDICATOR_DATETIME_PLANNER_AGGREGATE_H |
2071 | |
2072 | === removed file 'include/datetime/planner-month.h' |
2073 | --- include/datetime/planner-month.h 2014-03-10 02:08:47 +0000 |
2074 | +++ include/datetime/planner-month.h 1970-01-01 00:00:00 +0000 |
2075 | @@ -1,56 +0,0 @@ |
2076 | -/* |
2077 | - * Copyright 2014 Canonical Ltd. |
2078 | - * |
2079 | - * This program is free software: you can redistribute it and/or modify it |
2080 | - * under the terms of the GNU General Public License version 3, as published |
2081 | - * by the Free Software Foundation. |
2082 | - * |
2083 | - * This program is distributed in the hope that it will be useful, but |
2084 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2085 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2086 | - * PURPOSE. See the GNU General Public License for more details. |
2087 | - * |
2088 | - * You should have received a copy of the GNU General Public License along |
2089 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2090 | - * |
2091 | - * Authors: |
2092 | - * Charles Kerr <charles.kerr@canonical.com> |
2093 | - */ |
2094 | - |
2095 | -#ifndef INDICATOR_DATETIME_PLANNER_MONTH_H |
2096 | -#define INDICATOR_DATETIME_PLANNER_MONTH_H |
2097 | - |
2098 | -#include <datetime/planner.h> |
2099 | - |
2100 | -#include <datetime/date-time.h> |
2101 | -#include <datetime/planner-range.h> |
2102 | - |
2103 | -#include <memory> // std::shared_ptr |
2104 | - |
2105 | -namespace unity { |
2106 | -namespace indicator { |
2107 | -namespace datetime { |
2108 | - |
2109 | -/** |
2110 | - * \brief A #Planner that contains appointments for a specified calendar month |
2111 | - */ |
2112 | -class MonthPlanner: public Planner |
2113 | -{ |
2114 | -public: |
2115 | - MonthPlanner(const std::shared_ptr<RangePlanner>& range_planner, |
2116 | - const DateTime& month_in); |
2117 | - ~MonthPlanner() =default; |
2118 | - |
2119 | - core::Property<std::vector<Appointment>>& appointments(); |
2120 | - core::Property<DateTime>& month(); |
2121 | - |
2122 | -private: |
2123 | - std::shared_ptr<RangePlanner> m_range_planner; |
2124 | - core::Property<DateTime> m_month; |
2125 | -}; |
2126 | - |
2127 | -} // namespace datetime |
2128 | -} // namespace indicator |
2129 | -} // namespace unity |
2130 | - |
2131 | -#endif // INDICATOR_DATETIME_PLANNER_MONTH_H |
2132 | |
2133 | === removed file 'include/datetime/planner-range.h' |
2134 | --- include/datetime/planner-range.h 2014-09-17 16:51:51 +0000 |
2135 | +++ include/datetime/planner-range.h 1970-01-01 00:00:00 +0000 |
2136 | @@ -1,84 +0,0 @@ |
2137 | -/* |
2138 | - * Copyright 2014 Canonical Ltd. |
2139 | - * |
2140 | - * This program is free software: you can redistribute it and/or modify it |
2141 | - * under the terms of the GNU General Public License version 3, as published |
2142 | - * by the Free Software Foundation. |
2143 | - * |
2144 | - * This program is distributed in the hope that it will be useful, but |
2145 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2146 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2147 | - * PURPOSE. See the GNU General Public License for more details. |
2148 | - * |
2149 | - * You should have received a copy of the GNU General Public License along |
2150 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2151 | - * |
2152 | - * Authors: |
2153 | - * Charles Kerr <charles.kerr@canonical.com> |
2154 | - */ |
2155 | - |
2156 | -#ifndef INDICATOR_DATETIME_PLANNER_RANGE_H |
2157 | -#define INDICATOR_DATETIME_PLANNER_RANGE_H |
2158 | - |
2159 | -#include <datetime/planner.h> |
2160 | - |
2161 | -#include <datetime/date-time.h> |
2162 | -#include <datetime/engine.h> |
2163 | - |
2164 | -namespace unity { |
2165 | -namespace indicator { |
2166 | -namespace datetime { |
2167 | - |
2168 | -/** |
2169 | - * \brief A #Planner that contains appointments in a specified date range |
2170 | - * |
2171 | - * @see Planner |
2172 | - */ |
2173 | -class RangePlanner: public Planner |
2174 | -{ |
2175 | -public: |
2176 | - virtual ~RangePlanner() =default; |
2177 | - virtual core::Property<std::pair<DateTime,DateTime>>& range() =0; |
2178 | - |
2179 | -protected: |
2180 | - RangePlanner() =default; |
2181 | -}; |
2182 | - |
2183 | -/** |
2184 | - * \brief A #RangePlanner that uses an #Engine to generate appointments |
2185 | - * |
2186 | - * @see Planner |
2187 | - */ |
2188 | -class SimpleRangePlanner: public RangePlanner |
2189 | -{ |
2190 | -public: |
2191 | - SimpleRangePlanner(const std::shared_ptr<Engine>& engine, |
2192 | - const std::shared_ptr<Timezone>& timezone); |
2193 | - virtual ~SimpleRangePlanner(); |
2194 | - |
2195 | - core::Property<std::vector<Appointment>>& appointments(); |
2196 | - core::Property<std::pair<DateTime,DateTime>>& range(); |
2197 | - |
2198 | -private: |
2199 | - // rebuild scaffolding |
2200 | - void rebuild_soon(); |
2201 | - virtual void rebuild_now(); |
2202 | - static gboolean rebuild_now_static(gpointer); |
2203 | - guint m_rebuild_tag = 0; |
2204 | - |
2205 | - std::shared_ptr<Engine> m_engine; |
2206 | - std::shared_ptr<Timezone> m_timezone; |
2207 | - core::Property<std::pair<DateTime,DateTime>> m_range; |
2208 | - core::Property<std::vector<Appointment>> m_appointments; |
2209 | - |
2210 | - // we've got a GSignal tag here, so disable copying |
2211 | - explicit SimpleRangePlanner(const RangePlanner&) =delete; |
2212 | - SimpleRangePlanner& operator=(const RangePlanner&) =delete; |
2213 | -}; |
2214 | - |
2215 | - |
2216 | -} // namespace datetime |
2217 | -} // namespace indicator |
2218 | -} // namespace unity |
2219 | - |
2220 | -#endif // INDICATOR_DATETIME_PLANNER_RANGE_H |
2221 | |
2222 | === removed file 'include/datetime/planner-snooze.h' |
2223 | --- include/datetime/planner-snooze.h 2015-04-03 18:11:39 +0000 |
2224 | +++ include/datetime/planner-snooze.h 1970-01-01 00:00:00 +0000 |
2225 | @@ -1,55 +0,0 @@ |
2226 | -/* |
2227 | - * Copyright 2013 Canonical Ltd. |
2228 | - * |
2229 | - * This program is free software: you can redistribute it and/or modify it |
2230 | - * under the terms of the GNU General Public License version 3, as published |
2231 | - * by the Free Software Foundation. |
2232 | - * |
2233 | - * This program is distributed in the hope that it will be useful, but |
2234 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2235 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2236 | - * PURPOSE. See the GNU General Public License for more details. |
2237 | - * |
2238 | - * You should have received a copy of the GNU General Public License along |
2239 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2240 | - * |
2241 | - * Authors: |
2242 | - * Charles Kerr <charles.kerr@canonical.com> |
2243 | - */ |
2244 | - |
2245 | -#ifndef INDICATOR_DATETIME_PLANNER_SNOOZE_H |
2246 | -#define INDICATOR_DATETIME_PLANNER_SNOOZE_H |
2247 | - |
2248 | -#include <datetime/clock.h> |
2249 | -#include <datetime/planner.h> |
2250 | -#include <datetime/settings.h> |
2251 | - |
2252 | -#include <memory> |
2253 | - |
2254 | -namespace unity { |
2255 | -namespace indicator { |
2256 | -namespace datetime { |
2257 | - |
2258 | -/** |
2259 | - * A planner to hold 'Snooze' copies of other appointments |
2260 | - */ |
2261 | -class SnoozePlanner: public Planner |
2262 | -{ |
2263 | -public: |
2264 | - SnoozePlanner(const std::shared_ptr<Settings>&, |
2265 | - const std::shared_ptr<Clock>&); |
2266 | - ~SnoozePlanner(); |
2267 | - core::Property<std::vector<Appointment>>& appointments() override; |
2268 | - void add(const Appointment&, const Alarm&); |
2269 | - |
2270 | -protected: |
2271 | - class Impl; |
2272 | - friend class Impl; |
2273 | - std::unique_ptr<Impl> impl; |
2274 | -}; |
2275 | - |
2276 | -} // namespace datetime |
2277 | -} // namespace indicator |
2278 | -} // namespace unity |
2279 | - |
2280 | -#endif // INDICATOR_DATETIME_PLANNER_H |
2281 | |
2282 | === removed file 'include/datetime/planner-upcoming.h' |
2283 | --- include/datetime/planner-upcoming.h 2014-03-10 02:08:47 +0000 |
2284 | +++ include/datetime/planner-upcoming.h 1970-01-01 00:00:00 +0000 |
2285 | @@ -1,56 +0,0 @@ |
2286 | -/* |
2287 | - * Copyright 2014 Canonical Ltd. |
2288 | - * |
2289 | - * This program is free software: you can redistribute it and/or modify it |
2290 | - * under the terms of the GNU General Public License version 3, as published |
2291 | - * by the Free Software Foundation. |
2292 | - * |
2293 | - * This program is distributed in the hope that it will be useful, but |
2294 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2295 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2296 | - * PURPOSE. See the GNU General Public License for more details. |
2297 | - * |
2298 | - * You should have received a copy of the GNU General Public License along |
2299 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2300 | - * |
2301 | - * Authors: |
2302 | - * Charles Kerr <charles.kerr@canonical.com> |
2303 | - */ |
2304 | - |
2305 | -#ifndef INDICATOR_DATETIME_PLANNER_UPCOMING_H |
2306 | -#define INDICATOR_DATETIME_PLANNER_UPCOMING_H |
2307 | - |
2308 | -#include <datetime/planner.h> |
2309 | - |
2310 | -#include <datetime/date-time.h> |
2311 | -#include <datetime/planner-range.h> |
2312 | - |
2313 | -#include <memory> // std::shared_ptr |
2314 | - |
2315 | -namespace unity { |
2316 | -namespace indicator { |
2317 | -namespace datetime { |
2318 | - |
2319 | -/** |
2320 | - * \brief A collection of upcoming appointments starting from the specified date |
2321 | - */ |
2322 | -class UpcomingPlanner: public Planner |
2323 | -{ |
2324 | -public: |
2325 | - UpcomingPlanner(const std::shared_ptr<RangePlanner>& range_planner, |
2326 | - const DateTime& date); |
2327 | - ~UpcomingPlanner() =default; |
2328 | - |
2329 | - core::Property<std::vector<Appointment>>& appointments(); |
2330 | - core::Property<DateTime>& date(); |
2331 | - |
2332 | -private: |
2333 | - std::shared_ptr<RangePlanner> m_range_planner; |
2334 | - core::Property<DateTime> m_date; |
2335 | -}; |
2336 | - |
2337 | -} // namespace datetime |
2338 | -} // namespace indicator |
2339 | -} // namespace unity |
2340 | - |
2341 | -#endif // INDICATOR_DATETIME_PLANNER_UPCOMING_H |
2342 | |
2343 | === removed file 'include/datetime/planner.h' |
2344 | --- include/datetime/planner.h 2014-09-03 04:37:35 +0000 |
2345 | +++ include/datetime/planner.h 1970-01-01 00:00:00 +0000 |
2346 | @@ -1,52 +0,0 @@ |
2347 | -/* |
2348 | - * Copyright 2013 Canonical Ltd. |
2349 | - * |
2350 | - * This program is free software: you can redistribute it and/or modify it |
2351 | - * under the terms of the GNU General Public License version 3, as published |
2352 | - * by the Free Software Foundation. |
2353 | - * |
2354 | - * This program is distributed in the hope that it will be useful, but |
2355 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2356 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2357 | - * PURPOSE. See the GNU General Public License for more details. |
2358 | - * |
2359 | - * You should have received a copy of the GNU General Public License along |
2360 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2361 | - * |
2362 | - * Authors: |
2363 | - * Charles Kerr <charles.kerr@canonical.com> |
2364 | - */ |
2365 | - |
2366 | -#ifndef INDICATOR_DATETIME_PLANNER_H |
2367 | -#define INDICATOR_DATETIME_PLANNER_H |
2368 | - |
2369 | -#include <datetime/appointment.h> |
2370 | -#include <datetime/date-time.h> |
2371 | - |
2372 | -#include <core/property.h> |
2373 | - |
2374 | -#include <vector> |
2375 | - |
2376 | -namespace unity { |
2377 | -namespace indicator { |
2378 | -namespace datetime { |
2379 | - |
2380 | -/** |
2381 | - * \brief Simple collection of appointments |
2382 | - */ |
2383 | -class Planner |
2384 | -{ |
2385 | -public: |
2386 | - virtual ~Planner(); |
2387 | - virtual core::Property<std::vector<Appointment>>& appointments() =0; |
2388 | - |
2389 | -protected: |
2390 | - Planner(); |
2391 | - static void sort(std::vector<Appointment>&); |
2392 | -}; |
2393 | - |
2394 | -} // namespace datetime |
2395 | -} // namespace indicator |
2396 | -} // namespace unity |
2397 | - |
2398 | -#endif // INDICATOR_DATETIME_PLANNER_H |
2399 | |
2400 | === removed file 'include/datetime/settings-live.h' |
2401 | --- include/datetime/settings-live.h 2016-07-04 19:30:18 +0000 |
2402 | +++ include/datetime/settings-live.h 1970-01-01 00:00:00 +0000 |
2403 | @@ -1,88 +0,0 @@ |
2404 | -/* |
2405 | - * Copyright 2013 Canonical Ltd. |
2406 | - * |
2407 | - * This program is free software: you can redistribute it and/or modify it |
2408 | - * under the terms of the GNU General Public License version 3, as published |
2409 | - * by the Free Software Foundation. |
2410 | - * |
2411 | - * This program is distributed in the hope that it will be useful, but |
2412 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2413 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2414 | - * PURPOSE. See the GNU General Public License for more details. |
2415 | - * |
2416 | - * You should have received a copy of the GNU General Public License along |
2417 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2418 | - * |
2419 | - * Authors: |
2420 | - * Charles Kerr <charles.kerr@canonical.com> |
2421 | - */ |
2422 | - |
2423 | -#ifndef INDICATOR_DATETIME_SETTINGS_LIVE_H |
2424 | -#define INDICATOR_DATETIME_SETTINGS_LIVE_H |
2425 | - |
2426 | -#include <datetime/settings.h> // parent class |
2427 | - |
2428 | -#include <gio/gio.h> // GSettings |
2429 | - |
2430 | -namespace unity { |
2431 | -namespace indicator { |
2432 | -namespace datetime { |
2433 | - |
2434 | -/** |
2435 | - * \brief #Settings implementation which uses GSettings. |
2436 | - */ |
2437 | -class LiveSettings: public Settings |
2438 | -{ |
2439 | -public: |
2440 | - LiveSettings(); |
2441 | - virtual ~LiveSettings(); |
2442 | - |
2443 | -private: |
2444 | - static void on_changed_ccid(GSettings*, gchar*, gpointer); |
2445 | - static void on_changed_cal_notification(GSettings*, gchar*, gpointer); |
2446 | - static void on_changed_general_notification(GSettings*, gchar*, gpointer); |
2447 | - void update_key_ccid(const std::string& key); |
2448 | - void update_key_cal_notification(const std::string& key); |
2449 | - void update_key_general_notification(const std::string& key); |
2450 | - |
2451 | - void update_custom_time_format(); |
2452 | - void update_locations(); |
2453 | - void update_show_calendar(); |
2454 | - void update_show_clock(); |
2455 | - void update_show_date(); |
2456 | - void update_show_day(); |
2457 | - void update_show_detected_locations(); |
2458 | - void update_show_events(); |
2459 | - void update_show_locations(); |
2460 | - void update_show_seconds(); |
2461 | - void update_show_week_numbers(); |
2462 | - void update_show_year(); |
2463 | - void update_time_format_mode(); |
2464 | - void update_timezone_name(); |
2465 | - void update_calendar_sound(); |
2466 | - void update_alarm_sound(); |
2467 | - void update_alarm_volume(); |
2468 | - void update_alarm_duration(); |
2469 | - void update_alarm_haptic(); |
2470 | - void update_snooze_duration(); |
2471 | - void update_cal_notification_enabled(); |
2472 | - void update_cal_notification_sounds(); |
2473 | - void update_cal_notification_vibrations(); |
2474 | - void update_cal_notification_bubbles(); |
2475 | - void update_cal_notification_list(); |
2476 | - void update_vibrate_silent_mode(); |
2477 | - |
2478 | - GSettings* m_settings; |
2479 | - GSettings* m_settings_cal_notification; |
2480 | - GSettings* m_settings_general_notification; |
2481 | - |
2482 | - // we've got a raw pointer here, so disable copying |
2483 | - LiveSettings(const LiveSettings&) =delete; |
2484 | - LiveSettings& operator=(const LiveSettings&) =delete; |
2485 | -}; |
2486 | - |
2487 | -} // namespace datetime |
2488 | -} // namespace indicator |
2489 | -} // namespace unity |
2490 | - |
2491 | -#endif // INDICATOR_DATETIME_SETTINGS_LIVE_H |
2492 | |
2493 | === removed file 'include/datetime/settings-shared.h' |
2494 | --- include/datetime/settings-shared.h 2016-07-04 19:30:18 +0000 |
2495 | +++ include/datetime/settings-shared.h 1970-01-01 00:00:00 +0000 |
2496 | @@ -1,65 +0,0 @@ |
2497 | -/* |
2498 | - * Copyright 2010 Canonical Ltd. |
2499 | - * |
2500 | - * This program is free software: you can redistribute it and/or modify it |
2501 | - * under the terms of the GNU General Public License version 3, as published |
2502 | - * by the Free Software Foundation. |
2503 | - * |
2504 | - * This program is distributed in the hope that it will be useful, but |
2505 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2506 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2507 | - * PURPOSE. See the GNU General Public License for more details. |
2508 | - * |
2509 | - * You should have received a copy of the GNU General Public License along |
2510 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2511 | - * |
2512 | - * Authors: |
2513 | - * Ted Gould <ted@canonical.com> |
2514 | - * Charles Kerr <charles.kerr@canonical.com> |
2515 | - */ |
2516 | - |
2517 | -#ifndef INDICATOR_DATETIME_SETTINGS_SHARED |
2518 | -#define INDICATOR_DATETIME_SETTINGS_SHARED |
2519 | - |
2520 | -typedef enum |
2521 | -{ |
2522 | - TIME_FORMAT_MODE_LOCALE_DEFAULT, |
2523 | - TIME_FORMAT_MODE_12_HOUR, |
2524 | - TIME_FORMAT_MODE_24_HOUR, |
2525 | - TIME_FORMAT_MODE_CUSTOM |
2526 | -} |
2527 | -TimeFormatMode; |
2528 | - |
2529 | -#define SETTINGS_INTERFACE "com.canonical.indicator.datetime" |
2530 | -#define SETTINGS_SHOW_CLOCK_S "show-clock" |
2531 | -#define SETTINGS_TIME_FORMAT_S "time-format" |
2532 | -#define SETTINGS_SHOW_SECONDS_S "show-seconds" |
2533 | -#define SETTINGS_SHOW_DAY_S "show-day" |
2534 | -#define SETTINGS_SHOW_DATE_S "show-date" |
2535 | -#define SETTINGS_SHOW_YEAR_S "show-year" |
2536 | -#define SETTINGS_CUSTOM_TIME_FORMAT_S "custom-time-format" |
2537 | -#define SETTINGS_SHOW_CALENDAR_S "show-calendar" |
2538 | -#define SETTINGS_SHOW_WEEK_NUMBERS_S "show-week-numbers" |
2539 | -#define SETTINGS_SHOW_EVENTS_S "show-events" |
2540 | -#define SETTINGS_SHOW_LOCATIONS_S "show-locations" |
2541 | -#define SETTINGS_SHOW_DETECTED_S "show-auto-detected-location" |
2542 | -#define SETTINGS_LOCATIONS_S "locations" |
2543 | -#define SETTINGS_TIMEZONE_NAME_S "timezone-name" |
2544 | -#define SETTINGS_CALENDAR_SOUND_S "calendar-default-sound" |
2545 | -#define SETTINGS_ALARM_SOUND_S "alarm-default-sound" |
2546 | -#define SETTINGS_ALARM_VOLUME_S "alarm-default-volume" |
2547 | -#define SETTINGS_ALARM_DURATION_S "alarm-duration-minutes" |
2548 | -#define SETTINGS_ALARM_HAPTIC_S "alarm-haptic-feedback" |
2549 | -#define SETTINGS_SNOOZE_DURATION_S "snooze-duration-minutes" |
2550 | - |
2551 | -#define SETTINGS_NOTIFY_APPS_SCHEMA_ID "com.ubuntu.notifications.settings.applications" |
2552 | -#define SETTINGS_VIBRATE_SILENT_KEY "vibrate-silent-mode" |
2553 | -#define SETTINGS_NOTIFY_SCHEMA_ID "com.ubuntu.notifications.settings" |
2554 | -#define SETTINGS_NOTIFY_CALENDAR_PATH "/com/ubuntu/NotificationSettings/com.ubuntu.calendar/calendar/" |
2555 | -#define SETTINGS_NOTIFY_ENABLED_KEY "enable-notifications" |
2556 | -#define SETTINGS_NOTIFY_SOUNDS_KEY "use-sounds-notifications" |
2557 | -#define SETTINGS_NOTIFY_VIBRATIONS_KEY "use-vibrations-notifications" |
2558 | -#define SETTINGS_NOTIFY_BUBBLES_KEY "use-bubbles-notifications" |
2559 | -#define SETTINGS_NOTIFY_LIST_KEY "use-list-notifications" |
2560 | - |
2561 | -#endif // INDICATOR_DATETIME_SETTINGS_SHARED |
2562 | |
2563 | === removed file 'include/datetime/settings.h' |
2564 | --- include/datetime/settings.h 2016-07-04 19:30:18 +0000 |
2565 | +++ include/datetime/settings.h 1970-01-01 00:00:00 +0000 |
2566 | @@ -1,77 +0,0 @@ |
2567 | -/* |
2568 | - * Copyright 2013 Canonical Ltd. |
2569 | - * |
2570 | - * This program is free software: you can redistribute it and/or modify it |
2571 | - * under the terms of the GNU General Public License version 3, as published |
2572 | - * by the Free Software Foundation. |
2573 | - * |
2574 | - * This program is distributed in the hope that it will be useful, but |
2575 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2576 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2577 | - * PURPOSE. See the GNU General Public License for more details. |
2578 | - * |
2579 | - * You should have received a copy of the GNU General Public License along |
2580 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2581 | - * |
2582 | - * Authors: |
2583 | - * Charles Kerr <charles.kerr@canonical.com> |
2584 | - */ |
2585 | - |
2586 | -#ifndef INDICATOR_DATETIME_SETTINGS_H |
2587 | -#define INDICATOR_DATETIME_SETTINGS_H |
2588 | - |
2589 | -#include <datetime/settings-shared.h> |
2590 | - |
2591 | -#include <core/property.h> |
2592 | - |
2593 | -#include <vector> |
2594 | - |
2595 | -namespace unity { |
2596 | -namespace indicator { |
2597 | -namespace datetime { |
2598 | - |
2599 | -/** |
2600 | - * \brief Interface that represents user-configurable settings. |
2601 | - * |
2602 | - * See the descriptions in data/com.canonical.indicator.datetime.gschema.xml |
2603 | - * for more information on specific properties. |
2604 | - */ |
2605 | -class Settings |
2606 | -{ |
2607 | -public: |
2608 | - Settings() =default; |
2609 | - virtual ~Settings() =default; |
2610 | - |
2611 | - core::Property<std::string> custom_time_format; |
2612 | - core::Property<std::vector<std::string>> locations; |
2613 | - core::Property<bool> show_calendar; |
2614 | - core::Property<bool> show_clock; |
2615 | - core::Property<bool> show_date; |
2616 | - core::Property<bool> show_day; |
2617 | - core::Property<bool> show_detected_location; |
2618 | - core::Property<bool> show_events; |
2619 | - core::Property<bool> show_locations; |
2620 | - core::Property<bool> show_seconds; |
2621 | - core::Property<bool> show_week_numbers; |
2622 | - core::Property<bool> show_year; |
2623 | - core::Property<TimeFormatMode> time_format_mode; |
2624 | - core::Property<std::string> timezone_name; |
2625 | - core::Property<std::string> calendar_sound; |
2626 | - core::Property<std::string> alarm_sound; |
2627 | - core::Property<std::string> alarm_haptic; |
2628 | - core::Property<unsigned int> alarm_volume; |
2629 | - core::Property<unsigned int> alarm_duration; |
2630 | - core::Property<unsigned int> snooze_duration; |
2631 | - core::Property<bool> cal_notification_enabled; |
2632 | - core::Property<bool> cal_notification_sounds; |
2633 | - core::Property<bool> cal_notification_vibrations; |
2634 | - core::Property<bool> cal_notification_bubbles; |
2635 | - core::Property<bool> cal_notification_list; |
2636 | - core::Property<bool> vibrate_silent_mode; |
2637 | -}; |
2638 | - |
2639 | -} // namespace datetime |
2640 | -} // namespace indicator |
2641 | -} // namespace unity |
2642 | - |
2643 | -#endif // INDICATOR_DATETIME_SETTINGS_H |
2644 | |
2645 | === removed file 'include/datetime/snap.h' |
2646 | --- include/datetime/snap.h 2016-10-06 17:08:29 +0000 |
2647 | +++ include/datetime/snap.h 1970-01-01 00:00:00 +0000 |
2648 | @@ -1,65 +0,0 @@ |
2649 | -/* |
2650 | - * Copyright 2014 Canonical Ltd. |
2651 | - * |
2652 | - * This program is free software: you can redistribute it and/or modify it |
2653 | - * under the terms of the GNU General Public License version 3, as published |
2654 | - * by the Free Software Foundation. |
2655 | - * |
2656 | - * This program is distributed in the hope that it will be useful, but |
2657 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2658 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2659 | - * PURPOSE. See the GNU General Public License for more details. |
2660 | - * |
2661 | - * You should have received a copy of the GNU General Public License along |
2662 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2663 | - * |
2664 | - * Authors: |
2665 | - * Charles Kerr <charles.kerr@canonical.com> |
2666 | - */ |
2667 | - |
2668 | -#ifndef INDICATOR_DATETIME_SNAP_H |
2669 | -#define INDICATOR_DATETIME_SNAP_H |
2670 | - |
2671 | -#include <datetime/appointment.h> |
2672 | -#include <datetime/settings.h> |
2673 | - |
2674 | -#include <notifications/notifications.h> |
2675 | -#include <notifications/sound.h> |
2676 | - |
2677 | -#include <gio/gio.h> // GDBusConnection |
2678 | - |
2679 | -#include <functional> |
2680 | -#include <memory> |
2681 | - |
2682 | -namespace unity { |
2683 | -namespace indicator { |
2684 | -namespace datetime { |
2685 | - |
2686 | -/** |
2687 | - * \brief Pops up Snap Decisions for appointments |
2688 | - */ |
2689 | -class Snap |
2690 | -{ |
2691 | -public: |
2692 | - Snap(const std::shared_ptr<unity::indicator::notifications::Engine>& engine, |
2693 | - const std::shared_ptr<unity::indicator::notifications::SoundBuilder>& sound_builder, |
2694 | - const std::shared_ptr<const Settings>& settings, |
2695 | - GDBusConnection* system_bus); |
2696 | - virtual ~Snap(); |
2697 | - |
2698 | - enum class Response { None, Snooze, ShowApp }; |
2699 | - typedef std::function<void(const Appointment&, const Alarm&, const Response&)> response_func; |
2700 | - void operator()(const Appointment& appointment, |
2701 | - const Alarm& alarm, |
2702 | - response_func on_response); |
2703 | - |
2704 | -private: |
2705 | - class Impl; |
2706 | - std::unique_ptr<Impl> impl; |
2707 | -}; |
2708 | - |
2709 | -} // namespace datetime |
2710 | -} // namespace indicator |
2711 | -} // namespace unity |
2712 | - |
2713 | -#endif // INDICATOR_DATETIME_SNAP_H |
2714 | |
2715 | === removed file 'include/datetime/state.h' |
2716 | --- include/datetime/state.h 2014-03-10 02:08:47 +0000 |
2717 | +++ include/datetime/state.h 1970-01-01 00:00:00 +0000 |
2718 | @@ -1,81 +0,0 @@ |
2719 | -/* |
2720 | - * Copyright 2013 Canonical Ltd. |
2721 | - * |
2722 | - * This program is free software: you can redistribute it and/or modify it |
2723 | - * under the terms of the GNU General Public License version 3, as published |
2724 | - * by the Free Software Foundation. |
2725 | - * |
2726 | - * This program is distributed in the hope that it will be useful, but |
2727 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2728 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2729 | - * PURPOSE. See the GNU General Public License for more details. |
2730 | - * |
2731 | - * You should have received a copy of the GNU General Public License along |
2732 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2733 | - * |
2734 | - * Authors: |
2735 | - * Charles Kerr <charles.kerr@canonical.com> |
2736 | - */ |
2737 | - |
2738 | -#ifndef INDICATOR_DATETIME_STATE_H |
2739 | -#define INDICATOR_DATETIME_STATE_H |
2740 | - |
2741 | -#include <datetime/clock.h> |
2742 | -#include <datetime/locations.h> |
2743 | -#include <datetime/planner-month.h> |
2744 | -#include <datetime/planner-upcoming.h> |
2745 | -#include <datetime/settings.h> |
2746 | -#include <datetime/timezones.h> |
2747 | - |
2748 | -#include <core/property.h> |
2749 | - |
2750 | -#include <memory> // std::shared_ptr |
2751 | - |
2752 | -namespace unity { |
2753 | -namespace indicator { |
2754 | -namespace datetime { |
2755 | - |
2756 | -/** |
2757 | - * \brief Aggregates all the classes that represent the backend state. |
2758 | - * |
2759 | - * This is where the app comes together. It's a model that aggregates |
2760 | - * all of the backend appointments/alarms, locations, timezones, |
2761 | - * system time, and so on. The "view" code (ie, the Menus) need to |
2762 | - * respond to Signals from the State and update themselves accordingly. |
2763 | - * |
2764 | - * @see Menu |
2765 | - * @see MenuFactory |
2766 | - * @see Timezones |
2767 | - * @see Clock |
2768 | - * @see Planner |
2769 | - * @see Locations |
2770 | - * @see Settings |
2771 | - */ |
2772 | -struct State |
2773 | -{ |
2774 | - /** \brief The current time. Used by the header, by the date menuitem, |
2775 | - and by the locations for relative timestamp */ |
2776 | - std::shared_ptr<Clock> clock; |
2777 | - |
2778 | - /** \brief The locations to be displayed in the Locations |
2779 | - section of the #Menu */ |
2780 | - std::shared_ptr<Locations> locations; |
2781 | - |
2782 | - /** \brief Appointments in the month that's being displayed |
2783 | - in the calendar section of the #Menu */ |
2784 | - std::shared_ptr<MonthPlanner> calendar_month; |
2785 | - |
2786 | - /** \brief The next appointments that follow highlighed date |
2787 | - highlighted in the calendar section of the #Menu |
2788 | - (default date = today) */ |
2789 | - std::shared_ptr<UpcomingPlanner> calendar_upcoming; |
2790 | - |
2791 | - /** \brief Configuration options that modify the view */ |
2792 | - std::shared_ptr<Settings> settings; |
2793 | -}; |
2794 | - |
2795 | -} // namespace datetime |
2796 | -} // namespace indicator |
2797 | -} // namespace unity |
2798 | - |
2799 | -#endif // INDICATOR_DATETIME_STATE_H |
2800 | |
2801 | === removed file 'include/datetime/timezone-geoclue.h' |
2802 | --- include/datetime/timezone-geoclue.h 2014-09-13 20:45:23 +0000 |
2803 | +++ include/datetime/timezone-geoclue.h 1970-01-01 00:00:00 +0000 |
2804 | @@ -1,53 +0,0 @@ |
2805 | -/* |
2806 | - * Copyright 2013 Canonical Ltd. |
2807 | - * |
2808 | - * This program is free software: you can redistribute it and/or modify it |
2809 | - * under the terms of the GNU General Public License version 3, as published |
2810 | - * by the Free Software Foundation. |
2811 | - * |
2812 | - * This program is distributed in the hope that it will be useful, but |
2813 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2814 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2815 | - * PURPOSE. See the GNU General Public License for more details. |
2816 | - * |
2817 | - * You should have received a copy of the GNU General Public License along |
2818 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2819 | - * |
2820 | - * Authors: |
2821 | - * Charles Kerr <charles.kerr@canonical.com> |
2822 | - */ |
2823 | - |
2824 | -#ifndef INDICATOR_DATETIME_GEOCLUE_TIMEZONE_H |
2825 | -#define INDICATOR_DATETIME_GEOCLUE_TIMEZONE_H |
2826 | - |
2827 | -#include <datetime/timezone.h> // base class |
2828 | - |
2829 | -namespace unity { |
2830 | -namespace indicator { |
2831 | -namespace datetime { |
2832 | - |
2833 | -/** |
2834 | - * \brief A #Timezone that gets its information from asking GeoClue |
2835 | - */ |
2836 | -class GeoclueTimezone: public Timezone |
2837 | -{ |
2838 | -public: |
2839 | - GeoclueTimezone(); |
2840 | - ~GeoclueTimezone(); |
2841 | - |
2842 | -private: |
2843 | - struct Impl; |
2844 | - std::unique_ptr<Impl> impl; |
2845 | - |
2846 | - // we've got pointers in here, so don't allow copying |
2847 | - GeoclueTimezone(const GeoclueTimezone&) =delete; |
2848 | - GeoclueTimezone& operator=(const GeoclueTimezone&) =delete; |
2849 | -}; |
2850 | - |
2851 | - |
2852 | -} // namespace datetime |
2853 | -} // namespace indicator |
2854 | -} // namespace unity |
2855 | - |
2856 | -#endif // INDICATOR_DATETIME_GEOCLUE_TIMEZONE_H |
2857 | - |
2858 | |
2859 | === removed file 'include/datetime/timezone-timedated.h' |
2860 | --- include/datetime/timezone-timedated.h 2016-04-12 17:03:36 +0000 |
2861 | +++ include/datetime/timezone-timedated.h 1970-01-01 00:00:00 +0000 |
2862 | @@ -1,56 +0,0 @@ |
2863 | -/* |
2864 | - * Copyright 2013 Canonical Ltd. |
2865 | - * |
2866 | - * This program is free software: you can redistribute it and/or modify it |
2867 | - * under the terms of the GNU General Public License version 3, as published |
2868 | - * by the Free Software Foundation. |
2869 | - * |
2870 | - * This program is distributed in the hope that it will be useful, but |
2871 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2872 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2873 | - * PURPOSE. See the GNU General Public License for more details. |
2874 | - * |
2875 | - * You should have received a copy of the GNU General Public License along |
2876 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2877 | - * |
2878 | - * Authors: |
2879 | - * Charles Kerr <charles.kerr@canonical.com> |
2880 | - */ |
2881 | - |
2882 | -#ifndef INDICATOR_DATETIME_TIMEDATED_TIMEZONE_H |
2883 | -#define INDICATOR_DATETIME_TIMEDATED_TIMEZONE_H |
2884 | - |
2885 | -#include <datetime/timezone.h> // base class |
2886 | - |
2887 | -#include <gio/gio.h> // GDBusConnection* |
2888 | - |
2889 | -#include <string> // std::string |
2890 | - |
2891 | -namespace unity { |
2892 | -namespace indicator { |
2893 | -namespace datetime { |
2894 | - |
2895 | -/** |
2896 | - * \brief A #Timezone that gets its information from org.freedesktop.timedate1 |
2897 | - */ |
2898 | -class TimedatedTimezone: public Timezone |
2899 | -{ |
2900 | -public: |
2901 | - TimedatedTimezone(GDBusConnection* connection); |
2902 | - ~TimedatedTimezone(); |
2903 | - |
2904 | -private: |
2905 | - class Impl; |
2906 | - friend Impl; |
2907 | - std::unique_ptr<Impl> impl; |
2908 | - |
2909 | - // we have pointers in here, so disable copying |
2910 | - TimedatedTimezone(const TimedatedTimezone&) =delete; |
2911 | - TimedatedTimezone& operator=(const TimedatedTimezone&) =delete; |
2912 | -}; |
2913 | - |
2914 | -} // namespace datetime |
2915 | -} // namespace indicator |
2916 | -} // namespace unity |
2917 | - |
2918 | -#endif // INDICATOR_DATETIME_TIMEDATED_TIMEZONE_H |
2919 | |
2920 | === removed file 'include/datetime/timezone.h' |
2921 | --- include/datetime/timezone.h 2014-01-30 19:00:22 +0000 |
2922 | +++ include/datetime/timezone.h 1970-01-01 00:00:00 +0000 |
2923 | @@ -1,45 +0,0 @@ |
2924 | -/* |
2925 | - * Copyright 2013 Canonical Ltd. |
2926 | - * |
2927 | - * This program is free software: you can redistribute it and/or modify it |
2928 | - * under the terms of the GNU General Public License version 3, as published |
2929 | - * by the Free Software Foundation. |
2930 | - * |
2931 | - * This program is distributed in the hope that it will be useful, but |
2932 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2933 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2934 | - * PURPOSE. See the GNU General Public License for more details. |
2935 | - * |
2936 | - * You should have received a copy of the GNU General Public License along |
2937 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2938 | - * |
2939 | - * Authors: |
2940 | - * Charles Kerr <charles.kerr@canonical.com> |
2941 | - */ |
2942 | - |
2943 | -#ifndef INDICATOR_DATETIME_TIMEZONE_H |
2944 | -#define INDICATOR_DATETIME_TIMEZONE_H |
2945 | - |
2946 | -#include <core/property.h> |
2947 | - |
2948 | -#include <string> |
2949 | - |
2950 | -namespace unity { |
2951 | -namespace indicator { |
2952 | -namespace datetime { |
2953 | - |
2954 | -/** \brief Base a timezone, such as "America/Chicago". */ |
2955 | -class Timezone |
2956 | -{ |
2957 | -protected: |
2958 | - Timezone() =default; |
2959 | - |
2960 | -public: |
2961 | - core::Property<std::string> timezone; |
2962 | -}; |
2963 | - |
2964 | -} // namespace datetime |
2965 | -} // namespace indicator |
2966 | -} // namespace unity |
2967 | - |
2968 | -#endif // INDICATOR_DATETIME_TIMEZONE_H |
2969 | |
2970 | === removed file 'include/datetime/timezones-live.h' |
2971 | --- include/datetime/timezones-live.h 2016-04-12 17:05:11 +0000 |
2972 | +++ include/datetime/timezones-live.h 1970-01-01 00:00:00 +0000 |
2973 | @@ -1,55 +0,0 @@ |
2974 | -/* |
2975 | - * Copyright 2013 Canonical Ltd. |
2976 | - * |
2977 | - * This program is free software: you can redistribute it and/or modify it |
2978 | - * under the terms of the GNU General Public License version 3, as published |
2979 | - * by the Free Software Foundation. |
2980 | - * |
2981 | - * This program is distributed in the hope that it will be useful, but |
2982 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
2983 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2984 | - * PURPOSE. See the GNU General Public License for more details. |
2985 | - * |
2986 | - * You should have received a copy of the GNU General Public License along |
2987 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
2988 | - * |
2989 | - * Authors: |
2990 | - * Charles Kerr <charles.kerr@canonical.com> |
2991 | - */ |
2992 | - |
2993 | -#ifndef INDICATOR_DATETIME_LIVE_TIMEZONES_H |
2994 | -#define INDICATOR_DATETIME_LIVE_TIMEZONES_H |
2995 | - |
2996 | -#include <datetime/settings.h> |
2997 | -#include <datetime/timezones.h> |
2998 | -#include <datetime/timezone-geoclue.h> |
2999 | - |
3000 | -#include <memory> // shared_ptr<> |
3001 | - |
3002 | -namespace unity { |
3003 | -namespace indicator { |
3004 | -namespace datetime { |
3005 | - |
3006 | -/** |
3007 | - * \brief #Timezones object that uses a #TimedatedTimezone and #GeoclueTimezone |
3008 | - * to detect what timezone we're in |
3009 | - */ |
3010 | -class LiveTimezones: public Timezones |
3011 | -{ |
3012 | -public: |
3013 | - LiveTimezones(const std::shared_ptr<const Settings>& settings, const std::shared_ptr<Timezone>& primary_timezone); |
3014 | - |
3015 | -private: |
3016 | - void update_geolocation(); |
3017 | - void update_timezones(); |
3018 | - |
3019 | - std::shared_ptr<Timezone> m_primary_timezone; |
3020 | - std::shared_ptr<const Settings> m_settings; |
3021 | - std::shared_ptr<GeoclueTimezone> m_geo; |
3022 | -}; |
3023 | - |
3024 | -} // namespace datetime |
3025 | -} // namespace indicator |
3026 | -} // namespace unity |
3027 | - |
3028 | -#endif // INDICATOR_DATETIME_LIVE_TIMEZONES_H |
3029 | |
3030 | === removed file 'include/datetime/timezones.h' |
3031 | --- include/datetime/timezones.h 2014-01-22 17:29:10 +0000 |
3032 | +++ include/datetime/timezones.h 1970-01-01 00:00:00 +0000 |
3033 | @@ -1,59 +0,0 @@ |
3034 | -/* |
3035 | - * Copyright 2013 Canonical Ltd. |
3036 | - * |
3037 | - * This program is free software: you can redistribute it and/or modify it |
3038 | - * under the terms of the GNU General Public License version 3, as published |
3039 | - * by the Free Software Foundation. |
3040 | - * |
3041 | - * This program is distributed in the hope that it will be useful, but |
3042 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
3043 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3044 | - * PURPOSE. See the GNU General Public License for more details. |
3045 | - * |
3046 | - * You should have received a copy of the GNU General Public License along |
3047 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
3048 | - * |
3049 | - * Authors: |
3050 | - * Charles Kerr <charles.kerr@canonical.com> |
3051 | - */ |
3052 | - |
3053 | -#ifndef INDICATOR_DATETIME_TIMEZONES_H |
3054 | -#define INDICATOR_DATETIME_TIMEZONES_H |
3055 | - |
3056 | -#include <datetime/timezone.h> |
3057 | - |
3058 | -#include <core/property.h> |
3059 | - |
3060 | -namespace unity { |
3061 | -namespace indicator { |
3062 | -namespace datetime { |
3063 | - |
3064 | -/** |
3065 | - * \brief Helper class which aggregates one or more timezones |
3066 | - * |
3067 | - * @see LiveClock |
3068 | - * @see SettingsLocations |
3069 | - */ |
3070 | -class Timezones |
3071 | -{ |
3072 | -public: |
3073 | - Timezones() =default; |
3074 | - virtual ~Timezones() =default; |
3075 | - |
3076 | - /** |
3077 | - * \brief the current timezone |
3078 | - */ |
3079 | - core::Property<std::string> timezone; |
3080 | - |
3081 | - /** |
3082 | - * \brief all the detected timezones. |
3083 | - * The count is >1 iff the detection mechamisms disagree. |
3084 | - */ |
3085 | - core::Property<std::set<std::string> > timezones; |
3086 | -}; |
3087 | - |
3088 | -} // namespace datetime |
3089 | -} // namespace indicator |
3090 | -} // namespace unity |
3091 | - |
3092 | -#endif // INDICATOR_DATETIME_TIMEZONES_H |
3093 | |
3094 | === removed file 'include/datetime/utils.h' |
3095 | --- include/datetime/utils.h 2014-01-28 22:26:45 +0000 |
3096 | +++ include/datetime/utils.h 1970-01-01 00:00:00 +0000 |
3097 | @@ -1,54 +0,0 @@ |
3098 | -/* |
3099 | - * Copyright 2010, 2014 Canonical Ltd. |
3100 | - * |
3101 | - * This program is free software: you can redistribute it and/or modify it |
3102 | - * under the terms of the GNU General Public License version 3, as published |
3103 | - * by the Free Software Foundation. |
3104 | - * |
3105 | - * This program is distributed in the hope that it will be useful, but |
3106 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
3107 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3108 | - * PURPOSE. See the GNU General Public License for more details. |
3109 | - * |
3110 | - * You should have received a copy of the GNU General Public License along |
3111 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
3112 | - * |
3113 | - * Authors: |
3114 | - * Michael Terry <michael.terry@canonical.com> |
3115 | - * Charles Kerr <charles.kerr@canonical.com> |
3116 | - */ |
3117 | - |
3118 | -#ifndef INDICATOR_DATETIME_UTILS_H |
3119 | -#define INDICATOR_DATETIME_UTILS_H |
3120 | - |
3121 | -#include <glib.h> |
3122 | -#include <gio/gio.h> /* GSettings */ |
3123 | - |
3124 | -G_BEGIN_DECLS |
3125 | - |
3126 | -/** \brief Returns true if the current locale prefers 12h display instead of 24h */ |
3127 | -gboolean is_locale_12h (void); |
3128 | - |
3129 | -void split_settings_location (const char * location, |
3130 | - char ** zone, |
3131 | - char ** name); |
3132 | - |
3133 | -gchar * get_timezone_name (const char * timezone, |
3134 | - GSettings * settings); |
3135 | - |
3136 | -gchar * get_beautified_timezone_name (const char * timezone, |
3137 | - const char * saved_location); |
3138 | - |
3139 | -gchar * generate_full_format_string_at_time (GDateTime * now, |
3140 | - GDateTime * then_begin, |
3141 | - GDateTime * then_end); |
3142 | - |
3143 | -/** \brief Translate the string based on LC_TIME instead of LC_MESSAGES. |
3144 | - The intent of this is to let users set LC_TIME to override |
3145 | - their other locale settings when generating time format string */ |
3146 | -const char* T_ (const char * msg); |
3147 | - |
3148 | - |
3149 | -G_END_DECLS |
3150 | - |
3151 | -#endif /* INDICATOR_DATETIME_UTILS_H */ |
3152 | |
3153 | === removed file 'include/datetime/wakeup-timer-mainloop.h' |
3154 | --- include/datetime/wakeup-timer-mainloop.h 2015-04-03 17:31:36 +0000 |
3155 | +++ include/datetime/wakeup-timer-mainloop.h 1970-01-01 00:00:00 +0000 |
3156 | @@ -1,62 +0,0 @@ |
3157 | -/* |
3158 | - * Copyright 2014 Canonical Ltd. |
3159 | - * |
3160 | - * This program is free software: you can redistribute it and/or modify it |
3161 | - * under the terms of the GNU General Public License version 3, as published |
3162 | - * by the Free Software Foundation. |
3163 | - * |
3164 | - * This program is distributed in the hope that it will be useful, but |
3165 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
3166 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3167 | - * PURPOSE. See the GNU General Public License for more details. |
3168 | - * |
3169 | - * You should have received a copy of the GNU General Public License along |
3170 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
3171 | - * |
3172 | - * Authors: |
3173 | - * Charles Kerr <charles.kerr@canonical.com> |
3174 | - */ |
3175 | - |
3176 | -#ifndef INDICATOR_DATETIME_WAKEUP_TIMER_MAINLOOP_H |
3177 | -#define INDICATOR_DATETIME_WAKEUP_TIMER_MAINLOOP_H |
3178 | - |
3179 | -#include <datetime/clock.h> |
3180 | -#include <datetime/wakeup-timer.h> |
3181 | - |
3182 | -#include <memory> // std::unique_ptr, std::shared_ptr |
3183 | - |
3184 | -namespace unity { |
3185 | -namespace indicator { |
3186 | -namespace datetime { |
3187 | - |
3188 | -/*** |
3189 | -**** |
3190 | -***/ |
3191 | - |
3192 | -/** |
3193 | - * \brief a WakeupTimer implemented with g_timeout_add() |
3194 | - */ |
3195 | -class MainloopWakeupTimer: public WakeupTimer |
3196 | -{ |
3197 | -public: |
3198 | - explicit MainloopWakeupTimer(const std::shared_ptr<Clock>&); |
3199 | - ~MainloopWakeupTimer(); |
3200 | - void set_wakeup_time (const DateTime&) override; |
3201 | - core::Signal<>& timeout() override; |
3202 | - |
3203 | -private: |
3204 | - MainloopWakeupTimer(const MainloopWakeupTimer&) =delete; |
3205 | - MainloopWakeupTimer& operator= (const MainloopWakeupTimer&) =delete; |
3206 | - class Impl; |
3207 | - std::unique_ptr<Impl> p; |
3208 | -}; |
3209 | - |
3210 | -/*** |
3211 | -**** |
3212 | -***/ |
3213 | - |
3214 | -} // namespace datetime |
3215 | -} // namespace indicator |
3216 | -} // namespace unity |
3217 | - |
3218 | -#endif // INDICATOR_DATETIME_WAKEUP_TIMER_MAINLOOP_H |
3219 | |
3220 | === removed file 'include/datetime/wakeup-timer-powerd.h' |
3221 | --- include/datetime/wakeup-timer-powerd.h 2015-04-03 17:31:36 +0000 |
3222 | +++ include/datetime/wakeup-timer-powerd.h 1970-01-01 00:00:00 +0000 |
3223 | @@ -1,62 +0,0 @@ |
3224 | -/* |
3225 | - * Copyright 2014 Canonical Ltd. |
3226 | - * |
3227 | - * This program is free software: you can redistribute it and/or modify it |
3228 | - * under the terms of the GNU General Public License version 3, as published |
3229 | - * by the Free Software Foundation. |
3230 | - * |
3231 | - * This program is distributed in the hope that it will be useful, but |
3232 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
3233 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3234 | - * PURPOSE. See the GNU General Public License for more details. |
3235 | - * |
3236 | - * You should have received a copy of the GNU General Public License along |
3237 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
3238 | - * |
3239 | - * Authors: |
3240 | - * Charles Kerr <charles.kerr@canonical.com> |
3241 | - */ |
3242 | - |
3243 | -#ifndef INDICATOR_DATETIME_WAKEUP_TIMER_POWERD_H |
3244 | -#define INDICATOR_DATETIME_WAKEUP_TIMER_POWERD_H |
3245 | - |
3246 | -#include <datetime/clock.h> |
3247 | -#include <datetime/wakeup-timer.h> |
3248 | - |
3249 | -#include <memory> // std::unique_ptr, std::shared_ptr |
3250 | - |
3251 | -namespace unity { |
3252 | -namespace indicator { |
3253 | -namespace datetime { |
3254 | - |
3255 | -/*** |
3256 | -**** |
3257 | -***/ |
3258 | - |
3259 | -/** |
3260 | - * \brief a WakeupTimer implemented with g_timeout_add() |
3261 | - */ |
3262 | -class PowerdWakeupTimer: public WakeupTimer |
3263 | -{ |
3264 | -public: |
3265 | - explicit PowerdWakeupTimer(const std::shared_ptr<Clock>&); |
3266 | - ~PowerdWakeupTimer(); |
3267 | - void set_wakeup_time(const DateTime&) override; |
3268 | - core::Signal<>& timeout() override; |
3269 | - |
3270 | -private: |
3271 | - PowerdWakeupTimer(const PowerdWakeupTimer&) =delete; |
3272 | - PowerdWakeupTimer& operator=(const PowerdWakeupTimer&) =delete; |
3273 | - class Impl; |
3274 | - std::unique_ptr<Impl> p; |
3275 | -}; |
3276 | - |
3277 | -/*** |
3278 | -**** |
3279 | -***/ |
3280 | - |
3281 | -} // namespace datetime |
3282 | -} // namespace indicator |
3283 | -} // namespace unity |
3284 | - |
3285 | -#endif // INDICATOR_DATETIME_WAKEUP_TIMER_MAINLOOP_H |
3286 | |
3287 | === removed file 'include/datetime/wakeup-timer.h' |
3288 | --- include/datetime/wakeup-timer.h 2015-04-03 17:31:36 +0000 |
3289 | +++ include/datetime/wakeup-timer.h 1970-01-01 00:00:00 +0000 |
3290 | @@ -1,55 +0,0 @@ |
3291 | -/* |
3292 | - * Copyright 2014 Canonical Ltd. |
3293 | - * |
3294 | - * This program is free software: you can redistribute it and/or modify it |
3295 | - * under the terms of the GNU General Public License version 3, as published |
3296 | - * by the Free Software Foundation. |
3297 | - * |
3298 | - * This program is distributed in the hope that it will be useful, but |
3299 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
3300 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3301 | - * PURPOSE. See the GNU General Public License for more details. |
3302 | - * |
3303 | - * You should have received a copy of the GNU General Public License along |
3304 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
3305 | - * |
3306 | - * Authors: |
3307 | - * Charles Kerr <charles.kerr@canonical.com> |
3308 | - */ |
3309 | - |
3310 | -#ifndef INDICATOR_DATETIME_WAKEUP_TIMER_H |
3311 | -#define INDICATOR_DATETIME_WAKEUP_TIMER_H |
3312 | - |
3313 | -#include <datetime/date-time.h> |
3314 | - |
3315 | -#include <core/signal.h> |
3316 | - |
3317 | -namespace unity { |
3318 | -namespace indicator { |
3319 | -namespace datetime { |
3320 | - |
3321 | -/*** |
3322 | -**** |
3323 | -***/ |
3324 | - |
3325 | -/** |
3326 | - * \brief A one-shot timer that emits a signal when its timeout is reached. |
3327 | - */ |
3328 | -class WakeupTimer |
3329 | -{ |
3330 | -public: |
3331 | - WakeupTimer() =default; |
3332 | - virtual ~WakeupTimer() =default; |
3333 | - virtual void set_wakeup_time (const DateTime&) =0; |
3334 | - virtual core::Signal<>& timeout() =0; |
3335 | -}; |
3336 | - |
3337 | -/*** |
3338 | -**** |
3339 | -***/ |
3340 | - |
3341 | -} // namespace datetime |
3342 | -} // namespace indicator |
3343 | -} // namespace unity |
3344 | - |
3345 | -#endif // INDICATOR_DATETIME_WAKEUP_TIMER_H |
3346 | |
3347 | === removed directory 'include/notifications' |
3348 | === removed file 'include/notifications/CMakeLists.txt' |
3349 | === removed file 'include/notifications/awake.h' |
3350 | --- include/notifications/awake.h 2016-10-06 17:07:05 +0000 |
3351 | +++ include/notifications/awake.h 1970-01-01 00:00:00 +0000 |
3352 | @@ -1,57 +0,0 @@ |
3353 | -/* |
3354 | - * Copyright 2014 Canonical Ltd. |
3355 | - * |
3356 | - * This program is free software: you can redistribute it and/or modify it |
3357 | - * under the terms of the GNU General Public License version 3, as published |
3358 | - * by the Free Software Foundation. |
3359 | - * |
3360 | - * This program is distributed in the hope that it will be useful, but |
3361 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
3362 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3363 | - * PURPOSE. See the GNU General Public License for more details. |
3364 | - * |
3365 | - * You should have received a copy of the GNU General Public License along |
3366 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
3367 | - * |
3368 | - * Authors: |
3369 | - * Charles Kerr <charles.kerr@canonical.com> |
3370 | - */ |
3371 | - |
3372 | -#ifndef UNITY_INDICATOR_NOTIFICATIONS_AWAKE_H |
3373 | -#define UNITY_INDICATOR_NOTIFICATIONS_AWAKE_H |
3374 | - |
3375 | -#include <memory> |
3376 | - |
3377 | -#include <gio/gio.h> |
3378 | - |
3379 | -namespace unity { |
3380 | -namespace indicator { |
3381 | -namespace notifications { |
3382 | - |
3383 | -/*** |
3384 | -**** |
3385 | -***/ |
3386 | - |
3387 | -/** |
3388 | - * A class that forces the screen display on and inhibits sleep |
3389 | - */ |
3390 | -class Awake |
3391 | -{ |
3392 | -public: |
3393 | - explicit Awake(GDBusConnection* system_bus, const std::string& app_name); |
3394 | - ~Awake(); |
3395 | - |
3396 | -private: |
3397 | - class Impl; |
3398 | - std::unique_ptr<Impl> impl; |
3399 | -}; |
3400 | - |
3401 | -/*** |
3402 | -**** |
3403 | -***/ |
3404 | - |
3405 | -} // namespace notifications |
3406 | -} // namespace indicator |
3407 | -} // namespace unity |
3408 | - |
3409 | -#endif // UNITY_INDICATOR_NOTIFICATIONS_AWAKE_H |
3410 | |
3411 | === removed file 'include/notifications/dbus-shared.h' |
3412 | --- include/notifications/dbus-shared.h 2014-07-31 20:22:47 +0000 |
3413 | +++ include/notifications/dbus-shared.h 1970-01-01 00:00:00 +0000 |
3414 | @@ -1,36 +0,0 @@ |
3415 | -/* |
3416 | - * Copyright 2013 Canonical Ltd. |
3417 | - * |
3418 | - * This program is free software: you can redistribute it and/or modify it |
3419 | - * under the terms of the GNU General Public License version 3, as published |
3420 | - * by the Free Software Foundation. |
3421 | - * |
3422 | - * This program is distributed in the hope that it will be useful, but |
3423 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
3424 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3425 | - * PURPOSE. See the GNU General Public License for more details. |
3426 | - * |
3427 | - * You should have received a copy of the GNU General Public License along |
3428 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
3429 | - * |
3430 | - * Authors: |
3431 | - * Ted Gould <ted@canonical.com> |
3432 | - * Charles Kerr <charles.kerr@canonical.com> |
3433 | - */ |
3434 | - |
3435 | -#ifndef UNITY_INDICATOR_NOTIFICATIONS_DBUS_SHARED_H |
3436 | -#define UNITY_INDICATOR_NOTIFICATIONS_DBUS_SHARED_H |
3437 | - |
3438 | -#define BUS_SCREEN_NAME "com.canonical.Unity.Screen" |
3439 | -#define BUS_SCREEN_PATH "/com/canonical/Unity/Screen" |
3440 | -#define BUS_SCREEN_INTERFACE "com.canonical.Unity.Screen" |
3441 | - |
3442 | -#define BUS_POWERD_NAME "com.canonical.powerd" |
3443 | -#define BUS_POWERD_PATH "/com/canonical/powerd" |
3444 | -#define BUS_POWERD_INTERFACE "com.canonical.powerd" |
3445 | - |
3446 | -#define BUS_HAPTIC_NAME "com.canonical.usensord" |
3447 | -#define BUS_HAPTIC_PATH "/com/canonical/usensord/haptic" |
3448 | -#define BUS_HAPTIC_INTERFACE "com.canonical.usensord.haptic" |
3449 | - |
3450 | -#endif /* INDICATOR_NOTIFICATIONS_DBUS_SHARED_H */ |
3451 | |
3452 | === removed file 'include/notifications/haptic.h' |
3453 | --- include/notifications/haptic.h 2016-05-14 02:07:10 +0000 |
3454 | +++ include/notifications/haptic.h 1970-01-01 00:00:00 +0000 |
3455 | @@ -1,60 +0,0 @@ |
3456 | -/* |
3457 | - * Copyright 2014 Canonical Ltd. |
3458 | - * |
3459 | - * This program is free software: you can redistribute it and/or modify it |
3460 | - * under the terms of the GNU General Public License version 3, as published |
3461 | - * by the Free Software Foundation. |
3462 | - * |
3463 | - * This program is distributed in the hope that it will be useful, but |
3464 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
3465 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3466 | - * PURPOSE. See the GNU General Public License for more details. |
3467 | - * |
3468 | - * You should have received a copy of the GNU General Public License along |
3469 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
3470 | - * |
3471 | - * Authors: |
3472 | - * Charles Kerr <charles.kerr@canonical.com> |
3473 | - */ |
3474 | - |
3475 | -#ifndef UNITY_INDICATOR_NOTIFICATIONS_HAPTIC_H |
3476 | -#define UNITY_INDICATOR_NOTIFICATIONS_HAPTIC_H |
3477 | - |
3478 | -#include <memory> |
3479 | - |
3480 | -namespace unity { |
3481 | -namespace indicator { |
3482 | -namespace notifications { |
3483 | - |
3484 | -/*** |
3485 | -**** |
3486 | -***/ |
3487 | - |
3488 | -/** |
3489 | - * Tries to emit haptic feedback to match the user-specified mode. |
3490 | - */ |
3491 | -class Haptic |
3492 | -{ |
3493 | -public: |
3494 | - enum Mode |
3495 | - { |
3496 | - MODE_PULSE |
3497 | - }; |
3498 | - |
3499 | - explicit Haptic(const Mode& mode = MODE_PULSE, bool repeat = false); |
3500 | - ~Haptic(); |
3501 | - |
3502 | -private: |
3503 | - class Impl; |
3504 | - std::unique_ptr<Impl> impl; |
3505 | -}; |
3506 | - |
3507 | -/*** |
3508 | -**** |
3509 | -***/ |
3510 | - |
3511 | -} // namespace notifications |
3512 | -} // namespace indicator |
3513 | -} // namespace unity |
3514 | - |
3515 | -#endif // UNITY_INDICATOR_NOTIFICATIONS_HAPTIC_H |
3516 | |
3517 | === removed file 'include/notifications/notifications.h' |
3518 | --- include/notifications/notifications.h 2016-06-30 00:37:56 +0000 |
3519 | +++ include/notifications/notifications.h 1970-01-01 00:00:00 +0000 |
3520 | @@ -1,130 +0,0 @@ |
3521 | -/* |
3522 | - * Copyright 2014 Canonical Ltd. |
3523 | - * |
3524 | - * This program is free software: you can redistribute it and/or modify it |
3525 | - * under the terms of the GNU General Public License version 3, as published |
3526 | - * by the Free Software Foundation. |
3527 | - * |
3528 | - * This program is distributed in the hope that it will be useful, but |
3529 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
3530 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3531 | - * PURPOSE. See the GNU General Public License for more details. |
3532 | - * |
3533 | - * You should have received a copy of the GNU General Public License along |
3534 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
3535 | - * |
3536 | - * Authors: |
3537 | - * Charles Kerr <charles.kerr@canonical.com> |
3538 | - */ |
3539 | - |
3540 | -#ifndef UNITY_INDICATOR_NOTIFICATIONS_NOTIFICATIONS_H |
3541 | -#define UNITY_INDICATOR_NOTIFICATIONS_NOTIFICATIONS_H |
3542 | - |
3543 | -#include <chrono> |
3544 | -#include <functional> |
3545 | -#include <memory> |
3546 | -#include <string> |
3547 | - |
3548 | -namespace unity { |
3549 | -namespace indicator { |
3550 | -namespace notifications { |
3551 | - |
3552 | -class Engine; |
3553 | - |
3554 | -/** |
3555 | - * Helper class for showing notifications. |
3556 | - * |
3557 | - * Populate the builder, then pass it to Engine::show(). |
3558 | - * |
3559 | - * @see Engine::show(Builder) |
3560 | - */ |
3561 | -class Builder |
3562 | -{ |
3563 | -public: |
3564 | - Builder(); |
3565 | - ~Builder(); |
3566 | - |
3567 | - void set_title (const std::string& title); |
3568 | - |
3569 | - void set_body (const std::string& body); |
3570 | - |
3571 | - void set_icon_name (const std::string& icon_name); |
3572 | - |
3573 | - void set_start_time(uint64_t time); |
3574 | - |
3575 | - /* Set an interval, after which the notification will automatically |
3576 | - be closed. If not set, the notification server's default timeout |
3577 | - is used. */ |
3578 | - void set_timeout (const std::chrono::seconds& duration); |
3579 | - |
3580 | - /* Add a notification hint. |
3581 | - These keys may be dependent on the notification server. */ |
3582 | - void add_hint (const std::string& name); |
3583 | - static constexpr char const * HINT_SNAP {"x-canonical-snap-decisions"}; |
3584 | - static constexpr char const * HINT_NONSHAPED_ICON {"x-canonical-non-shaped-icon"}; |
3585 | - static constexpr char const * HINT_AFFIRMATIVE_HINT {"x-canonical-private-affirmative-tint"}; |
3586 | - static constexpr char const * HINT_REJECTION_TINT {"x-canonical-private-rejection-tint"}; |
3587 | - static constexpr char const * HINT_INTERACTIVE {"x-canonical-switch-to-application"}; |
3588 | - |
3589 | - /* Add an action button. |
3590 | - This may fail if the Engine doesn't support actions. |
3591 | - @see Engine::supports_actions() */ |
3592 | - void add_action (const std::string& action, const std::string& label); |
3593 | - |
3594 | - /** Sets the closed callback. This will be called exactly once. After notification dissapear */ |
3595 | - void set_closed_callback (std::function<void(const std::string& action)>); |
3596 | - |
3597 | - /** Sets the time-out callback. This will be called exactly once. */ |
3598 | - void set_timeout_callback (std::function<void()>); |
3599 | - |
3600 | - /** Sets if a notification bubble should be displayed. */ |
3601 | - void set_show_notification_bubble (bool show); |
3602 | - |
3603 | - /** Sets if notification should be posted to messaging menu after it is closed. */ |
3604 | - void set_post_to_messaging_menu (bool post); |
3605 | - |
3606 | - |
3607 | -private: |
3608 | - friend class Engine; |
3609 | - class Impl; |
3610 | - std::unique_ptr<Impl> impl; |
3611 | -}; |
3612 | - |
3613 | -/** |
3614 | - * Manages Notifications and the connection to the notification server. |
3615 | - * |
3616 | - * When this class is destroyed, any remaining notifications it created |
3617 | - * will be closed and their closed() callbacks will be invoked. |
3618 | - */ |
3619 | -class Engine |
3620 | -{ |
3621 | -public: |
3622 | - explicit Engine(const std::string& app_name); |
3623 | - ~Engine(); |
3624 | - |
3625 | - /** @see Builder::set_action() */ |
3626 | - bool supports_actions() const; |
3627 | - |
3628 | - /** Show a notification. |
3629 | - @return zero on failure, or a key that can be passed to close() */ |
3630 | - int show(const Builder& builder); |
3631 | - |
3632 | - /** Close a notification. |
3633 | - @param key the int returned by show() */ |
3634 | - void close(int key); |
3635 | - |
3636 | - /** Close all remaining notifications. */ |
3637 | - void close_all(); |
3638 | - |
3639 | - const std::string& app_name() const; |
3640 | - |
3641 | -private: |
3642 | - class Impl; |
3643 | - std::unique_ptr<Impl> impl; |
3644 | -}; |
3645 | - |
3646 | -} // namespace notifications |
3647 | -} // namespace indicator |
3648 | -} // namespace unity |
3649 | - |
3650 | -#endif // UNITY_INDICATOR_NOTIFICATIONS_NOTIFICATIONS_H |
3651 | |
3652 | === removed file 'include/notifications/sound.h' |
3653 | --- include/notifications/sound.h 2015-10-13 16:06:35 +0000 |
3654 | +++ include/notifications/sound.h 1970-01-01 00:00:00 +0000 |
3655 | @@ -1,82 +0,0 @@ |
3656 | -/* |
3657 | - * Copyright 2014 Canonical Ltd. |
3658 | - * |
3659 | - * This program is free software: you can redistribute it and/or modify it |
3660 | - * under the terms of the GNU General Public License version 3, as published |
3661 | - * by the Free Software Foundation. |
3662 | - * |
3663 | - * This program is distributed in the hope that it will be useful, but |
3664 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
3665 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3666 | - * PURPOSE. See the GNU General Public License for more details. |
3667 | - * |
3668 | - * You should have received a copy of the GNU General Public License along |
3669 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
3670 | - * |
3671 | - * Authors: |
3672 | - * Charles Kerr <charles.kerr@canonical.com> |
3673 | - */ |
3674 | - |
3675 | -#ifndef UNITY_INDICATOR_NOTIFICATIONS_SOUND_H |
3676 | -#define UNITY_INDICATOR_NOTIFICATIONS_SOUND_H |
3677 | - |
3678 | -#include <memory> |
3679 | -#include <string> |
3680 | - |
3681 | -namespace unity { |
3682 | -namespace indicator { |
3683 | -namespace notifications { |
3684 | - |
3685 | -/*** |
3686 | -**** |
3687 | -***/ |
3688 | - |
3689 | -/** |
3690 | - * Plays a sound, possibly looping. |
3691 | - * |
3692 | - * @param uri the file to play |
3693 | - * @param volume the volume at which to play the sound, [0..100] |
3694 | - * @param loop if true, loop the sound for the lifespan of the object |
3695 | - */ |
3696 | -class Sound |
3697 | -{ |
3698 | -public: |
3699 | - Sound(const std::string& role, const std::string& uri, unsigned int volume, bool loop); |
3700 | - ~Sound(); |
3701 | - |
3702 | -private: |
3703 | - class Impl; |
3704 | - std::unique_ptr<Impl> impl; |
3705 | -}; |
3706 | - |
3707 | -/*** |
3708 | -**** |
3709 | -***/ |
3710 | - |
3711 | -class SoundBuilder |
3712 | -{ |
3713 | -public: |
3714 | - SoundBuilder() =default; |
3715 | - virtual ~SoundBuilder() =default; |
3716 | - virtual std::shared_ptr<Sound> create(const std::string& role, const std::string& uri, unsigned int volume, bool loop) =0; |
3717 | -}; |
3718 | - |
3719 | -class DefaultSoundBuilder: public SoundBuilder |
3720 | -{ |
3721 | -public: |
3722 | - DefaultSoundBuilder() =default; |
3723 | - ~DefaultSoundBuilder() =default; |
3724 | - virtual std::shared_ptr<Sound> create(const std::string& role, const std::string& uri, unsigned int volume, bool loop) override { |
3725 | - return std::make_shared<Sound>(role, uri, volume, loop); |
3726 | - } |
3727 | -}; |
3728 | - |
3729 | -/*** |
3730 | -**** |
3731 | -***/ |
3732 | - |
3733 | -} // namespace notifications |
3734 | -} // namespace indicator |
3735 | -} // namespace unity |
3736 | - |
3737 | -#endif // UNITY_INDICATOR_NOTIFICATIONS_SOUND_H |
3738 | |
3739 | === modified file 'po/CMakeLists.txt' |
3740 | --- po/CMakeLists.txt 2017-02-09 17:28:21 +0000 |
3741 | +++ po/CMakeLists.txt 2019-08-18 14:27:47 +0000 |
3742 | @@ -1,13 +1,3 @@ |
3743 | -find_package(Intltool REQUIRED) |
3744 | - |
3745 | -intltool_update_potfile( |
3746 | - KEYWORDS "_" "_:1,2" "N_" "N_:1,2" |
3747 | - GETTEXT_PACKAGE ${GETTEXT_PACKAGE} |
3748 | - COPYRIGHT_HOLDER "Canonical Ltd." |
3749 | - FILTER "test/*" |
3750 | -) |
3751 | - |
3752 | -intltool_install_translations( |
3753 | - ALL |
3754 | - GETTEXT_PACKAGE ${GETTEXT_PACKAGE} |
3755 | -) |
3756 | +include (Translations) |
3757 | +add_translations_directory ("${GETTEXT_PACKAGE}") |
3758 | +add_translations_catalog ("${GETTEXT_PACKAGE}" ../src/) |
3759 | |
3760 | === added file 'po/LINGUAS' |
3761 | --- po/LINGUAS 1970-01-01 00:00:00 +0000 |
3762 | +++ po/LINGUAS 2019-08-18 14:27:47 +0000 |
3763 | @@ -0,0 +1,31 @@ |
3764 | +ar |
3765 | +bg |
3766 | +cs |
3767 | +da |
3768 | +de |
3769 | +el |
3770 | +es |
3771 | +fi |
3772 | +fr |
3773 | +he |
3774 | +hi |
3775 | +hr |
3776 | +hu |
3777 | +it |
3778 | +ja |
3779 | +ko |
3780 | +nb |
3781 | +nl |
3782 | +pl |
3783 | +pt |
3784 | +pt_BR |
3785 | +ro |
3786 | +ru |
3787 | +sk |
3788 | +sl |
3789 | +sr |
3790 | +sv |
3791 | +th |
3792 | +tr |
3793 | +zh_CN |
3794 | +zh_TW |
3795 | |
3796 | === added file 'po/Makevars' |
3797 | --- po/Makevars 1970-01-01 00:00:00 +0000 |
3798 | +++ po/Makevars 2019-08-18 14:27:47 +0000 |
3799 | @@ -0,0 +1,7 @@ |
3800 | +DOMAIN = $(PACKAGE) |
3801 | +subdir = po |
3802 | +top_builddir = .. |
3803 | +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=T_ --from-code=UTF-8 |
3804 | +COPYRIGHT_HOLDER = Canonical Ltd. |
3805 | +MSGID_BUGS_ADDRESS = ted@canonical.com |
3806 | +EXTRA_LOCALE_CATEGORIES = |
3807 | |
3808 | === added file 'po/POTFILES.in' |
3809 | --- po/POTFILES.in 1970-01-01 00:00:00 +0000 |
3810 | +++ po/POTFILES.in 2019-08-18 14:27:47 +0000 |
3811 | @@ -0,0 +1,3 @@ |
3812 | +src/service.c |
3813 | +src/settings-shared.h |
3814 | +src/utils.c |
3815 | |
3816 | === modified file 'po/indicator-datetime.pot' |
3817 | --- po/indicator-datetime.pot 2017-12-09 16:19:06 +0000 |
3818 | +++ po/indicator-datetime.pot 2019-08-18 14:27:47 +0000 |
3819 | @@ -1,5 +1,5 @@ |
3820 | # SOME DESCRIPTIVE TITLE. |
3821 | -# Copyright (C) YEAR Canonical Ltd. |
3822 | +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
3823 | # This file is distributed under the same license as the PACKAGE package. |
3824 | # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
3825 | # |
3826 | @@ -7,8 +7,8 @@ |
3827 | msgid "" |
3828 | msgstr "" |
3829 | "Project-Id-Version: PACKAGE VERSION\n" |
3830 | -"Report-Msgid-Bugs-To: \n" |
3831 | -"POT-Creation-Date: 2017-12-09 16:27+0000\n" |
3832 | +"Report-Msgid-Bugs-To: ted@canonical.com\n" |
3833 | +"POT-Creation-Date: 2019-06-11 19:11+0530\n" |
3834 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
3835 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
3836 | "Language-Team: LANGUAGE <LL@li.org>\n" |
3837 | @@ -17,67 +17,121 @@ |
3838 | "Content-Type: text/plain; charset=UTF-8\n" |
3839 | "Content-Transfer-Encoding: 8bit\n" |
3840 | |
3841 | -#. Translators, please edit/rearrange these strftime(3) tokens to suit your locale! |
3842 | -#. Format string for the day on the first menuitem in the datetime indicator. |
3843 | -#. This format string gives the full weekday, date, month, and year. |
3844 | -#. en_US example: "%A, %B %e %Y" --> Saturday, October 31 2020" |
3845 | -#. en_GB example: "%A, %e %B %Y" --> Saturday, 31 October 2020" |
3846 | -#: ../src/menu.cpp:329 |
3847 | +#: ../src/service.c:493 |
3848 | +#, c-format |
3849 | +msgid "Unsupported date format “%s”" |
3850 | +msgstr "" |
3851 | + |
3852 | +#: ../src/service.c:501 |
3853 | +msgid "Date and Time" |
3854 | +msgstr "" |
3855 | + |
3856 | +#: ../src/service.c:590 |
3857 | msgid "%A, %e %B %Y" |
3858 | msgstr "" |
3859 | |
3860 | +#: ../src/service.c:634 |
3861 | +msgid "Daily" |
3862 | +msgstr "" |
3863 | + |
3864 | +#. TRANSLATORS: a strftime(3) format showing full day events. |
3865 | +#. * "%A" means a full text day (Wednesday), "%a" means abbreviated (Wed). |
3866 | +#: ../src/service.c:640 |
3867 | +#, c-format |
3868 | +msgid "%A" |
3869 | +msgstr "" |
3870 | + |
3871 | #. add the 'Add Event…' menuitem |
3872 | -#: ../src/menu.cpp:429 |
3873 | +#: ../src/service.c:748 |
3874 | msgid "Add Event…" |
3875 | msgstr "" |
3876 | |
3877 | -#: ../src/menu.cpp:439 |
3878 | -msgid "Clock" |
3879 | -msgstr "" |
3880 | - |
3881 | -#: ../src/menu.cpp:491 |
3882 | -msgid "Time & Date Settings…" |
3883 | -msgstr "" |
3884 | - |
3885 | -#: ../src/menu.cpp:546 |
3886 | -msgid "Date and Time" |
3887 | -msgstr "" |
3888 | - |
3889 | -#: ../src/menu.cpp:596 |
3890 | -msgid "Time & Date" |
3891 | -msgstr "" |
3892 | - |
3893 | -#: ../src/menu.cpp:601 |
3894 | -#, c-format |
3895 | -msgid "%s (has alarms)" |
3896 | -msgstr "" |
3897 | - |
3898 | -#. * strftime(3) format for abbreviated weekday, |
3899 | -#. hours, minutes in a 12h locale; e.g. Wed, 2:00 PM |
3900 | -#: ../src/snap.cpp:144 |
3901 | -msgid "%a, %l:%M %p" |
3902 | -msgstr "" |
3903 | - |
3904 | -#. * A strftime(3) format for abbreviated weekday, |
3905 | -#. hours, minutes in a 24h locale; e.g. Wed, 14:00 |
3906 | -#: ../src/snap.cpp:148 |
3907 | -msgid "%a, %H:%M" |
3908 | -msgstr "" |
3909 | - |
3910 | -#: ../src/snap.cpp:153 |
3911 | -#, c-format |
3912 | -msgid "Alarm %s" |
3913 | -msgstr "" |
3914 | - |
3915 | -#: ../src/snap.cpp:154 |
3916 | -#, c-format |
3917 | -msgid "Event %s" |
3918 | -msgstr "" |
3919 | - |
3920 | -#: ../src/snap.cpp:162 ../src/snap.cpp:166 |
3921 | -msgid "OK" |
3922 | -msgstr "" |
3923 | - |
3924 | -#: ../src/snap.cpp:163 |
3925 | -msgid "Snooze" |
3926 | +#: ../src/service.c:1079 |
3927 | +msgid "Date & Time Settings…" |
3928 | +msgstr "" |
3929 | + |
3930 | +#. TRANSLATORS: This is a format string passed to strftime to combine the |
3931 | +#. * date and the time. The value of "%s\xE2\x80\x82%s" will result in a |
3932 | +#. * string like this in US English 12-hour time: 'Fri Jul 16 11:50 AM'. |
3933 | +#. * The space in between date and time is a Unicode en space |
3934 | +#. * (E28082 in UTF-8 hex). |
3935 | +#: ../src/utils.c:196 |
3936 | +#, c-format |
3937 | +msgid "%s %s" |
3938 | +msgstr "" |
3939 | + |
3940 | +#: ../src/utils.c:200 ../src/utils.c:204 |
3941 | +#, c-format |
3942 | +msgid "%s" |
3943 | +msgstr "" |
3944 | + |
3945 | +#. TRANSLATORS: a strftime(3) format for 12hr time w/seconds |
3946 | +#: ../src/utils.c:221 |
3947 | +msgid "%l:%M:%S %p" |
3948 | +msgstr "" |
3949 | + |
3950 | +#. TRANSLATORS: a strftime(3) format for 12hr time |
3951 | +#: ../src/utils.c:224 |
3952 | +msgid "%l:%M %p" |
3953 | +msgstr "" |
3954 | + |
3955 | +#. TRANSLATORS: a strftime(3) format for 24hr time w/seconds |
3956 | +#: ../src/utils.c:227 |
3957 | +msgid "%H:%M:%S" |
3958 | +msgstr "" |
3959 | + |
3960 | +#. TRANSLATORS: a strftime(3) format for 24hr time |
3961 | +#: ../src/utils.c:230 |
3962 | +msgid "%H:%M" |
3963 | +msgstr "" |
3964 | + |
3965 | +#: ../src/utils.c:324 |
3966 | +msgid "Tomorrow" |
3967 | +msgstr "" |
3968 | + |
3969 | +#. a strftime(3) fmt string for abbreviated day of week |
3970 | +#. TRANSLATORS: a strftime(3) format showing the weekday. |
3971 | +#: ../src/utils.c:329 ../src/utils.c:397 |
3972 | +#, c-format |
3973 | +msgid "%a" |
3974 | +msgstr "" |
3975 | + |
3976 | +#. a strftime(3) fmt string for day-of-month and abbreviated month |
3977 | +#: ../src/utils.c:334 |
3978 | +msgid "%d %b" |
3979 | +msgstr "" |
3980 | + |
3981 | +#. a strftime(3) fmt string for a 12 hour on-the-hour time, eg "7 PM" |
3982 | +#: ../src/utils.c:362 |
3983 | +msgid "%l %p" |
3984 | +msgstr "" |
3985 | + |
3986 | +#. TRANSLATORS: a strftime(3) format showing the weekday, date, and year |
3987 | +#: ../src/utils.c:388 |
3988 | +msgid "%a %b %e %Y" |
3989 | +msgstr "" |
3990 | + |
3991 | +#. TRANSLATORS: a strftime(3) format showing the weekday and date |
3992 | +#: ../src/utils.c:391 |
3993 | +msgid "%a %b %e" |
3994 | +msgstr "" |
3995 | + |
3996 | +#. TRANSLATORS: a strftime(3) format showing the weekday and year. |
3997 | +#: ../src/utils.c:394 |
3998 | +msgid "%a %Y" |
3999 | +msgstr "" |
4000 | + |
4001 | +#. TRANSLATORS: a strftime(3) format showing the date and year |
4002 | +#: ../src/utils.c:400 |
4003 | +msgid "%b %e %Y" |
4004 | +msgstr "" |
4005 | + |
4006 | +#. TRANSLATORS: a strftime(3) format showing the date |
4007 | +#: ../src/utils.c:403 |
4008 | +msgid "%b %e" |
4009 | +msgstr "" |
4010 | + |
4011 | +#. TRANSLATORS: a strftime(3) format showing the year |
4012 | +#: ../src/utils.c:406 |
4013 | +msgid "%Y" |
4014 | msgstr "" |
4015 | |
4016 | === modified file 'src/CMakeLists.txt' |
4017 | --- src/CMakeLists.txt 2017-02-10 16:15:07 +0000 |
4018 | +++ src/CMakeLists.txt 2019-08-18 14:27:47 +0000 |
4019 | @@ -1,72 +1,38 @@ |
4020 | set (SERVICE_LIB "indicatordatetimeservice") |
4021 | set (SERVICE_EXEC "indicator-datetime-service") |
4022 | |
4023 | -add_definitions (-DG_LOG_DOMAIN="Indicator-Datetime") |
4024 | - |
4025 | -# handwritten sources |
4026 | -set (SERVICE_C_SOURCES |
4027 | - utils.c) |
4028 | -set (SERVICE_CXX_SOURCES |
4029 | - actions.cpp |
4030 | - actions-live.cpp |
4031 | - alarm-queue-simple.cpp |
4032 | - awake.cpp |
4033 | - appointment.cpp |
4034 | - clock.cpp |
4035 | - clock-live.cpp |
4036 | - date-time.cpp |
4037 | - engine-eds.cpp |
4038 | - exporter.cpp |
4039 | - formatter.cpp |
4040 | - formatter-desktop.cpp |
4041 | - haptic.cpp |
4042 | - locations.cpp |
4043 | - locations-settings.cpp |
4044 | - menu.cpp |
4045 | - myself.cpp |
4046 | - notifications.cpp |
4047 | - planner.cpp |
4048 | - planner-aggregate.cpp |
4049 | - planner-snooze.cpp |
4050 | - planner-month.cpp |
4051 | - planner-range.cpp |
4052 | - planner-upcoming.cpp |
4053 | - settings-live.cpp |
4054 | - snap.cpp |
4055 | - sound.cpp |
4056 | - timezone-geoclue.cpp |
4057 | - timezones-live.cpp |
4058 | - timezone-timedated.cpp |
4059 | - utils.c |
4060 | - wakeup-timer-mainloop.cpp |
4061 | - wakeup-timer-powerd.cpp) |
4062 | - |
4063 | -# generated sources |
4064 | -include (GdbusCodegen) |
4065 | -set(SERVICE_GENERATED_SOURCES) |
4066 | -add_gdbus_codegen(SERVICE_GENERATED_SOURCES dbus-alarm-properties |
4067 | - com.canonical.indicator |
4068 | - ${CMAKE_SOURCE_DIR}/data/com.canonical.indicator.datetime.AlarmProperties.xml) |
4069 | -add_gdbus_codegen(SERVICE_GENERATED_SOURCES dbus-accounts-sound |
4070 | - com.ubuntu.touch |
4071 | - ${CMAKE_SOURCE_DIR}/src/com.ubuntu.touch.AccountsService.Sound.xml) |
4072 | - |
4073 | -# add warnings/coverage info on handwritten files |
4074 | -# but not the autogenerated ones... |
4075 | -set_source_files_properties(${SERVICE_CXX_SOURCES} |
4076 | - PROPERTIES COMPILE_FLAGS "${CXX_WARNING_ARGS} -std=c++11") |
4077 | -set_source_files_properties(${SERVICE_C_SOURCES} |
4078 | - PROPERTIES COMPILE_FLAGS "${CXX_WARNING_ARGS} -std=c99") |
4079 | - |
4080 | -# add the bin dir to our include path so our code can find the generated header files |
4081 | -include_directories (${CMAKE_CURRENT_BINARY_DIR}) |
4082 | - |
4083 | -add_library (${SERVICE_LIB} STATIC ${SERVICE_C_SOURCES} ${SERVICE_CXX_SOURCES} ${SERVICE_GENERATED_SOURCES}) |
4084 | -include_directories (${CMAKE_SOURCE_DIR}) |
4085 | +add_definitions (-DTIMEZONE_FILE="/etc/timezone" |
4086 | + -DG_LOG_DOMAIN="Indicator-Datetime") |
4087 | + |
4088 | +add_library (${SERVICE_LIB} STATIC |
4089 | + clock.c |
4090 | + clock.h |
4091 | + clock-live.c |
4092 | + clock-live.h |
4093 | + planner.c |
4094 | + planner.h |
4095 | + planner-eds.c |
4096 | + planner-eds.h |
4097 | + service.c |
4098 | + service.h |
4099 | + timezone.c |
4100 | + timezone.h |
4101 | + timezone-file.c |
4102 | + timezone-file.h |
4103 | + utils.c |
4104 | + utils.h |
4105 | + dbus-shared.h |
4106 | + settings-shared.h) |
4107 | +include_directories (${SERVICE_DEPS_INCLUDE_DIRS}) |
4108 | link_directories (${SERVICE_DEPS_LIBRARY_DIRS}) |
4109 | |
4110 | -add_executable (${SERVICE_EXEC} main.cpp) |
4111 | -set_source_files_properties(${SERVICE_SOURCES} main.cpp PROPERTIES COMPILE_FLAGS "${CXX_WARNING_ARGS} -std=c++11") |
4112 | -target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES}) |
4113 | +add_executable (${SERVICE_EXEC} main.c) |
4114 | +target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES} ${GCOV_LIBS}) |
4115 | install (TARGETS ${SERVICE_EXEC} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}) |
4116 | |
4117 | +# common properties |
4118 | +set_property (TARGET ${SERVICE_LIB} ${SERVICE_EXEC} |
4119 | + APPEND_STRING PROPERTY COMPILE_FLAGS |
4120 | + " -g ${CC_WARNING_ARGS} ${GCOV_FLAGS}") |
4121 | + |
4122 | + |
4123 | |
4124 | === removed file 'src/actions-live.cpp' |
4125 | --- src/actions-live.cpp 2019-05-18 06:48:53 +0000 |
4126 | +++ src/actions-live.cpp 1970-01-01 00:00:00 +0000 |
4127 | @@ -1,312 +0,0 @@ |
4128 | -/* |
4129 | - * Copyright 2013 Canonical Ltd. |
4130 | - * |
4131 | - * This program is free software: you can redistribute it and/or modify it |
4132 | - * under the terms of the GNU General Public License version 3, as published |
4133 | - * by the Free Software Foundation. |
4134 | - * |
4135 | - * This program is distributed in the hope that it will be useful, but |
4136 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
4137 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
4138 | - * PURPOSE. See the GNU General Public License for more details. |
4139 | - * |
4140 | - * You should have received a copy of the GNU General Public License along |
4141 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
4142 | - * |
4143 | - * Authors: |
4144 | - * Charles Kerr <charles.kerr@canonical.com> |
4145 | - */ |
4146 | - |
4147 | -#include <datetime/dbus-shared.h> |
4148 | -#include <datetime/actions-live.h> |
4149 | - |
4150 | -#include <url-dispatcher.h> |
4151 | - |
4152 | -#include <glib.h> |
4153 | - |
4154 | -#include <sstream> |
4155 | - |
4156 | -namespace unity { |
4157 | -namespace indicator { |
4158 | -namespace datetime { |
4159 | - |
4160 | -/*** |
4161 | -**** |
4162 | -***/ |
4163 | - |
4164 | -LiveActions::LiveActions(const std::shared_ptr<State>& state_in): |
4165 | - Actions(state_in) |
4166 | -{ |
4167 | -} |
4168 | - |
4169 | -void LiveActions::execute_command(const std::string& cmdstr) |
4170 | -{ |
4171 | - const auto cmd = cmdstr.c_str(); |
4172 | - g_debug("Issuing command '%s'", cmd); |
4173 | - |
4174 | - GError* error = nullptr; |
4175 | - if (!g_spawn_command_line_async(cmd, &error)) |
4176 | - { |
4177 | - g_warning("Unable to start \"%s\": %s", cmd, error->message); |
4178 | - g_error_free(error); |
4179 | - } |
4180 | -} |
4181 | - |
4182 | -void LiveActions::dispatch_url(const std::string& url) |
4183 | -{ |
4184 | - g_debug("Dispatching url '%s'", url.c_str()); |
4185 | - url_dispatch_send(url.c_str(), nullptr, nullptr); |
4186 | -} |
4187 | - |
4188 | -/*** |
4189 | -**** |
4190 | -***/ |
4191 | - |
4192 | -LiveActions::Desktop LiveActions::get_desktop() |
4193 | -{ |
4194 | - static bool cached = false; |
4195 | - static LiveActions::Desktop result = LiveActions::OTHER; |
4196 | - |
4197 | - if (cached) { |
4198 | - return result; |
4199 | - } |
4200 | - |
4201 | - // check for unity8 |
4202 | - if (g_getenv ("MIR_SOCKET") != nullptr) { |
4203 | - result = LiveActions::UNITY8; |
4204 | - } else { |
4205 | - const gchar *xdg_current_desktop = g_getenv ("XDG_CURRENT_DESKTOP"); |
4206 | - if (xdg_current_desktop != NULL) { |
4207 | - gchar **desktop_names = g_strsplit (xdg_current_desktop, ":", 0); |
4208 | - for (size_t i = 0; desktop_names[i]; ++i) { |
4209 | - if (!g_strcmp0 (desktop_names[i], "Unity")) { |
4210 | - result = LiveActions::UNITY7; |
4211 | - break; |
4212 | - } else if (!g_strcmp0 (desktop_names[i], "MATE")) { |
4213 | - result = LiveActions::MATE; |
4214 | - break; |
4215 | - } |
4216 | - } |
4217 | - g_strfreev (desktop_names); |
4218 | - } |
4219 | - } |
4220 | - cached = true; |
4221 | - return result; |
4222 | -} |
4223 | - |
4224 | -void LiveActions::open_alarm_app() |
4225 | -{ |
4226 | - switch(get_desktop()) { |
4227 | - case LiveActions::UNITY8: |
4228 | - dispatch_url("appid://ubuntu-clock-app/ubuntu-clock-app/current-user-version"); |
4229 | - break; |
4230 | - case LiveActions::UNITY7: |
4231 | - default: |
4232 | - execute_command("evolution -c calendar"); |
4233 | - } |
4234 | -} |
4235 | - |
4236 | -void LiveActions::open_appointment(const Appointment& appt, const DateTime& date) |
4237 | -{ |
4238 | - switch(get_desktop()) { |
4239 | - case LiveActions::UNITY8: |
4240 | - unity8_open_appointment(appt, date); |
4241 | - break; |
4242 | - case LiveActions::UNITY7: |
4243 | - default: |
4244 | - open_calendar_app(date); |
4245 | - } |
4246 | -} |
4247 | - |
4248 | -void LiveActions::open_calendar_app(const DateTime& dt) |
4249 | -{ |
4250 | - switch(get_desktop()) { |
4251 | - case LiveActions::UNITY8: |
4252 | - { |
4253 | - const auto utc = dt.to_timezone("UTC"); |
4254 | - auto cmd = utc.format("calendar://startdate=%Y-%m-%dT%H:%M:%S+00:00"); |
4255 | - dispatch_url(cmd); |
4256 | - break; |
4257 | - } |
4258 | - case LiveActions::UNITY7: |
4259 | - default: |
4260 | - { |
4261 | - const auto utc = dt.start_of_day().to_timezone("UTC"); |
4262 | - auto cmd = utc.format("evolution \"calendar:///?startdate=%Y%m%dT%H%M%SZ\""); |
4263 | - execute_command(cmd.c_str()); |
4264 | - } |
4265 | - } |
4266 | -} |
4267 | - |
4268 | -void LiveActions::open_settings_app() |
4269 | -{ |
4270 | - switch(get_desktop()) { |
4271 | - case LiveActions::UNITY8: |
4272 | - dispatch_url("settings:///system/time-date"); |
4273 | - break; |
4274 | - case LiveActions::UNITY7: |
4275 | - execute_command("unity-control-center datetime"); |
4276 | - break; |
4277 | - case LiveActions::MATE: |
4278 | - execute_command("time-admin"); |
4279 | - break; |
4280 | - default: |
4281 | - execute_command("gnome-control-center datetime"); |
4282 | - } |
4283 | -} |
4284 | - |
4285 | - |
4286 | -bool LiveActions::desktop_has_calendar_app() const |
4287 | -{ |
4288 | - static bool inited = false; |
4289 | - static bool have_calendar = false; |
4290 | - |
4291 | - if (G_UNLIKELY(!inited)) |
4292 | - { |
4293 | - inited = true; |
4294 | - |
4295 | -#if 0 |
4296 | - auto all = g_app_info_get_all_for_type ("text/calendar"); |
4297 | - for(auto l=all; !have_calendar && l!=nullptr; l=l->next) |
4298 | - { |
4299 | - auto app_info = static_cast<GAppInfo*>(l->data); |
4300 | - |
4301 | - if (!g_strcmp0("evolution.desktop", g_app_info_get_id(app_info))) |
4302 | - have_calendar = true; |
4303 | - } |
4304 | - |
4305 | - g_list_free_full(all, (GDestroyNotify)g_object_unref); |
4306 | -#else |
4307 | - /* Work around http://pad.lv/1296233 for Trusty... |
4308 | - let's revert this when the GIO bug is fixed. */ |
4309 | - auto executable = g_find_program_in_path("evolution"); |
4310 | - have_calendar = executable != nullptr; |
4311 | - g_free(executable); |
4312 | -#endif |
4313 | - } |
4314 | - |
4315 | - return have_calendar; |
4316 | -} |
4317 | - |
4318 | -void LiveActions::unity8_open_appointment(const Appointment& appt, const DateTime& date) |
4319 | -{ |
4320 | - if (!appt.activation_url.empty()) |
4321 | - { |
4322 | - dispatch_url(appt.activation_url); |
4323 | - } |
4324 | - else switch (appt.type) |
4325 | - { |
4326 | - case Appointment::UBUNTU_ALARM: |
4327 | - open_alarm_app(); |
4328 | - break; |
4329 | - |
4330 | - case Appointment::EVENT: |
4331 | - default: |
4332 | - open_calendar_app(date); |
4333 | - break; |
4334 | - } |
4335 | -} |
4336 | - |
4337 | -/*** |
4338 | -**** |
4339 | -***/ |
4340 | - |
4341 | -namespace |
4342 | -{ |
4343 | - |
4344 | -struct setlocation_data |
4345 | -{ |
4346 | - std::string tzid; |
4347 | - std::string name; |
4348 | - std::shared_ptr<Settings> settings; |
4349 | -}; |
4350 | - |
4351 | -static void |
4352 | -on_datetime1_set_timezone_response(GObject * object, |
4353 | - GAsyncResult * res, |
4354 | - gpointer gdata) |
4355 | -{ |
4356 | - GError* err = nullptr; |
4357 | - auto response = g_dbus_proxy_call_finish(G_DBUS_PROXY(object), res, &err); |
4358 | - auto data = static_cast<struct setlocation_data*>(gdata); |
4359 | - |
4360 | - if (err != nullptr) |
4361 | - { |
4362 | - if (!g_error_matches(err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) |
4363 | - g_warning("Could not set new timezone: %s", err->message); |
4364 | - |
4365 | - g_error_free(err); |
4366 | - } |
4367 | - else |
4368 | - { |
4369 | - data->settings->timezone_name.set(data->tzid + " " + data->name); |
4370 | - g_variant_unref(response); |
4371 | - } |
4372 | - |
4373 | - delete data; |
4374 | -} |
4375 | - |
4376 | -static void |
4377 | -on_datetime1_proxy_ready (GObject * object G_GNUC_UNUSED, |
4378 | - GAsyncResult * res, |
4379 | - gpointer gdata) |
4380 | -{ |
4381 | - auto data = static_cast<struct setlocation_data*>(gdata); |
4382 | - |
4383 | - GError * err = nullptr; |
4384 | - auto proxy = g_dbus_proxy_new_for_bus_finish(res, &err); |
4385 | - if (err != nullptr) |
4386 | - { |
4387 | - if (!g_error_matches(err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) |
4388 | - g_warning("Could not grab DBus proxy for timedated: %s", err->message); |
4389 | - |
4390 | - g_error_free(err); |
4391 | - |
4392 | - delete data; |
4393 | - } |
4394 | - else |
4395 | - { |
4396 | - g_dbus_proxy_call(proxy, |
4397 | - Bus::Timedate1::Methods::SET_TIMEZONE, |
4398 | - g_variant_new ("(sb)", data->tzid.c_str(), TRUE), |
4399 | - G_DBUS_CALL_FLAGS_NONE, |
4400 | - -1, |
4401 | - nullptr, |
4402 | - on_datetime1_set_timezone_response, |
4403 | - data); |
4404 | - |
4405 | - g_object_unref (proxy); |
4406 | - } |
4407 | -} |
4408 | - |
4409 | -} // unnamed namespace |
4410 | - |
4411 | - |
4412 | -void LiveActions::set_location(const std::string& tzid, const std::string& name) |
4413 | -{ |
4414 | - g_return_if_fail(!tzid.empty()); |
4415 | - g_return_if_fail(!name.empty()); |
4416 | - |
4417 | - auto data = new struct setlocation_data; |
4418 | - data->tzid = tzid; |
4419 | - data->name = name; |
4420 | - data->settings = state()->settings; |
4421 | - |
4422 | - g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, |
4423 | - G_DBUS_PROXY_FLAGS_NONE, |
4424 | - nullptr, |
4425 | - Bus::Timedate1::BUSNAME, |
4426 | - Bus::Timedate1::ADDR, |
4427 | - Bus::Timedate1::IFACE, |
4428 | - nullptr, |
4429 | - on_datetime1_proxy_ready, |
4430 | - data); |
4431 | -} |
4432 | - |
4433 | -/*** |
4434 | -**** |
4435 | -***/ |
4436 | - |
4437 | -} // namespace datetime |
4438 | -} // namespace indicator |
4439 | -} // namespace unity |
4440 | |
4441 | === removed file 'src/actions.cpp' |
4442 | --- src/actions.cpp 2016-05-14 02:07:10 +0000 |
4443 | +++ src/actions.cpp 1970-01-01 00:00:00 +0000 |
4444 | @@ -1,273 +0,0 @@ |
4445 | -/* |
4446 | - * Copyright 2013 Canonical Ltd. |
4447 | - * |
4448 | - * This program is free software: you can redistribute it and/or modify it |
4449 | - * under the terms of the GNU General Public License version 3, as published |
4450 | - * by the Free Software Foundation. |
4451 | - * |
4452 | - * This program is distributed in the hope that it will be useful, but |
4453 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
4454 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
4455 | - * PURPOSE. See the GNU General Public License for more details. |
4456 | - * |
4457 | - * You should have received a copy of the GNU General Public License along |
4458 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
4459 | - * |
4460 | - * Authors: |
4461 | - * Charles Kerr <charles.kerr@canonical.com> |
4462 | - */ |
4463 | - |
4464 | -#include <datetime/actions.h> |
4465 | -#include <datetime/utils.h> // split_settings_location() |
4466 | - |
4467 | -#include <glib.h> |
4468 | -#include <gio/gio.h> |
4469 | - |
4470 | -namespace unity { |
4471 | -namespace indicator { |
4472 | -namespace datetime { |
4473 | - |
4474 | -/*** |
4475 | -**** |
4476 | -***/ |
4477 | - |
4478 | -namespace |
4479 | -{ |
4480 | - |
4481 | -DateTime datetime_from_timet_variant(GVariant* v) |
4482 | -{ |
4483 | - int64_t t = 0; |
4484 | - |
4485 | - if (v != nullptr) |
4486 | - if (g_variant_type_equal(G_VARIANT_TYPE_INT64,g_variant_get_type(v))) |
4487 | - t = g_variant_get_int64(v); |
4488 | - |
4489 | - if (t != 0) |
4490 | - return DateTime::Local(t); |
4491 | - else |
4492 | - return DateTime::NowLocal(); |
4493 | -} |
4494 | - |
4495 | -bool lookup_appointment_by_uid(const std::shared_ptr<State>& state, const gchar* uid, Appointment& setme) |
4496 | -{ |
4497 | - for(const auto& appt : state->calendar_upcoming->appointments().get()) |
4498 | - { |
4499 | - if (appt.uid == uid) |
4500 | - { |
4501 | - setme = appt; |
4502 | - return true; |
4503 | - } |
4504 | - } |
4505 | - |
4506 | - return false; |
4507 | -} |
4508 | - |
4509 | -void on_appointment_activated (GSimpleAction*, GVariant *vdata, gpointer gself) |
4510 | -{ |
4511 | - auto self = static_cast<Actions*>(gself); |
4512 | - Appointment appt; |
4513 | - const gchar* uid = nullptr; |
4514 | - gint64 time = 0; |
4515 | - g_variant_get(vdata, "(&sx)", &uid, &time); |
4516 | - if (lookup_appointment_by_uid(self->state(), uid, appt)) |
4517 | - self->open_appointment(appt, DateTime::Local(time)); |
4518 | -} |
4519 | -void on_alarm_activated (GSimpleAction*, GVariant*, gpointer gself) |
4520 | -{ |
4521 | - static_cast<Actions*>(gself)->open_alarm_app(); |
4522 | -} |
4523 | -void on_calendar_activated (GSimpleAction*, GVariant* vt, gpointer gself) |
4524 | -{ |
4525 | - const auto dt = datetime_from_timet_variant(vt); |
4526 | - static_cast<Actions*>(gself)->open_calendar_app(dt); |
4527 | -} |
4528 | -void on_settings_activated (GSimpleAction*, GVariant*, gpointer gself) |
4529 | -{ |
4530 | - static_cast<Actions*>(gself)->open_settings_app(); |
4531 | -} |
4532 | - |
4533 | - |
4534 | -void on_set_location(GSimpleAction * /*action*/, |
4535 | - GVariant * param, |
4536 | - gpointer gself) |
4537 | -{ |
4538 | - char * zone; |
4539 | - char * name; |
4540 | - split_settings_location(g_variant_get_string(param, nullptr), &zone, &name); |
4541 | - static_cast<Actions*>(gself)->set_location(zone, name); |
4542 | - g_free(name); |
4543 | - g_free(zone); |
4544 | -} |
4545 | - |
4546 | -void on_calendar_active_changed(GSimpleAction * /*action*/, |
4547 | - GVariant * state, |
4548 | - gpointer gself) |
4549 | -{ |
4550 | - // reset the date when the menu is shown |
4551 | - if (g_variant_get_boolean(state)) |
4552 | - { |
4553 | - auto self = static_cast<Actions*>(gself); |
4554 | - |
4555 | - self->set_calendar_date(self->state()->clock->localtime()); |
4556 | - } |
4557 | -} |
4558 | - |
4559 | -void on_calendar_date_activated(GSimpleAction * /*action*/, |
4560 | - GVariant * state, |
4561 | - gpointer gself) |
4562 | -{ |
4563 | - const time_t t = g_variant_get_int64(state); |
4564 | - |
4565 | - g_return_if_fail(t != 0); |
4566 | - |
4567 | - auto dt = DateTime::Local(t).start_of_day(); |
4568 | - static_cast<Actions*>(gself)->set_calendar_date(dt); |
4569 | -} |
4570 | - |
4571 | -GVariant* create_default_header_state() |
4572 | -{ |
4573 | - GVariantBuilder b; |
4574 | - g_variant_builder_init(&b, G_VARIANT_TYPE_VARDICT); |
4575 | - g_variant_builder_add(&b, "{sv}", "accessible-desc", g_variant_new_string("accessible-desc")); |
4576 | - g_variant_builder_add(&b, "{sv}", "label", g_variant_new_string("label")); |
4577 | - g_variant_builder_add(&b, "{sv}", "title", g_variant_new_string("title")); |
4578 | - g_variant_builder_add(&b, "{sv}", "visible", g_variant_new_boolean(true)); |
4579 | - return g_variant_builder_end(&b); |
4580 | -} |
4581 | - |
4582 | -GVariant* create_calendar_state(const std::shared_ptr<State>& state) |
4583 | -{ |
4584 | - gboolean days[32] = { 0 }; |
4585 | - for (const auto& appt : state->calendar_month->appointments().get()) |
4586 | - days[appt.begin.day_of_month()] = true; |
4587 | - |
4588 | - GVariantBuilder day_builder; |
4589 | - g_variant_builder_init(&day_builder, G_VARIANT_TYPE("ai")); |
4590 | - for (guint i=0; i<G_N_ELEMENTS(days); i++) |
4591 | - if (days[i]) |
4592 | - g_variant_builder_add(&day_builder, "i", i); |
4593 | - |
4594 | - GVariantBuilder dict_builder; |
4595 | - g_variant_builder_init(&dict_builder, G_VARIANT_TYPE_DICTIONARY); |
4596 | - |
4597 | - auto key = "appointment-days"; |
4598 | - auto v = g_variant_builder_end(&day_builder); |
4599 | - g_variant_builder_add(&dict_builder, "{sv}", key, v); |
4600 | - |
4601 | - key = "calendar-day"; |
4602 | - v = g_variant_new_int64(state->calendar_month->month().get().to_unix()); |
4603 | - g_variant_builder_add(&dict_builder, "{sv}", key, v); |
4604 | - |
4605 | - key = "show-week-numbers"; |
4606 | - v = g_variant_new_boolean(state->settings->show_week_numbers.get()); |
4607 | - g_variant_builder_add(&dict_builder, "{sv}", key, v); |
4608 | - |
4609 | - return g_variant_builder_end(&dict_builder); |
4610 | -} |
4611 | -} // unnamed namespace |
4612 | - |
4613 | -/*** |
4614 | -**** |
4615 | -***/ |
4616 | - |
4617 | -Actions::Actions(const std::shared_ptr<State>& state): |
4618 | - m_state(state), |
4619 | - m_actions(g_simple_action_group_new()) |
4620 | -{ |
4621 | - GActionEntry entries[] = { |
4622 | - |
4623 | - { "desktop.open-appointment", on_appointment_activated, "(sx)", nullptr }, |
4624 | - { "desktop.open-alarm-app", on_alarm_activated }, |
4625 | - { "desktop.open-calendar-app", on_calendar_activated, "x", nullptr }, |
4626 | - { "desktop.open-settings-app", on_settings_activated }, |
4627 | - |
4628 | - { "phone.open-appointment", on_appointment_activated, "(sx)", nullptr }, |
4629 | - { "phone.open-alarm-app", on_alarm_activated }, |
4630 | - { "phone.open-calendar-app", on_calendar_activated, "x", nullptr }, |
4631 | - { "phone.open-settings-app", on_settings_activated }, |
4632 | - |
4633 | - { "calendar-active", nullptr, nullptr, "false", on_calendar_active_changed }, |
4634 | - { "set-location", on_set_location, "s" } |
4635 | - }; |
4636 | - |
4637 | - g_action_map_add_action_entries(G_ACTION_MAP(m_actions), |
4638 | - entries, |
4639 | - G_N_ELEMENTS(entries), |
4640 | - this); |
4641 | - |
4642 | - // add the header actions |
4643 | - auto gam = G_ACTION_MAP(m_actions); |
4644 | - auto v = create_default_header_state(); |
4645 | - auto a = g_simple_action_new_stateful("desktop-header", nullptr, v); |
4646 | - g_action_map_add_action(gam, G_ACTION(a)); |
4647 | - g_object_unref(a); |
4648 | - |
4649 | - a = g_simple_action_new_stateful("desktop_greeter-header", nullptr, v); |
4650 | - g_action_map_add_action(gam, G_ACTION(a)); |
4651 | - g_object_unref(a); |
4652 | - |
4653 | - a = g_simple_action_new_stateful("phone-header", nullptr, v); |
4654 | - g_action_map_add_action(gam, G_ACTION(a)); |
4655 | - g_object_unref(a); |
4656 | - |
4657 | - a = g_simple_action_new_stateful("phone_greeter-header", nullptr, v); |
4658 | - g_action_map_add_action(gam, G_ACTION(a)); |
4659 | - g_object_unref(a); |
4660 | - |
4661 | - // add the calendar action |
4662 | - v = create_calendar_state(state); |
4663 | - a = g_simple_action_new_stateful("calendar", G_VARIANT_TYPE_INT64, v); |
4664 | - g_action_map_add_action(gam, G_ACTION(a)); |
4665 | - g_signal_connect(a, "activate", G_CALLBACK(on_calendar_date_activated), this); |
4666 | - g_object_unref(a); |
4667 | - |
4668 | - /// |
4669 | - /// Keep our GActionGroup's action's states in sync with m_state |
4670 | - /// |
4671 | - |
4672 | - m_state->calendar_month->month().changed().connect([this](const DateTime&){ |
4673 | - update_calendar_state(); |
4674 | - }); |
4675 | - m_state->calendar_month->appointments().changed().connect([this](const std::vector<Appointment>&){ |
4676 | - update_calendar_state(); |
4677 | - }); |
4678 | - m_state->settings->show_week_numbers.changed().connect([this](bool){ |
4679 | - update_calendar_state(); |
4680 | - }); |
4681 | - |
4682 | - // FIXME: rebuild the calendar state when show-week-number changes |
4683 | -} |
4684 | - |
4685 | -Actions::~Actions() |
4686 | -{ |
4687 | - g_clear_object(&m_actions); |
4688 | -} |
4689 | - |
4690 | -void Actions::update_calendar_state() |
4691 | -{ |
4692 | - g_action_group_change_action_state(action_group(), |
4693 | - "calendar", |
4694 | - create_calendar_state(m_state)); |
4695 | -} |
4696 | - |
4697 | -void Actions::set_calendar_date(const DateTime& date) |
4698 | -{ |
4699 | - m_state->calendar_month->month().set(date); |
4700 | - m_state->calendar_upcoming->date().set(date); |
4701 | -} |
4702 | - |
4703 | -GActionGroup* Actions::action_group() |
4704 | -{ |
4705 | - return G_ACTION_GROUP(m_actions); |
4706 | -} |
4707 | - |
4708 | -const std::shared_ptr<State> Actions::state() const |
4709 | -{ |
4710 | - return m_state; |
4711 | -} |
4712 | - |
4713 | - |
4714 | - |
4715 | -} // namespace datetime |
4716 | -} // namespace indicator |
4717 | -} // namespace unity |
4718 | |
4719 | === removed file 'src/alarm-queue-simple.cpp' |
4720 | --- src/alarm-queue-simple.cpp 2015-04-06 19:26:24 +0000 |
4721 | +++ src/alarm-queue-simple.cpp 1970-01-01 00:00:00 +0000 |
4722 | @@ -1,190 +0,0 @@ |
4723 | -/* |
4724 | - * Copyright 2014 Canonical Ltd. |
4725 | - * |
4726 | - * This program is free software: you can redistribute it and/or modify it |
4727 | - * under the terms of the GNU General Public License version 3, as published |
4728 | - * by the Free Software Foundation. |
4729 | - * |
4730 | - * This program is distributed in the hope that it will be useful, but |
4731 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
4732 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
4733 | - * PURPOSE. See the GNU General Public License for more details. |
4734 | - * |
4735 | - * You should have received a copy of the GNU General Public License along |
4736 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
4737 | - * |
4738 | - * Authors: |
4739 | - * Charles Kerr <charles.kerr@canonical.com> |
4740 | - */ |
4741 | - |
4742 | -#include <datetime/alarm-queue-simple.h> |
4743 | - |
4744 | -#include <cmath> |
4745 | -#include <set> |
4746 | - |
4747 | -namespace unity { |
4748 | -namespace indicator { |
4749 | -namespace datetime { |
4750 | - |
4751 | -/*** |
4752 | -**** |
4753 | -***/ |
4754 | - |
4755 | -class SimpleAlarmQueue::Impl |
4756 | -{ |
4757 | -public: |
4758 | - |
4759 | - Impl(const std::shared_ptr<Clock>& clock, |
4760 | - const std::shared_ptr<Planner>& planner, |
4761 | - const std::shared_ptr<WakeupTimer>& timer): |
4762 | - m_clock{clock}, |
4763 | - m_planner{planner}, |
4764 | - m_timer{timer}, |
4765 | - m_datetime{clock->localtime()} |
4766 | - { |
4767 | - m_planner->appointments().changed().connect([this](const std::vector<Appointment>&){ |
4768 | - g_debug("AlarmQueue %p calling requeue() due to appointments changed", this); |
4769 | - requeue(); |
4770 | - }); |
4771 | - |
4772 | - m_clock->minute_changed.connect([this]{ |
4773 | - const auto now = m_clock->localtime(); |
4774 | - constexpr auto skew_threshold_usec = int64_t{90} * G_USEC_PER_SEC; |
4775 | - const bool clock_jumped = std::abs(now - m_datetime) > skew_threshold_usec; |
4776 | - m_datetime = now; |
4777 | - if (clock_jumped) { |
4778 | - g_debug("AlarmQueue %p calling requeue() due to clock skew", this); |
4779 | - requeue(); |
4780 | - } |
4781 | - }); |
4782 | - |
4783 | - m_timer->timeout().connect([this](){ |
4784 | - g_debug("AlarmQueue %p calling requeue() due to timeout", this); |
4785 | - requeue(); |
4786 | - }); |
4787 | - |
4788 | - requeue(); |
4789 | - } |
4790 | - |
4791 | - ~Impl() |
4792 | - { |
4793 | - } |
4794 | - |
4795 | - core::Signal<const Appointment&, const Alarm&>& alarm_reached() |
4796 | - { |
4797 | - return m_alarm_reached; |
4798 | - } |
4799 | - |
4800 | -private: |
4801 | - |
4802 | - void requeue() |
4803 | - { |
4804 | - const auto appointments = m_planner->appointments().get(); |
4805 | - const Alarm* alarm; |
4806 | - |
4807 | - // kick any current alarms |
4808 | - for (const auto& appointment : appointments) |
4809 | - { |
4810 | - if ((alarm = appointment_get_current_alarm(appointment))) |
4811 | - { |
4812 | - m_triggered.insert(std::make_pair(appointment.uid, alarm->time)); |
4813 | - m_alarm_reached(appointment, *alarm); |
4814 | - } |
4815 | - } |
4816 | - |
4817 | - // idle until the next alarm |
4818 | - if ((alarm = find_next_alarm(appointments))) |
4819 | - { |
4820 | - g_debug ("setting timer to wake up for next appointment '%s' at %s", |
4821 | - alarm->text.c_str(), |
4822 | - alarm->time.format("%F %T").c_str()); |
4823 | - |
4824 | - m_timer->set_wakeup_time(alarm->time); |
4825 | - } |
4826 | - } |
4827 | - |
4828 | - bool already_triggered (const Appointment& appt, const Alarm& alarm) const |
4829 | - { |
4830 | - const std::pair<const std::string&,const DateTime&> key{appt.uid, alarm.time}; |
4831 | - return m_triggered.count(key) != 0; |
4832 | - } |
4833 | - |
4834 | - // return the next Alarm (if any) that will kick now or in the future |
4835 | - const Alarm* find_next_alarm(const std::vector<Appointment>& appointments) const |
4836 | - { |
4837 | - const Alarm* best {}; |
4838 | - const auto now = m_clock->localtime(); |
4839 | - const auto beginning_of_minute = now.start_of_minute(); |
4840 | - |
4841 | - g_debug ("planner has %zu appointments in it", (size_t)appointments.size()); |
4842 | - |
4843 | - for(const auto& appointment : appointments) |
4844 | - { |
4845 | - for(const auto& alarm : appointment.alarms) |
4846 | - { |
4847 | - if (already_triggered(appointment, alarm)) |
4848 | - continue; |
4849 | - |
4850 | - if (alarm.time < beginning_of_minute) // has this one already passed? |
4851 | - continue; |
4852 | - |
4853 | - if (best && (best->time < alarm.time)) // do we already have a better match? |
4854 | - continue; |
4855 | - |
4856 | - best = &alarm; |
4857 | - } |
4858 | - } |
4859 | - |
4860 | - return best; |
4861 | - } |
4862 | - |
4863 | - // return the Appointment's current Alarm (if any) |
4864 | - const Alarm* appointment_get_current_alarm(const Appointment& appointment) const |
4865 | - { |
4866 | - const auto now = m_clock->localtime(); |
4867 | - |
4868 | - for (const auto& alarm : appointment.alarms) |
4869 | - if (!already_triggered(appointment, alarm) && DateTime::is_same_minute(now, alarm.time)) |
4870 | - return &alarm; |
4871 | - |
4872 | - return nullptr; |
4873 | - } |
4874 | - |
4875 | - |
4876 | - std::set<std::pair<std::string,DateTime>> m_triggered; |
4877 | - const std::shared_ptr<Clock> m_clock; |
4878 | - const std::shared_ptr<Planner> m_planner; |
4879 | - const std::shared_ptr<WakeupTimer> m_timer; |
4880 | - core::Signal<const Appointment&, const Alarm&> m_alarm_reached; |
4881 | - DateTime m_datetime; |
4882 | -}; |
4883 | - |
4884 | -/*** |
4885 | -**** Public API |
4886 | -***/ |
4887 | - |
4888 | - |
4889 | -SimpleAlarmQueue::SimpleAlarmQueue(const std::shared_ptr<Clock>& clock, |
4890 | - const std::shared_ptr<Planner>& planner, |
4891 | - const std::shared_ptr<WakeupTimer>& timer): |
4892 | - impl{new Impl{clock, planner, timer}} |
4893 | -{ |
4894 | -} |
4895 | - |
4896 | -SimpleAlarmQueue::~SimpleAlarmQueue() |
4897 | -{ |
4898 | -} |
4899 | - |
4900 | -core::Signal<const Appointment&, const Alarm&>& |
4901 | -SimpleAlarmQueue::alarm_reached() |
4902 | -{ |
4903 | - return impl->alarm_reached(); |
4904 | -} |
4905 | - |
4906 | -/*** |
4907 | -**** |
4908 | -***/ |
4909 | - |
4910 | -} // namespace datetime |
4911 | -} // namespace indicator |
4912 | -} // namespace unity |
4913 | |
4914 | === removed file 'src/appointment.cpp' |
4915 | --- src/appointment.cpp 2016-05-14 02:07:10 +0000 |
4916 | +++ src/appointment.cpp 1970-01-01 00:00:00 +0000 |
4917 | @@ -1,64 +0,0 @@ |
4918 | -/* |
4919 | - * Copyright 2013 Canonical Ltd. |
4920 | - * |
4921 | - * This program is free software: you can redistribute it and/or modify it |
4922 | - * under the terms of the GNU General Public License version 3, as published |
4923 | - * by the Free Software Foundation. |
4924 | - * |
4925 | - * This program is distributed in the hope that it will be useful, but |
4926 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
4927 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
4928 | - * PURPOSE. See the GNU General Public License for more details. |
4929 | - * |
4930 | - * You should have received a copy of the GNU General Public License along |
4931 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
4932 | - * |
4933 | - * Authors: |
4934 | - * Charles Kerr <charles.kerr@canonical.com> |
4935 | - */ |
4936 | - |
4937 | -#include <datetime/appointment.h> |
4938 | - |
4939 | -namespace unity { |
4940 | -namespace indicator { |
4941 | -namespace datetime { |
4942 | - |
4943 | -/**** |
4944 | -***** |
4945 | -****/ |
4946 | - |
4947 | -bool Alarm::operator==(const Alarm& that) const |
4948 | -{ |
4949 | - return (text==that.text) |
4950 | - && (audio_url==that.audio_url) |
4951 | - && (this->time==that.time); |
4952 | -} |
4953 | - |
4954 | -bool Alarm::has_sound() const |
4955 | -{ |
4956 | - return !audio_url.empty(); |
4957 | -} |
4958 | - |
4959 | -bool Alarm::has_text() const |
4960 | -{ |
4961 | - return !text.empty(); |
4962 | -} |
4963 | - |
4964 | -bool Appointment::operator==(const Appointment& that) const |
4965 | -{ |
4966 | - return (type==that.type) |
4967 | - && (uid==that.uid) |
4968 | - && (color==that.color) |
4969 | - && (summary==that.summary) |
4970 | - && (begin==that.begin) |
4971 | - && (end==that.end) |
4972 | - && (alarms==that.alarms); |
4973 | -} |
4974 | - |
4975 | -/**** |
4976 | -***** |
4977 | -****/ |
4978 | - |
4979 | -} // namespace datetime |
4980 | -} // namespace indicator |
4981 | -} // namespace unity |
4982 | |
4983 | === removed file 'src/awake.cpp' |
4984 | --- src/awake.cpp 2016-11-04 16:00:24 +0000 |
4985 | +++ src/awake.cpp 1970-01-01 00:00:00 +0000 |
4986 | @@ -1,151 +0,0 @@ |
4987 | -/* |
4988 | - * Copyright 2014 Canonical Ltd. |
4989 | - * |
4990 | - * This program is free software: you can redistribute it and/or modify it |
4991 | - * under the terms of the GNU General Public License version 3, as published |
4992 | - * by the Free Software Foundation. |
4993 | - * |
4994 | - * This program is distributed in the hope that it will be useful, but |
4995 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
4996 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
4997 | - * PURPOSE. See the GNU General Public License for more details. |
4998 | - * |
4999 | - * You should have received a copy of the GNU General Public License along |
5000 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
The diff has been truncated, so I am reviewing locally.