[Xfce4-commits] [apps/xfdashboard] 01/04: Emit new signal "initialized" in XfdashboardApplication if it is the primary instance and fully initialized, that means all managers and the stage were set up successfully.

noreply at xfce.org noreply at xfce.org
Mon Jun 20 09:48:20 CEST 2016


This is an automated email from the git hooks/post-receive script.

nomad pushed a commit to branch master
in repository apps/xfdashboard.

commit 5ba19f79c3f3af2c141988cb985ce8a8fd935a46
Author: Stephan Haller <nomad at froevel.de>
Date:   Mon Jun 20 08:36:16 2016 +0200

    Emit new signal "initialized" in XfdashboardApplication if it is the primary instance and fully initialized, that means all managers and the stage were set up successfully.
    
    The main purpose for this signal is for plugin which need to initialize after application is fully initialized and all components are available, initialized and ready for use.
---
 libxfdashboard/application.c | 28 +++++++++++++++++++++++++++-
 libxfdashboard/application.h |  2 ++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/libxfdashboard/application.c b/libxfdashboard/application.c
index 789a231..a5aa1e2 100644
--- a/libxfdashboard/application.c
+++ b/libxfdashboard/application.c
@@ -120,6 +120,7 @@ static GParamSpec* XfdashboardApplicationProperties[PROP_LAST]={ 0, };
 /* Signals */
 enum
 {
+	SIGNAL_INITIALIZED,
 	SIGNAL_QUIT,
 	SIGNAL_SHUTDOWN_FINAL,
 	SIGNAL_SUSPEND,
@@ -490,12 +491,15 @@ static gboolean _xfdashboard_application_initialize_full(XfdashboardApplication
 	/* Emit signal 'theme-changed' to get current theme loaded at each stage created */
 	g_signal_emit(self, XfdashboardApplicationSignals[SIGNAL_THEME_CHANGED], 0, priv->theme);
 
-	/* Initialization was successful so return TRUE */
+	/* Initialization was successful so send signal and return TRUE */
+	g_signal_emit(self, XfdashboardApplicationSignals[SIGNAL_INITIALIZED], 0);
+
 #ifdef DEBUG
 	xfdashboard_notify(NULL, NULL, _("Welcome to %s (%s)!"), PACKAGE_NAME, PACKAGE_VERSION);
 #else
 	xfdashboard_notify(NULL, NULL, _("Welcome to %s!"), PACKAGE_NAME);
 #endif
+
 	return(TRUE);
 }
 
@@ -1121,6 +1125,28 @@ static void xfdashboard_application_class_init(XfdashboardApplicationClass *klas
 
 	/* Define signals */
 	/**
+	 * XfdashboardApplication::initialized:
+	 * @self: The application's primary instance was fully initialized
+	 *
+	 * The ::initialized signal is emitted when the primary instance of
+	 * application was fully initialized.
+	 *
+	 * The main purpose of this signal is to give other objects and plugin
+	 * a chance to initialize properly after application is fully initialized
+	 * and all other components are really available and also initialized.
+	 */
+	XfdashboardApplicationSignals[SIGNAL_INITIALIZED]=
+		g_signal_new("initialized",
+						G_TYPE_FROM_CLASS(klass),
+						G_SIGNAL_RUN_LAST,
+						G_STRUCT_OFFSET(XfdashboardApplicationClass, initialized),
+						NULL,
+						NULL,
+						g_cclosure_marshal_VOID__VOID,
+						G_TYPE_NONE,
+						0);
+
+	/**
 	 * XfdashboardApplication::quit:
 	 * @self: The application going to quit
 	 *
diff --git a/libxfdashboard/application.h b/libxfdashboard/application.h
index 56c31ed..4faada7 100644
--- a/libxfdashboard/application.h
+++ b/libxfdashboard/application.h
@@ -86,6 +86,8 @@ struct _XfdashboardApplicationClass
 
 	/*< public >*/
 	/* Virtual functions */
+	void (*initialized)(XfdashboardApplication *self);
+
 	void (*suspend)(XfdashboardApplication *self);
 	void (*resume)(XfdashboardApplication *self);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list