index dc03e142a9ca22fa40d1564d0d42403b94bcf0f1..a4eac8b67e1e39fad4b7d53a5f3f78b00851d964 100644 (file)
#endif
unsigned int ret = FALSE;
+ gchar const *destination = mod->get_param_string("destination");
/* Create dialog */
GtkTooltips *tt = gtk_tooltips_new();
g_object_ref((GObject *) tt);
gtk_object_sink((GtkObject *) tt);
- GtkWidget *dlg = gtk_dialog_new_with_buttons(_("Print Destination"),
+ GtkWidget *dlg = gtk_dialog_new_with_buttons(
+ destination ? _("Print Configuration") : _("Print Destination"),
// SP_DT_WIDGET(SP_ACTIVE_DESKTOP)->window,
NULL,
(GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_DESTROY_WITH_PARENT),
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL,
- GTK_STOCK_PRINT,
+ destination ? GTK_STOCK_GO_FORWARD : GTK_STOCK_PRINT,
GTK_RESPONSE_OK,
NULL);
GtkWidget *l = gtk_label_new(_("Resolution:"));
gtk_box_pack_end(GTK_BOX(hb), l, FALSE, FALSE, 0);
- /* Print destination frame */
- f = gtk_frame_new(_("Print destination"));
- gtk_box_pack_start(GTK_BOX(vbox), f, FALSE, FALSE, 4);
- vb = gtk_vbox_new(FALSE, 4);
- gtk_container_add(GTK_CONTAINER(f), vb);
- gtk_container_set_border_width(GTK_CONTAINER(vb), 4);
-
- l = gtk_label_new(_("Printer name (as given by lpstat -p);\n"
- "leave empty to use the system default printer.\n"
- "Use '> filename' to print to file.\n"
+ GtkWidget *e = NULL;
+ /* if the destination isn't already set, we must prompt for it */
+ if (!destination) {
+ /* Print destination frame */
+ f = gtk_frame_new(_("Print destination"));
+ gtk_box_pack_start(GTK_BOX(vbox), f, FALSE, FALSE, 4);
+ vb = gtk_vbox_new(FALSE, 4);
+ gtk_container_add(GTK_CONTAINER(f), vb);
+ gtk_container_set_border_width(GTK_CONTAINER(vb), 4);
+
+ l = gtk_label_new(_("Printer name (as given by lpstat -p);\n"
+ "leave empty to use the system default printer.\n"
+ "Use '> filename' to print to file.\n"
"Use '| prog arg...' to pipe to a program."));
- gtk_box_pack_start(GTK_BOX(vb), l, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vb), l, FALSE, FALSE, 0);
- GtkWidget *e = gtk_entry_new();
- if (1) {
- gchar const *val = mod->get_param_string("destination");
- gtk_entry_set_text(GTK_ENTRY(e), ( val != NULL
- ? val
+ e = gtk_entry_new();
+ gtk_entry_set_text(GTK_ENTRY(e), ( destination != NULL
+ ? destination
: "" ));
- }
- gtk_box_pack_start(GTK_BOX(vb), e, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vb), e, FALSE, FALSE, 0);
- // pressing enter in the destination field is the same as clicking Print:
- gtk_entry_set_activates_default(GTK_ENTRY(e), TRUE);
+ // pressing enter in the destination field is the same as clicking Print:
+ gtk_entry_set_activates_default(GTK_ENTRY(e), TRUE);
+ }
gtk_widget_show_all(vbox);
_bitmap = gtk_toggle_button_get_active((GtkToggleButton *) rb);
sstr = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(combo)->entry));
_dpi = (unsigned int) MAX((int)(atof(sstr)), 1);
- /* Arrgh, have to do something */
- fn = gtk_entry_get_text(GTK_ENTRY(e));
- /* skip leading whitespace, bug #1068483 */
- while (fn && *fn==' ') { fn++; }
- /* g_print("Printing to %s\n", fn); */
+ /* if the destination was prompted for, record the new value */
+ if (e) {
+ /* Arrgh, have to do something */
+ fn = gtk_entry_get_text(GTK_ENTRY(e));
+ /* skip leading whitespace, bug #1068483 */
+ while (fn && *fn==' ') { fn++; }
+ /* g_print("Printing to %s\n", fn); */
+
+ mod->set_param_string("destination", (gchar *)fn);
+ }
mod->set_param_bool("bitmap", _bitmap);
mod->set_param_string("resolution", (gchar *)sstr);
- mod->set_param_string("destination", (gchar *)fn);
ret = TRUE;
}
<< d.y0 << " "
<< d.x1 << " "
<< d.y1 << "\n";
- os << "%%DocumentMedia: plain "
- << (int) ceil(_width) << " "
- << (int) ceil(_height) << " "
- << "0 () ()\n";
+ if (!epsexport) {
+ os << "%%DocumentMedia: plain "
+ << (int) ceil(_width) << " "
+ << (int) ceil(_height) << " "
+ << "0 () ()\n";
+ }
}
os << "%%EndComments\n";
bbox.x0, bbox.y0, bbox.x1, bbox.y1,
(guchar*)px, 4 * width, FALSE, FALSE);
memset(px, 0xff, 4 * width * 64);
- nr_arena_item_invoke_render(mod->root, &bbox, &pb, 0);
+ nr_arena_item_invoke_render(NULL, mod->root, &bbox, &pb, 0);
/* Blitter goes here */
NRMatrix imgt;
imgt.c[0] = (bbox.x1 - bbox.x0) / dots_per_pt;
{
while((c = fgetc(_stream))!=EOF) fputc(c, _begin_stream);
}
- fclose(_begin_stream);
+ fclose(_stream);
+ _stream = _begin_stream;
}
/* fixme: should really use pclose for popen'd streams */
fclose(_stream);
- _stream = 0;
+ _stream = NULL;
+
_latin1_encoded_fonts.clear();
g_tree_destroy(_fonts);