[evolution-kolab] EPlugin: new action group name util function



commit 6abf3b58cc172c78892b00a1b16b4ef4478377c5
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Fri Oct 19 11:11:02 2012 +0200

    EPlugin: new action group name util function
    
    * added function which extracts the group name
      from a GtkActionEntry

 src/eplugin/e-kolab-plugin-util.c |   22 ++++++++++++++++++++++
 src/eplugin/e-kolab-plugin-util.h |    3 +++
 2 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/eplugin/e-kolab-plugin-util.c b/src/eplugin/e-kolab-plugin-util.c
index 7d7230b..e290f8e 100644
--- a/src/eplugin/e-kolab-plugin-util.c
+++ b/src/eplugin/e-kolab-plugin-util.c
@@ -130,6 +130,28 @@ kolab_plugin_util_ui_path_from_pim_view (EShellView *shell_view,
 /* API functions (non-UI) */
 
 
+const gchar*
+e_kolab_plugin_util_group_name_from_action_entry_name (const gchar *entry_name)
+{
+	const gchar *group = NULL;
+
+	if (entry_name == NULL)
+		return NULL;
+
+	if (strstr (entry_name, "calendar") != NULL)
+		group = "calendar";
+	else if (strstr (entry_name, "tasks") != NULL)
+		group = "tasks";
+	else if (strstr (entry_name, "memos") != NULL)
+		group = "memos";
+	else if (strstr (entry_name, "contacts") != NULL)
+		group = "contacts";
+	else
+		g_return_val_if_reached (NULL);
+
+	return group;
+}
+
 /*----------------------------------------------------------------------------*/
 /* API functions (UI) */
 
diff --git a/src/eplugin/e-kolab-plugin-util.h b/src/eplugin/e-kolab-plugin-util.h
index 6706521..9cfea5b 100644
--- a/src/eplugin/e-kolab-plugin-util.h
+++ b/src/eplugin/e-kolab-plugin-util.h
@@ -42,6 +42,9 @@
 
 /*----------------------------------------------------------------------------*/
 
+const gchar*
+e_kolab_plugin_util_group_name_from_action_entry_name (const gchar *entry_name);
+
 GtkWidget*
 e_kolab_plugin_util_ui_label_new (const gchar *text,
                                   gboolean add_bottom_space);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]