ALT Linux Bugzilla
– Attachment 20879 Details for
Bug 51204
Поддержка waked в gnome-clocks
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
patch for 50 release
gnome-clocks-50.0-alt-waked.patch (text/plain), 5.72 KB, created by
Egor Shestakov
on 2026-03-13 19:00:35 MSK
(
hide
)
Description:
patch for 50 release
Filename:
MIME Type:
Creator:
Egor Shestakov
Created:
2026-03-13 19:00:35 MSK
Size:
5.72 KB
patch
obsolete
>diff --git a/build-aux/flatpak/org.gnome.clocks.json b/build-aux/flatpak/org.gnome.clocks.json >index 9bc81205..1612befd 100644 >--- a/build-aux/flatpak/org.gnome.clocks.json >+++ b/build-aux/flatpak/org.gnome.clocks.json >@@ -15,6 +15,7 @@ > "--socket=wayland", > "--socket=pulseaudio", > "--share=network", >+ "--system-talk-name=de.seath.Waked", > "--env=G_MESSAGES_DEBUG=org.gnome.ClocksDevel" > ], > "build-options": { >diff --git a/meson_options.txt b/meson_options.txt >index 12ff40dc..928e8a39 100644 >--- a/meson_options.txt >+++ b/meson_options.txt >@@ -9,4 +9,6 @@ option( > description: 'The build profile for Clock. One of "default" or "development".' > ) > >-option('docs', type : 'boolean', value : false) >\ No newline at end of file >+option('docs', type : 'boolean', value : false) >+ >+option('waked', type : 'boolean', value : false) >diff --git a/src/alarm-face.vala b/src/alarm-face.vala >index 48a1a30e..6b66d91a 100644 >--- a/src/alarm-face.vala >+++ b/src/alarm-face.vala >@@ -82,6 +82,9 @@ public class Face : Adw.Bin, Clocks.Clock { > }); > > row.remove_alarm.connect (() => { >+#if HAVE_WAKED >+ Waked.get_default ().remove_timer.begin (((Item) item).id); >+#endif > alarms.remove ((Item) item); > if (ring_time_toast != null && item == ring_time_toast_alarm) { > ring_time_toast_alarm = null; >@@ -187,6 +190,9 @@ public class Face : Adw.Bin, Clocks.Clock { > alarm.active = true; > save (); > } else if (response == DELETE_ALARM) { >+#if HAVE_WAKED >+ Waked.get_default ().remove_timer.begin (alarm.id); >+#endif > alarms.remove (alarm); > save (); > } >diff --git a/src/alarm-item.vala b/src/alarm-item.vala >index 7b6735d8..e945186a 100644 >--- a/src/alarm-item.vala >+++ b/src/alarm-item.vala >@@ -89,6 +89,14 @@ private class Item : Object, ContentItem { > notify_property ("active"); > } > notify_property ("ring-time"); >+ >+#if HAVE_WAKED >+ if (value == null) { >+ Waked.get_default ().remove_timer.begin (id); >+ } else { >+ Waked.get_default ().update_timer.begin (id, ring_time); >+ } >+#endif > } > } > >@@ -193,6 +201,11 @@ private class Item : Object, ContentItem { > public Item (string? id = null) { > Object (id: id); > } >+ ~Item () { >+#if HAVE_WAKED >+ Waked.get_default ().remove_timer.begin (id); >+#endif >+ } > > private void setup_bell () { > bell = new Utils.Bell (sound_file); >diff --git a/src/meson.build b/src/meson.build >index bf3bde79..552f45cc 100644 >--- a/src/meson.build >+++ b/src/meson.build >@@ -1,5 +1,9 @@ > clocks_c_sources = files('cutils.c', 'twilight.c') > >+if get_option('waked') >+ add_project_arguments('-D', 'HAVE_WAKED', language: 'vala') >+endif >+ > clocks_c_args = [ > '-DGWEATHER_I_KNOW_THIS_IS_UNSTABLE', > '-DGNOME_DESKTOP_USE_UNSTABLE_API', >@@ -47,6 +51,7 @@ clocks_vala_sources = files( > 'timer-setup.vala', > 'timer-setup-dialog.vala', > 'utils.vala', >+ 'waked.vala', > 'widgets.vala', > 'window.vala', > 'world-face.vala', >diff --git a/src/waked.vala b/src/waked.vala >new file mode 100644 >index 0000000..e2523b4 >--- /dev/null >+++ b/src/waked.vala >@@ -0,0 +1,76 @@ >+/* >+ * Copyright (C) 2021 Robin Westermann <waked@seath.de> >+ * >+ * This program is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU General Public License >+ * as published by the Free Software Foundation; either version 2 >+ * of the License, or (at your option) any later version. >+ * >+ * This program is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+ * GNU General Public License for more details. >+ * >+ * You should have received a copy of the GNU General Public License >+ * along with this program; if not, write to the Free Software >+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. >+ */ >+ >+namespace Clocks { >+ >+[SingleInstance] >+public class Waked : GLib.Object { >+ [DBus (name = "de.seath.Waked")] >+ internal interface WakedProxy : GLib.Object { >+ public async abstract void add (string id, uint64 time) throws GLib.Error; >+ public async abstract void update (string id, uint64 time) throws GLib.Error; >+ public async abstract void remove (string id) throws GLib.Error; >+ } >+ >+ static Waked instance; >+ private WakedProxy _waked_proxy; >+ >+ public static Waked get_default () { >+ if (instance == null) { >+ instance = new Waked (); >+ } >+ >+ return instance; >+ } >+ >+ async WakedProxy get_proxy () throws GLib.IOError { >+ if (_waked_proxy == null) { >+ _waked_proxy = >+ yield Bus.get_proxy<WakedProxy> ( >+ BusType.SYSTEM, >+ "de.seath.Waked", >+ "/de/seath/Waked/Alarm"); >+ } >+ >+ return _waked_proxy; >+ } >+ >+ public async void update_timer (string id, GLib.DateTime time) { >+ try { >+ var waked_proxy = yield get_proxy (); >+ >+ yield waked_proxy.update (id, time.to_unix ()); >+ >+ } catch (GLib.Error e) { >+ stderr.printf ("%s\n", e.message); >+ } >+ } >+ >+ public async void remove_timer (string id) { >+ try { >+ var waked_proxy = yield get_proxy (); >+ >+ yield waked_proxy.remove (id); >+ >+ } catch (GLib.Error e) { >+ stderr.printf ("%s\n", e.message); >+ } >+ } >+} >+ >+} // namespace Clocks
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 51204
:
16650
| 20879