summaryrefslogtreecommitdiffstats
path: root/print.c
diff options
context:
space:
mode:
authorGravatar Salvador Cuñat <salvador.cunat@gmail.com>2013-03-18 21:33:37 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-03-19 12:43:28 -0700
commit0a75ae63bfe0e95bd79ff05c3eb05159d73850ab (patch)
tree4db731309fe2ba4af286d802bc6c9c48f5548fe5 /print.c
parent9d6ddc24e9da9da80ac78a4865fbb889a99374dc (diff)
downloadsubsurface-0a75ae63bfe0e95bd79ff05c3eb05159d73850ab.tar.gz
Fix warning on g_signal_connect() for radio4
Gtk complains if there is no GCallback to connect. Fixes too a bug with gtk_toggle_button_set_active for radio5. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'print.c')
-rw-r--r--print.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/print.c b/print.c
index 1262841b8..02e51d292 100644
--- a/print.c
+++ b/print.c
@@ -878,6 +878,8 @@ static void name(GtkWidget *w, gpointer data) \
OPTIONCALLBACK(set_pretty, type, PRETTY)
OPTIONCALLBACK(set_table, type, TABLE)
OPTIONCALLBACK(set_twoperpage, type, TWOPERPAGE)
+OPTIONCALLBACK(set_notes_up, notes_up, TRUE)
+OPTIONCALLBACK(set_profile_up, notes_up, FALSE)
#define OPTIONSELECTEDCALLBACK(name, option) \
static void name(GtkWidget *w, gpointer data) \
@@ -887,7 +889,6 @@ static void name(GtkWidget *w, gpointer data) \
OPTIONSELECTEDCALLBACK(print_selection_toggle, print_options.print_selected)
OPTIONSELECTEDCALLBACK(color_selection_toggle, print_options.color_selected)
-OPTIONSELECTEDCALLBACK(notes_up, print_options.notes_up)
/*
* Hardcoded minimum and maximum values for the scaling spin_buttons
@@ -977,13 +978,14 @@ static GtkWidget *print_dialog(GtkPrintOperation *operation, gpointer user_data)
box1 = gtk_vbox_new (TRUE, 1);
gtk_container_add(GTK_CONTAINER(frame1), box1);
- radio4 = gtk_radio_button_new_with_label_from_widget (NULL, _("Profile on top"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio4), FALSE);
- g_signal_connect(G_OBJECT(radio4), "toggled", NULL, NULL);
+ radio4 = gtk_radio_button_new_with_label (NULL, _("Profile on top"));
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio4), print_options.notes_up);
radio5 = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radio4), _("Notes on top"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio4), FALSE);
- g_signal_connect(G_OBJECT(radio5), "toggled", G_CALLBACK(notes_up), NULL);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio5), print_options.notes_up);
+
+ g_signal_connect(G_OBJECT(radio4), "toggled", G_CALLBACK(set_profile_up), NULL);
+ g_signal_connect(G_OBJECT(radio5), "toggled", G_CALLBACK(set_notes_up), NULL);
gtk_box_pack_start(GTK_BOX(box1), radio4, TRUE, FALSE, 2);
gtk_box_pack_start(GTK_BOX(box1), radio5, TRUE, FALSE, 2);