[Gnome-print] Print selection in gnome-print-dialog.c



Here is a patch for gnome-print that adds an unsensitive
"Print Selection" radio button to the range group.

Comments ?

I will apply in 2 days if I don't get any flames back.


Chema
Index: libgnomeprint/gnome-print-dialog.c
===================================================================
RCS file: /cvs/gnome/gnome-print/libgnomeprint/gnome-print-dialog.c,v
retrieving revision 1.6
diff -u -5 -r1.6 gnome-print-dialog.c
--- libgnomeprint/gnome-print-dialog.c	2000/04/19 04:15:52	1.6
+++ libgnomeprint/gnome-print-dialog.c	2000/06/15 18:16:46
@@ -269,16 +269,18 @@
 	GSList *group= NULL;
 
 	g_return_if_fail(gpd != NULL);
 	g_return_if_fail(GNOME_IS_PRINT_DIALOG(gpd));
 	g_return_if_fail(gpd->range_container != NULL);
-
+	g_return_if_fail(!(flags&GNOME_PRINT_RANGE_SELECTION && flags&GNOME_PRINT_RANGE_SELECTION_UNSENSITIVE));
 	p = gpd->priv;
 
 	row=0;
 	if (flags&GNOME_PRINT_RANGE_SELECTION)
 		row++;
+	if (flags&GNOME_PRINT_RANGE_SELECTION_UNSENSITIVE)
+		row++;
 	if (flags&GNOME_PRINT_RANGE_ALL)
 		row++;
 	if (flags&GNOME_PRINT_RANGE_RANGE)
 		row++;
 	if (flags&GNOME_PRINT_RANGE_CURRENT)
@@ -339,10 +341,20 @@
 		if (accel_key != GDK_VoidSymbol)
 			gtk_widget_add_accelerator (selection, "clicked",
 						    gpd->range_accel_group,
 						    accel_key,
 						    GDK_MOD1_MASK, 0);
+		row++;
+	}
+	if (flags&GNOME_PRINT_RANGE_SELECTION_UNSENSITIVE) {
+		selection = gtk_radio_button_new_with_label(group, "");
+		accel_key = gtk_label_parse_uline
+			(GTK_LABEL (GTK_BIN (selection)->child),
+			 _("_Selection"));
+		gtk_widget_set_sensitive (GTK_WIDGET(selection), FALSE);
+		gtk_table_attach(GTK_TABLE(table), selection, 0, 1, row, row+1, GTK_FILL, GTK_FILL, 0, 0);
+		group = gtk_radio_button_group((GtkRadioButton *)selection);
 		row++;
 	}
 
 	replace(&p->current, current);
 	replace(&p->all, all);
Index: libgnomeprint/gnome-print-dialog.h
===================================================================
RCS file: /cvs/gnome/gnome-print/libgnomeprint/gnome-print-dialog.h,v
retrieving revision 1.5
diff -u -5 -r1.5 gnome-print-dialog.h
--- libgnomeprint/gnome-print-dialog.h	2000/04/13 18:04:58	1.5
+++ libgnomeprint/gnome-print-dialog.h	2000/06/15 18:16:47
@@ -48,10 +48,11 @@
 enum GnomePrintRangeFlags {
 	GNOME_PRINT_RANGE_CURRENT = 1<<0,
 	GNOME_PRINT_RANGE_ALL = 1<<1,
 	GNOME_PRINT_RANGE_RANGE = 1<<2,
 	GNOME_PRINT_RANGE_SELECTION = 1<<3,
+	GNOME_PRINT_RANGE_SELECTION_UNSENSITIVE  = 1<<4,
 
 	/* options specific to dates */
 	GNOME_PRINT_RANGE_DATE_TIME = 1<<8,
 	GNOME_PRINT_RANGE_DATE_24HR = 1<<9,
 	GNOME_PRINT_RANGE_DATE_MONDAY = 1<<10,


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