[evolution-kolab] EPlugin: added file for utility functions



commit 2ff681c1af1009753541e6a0cd1039e1b5b2be5b
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Mon Jun 4 11:06:45 2012 +0200

    EPlugin: added file for utility functions
    
    * added util function to create GTK label for
      "selected folder name" (used in various places
      across the "Kolab Folder Properties..." dialogs)

 src/eplugin/Makefile.am           |    2 +
 src/eplugin/e-kolab-plugin-util.c |   74 +++++++++++++++++++++++++++++++++++++
 src/eplugin/e-kolab-plugin-util.h |   46 +++++++++++++++++++++++
 3 files changed, 122 insertions(+), 0 deletions(-)
---
diff --git a/src/eplugin/Makefile.am b/src/eplugin/Makefile.am
index 45ea299..ef44993 100644
--- a/src/eplugin/Makefile.am
+++ b/src/eplugin/Makefile.am
@@ -17,6 +17,7 @@ noinst_HEADERS =			\
 	e-kolab-freebusy.h		\
 	e-kolab-plugin-types.h		\
 	e-kolab-plugin-ui.h		\
+	e-kolab-plugin-util.h		\
 	e-kolab-plugin.h
 
 @EVO_PLUGIN_RULE@
@@ -32,6 +33,7 @@ liborg_gnome_kolab_la_SOURCES =		\
 	e-kolab-folder-permissions.c	\
 	e-kolab-freebusy.c		\
 	e-kolab-plugin-ui.c		\
+	e-kolab-plugin-util.c		\
 	e-kolab-plugin.c
 
 liborg_gnome_kolab_la_LDFLAGS = -module -avoid-version
diff --git a/src/eplugin/e-kolab-plugin-util.c b/src/eplugin/e-kolab-plugin-util.c
new file mode 100644
index 0000000..d72cdca
--- /dev/null
+++ b/src/eplugin/e-kolab-plugin-util.c
@@ -0,0 +1,74 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/***************************************************************************
+ *            e-kolab-plugin-util.c
+ *
+ *  Sat Jun 02 15:28:05 2012
+ *  Copyright  2012  Christian Hilberg
+ *  <hilberg kernelconcepts de>
+ *
+ ****************************************************************************/
+
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
+ */
+
+/*----------------------------------------------------------------------------*/
+
+#include <config.h>
+
+#include <glib/gi18n-lib.h>
+
+#include "e-kolab-plugin-util.h"
+
+/*----------------------------------------------------------------------------*/
+/* internal statics (non-UI) */
+
+
+/*----------------------------------------------------------------------------*/
+/* internal statics (UI) */
+
+
+/*----------------------------------------------------------------------------*/
+/* API functions (non-UI) */
+
+
+/*----------------------------------------------------------------------------*/
+/* API functions (UI) */
+
+GtkWidget*
+e_kolab_plugin_util_ui_selected_folder_widget (const gchar *foldername)
+{
+	GtkWidget *label = NULL;
+	gchar *labeltext = NULL;
+
+	g_assert (foldername != NULL);
+	
+	label = gtk_label_new (NULL);
+	labeltext = g_strconcat ("<b>",
+	                         C_("Kolab Folder Properties",
+	                            "Selected Folder:"),
+	                         " </b>",
+	                         foldername,
+	                         NULL);
+	gtk_label_set_markup (GTK_LABEL (label), labeltext);
+	g_free (labeltext);
+	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+	gtk_widget_set_margin_top (GTK_WIDGET (label), 4);
+	gtk_widget_set_margin_bottom (GTK_WIDGET (label), 4);
+
+	return label;
+}
+
+/*----------------------------------------------------------------------------*/
diff --git a/src/eplugin/e-kolab-plugin-util.h b/src/eplugin/e-kolab-plugin-util.h
new file mode 100644
index 0000000..ecb16cb
--- /dev/null
+++ b/src/eplugin/e-kolab-plugin-util.h
@@ -0,0 +1,46 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/***************************************************************************
+ *            e-kolab-plugin-util.h
+ *
+ *  Sat Jun 02 15:28:05 2012
+ *  Copyright  2012  Christian Hilberg
+ *  <hilberg kernelconcepts de>
+ *
+ ****************************************************************************/
+
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
+ */
+
+/*----------------------------------------------------------------------------*/
+
+#ifndef _E_KOLAB_PLUGIN_UTIL_H_
+#define _E_KOLAB_PLUGIN_UTIL_H_
+
+/*----------------------------------------------------------------------------*/
+
+#include <glib.h>
+#include <gtk/gtk.h>
+
+/*----------------------------------------------------------------------------*/
+
+GtkWidget*
+e_kolab_plugin_util_ui_selected_folder_widget (const gchar *foldername);
+
+/*----------------------------------------------------------------------------*/
+
+#endif /* _E_KOLAB_PLUGIN_UTIL_H_ */
+
+/*----------------------------------------------------------------------------*/



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