summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <juanpablougarte@gmail.com>2020-06-18 18:58:29 -0300
committerJuan Pablo Ugarte <juanpablougarte@gmail.com>2020-06-18 19:08:34 -0300
commitcabb5bebe3159e81a2e7e4237aaf90700023aa3d (patch)
tree81367393608ddf686e943f75ada6a77e90e7ae3b
parent381b6683c22642886b58e382a002aba0c38e1c38 (diff)
downloadglade-cabb5bebe3159e81a2e7e4237aaf90700023aa3d.tar.gz
GladeProject: show message on invalid GtkBuilder file
Show user an error dialog if he tries to open an old libglade file. https://gitlab.gnome.org/GNOME/glade/-/issues/389
-rw-r--r--gladeui/glade-project.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index 132b6deb..9f474c2d 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -2127,8 +2127,14 @@ glade_project_load_internal (GladeProject *project)
if (!glade_xml_node_verify_silent (root, GLADE_XML_TAG_PROJECT))
{
- g_warning ("Couldnt recognize GtkBuilder xml, skipping %s",
- load_path ? load_path : priv->path);
+ if (glade_xml_node_verify_silent (root, "glade-interface"))
+ glade_util_ui_message (glade_app_get_window (), GLADE_UI_ERROR, NULL,
+ "This version of Glade does not support old libglade files.\n"
+ "Please use Glade 3.8 for GTK 2 files.");
+ else
+ glade_util_ui_message (glade_app_get_window (), GLADE_UI_ERROR, NULL,
+ "Couldn't recognize GtkBuilder xml.\nskipping %s",
+ load_path ? load_path : priv->path);
glade_xml_context_free (context);
g_free (load_path);
priv->loading = FALSE;