From 4ca358920f4667ac30f639c133deb9b5643f3565 Mon Sep 17 00:00:00 2001 From: Wen-Wei Kao Date: Mon, 9 Jun 2025 14:27:34 +0800 Subject: [PATCH] Warn about nonexistent files --- src/actions/actions-file.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/actions/actions-file.cpp b/src/actions/actions-file.cpp index 69d02cbc39..352603d692 100644 --- a/src/actions/actions-file.cpp +++ b/src/actions/actions-file.cpp @@ -16,6 +16,8 @@ #include #include "actions-helper.h" +#include "desktop.h" +#include "ui/widget/desktop-widget.h" #include "document.h" #include "document-undo.h" #include "inkscape.h" // Inkscape::Application @@ -31,6 +33,9 @@ file_open(const Glib::VariantBase& value, InkscapeApplication *app) Glib::RefPtr file = Gio::File::create_for_path(s.get()); if (!file->query_exists()) { + SPDesktop* _desktop = SP_ACTIVE_DESKTOP; + SPDesktopWidget* _widget = _desktop->getDesktopWidget(); + _widget->showNotice((_("File %s does not exist."), s.get().raw()), 5000); show_output(Glib::ustring("file_open: file '") + s.get().raw() + "' does not exist."); return; } -- GitLab