From 5981085fa98a7cc785524f89f107cc7ff43c8b42 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 26 Nov 2017 22:55:09 +0100 Subject: Make file update dialog transient for the main window This ensures the (modal) dialog is positioned on top of the Inkscape window in which the file will be opened. Before it could happen that the dialog was not even on the same monitor as the Inkscape window leaving Inkscape in a seemingly inaccessible state if it was overlooked. --- src/file-update.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/file-update.cpp b/src/file-update.cpp index 303a5c4f1..1d95b5d4c 100644 --- a/src/file-update.cpp +++ b/src/file-update.cpp @@ -318,6 +318,7 @@ void sp_file_convert_dpi(SPDocument *doc) bool backup = prefs->getBool("/options/dpifixbackup", true); if (INKSCAPE.use_gui() && sp_file_convert_dpi_method_commandline == -1) { Gtk::Dialog scale_dialog(_("Convert legacy Inkscape file")); + scale_dialog.set_transient_for( *(INKSCAPE.active_desktop()->getToplevel()) ); scale_dialog.set_border_width(10); scale_dialog.set_resizable(false); Gtk::Label explanation; -- 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') 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 From f0be34d40fdb5840cb2ad4539db4f6dd3978cb3f Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Thu, 30 Nov 2017 22:04:34 +0100 Subject: Extensions: Don't crash on invalid effect extension output --- src/extension/implementation/script.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index eb98711bc..23c97c3b0 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -732,9 +732,14 @@ void Script::effect(Inkscape::Extension::Effect *module, SPDocument * mydoc = NULL; if (data_read > 10) { - mydoc = Inkscape::Extension::open( - Inkscape::Extension::db.get(SP_MODULE_KEY_INPUT_SVG), - tempfilename_out.c_str()); + try { + mydoc = Inkscape::Extension::open( + Inkscape::Extension::db.get(SP_MODULE_KEY_INPUT_SVG), + tempfilename_out.c_str()); + } catch (const Inkscape::Extension::Input::open_failed &e) { + /// \todo Popup dialog here + g_warning("Extension returned output that could not be parsed: %s", e.what()); + } } // data_read pump_events(); -- cgit v1.2.3 From 4648a396a0325563e55fa3c99eaba7a4ee965064 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Thu, 30 Nov 2017 22:31:40 +0100 Subject: Add a warning dialog for previous commit --- src/extension/implementation/script.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 23c97c3b0..0f0a79bfb 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -737,8 +737,12 @@ void Script::effect(Inkscape::Extension::Effect *module, Inkscape::Extension::db.get(SP_MODULE_KEY_INPUT_SVG), tempfilename_out.c_str()); } catch (const Inkscape::Extension::Input::open_failed &e) { - /// \todo Popup dialog here g_warning("Extension returned output that could not be parsed: %s", e.what()); + Gtk::MessageDialog warning( + _("The output from the extension could not be parsed."), + false, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK, true); + warning.set_transient_for( *(INKSCAPE.active_desktop()->getToplevel()) ); + warning.run(); } } // data_read -- cgit v1.2.3