[hitori] Include the current time in the win message



commit e25b51d0c464ccdc1e4a93645e4ff15cea2351dd
Author: Philip Withnall <philip tecnocode co uk>
Date:   Fri Nov 12 00:15:16 2010 +0000

    Include the current time in the win message

 src/rules.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/rules.c b/src/rules.c
index caea103..2d48c39 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -256,11 +256,17 @@ hitori_check_win (Hitori *hitori)
 	if (rule2 && rule3 && hitori_check_rule1 (hitori)) {
 		/* Win! */
 		GtkWidget *dialog;
+		gchar *message;
 
 		/* Tell the user they've won */
 		hitori_disable_events (hitori);
-		dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
-						 _("You've won!"));
+
+		/* Translators: The first parameter is the number of minutes which have elapsed since the start of the game; the second parameter is
+		 * the number of seconds. */
+		message = g_strdup_printf (_("You've won in a time of %02u:%02u!"), hitori->timer_value / 60, hitori->timer_value % 60);
+		dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "%s", message);
+		g_free (message);
+
 		gtk_dialog_run (GTK_DIALOG (dialog));
 		gtk_widget_destroy (dialog);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]