summaryrefslogtreecommitdiffstats
path: root/gtk-gui.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-03-19 14:09:28 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-03-19 14:09:28 -0700
commit487fe8784cee913b177dffcee83fe6df5c9b2ca6 (patch)
tree60d48d9c680c894c1a927ba1cb5915babb6da33d /gtk-gui.c
parent6a98588ed02320c4d33c1d848c38a424c90448f3 (diff)
downloadsubsurface-487fe8784cee913b177dffcee83fe6df5c9b2ca6.tar.gz
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 <dirk@hohndel.org>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r--gtk-gui.c4
1 files changed, 1 insertions, 3 deletions
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;