[mate-screensaver] 01/01: debian/patches: Add 0000_fix_idle_slider_display.patch.

Martin Wimpress flexiondotorg-guest at moszumanska.debian.org
Sat Sep 23 18:29:50 UTC 2017


This is an automated email from the git hooks/post-receive script.

flexiondotorg-guest pushed a commit to branch master
in repository mate-screensaver.

commit 8bfe4c702b340f5860784a0113cce8e5a38642dc
Author: Martin Wimpress <martin.wimpress at ubuntu.com>
Date:   Sat Sep 23 19:29:30 2017 +0100

    debian/patches: Add 0000_fix_idle_slider_display.patch.
---
 debian/changelog                                  |  7 ++
 debian/patches/0000_fix_idle_slider_display.patch | 97 +++++++++++++++++++++++
 debian/patches/series                             |  1 +
 3 files changed, 105 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 183fd7d..d958dfa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+mate-screensaver (1.18.1-2) UNRELEASED; urgency=medium
+
+  * debian/patches: Add 0000_fix_idle_slider_display.patch. Fix the idle
+    slider in screen saver preferences.
+
+ -- Martin Wimpress <martin.wimpress at ubuntu.com>  Sat, 23 Sep 2017 19:28:30 +0100
+
 mate-screensaver (1.18.1-1) unstable; urgency=medium
 
   [ Aron Xu ]
diff --git a/debian/patches/0000_fix_idle_slider_display.patch b/debian/patches/0000_fix_idle_slider_display.patch
new file mode 100644
index 0000000..e74dcda
--- /dev/null
+++ b/debian/patches/0000_fix_idle_slider_display.patch
@@ -0,0 +1,97 @@
+Author: ZenWalker <scow at riseup.net>
+Description: Fix idle slider display in all languages
+
+diff --git a/src/mate-screensaver-preferences.c b/src/mate-screensaver-preferences.c
+index ad38b36..0a9f9a6 100644
+--- a/src/mate-screensaver-preferences.c
++++ b/src/mate-screensaver-preferences.c
+@@ -935,6 +935,8 @@ time_to_string_text (long time)
+ 	char *secs, *mins, *hours, *string;
+ 	int   sec, min, hour;
+ 
++	int   inc_len, len_minutes;
++
+ 	sec = time % 60;
+ 	time = time - sec;
+ 	min = (time % (60 * 60)) / 60;
+@@ -950,6 +952,43 @@ time_to_string_text (long time)
+ 	secs = g_strdup_printf (ngettext ("%d second",
+ 	                                  "%d seconds", sec), sec);
+ 
++	inc_len = strlen (g_strdup_printf (_("%s %s"), 
++	                  g_strdup_printf (ngettext ("%d hour",
++	                                             "%d hours", 1), 1),
++	                  g_strdup_printf (ngettext ("%d minute",
++	                                             "%d minutes", 59), 59))) - 1;
++
++	len_minutes = 0;
++
++	for (int n = 2; n < 60; n++)
++	{
++		if (n < 10)
++		{
++			if ((strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute",
++	                                                                        "%d minutes", n), n), NULL)) - 2) > len_minutes)
++
++				len_minutes = strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute",
++	                                                                                         "%d minutes", n), n), NULL)) - 2;
++		}
++		else
++		{
++			if ((strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute",
++	                                                                        "%d minutes", n), n), NULL)) - 3) > len_minutes)
++
++				len_minutes = strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute",
++	                                                                                         "%d minutes", n), n), NULL)) - 3;
++		}
++	}
++
++	if ((strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute",
++	                                                        "%d minutes", 1), 1), NULL)) - 2) > len_minutes)
++
++		len_minutes = strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute",
++	                                                                         "%d minutes", 1), 1), NULL)) - 2;
++
++	if (len_minutes < 1)
++		len_minutes = 1;
++
+ 	if (hour > 0)
+ 	{
+ 		if (sec > 0)
+@@ -979,6 +1018,36 @@ time_to_string_text (long time)
+ 		{
+ 			/* minutes */
+ 			string = g_strdup_printf (_("%s"), mins);
++
++			if (min < 10)
++			{
++				if (min == 1)
++					while (strlen (string) != (len_minutes + inc_len + 3))
++					{
++						if (strlen (string) % 2 == 0)
++							string = g_strconcat (string, " ", NULL);
++						else
++							string = g_strconcat (" " , string, NULL);
++					}
++				else
++					while (strlen (string) != (len_minutes + inc_len))
++					{
++						if (strlen (string) % 2 == 0)
++							string = g_strconcat (string, " ", NULL);
++						else
++							string = g_strconcat (" " , string, NULL);
++					}
++			}
++			else
++			{
++				while (strlen (string) != (len_minutes + inc_len - 1))
++				{
++					if (strlen (string) % 2 == 0)
++						string = g_strconcat (string, " ", NULL);
++					else
++						string = g_strconcat (" " , string, NULL);
++				}
++			}
+ 		}
+ 	}
+ 	else
diff --git a/debian/patches/series b/debian/patches/series
index bc1e32e..a32a00a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
+0000_fix_idle_slider_display.patch
 1001_add-keywords-to-desktop-files.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mate/mate-screensaver.git



More information about the pkg-mate-commits mailing list