[gnome-panel/wip/muktupavels/help-about: 1/5] libgnome-panel: pass GpModule to applet
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel/wip/muktupavels/help-about: 1/5] libgnome-panel: pass GpModule to applet
- Date: Tue, 31 Mar 2020 17:58:00 +0000 (UTC)
commit 15b54c44d0c13a53d269e4a13e72933653dbe8e9
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Tue Mar 31 18:48:48 2020 +0300
libgnome-panel: pass GpModule to applet
libgnome-panel/gp-applet.c | 30 +++++++++++++++++++++++++++++-
libgnome-panel/gp-module.c | 1 +
2 files changed, 30 insertions(+), 1 deletion(-)
---
diff --git a/libgnome-panel/gp-applet.c b/libgnome-panel/gp-applet.c
index d67b7197b..d7bc10da2 100644
--- a/libgnome-panel/gp-applet.c
+++ b/libgnome-panel/gp-applet.c
@@ -45,9 +45,10 @@
*/
#include "config.h"
-
#include "gp-applet-private.h"
+
#include "gp-enum-types.h"
+#include "gp-module.h"
typedef struct
{
@@ -60,6 +61,8 @@ typedef struct
GtkBuilder *builder;
GSimpleActionGroup *action_group;
+ GpModule *module;
+
gchar *id;
gchar *settings_path;
GVariant *initial_settings;
@@ -87,6 +90,8 @@ enum
{
PROP_0,
+ PROP_MODULE,
+
PROP_ID,
PROP_SETTINGS_PATH,
PROP_INITIAL_SETTINGS,
@@ -358,6 +363,8 @@ gp_applet_dispose (GObject *object)
g_clear_object (&priv->builder);
g_clear_object (&priv->action_group);
+ g_clear_object (&priv->module);
+
if (priv->size_hints_idle != 0)
{
g_source_remove (priv->size_hints_idle);
@@ -401,6 +408,9 @@ gp_applet_get_property (GObject *object,
switch (property_id)
{
+ case PROP_MODULE:
+ break;
+
case PROP_ID:
g_value_set_string (value, priv->id);
break;
@@ -465,6 +475,11 @@ gp_applet_set_property (GObject *object,
switch (property_id)
{
+ case PROP_MODULE:
+ g_assert (priv->module == NULL);
+ priv->module = g_value_dup_object (value);
+ break;
+
case PROP_ID:
g_assert (priv->id == NULL);
priv->id = g_value_dup_string (value);
@@ -605,6 +620,19 @@ gp_applet_size_allocate (GtkWidget *widget,
static void
install_properties (GObjectClass *object_class)
{
+ /**
+ * GpApplet:module:
+ *
+ * The applet module.
+ */
+ properties[PROP_MODULE] =
+ g_param_spec_object ("module",
+ "Module",
+ "Module",
+ GP_TYPE_MODULE,
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE |
+ G_PARAM_STATIC_STRINGS);
+
/**
* GpApplet:id:
*
diff --git a/libgnome-panel/gp-module.c b/libgnome-panel/gp-module.c
index 63cd53eac..824edfed7 100644
--- a/libgnome-panel/gp-module.c
+++ b/libgnome-panel/gp-module.c
@@ -643,6 +643,7 @@ gp_module_applet_new (GpModule *module,
}
return g_object_new (type,
+ "module", module,
"id", applet,
"settings-path", settings_path,
"initial-settings", initial_settings,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]