New API questions



Hello all.

I've started some work on evince printing and the following questions
appeared, let me ask them in one mail since they all are related.

1. First of all, about old API, we have request from users to make
printing of current page easily available. There is possibility to add 
corresponding radio button in old API, but it's completely unusable.
Just because when you add current entry, it became selected by default,
and that is certainly not what user expects. By default all pages radio
should be selected. Unfortunately there is no way to change this value,
so I propose the attached patch.

2. Second problem that attached patch should solve is that with new API
passing GNOME_PRINT_DIALOG_RANGE to gnome_print_dialog_new creates two
(old and new) frames with the same label "Print range". Moreover, flags
don't manage visible controls on "Job" page. Proposed patch should make
situation clearer - setting "flags" property will hide or show needed
range control for both old and new API.

3. Third. We had requests to print pages in reverse order. In older view
it was possible with "From ... to ..." entry by passing bigger page in
first spinner and smaller one in second. Now I see this control was
removed in CVS. Do you have any plans to implement such functionality.

4. Generic one - I see new printing ui API is much different from older
one and probably won't satisfy our needs. And it looks unfinished a bit.
Is there any plan for future API already or it's in development stage?
Some of our needs are listed below.

5. We need to get range of pages and then create ps file ourselves
(something like that was possible with never offical
gnome_print_job_set_file API, although it's very incomplete. For
example, it's hard to get proper page layout and so on. Is something
like that planned for new API. I see there is no way to even get range
of pages selected by user.


6. Is it possible to customize new dialog view, for example to remove
"layout" combo in second page. Or to add "current" or "selected" radio
to range control. Is it possible to hide "Preview" dialog action.

7. Probably evince will be useful as print preview widget in the future.
Probably we can investigate such question and try to implement it
somehow.

Actually there are much more questions, but it's enough for one mail :)

Thanks for attention.


diff -upr libgnomeprintui-2.12.1/libgnomeprintui/gnome-print-dialog.c libgnomeprintui-2.12.1.new/libgnomeprintui/gnome-print-dialog.c
--- libgnomeprintui-2.12.1/libgnomeprintui/gnome-print-dialog.c	2005-09-19 21:59:29.000000000 +0400
+++ libgnomeprintui-2.12.1.new/libgnomeprintui/gnome-print-dialog.c	2005-11-09 17:07:19.000000000 +0300
@@ -242,6 +242,7 @@ gnome_print_dialog_set_property (GObject
 		GValue const *value, GParamSpec *pspec)
 {
 	GnomePrintDialog *gpd = GNOME_PRINT_DIALOG (object);
+	gpointer r;
 
 	switch (prop_id) {
 	case PROP_TITLE:
@@ -249,8 +250,16 @@ gnome_print_dialog_set_property (GObject
 		break;
 	case PROP_FLAGS:
 		gpd->flags = g_value_get_int (value);
-		g_object_set (G_OBJECT (gpd->e_range), "visible",
-				(gpd->flags & GNOME_PRINT_DIALOG_RANGE) > 0, NULL);
+
+		r = g_object_get_data (G_OBJECT (gpd->e_range), "range");
+		if (r) {
+			g_object_set (G_OBJECT (gpd->e_range), "visible",
+					(gpd->flags & GNOME_PRINT_DIALOG_RANGE) > 0, NULL);
+		} else {
+			g_object_set (G_OBJECT (gpd->s_page), "visible",
+					(gpd->flags & GNOME_PRINT_DIALOG_RANGE) > 0, NULL);
+		}
+							
 		g_object_set (G_OBJECT (gpd->s_copies), "visible",
 				(gpd->flags & GNOME_PRINT_DIALOG_COPIES) > 0, NULL);
 		break;
@@ -483,7 +492,6 @@ gnome_print_dialog_init (GnomePrintDialo
 
 	/* Print range, new API */
 	gpd->s_page = g_object_new (GNOME_TYPE_PRINT_PAGE_SELECTOR, NULL);
-	gtk_widget_show (gpd->s_page);
 	gtk_box_pack_start (GTK_BOX (vb), gpd->s_page, FALSE, FALSE, 0);
 
 	/* Copies */
@@ -531,9 +539,10 @@ gpd_create_range (gint flags, GtkWidget 
 	group = NULL;
 	row = 0;
 
-	if (flags & GNOME_PRINT_RANGE_CURRENT) {
-		rb = gtk_radio_button_new_with_mnemonic (group, (const gchar *) clabel);
-		g_object_set_data (G_OBJECT (t), "current", rb);
+
+	if (flags & GNOME_PRINT_RANGE_ALL) {
+		rb = gtk_radio_button_new_with_mnemonic(group, _("_All"));
+		g_object_set_data (G_OBJECT (t), "all", rb);
 		gtk_widget_show (rb);
 		gtk_table_attach (GTK_TABLE (t), rb, 0, 1, row, row + 1, GTK_FILL | GTK_EXPAND, 
 				  GTK_FILL, 0, 0);
@@ -541,9 +550,9 @@ gpd_create_range (gint flags, GtkWidget 
 		row += 1;
 	}
 
-	if (flags & GNOME_PRINT_RANGE_ALL) {
-		rb = gtk_radio_button_new_with_mnemonic(group, _("_All"));
-		g_object_set_data (G_OBJECT (t), "all", rb);
+	if (flags & GNOME_PRINT_RANGE_CURRENT) {
+		rb = gtk_radio_button_new_with_mnemonic (group, (const gchar *) clabel);
+		g_object_set_data (G_OBJECT (t), "current", rb);
 		gtk_widget_show (rb);
 		gtk_table_attach (GTK_TABLE (t), rb, 0, 1, row, row + 1, GTK_FILL | GTK_EXPAND, 
 				  GTK_FILL, 0, 0);
@@ -692,6 +701,8 @@ gnome_print_dialog_construct_range_any (
 	g_return_if_fail (!((flags & GNOME_PRINT_RANGE_SELECTION) && (flags & GNOME_PRINT_RANGE_SELECTION_UNSENSITIVE)));
 
 	gtk_widget_hide (gpd->s_page);
+	g_object_set (G_OBJECT (gpd->e_range), "visible",
+		(gpd->flags & GNOME_PRINT_DIALOG_RANGE) > 0, NULL);
 
 	f = g_object_get_data (G_OBJECT (gpd->job), "range");
 	g_return_if_fail (f != NULL);
@@ -742,6 +753,8 @@ gnome_print_dialog_construct_range_page 
 	GtkWidget *hbox = NULL;
 
 	gtk_widget_hide (gpd->s_page);
+	g_object_set (G_OBJECT (gpd->e_range), "visible",
+		(gpd->flags & GNOME_PRINT_DIALOG_RANGE) > 0, NULL);
 
 	if (flags & GNOME_PRINT_RANGE_RANGE) {
 		GtkWidget *l, *sb;


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