[geany/geany] b7839a: Add "project-before-close" signal to API

Matthew Brush git-noreply at geany.org
Sat Oct 29 14:58:37 UTC 2016


Branch:      refs/heads/master
Author:      Matthew Brush <matt at geany.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sat, 29 Oct 2016 14:58:37 UTC
Commit:      b7839a6e421431c8fa83204db351ccee3411cce1
             https://github.com/geany/geany/commit/b7839a6e421431c8fa83204db351ccee3411cce1

Log Message:
-----------
Add "project-before-close" signal to API

Closes #1223.


Modified Paths:
--------------
    doc/pluginsignals.c
    src/geanyobject.c
    src/geanyobject.h
    src/plugindata.h
    src/project.c

Modified: doc/pluginsignals.c
9 lines changed, 9 insertions(+), 0 deletions(-)
===================================================================
@@ -159,6 +159,15 @@ signal void (*project_save)(GObject *obj, GKeyFile *config, gpointer user_data);
  */
 signal void (*project_close)(GObject *obj, gpointer user_data);
 
+/** Sent before a project is closed.
+ *
+ * @param obj a GeanyObject instance, should be ignored.
+ * @param user_data user data.
+ *
+ * @since 1.29 (API 230)
+ */
+signal void (*project_before_close)(GObject *obj, gpointer user_data);
+
 /** Sent after a project dialog is opened but before it is displayed. Plugins
  *  can append their own project settings tabs by using this signal.
  *


Modified: src/geanyobject.c
6 lines changed, 6 insertions(+), 0 deletions(-)
===================================================================
@@ -156,6 +156,12 @@ static void create_signals(GObjectClass *g_object_class)
 		G_SIGNAL_RUN_FIRST,
 		0, NULL, NULL, g_cclosure_marshal_VOID__VOID,
 		G_TYPE_NONE, 0);
+	geany_object_signals[GCB_PROJECT_BEFORE_CLOSE] = g_signal_new (
+		"project-before-close",
+		G_OBJECT_CLASS_TYPE (g_object_class),
+		G_SIGNAL_RUN_FIRST,
+		0, NULL, NULL, g_cclosure_marshal_VOID__VOID,
+		G_TYPE_NONE, 0);
 	geany_object_signals[GCB_PROJECT_DIALOG_OPEN] = g_signal_new (
 		"project-dialog-open",
 		G_OBJECT_CLASS_TYPE (g_object_class),


Modified: src/geanyobject.h
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -47,6 +47,7 @@ typedef enum
 	GCB_PROJECT_OPEN,
 	GCB_PROJECT_SAVE,
 	GCB_PROJECT_CLOSE,
+	GCB_PROJECT_BEFORE_CLOSE,
 	GCB_PROJECT_DIALOG_OPEN,
 	GCB_PROJECT_DIALOG_CONFIRMED,
 	GCB_PROJECT_DIALOG_CLOSE,


Modified: src/plugindata.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -59,7 +59,7 @@ G_BEGIN_DECLS
  * @warning You should not test for values below 200 as previously
  * @c GEANY_API_VERSION was defined as an enum value, not a macro.
  */
-#define GEANY_API_VERSION 229
+#define GEANY_API_VERSION 230
 
 /* hack to have a different ABI when built with GTK3 because loading GTK2-linked plugins
  * with GTK3-linked Geany leads to crash */


Modified: src/project.c
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -425,6 +425,8 @@ static void destroy_project(gboolean open_default)
 
 	g_return_if_fail(app->project != NULL);
 
+	g_signal_emit_by_name(geany_object, "project-before-close");
+
 	/* remove project filetypes build entries */
 	if (app->project->priv->build_filetypes_list != NULL)
 	{



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list