[Xfce4-commits] [xfce/xfce4-power-manager] 01/01: Fix scale description and values for light-locker (Bug #13303)
noreply at xfce.org
noreply at xfce.org
Sun Oct 29 13:28:46 CET 2017
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfce4-power-manager.
commit 0c2312e317837894356892916d498849d28ced52
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Sun Oct 29 13:27:20 2017 +0100
Fix scale description and values for light-locker (Bug #13303)
Also make the capitalisation of "minutes" and "seconds" consistent.
---
settings/xfpm-settings.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/settings/xfpm-settings.c b/settings/xfpm-settings.c
index 0d1d04f..16c8c70 100644
--- a/settings/xfpm-settings.c
+++ b/settings/xfpm-settings.c
@@ -1499,15 +1499,16 @@ format_light_locker_value_cb (GtkScale *scale, gdouble value, gpointer data)
if ( (gint)value <= 0 )
return g_strdup (_("Never"));
- else if ( (gint)value < 60 )
+ else if ( value <= 59.0 )
return g_strdup_printf ("%d %s", (gint)value, _("Seconds"));
- else if ( (gint)value == 60)
- return g_strdup (_("One Minute"));
-
- /* value > 60 */
- min = (gint)value - 60;
-
- return g_strdup_printf ("%d %s", (gint)min, _("Minutes"));
+ else if ( value >= 60.0)
+ {
+ min = (gint)value - 60;
+ if (min == 0)
+ return g_strdup_printf ("%d %s", (gint)min + 1, _("Minute"));
+ else
+ return g_strdup_printf ("%d %s", (gint)min + 1, _("Minutes"));
+ }
}
void
@@ -1517,7 +1518,7 @@ light_locker_late_locking_value_changed_cb (GtkWidget *widget, XfconfChannel *ch
gint value = (gint)gtk_range_get_value (GTK_RANGE (widget));
if (value > 60) {
- value = (value - 60) * 60;
+ value = ((value - 60) + 1) * 60;
}
variant = g_variant_new_uint32 (value);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list