From 487fe8784cee913b177dffcee83fe6df5c9b2ca6 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 19 Mar 2013 14:09:28 -0700 Subject: Make slider labels consistent in print dialog To make this easier I created a new helper function create_label that takes printf style arguments. I assumed this would be usable in many places but ended up finding just one other obvious use for it. Signed-off-by: Dirk Hohndel --- gtk-gui.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gtk-gui.c') diff --git a/gtk-gui.c b/gtk-gui.c index 33777ed93..c5b9a8071 100644 --- a/gtk-gui.c +++ b/gtk-gui.c @@ -1981,11 +1981,9 @@ int confirm_dialog(int when, char *action_text, char *event_text) { GtkWidget *dialog, *vbox, *label; int confirmed; - char buffer[256]; char title[80]; snprintf(title, sizeof(title), "%s %s", action_text, event_text); - snprintf(buffer, sizeof(buffer), _("%s event at %d:%02u"), title, FRACTION(when, 60)); dialog = gtk_dialog_new_with_buttons(title, GTK_WINDOW(main_window), GTK_DIALOG_DESTROY_WITH_PARENT, @@ -1994,7 +1992,7 @@ int confirm_dialog(int when, char *action_text, char *event_text) NULL); vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); - label = gtk_label_new(buffer); + label = create_label(_("%s event at %d:%02u"), title, FRACTION(when, 60)); gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); gtk_widget_show_all(dialog); confirmed = gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT; -- cgit v1.2.3-70-g09d2