[gnome-panel] libgnome-panel: add gp_applet_info_set_has_about
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] libgnome-panel: add gp_applet_info_set_has_about
- Date: Sat, 17 Dec 2016 09:00:29 +0000 (UTC)
commit d716ec48d040b47fdd68f2356457e29260ca8a77
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sat Dec 3 13:58:33 2016 +0200
libgnome-panel: add gp_applet_info_set_has_about
libgnome-panel/gp-applet-info-private.h | 11 ++++---
libgnome-panel/gp-applet-info.c | 49 ++++++++++++++++++++++---------
libgnome-panel/gp-applet-info.h | 17 ++++++----
3 files changed, 51 insertions(+), 26 deletions(-)
---
diff --git a/libgnome-panel/gp-applet-info-private.h b/libgnome-panel/gp-applet-info-private.h
index 63eff02..1a024f0 100644
--- a/libgnome-panel/gp-applet-info-private.h
+++ b/libgnome-panel/gp-applet-info-private.h
@@ -22,13 +22,14 @@
struct _GpAppletInfo
{
- gchar *name;
- gchar *description;
- gchar *icon;
+ gchar *name;
+ gchar *description;
+ gchar *icon;
- gchar *help_uri;
+ gchar *help_uri;
+ gboolean has_about_dialog;
- gchar *backends;
+ gchar *backends;
};
void gp_applet_info_free (GpAppletInfo *info);
diff --git a/libgnome-panel/gp-applet-info.c b/libgnome-panel/gp-applet-info.c
index 219822c..c48eac0 100644
--- a/libgnome-panel/gp-applet-info.c
+++ b/libgnome-panel/gp-applet-info.c
@@ -51,37 +51,56 @@ gp_applet_info_new (const gchar *name,
info->description = g_strdup (description);
info->icon = g_strdup (icon);
+ info->help_uri = NULL;
+ info->has_about_dialog = FALSE;
+
+ info->backends = NULL;
+
return info;
}
/**
- * gp_applet_info_set_backends:
+ * gp_applet_info_set_help_uri:
* @info: a #GpAppletInfo
- * @backends: (nullable): a comma-separated list of backends
+ * @help_uri: the help uri
*
- * Sets a list of backends that this applet supports.
+ * Sets the help uri.
*/
void
-gp_applet_info_set_backends (GpAppletInfo *info,
- const gchar *backends)
+gp_applet_info_set_help_uri (GpAppletInfo *info,
+ const gchar *help_uri)
{
- g_free (info->backends);
- info->backends = g_strdup (backends);
+ g_free (info->help_uri);
+ info->help_uri = g_strdup (help_uri);
}
/**
- * gp_applet_info_set_help_uri:
+ * gp_applet_info_set_has_about_dialog:
* @info: a #GpAppletInfo
- * @help_uri: the help uri
+ * @has_about_dialog: whether applet has an about dialog
*
- * Sets the help uri.
+ * Sets whether applet has an about dialog.
*/
void
-gp_applet_info_set_help_uri (GpAppletInfo *info,
- const gchar *help_uri)
+gp_applet_info_set_has_about_dialog (GpAppletInfo *info,
+ gboolean has_about_dialog)
{
- g_free (info->help_uri);
- info->help_uri = g_strdup (help_uri);
+ info->has_about_dialog = has_about_dialog;
+}
+
+/**
+ * gp_applet_info_set_backends:
+ * @info: a #GpAppletInfo
+ * @backends: (nullable): a comma-separated list of backends
+ *
+ * Sets a list of backends that this applet supports.
+ */
+void
+gp_applet_info_set_backends (GpAppletInfo *info,
+ const gchar *backends)
+{
+ g_free (info->backends);
+ info->backends = g_strdup (backends);
}
void
@@ -93,7 +112,9 @@ gp_applet_info_free (GpAppletInfo *info)
g_free (info->name);
g_free (info->description);
g_free (info->icon);
+
g_free (info->help_uri);
+
g_free (info->backends);
g_free (info);
diff --git a/libgnome-panel/gp-applet-info.h b/libgnome-panel/gp-applet-info.h
index 135e4b9..b399d98 100644
--- a/libgnome-panel/gp-applet-info.h
+++ b/libgnome-panel/gp-applet-info.h
@@ -29,15 +29,18 @@ G_BEGIN_DECLS
*/
typedef struct _GpAppletInfo GpAppletInfo;
-GpAppletInfo *gp_applet_info_new (const gchar *name,
- const gchar *description,
- const gchar *icon);
+GpAppletInfo *gp_applet_info_new (const gchar *name,
+ const gchar *description,
+ const gchar *icon);
-void gp_applet_info_set_backends (GpAppletInfo *info,
- const gchar *backends);
+void gp_applet_info_set_help_uri (GpAppletInfo *info,
+ const gchar *help_uri);
-void gp_applet_info_set_help_uri (GpAppletInfo *info,
- const gchar *help_uri);
+void gp_applet_info_set_has_about_dialog (GpAppletInfo *info,
+ gboolean has_about_dialog);
+
+void gp_applet_info_set_backends (GpAppletInfo *info,
+ const gchar *backends);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]