From 4d71c10ed216be5f0f4dc52e28696a204988dd3d Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Tue, 21 Nov 2017 00:54:29 +0100 Subject: Fix printing multiple copies of a document Previously only the first page was printed properly, all following pages were either blank or were not printed at all. This was caused by finishing/destroying the cairo surface of the cairo context associated with the GtkPrintContext used for printing which made it impossible to draw to it for any consecutive page Fixed bugs: - https://bugs.launchpad.net/inkscape/+bug/1733424 - https://bugs.launchpad.net/inkscape/+bug/490866 --- src/ui/dialog/print.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ui') diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp index 532a8c364..ea99ffa19 100644 --- a/src/ui/dialog/print.cpp +++ b/src/ui/dialog/print.cpp @@ -35,6 +35,10 @@ static void draw_page(GtkPrintOperation *, gint /*page_nr*/, gpointer user_data) { + // TODO: If the user prints multiple copies we render the whole page for each copy + // It would be more efficient to render the page once (e.g. in "begin_print") + // and simply print this result as often as necessary + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); struct workaround_gtkmm *junk = (struct workaround_gtkmm*)user_data; //printf("%s %d\n",__FUNCTION__, page_nr); @@ -120,7 +124,7 @@ static void draw_page(GtkPrintOperation *, ret = renderer.setupDocument (ctx, junk->_doc, TRUE, 0., NULL); if (ret) { renderer.renderItem(ctx, junk->_base); - ctx->finish(); + ctx->finish(false); // do not finish the cairo_surface_t - it's owned by our GtkPrintContext! } else { g_warning("%s", _("Could not set up Document")); -- cgit v1.2.3 From b071ae75610f98247e2efb602884e240aeeb80d8 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 25 Nov 2017 20:33:49 +0100 Subject: Allow to cancel PNG export Fixed bug: - https://bugs.launchpad.net/inkscape/+bug/1195929 --- src/ui/dialog/export.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ui') diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index d878b50a4..8c710c8e5 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -851,10 +851,11 @@ void Export::onProgressCancel () unsigned int Export::onProgressCallback(float value, void *dlg) { Gtk::Dialog *dlg2 = reinterpret_cast(dlg); - if (dlg2->get_data("cancel")) { - return FALSE; - } + Export *self = reinterpret_cast(dlg2->get_data("exportPanel")); + if (self->interrupted) + return FALSE; + gint current = GPOINTER_TO_INT(dlg2->get_data("current")); gint total = GPOINTER_TO_INT(dlg2->get_data("total")); if (total > 0) { @@ -867,7 +868,6 @@ unsigned int Export::onProgressCallback(float value, void *dlg) Gtk::ProgressBar *prg = reinterpret_cast(dlg2->get_data("progress")); prg->set_fraction(value); - Export *self = reinterpret_cast(dlg2->get_data("exportPanel")); if (self) { self->_prog.set_fraction(value); } -- cgit v1.2.3 From 9ca077f9c4d7a8b1b1dca9ad3ed3f6cacad521d1 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 26 Nov 2017 19:07:36 +0100 Subject: Don't translate the empty string --- src/ui/dialog/inkscape-preferences.cpp | 2 +- src/ui/dialog/symbols.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ui') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 79d8b7411..b2d4c5837 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1461,7 +1461,7 @@ void InkscapePreferences::initPageRendering() // rendering tile multiplier _rendering_tile_multiplier.init("/options/rendering/tile-multiplier", 1.0, 512.0, 1.0, 16.0, 16.0, true, false); - _page_rendering.add_line( false, _("Rendering tile multiplier:"), _rendering_tile_multiplier, _(""), + _page_rendering.add_line( false, _("Rendering tile multiplier:"), _rendering_tile_multiplier, "", _("Set the relative size of tiles used to render the canvas. The larger the value, the bigger the tile size."), false); /* blur quality */ diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 6add2b73d..60c9b2b32 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -462,7 +462,7 @@ void SymbolsDialog::showOverlay() { } else { overlay_icon->set_from_icon_name("searching", iconsize); overlay_title->set_markup(Glib::ustring("") + Glib::ustring(_("Search in all symbol sets...")) + Glib::ustring("")); - overlay_desc->set_markup(Glib::ustring("") + Glib::ustring(_("")) + Glib::ustring("")); + overlay_desc->set_markup(Glib::ustring("") + Glib::ustring("")); } } else if (!number_symbols && (current != CURRENTDOC || !search_str.empty())) { overlay_title->set_markup(Glib::ustring("") + Glib::ustring(_("No results found")) + Glib::ustring("")); -- cgit v1.2.3 From 392723017aebe8bcfcefa73107b65af0d29acd00 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 26 Nov 2017 23:03:19 +0100 Subject: Make bitmap export progress dialog transient for the main window --- src/ui/dialog/export.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ui') diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index 8c710c8e5..53629a1a2 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -901,6 +901,7 @@ void Export::setExporting(bool exporting, Glib::ustring const &text) Gtk::Dialog * Export::create_progress_dialog (Glib::ustring progress_text) { Gtk::Dialog *dlg = new Gtk::Dialog(_("Export in progress"), TRUE); + dlg->set_transient_for( *(INKSCAPE.active_desktop()->getToplevel()) ); Gtk::ProgressBar *prg = new Gtk::ProgressBar (); prg->set_text(progress_text); -- cgit v1.2.3