summaryrefslogtreecommitdiffstats
path: root/print.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-08-20 12:55:10 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-08-20 12:55:10 -0700
commit0c49d406e0a7dd1fc66da81ece40405fd053302c (patch)
tree4708e3eb5eb2134fd28e7f9765b33064b10f069e /print.c
parent5726a50d89d1f76b6bc2cfb96568d41d27f2b63e (diff)
downloadsubsurface-0c49d406e0a7dd1fc66da81ece40405fd053302c.tar.gz
Add a "Dive details" widget to the print dialog
Ok, so the widget doesn't actually *do* anything, but this is where you would add dive printing settings for things like "print list" vs "print profiles" etc. Printing just a dense dive table (no profiles etc) is being discussed on the list, maybe starting the scaffolding will inspire somebody to do something about it ... Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'print.c')
-rw-r--r--print.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/print.c b/print.c
index bdebcfe15..0bd3110a7 100644
--- a/print.c
+++ b/print.c
@@ -196,6 +196,22 @@ static void begin_print(GtkPrintOperation *operation, gpointer user_data)
{
}
+static GtkWidget *print_dialog(GtkPrintOperation *operation, gpointer user_data)
+{
+ GtkWidget *vbox, *hbox, *label;
+ gtk_print_operation_set_custom_tab_label(operation, "Dive details");
+
+ vbox = gtk_vbox_new(TRUE, 5);
+ label = gtk_label_new("Print Dive details");
+ gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);
+ gtk_widget_show_all(vbox);
+ return vbox;
+}
+
+static void print_dialog_apply(GtkPrintOperation *operation, GtkWidget *widget, gpointer user_data)
+{
+}
+
static GtkPrintSettings *settings = NULL;
void do_print(void)
@@ -210,6 +226,8 @@ void do_print(void)
gtk_print_operation_set_print_settings(print, settings);
pages = (dive_table.nr + 5) / 6;
gtk_print_operation_set_n_pages(print, pages);
+ g_signal_connect(print, "create-custom-widget", G_CALLBACK(print_dialog), NULL);
+ g_signal_connect(print, "custom-widget-apply", G_CALLBACK(print_dialog_apply), NULL);
g_signal_connect(print, "begin_print", G_CALLBACK(begin_print), NULL);
g_signal_connect(print, "draw_page", G_CALLBACK(draw_page), NULL);
res = gtk_print_operation_run(print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,