After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 683107 - keynav for alarm stop and snooze
keynav for alarm stop and snooze
Status: RESOLVED WONTFIX
Product: gnome-clocks
Classification: Applications
Component: alarms
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Clocks maintainer(s)
Clocks maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-08-31 14:04 UTC by Paolo Borelli
Modified: 2020-11-24 13:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This allows to stop/snooze alarm using keynav. (3.56 KB, patch)
2014-01-24 22:34 UTC, Saurabh_P
needs-work Details | Review

Description Paolo Borelli 2012-08-31 14:04:54 UTC
Proposal:
 - pressing any key -> stop
 - pressing esc -> snooze
Comment 1 Saurabh_P 2014-01-24 16:56:17 UTC
Problem facing:
I've basically stopping or snoozing alarm from ringing_panel but I'm not able to close or press any button from notification window so suppose user presses esc then alarm gets set on snooze mode from ringing_panel but after that if user presses stop from notification window then alarm gets set to stop mode. This problem is a kind of bug too as normally we press stop or snooze from ringing_panel but ultimately the state of alarm depends on which button is pressed from notification window.

Need hint:
1 > Can I press stop or snooze button from notification window or can I activate related actions manually ? or Can I destroy notification window manually when user presses any key ?
Comment 2 Saurabh_P 2014-01-24 17:02:55 UTC
I guess we want that if user presses stop or snooze button from ringing_panel then notification dialogue box should get destroyed.
Comment 3 Saurabh_P 2014-01-24 22:34:02 UTC
Created attachment 267164 [details] [review]
This allows to stop/snooze alarm using keynav.

Escape -> Snooze alarm.
Any other key -> Stop alarm.

"Clocks" should be focused while pressing key. In other words key events should be identified to "Clocks".
Comment 4 Saurabh_P 2014-02-10 21:31:10 UTC
ping
Comment 5 Paolo Borelli 2014-12-25 18:22:21 UTC
Review of attachment 267164 [details] [review]:

sorry for the very long delay.

I do not think this is the right approach, we should not handle the keypress event manually. We should instead add appropriate GActions and then bind keyboard shortcuts to such actions
Comment 6 Robert Roth 2015-01-03 00:24:41 UTC
@Paolo: I could come up with a GAction version for snoozing, but how do I add a GAction with "Any other key than Escape"? Is it even possible, or for that, we should still handle the keypress?
Comment 7 Paolo Borelli 2015-01-03 08:59:02 UTC
Review of attachment 267164 [details] [review]:

Mmmm... you are right, I missed the "any-key" part. I withdraw my previous review, however some comments about the implementation follow

::: src/alarm.vala
@@ -159,3 +159,3 @@
     public virtual signal void ring () {
         var app = GLib.Application.get_default ();
-        app.send_notification (null, notification);
+        app.send_notification ("notify", notification);

I'd call this "alarm-notification" or even simply "alarm", so that we can distinguish it from the timer one if needed

@@ -656,1 +656,5 @@
     public bool escape_pressed () {
+        if (visible_child == ringing_panel) {
+            ringing_panel.alarm.snooze ();
+            var app = GLib.Application.get_default ();
+            app.withdraw_notification ("notify");

here we should return true, since if we are in the ringing panel we do not need to cancel the selection mode

::: src/clock.vala
@@ -47,1 +47,5 @@
 
+    public virtual bool other_key_pressed () {
+        return false;
+    }
+

However I do not like much the other_key_pressed virtual method, the escape_pressed thing was already a hack just to cancel the selection mode and if possible I would prefer to not go down this slippery slope.

Does simply connecting to the key_press_event in the ringing panel work? Maybe making sure that when ringing the focus is placed correctly
Comment 8 Alexandre Franke 2020-11-24 13:29:18 UTC
In the current design, a ringing alarm has two buttons on screen, Stop and Snooze. Tab can be used to go through the available options. That’s usable enough.