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 681931 - Alarms - minutes should always have two digits
Alarms - minutes should always have two digits
Status: RESOLVED FIXED
Product: gnome-clocks
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Clocks maintainer(s)
Clocks maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-08-15 17:03 UTC by Allan Day
Modified: 2012-08-16 16:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Replace AlarmDialogSpin with standard GtkSpinButton. (4.08 KB, patch)
2012-08-16 13:29 UTC, Maël Lavault
none Details | Review
Add leading zero to minutes when necessary (1.98 KB, patch)
2012-08-16 13:56 UTC, Maël Lavault
none Details | Review
How it looks when converting AlarmDialogSpin to GtkSpinButton (11.96 KB, image/png)
2012-08-16 15:56 UTC, Maël Lavault
  Details

Description Allan Day 2012-08-15 17:03:08 UTC
The minutes in the new alarm dialog can only have one digit. This is also how they are displayed in the alarms view.

The minutes should always have two digits. eg. 5.01 PM or 18:03.
Comment 1 Maël Lavault 2012-08-15 17:26:10 UTC
Any reason to not use gtkSpinButton in New Alarm dialog ? Why create a custom control (AlarmDialogSpin) which reproduce it ? 

By the way it would be easier and cleaner to fix this bug by using a gtkSpinButton.
Comment 2 Eslam Mostafa 2012-08-16 12:16:03 UTC
Because they wanted the time to cycle, could we do that using GtkSpinButton ?
Comment 3 Maël Lavault 2012-08-16 12:44:24 UTC
Of course. Just set the max and min value for the gtkspinbutton (with a step of one), that's just one line of code. Then just set the wrap flag : gtk_spin_button.set_wrap () to make it cycle.

Max 3-4 line of code to achieve that.

I will provide a patch to demonstrate it.
Comment 4 Maël Lavault 2012-08-16 13:29:30 UTC
Created attachment 221368 [details] [review]
Replace AlarmDialogSpin with standard GtkSpinButton.

Here is the cleanup, removed a lot of code. I'm working on fixing the two digit bug now.
Comment 5 Maël Lavault 2012-08-16 13:56:28 UTC
Created attachment 221371 [details] [review]
Add leading zero to minutes when necessary

Fixed in this patch, apply on top of the previous.
Comment 6 Maël Lavault 2012-08-16 15:56:51 UTC
Created attachment 221419 [details]
How it looks when converting AlarmDialogSpin to GtkSpinButton

Here is the screenshot after the change !
Comment 7 Allan Day 2012-08-16 16:08:36 UTC
(In reply to comment #6)
> Created an attachment (id=221419) [details]
> How it looks when converting AlarmDialogSpin to GtkSpinButton
> 
> Here is the screenshot after the change !

Looks good, except that the buttons are misaligned at the bottom (maybe a separate bug).
Comment 8 Maël Lavault 2012-08-16 16:31:17 UTC
Yep it is a separate bug, the same behaviour occurs with AlarmDialogSpintoo ;)
Comment 9 Paolo Borelli 2012-08-16 16:53:34 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.