Commit 98954a4e authored by Tristan Van Berkom's avatar Tristan Van Berkom

GladeProject: Identify when we are serializing for a preview

parent d6cac38b
......@@ -156,6 +156,7 @@ struct _GladeProjectPrivate
* for confirmation after a close or exit is
* requested
*/
guint writing_preview : 1; /* During serialization, if we are serializing for a preview */
guint pointer_mode : 3; /* The currently effective GladePointerMode */
};
......@@ -2846,7 +2847,9 @@ glade_project_preview (GladeProject *project, GladeWidget *gwidget)
g_return_if_fail (GLADE_IS_PROJECT (project));
project->priv->writing_preview = TRUE;
context = glade_project_write (project);
project->priv->writing_preview = FALSE;
text = glade_xml_dump_from_context (context);
......@@ -2889,6 +2892,14 @@ glade_project_preview (GladeProject *project, GladeWidget *gwidget)
g_free (text);
}
gboolean
glade_project_writing_preview (GladeProject *project)
{
g_return_val_if_fail (GLADE_IS_PROJECT (project), FALSE);
return project->priv->writing_preview;
}
/*******************************************************************
Verify code here (versioning, incompatability checks)
*******************************************************************/
......
......@@ -273,6 +273,7 @@ gchar *glade_project_verify_widget_adaptor(GladeProject *proj
void glade_project_verify_property (GladeProperty *property);
void glade_project_verify_signal (GladeWidget *widget,
GladeSignal *signal);
gboolean glade_project_writing_preview (GladeProject *project);
/* General selection driven commands */
void glade_project_copy_selection (GladeProject *project);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment