[evolution-kolab/ek-wip-gui: 17/22] EPlugin: moved common enumeration to separate header
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab/ek-wip-gui: 17/22] EPlugin: moved common enumeration to separate header
- Date: Mon, 20 Feb 2012 23:26:12 +0000 (UTC)
commit 47a259a78c463c162ae56284f4601d6bb2c69db5
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Fri Feb 17 21:14:06 2012 +0100
EPlugin: moved common enumeration to separate header
* moved the Kolab widted type enum to a separate
header file
* added libekolab dependency (LIBADD in Makefile.am)
src/eplugin/Makefile.am | 4 ++-
src/eplugin/e-kolab-account-setup.c | 8 +++---
src/eplugin/e-kolab-account-setup.h | 9 +-----
src/eplugin/e-kolab-plugin-types.h | 44 +++++++++++++++++++++++++++++++++++
src/eplugin/e-kolab-plugin.c | 5 ++-
5 files changed, 56 insertions(+), 14 deletions(-)
---
diff --git a/src/eplugin/Makefile.am b/src/eplugin/Makefile.am
index c52011f..8ae9677 100644
--- a/src/eplugin/Makefile.am
+++ b/src/eplugin/Makefile.am
@@ -14,6 +14,7 @@ noinst_HEADERS = \
e-kolab-folder-metadata.h \
e-kolab-folder-permissions.h \
e-kolab-freebusy.h \
+ e-kolab-plugin-types.h \
e-kolab-plugin-ui.h \
e-kolab-plugin.h
@@ -38,13 +39,14 @@ liborg_gnome_kolab_la_LIBADD = \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(EVOLUTION_LIBS) \
+ $(KOLAB_LIB_EKOLAB) \
$(KOLAB_LIB_EKOLABBACKEND)
EXTRA_DIST = \
org-gnome-kolab.eplug.xml \
$(noinst_HEADERS)
-BUILT_SOURCES = org-gnome-kolab.eplug
+BUILT_SOURCES = org-gnome-kolab.eplug
CLEANFILES = $(BUILT_SOURCES)
diff --git a/src/eplugin/e-kolab-account-setup.c b/src/eplugin/e-kolab-account-setup.c
index 1bd5305..14fe9a9 100644
--- a/src/eplugin/e-kolab-account-setup.c
+++ b/src/eplugin/e-kolab-account-setup.c
@@ -324,7 +324,7 @@ e_kolab_account_setup_ensure_contacts_source_group (void)
e_source_list_ensure_group (source_list,
KOLAB_CAMEL_PROVIDER_NAME,
- KOLAB_URI_PREFIX, FALSE);
+ KOLAB_CAMEL_URI_PREFIX, FALSE);
g_object_unref (source_list);
}
@@ -334,7 +334,7 @@ e_kolab_account_setup_ensure_contacts_source_group (void)
GtkWidget*
e_kolab_account_setup_backend_create (EPlugin *epl,
EConfigHookItemFactoryData *data,
- KolabWidgetType widget_type)
+ KolabWidgetTypeID widget_type)
{
EABConfigTargetSource *t = (EABConfigTargetSource *) data->target;
GtkWidget *parent = data->parent;
@@ -445,7 +445,7 @@ e_kolab_account_setup_backend_create (EPlugin *epl,
gtk_box_pack_start (GTK_BOX (kolab_vbox), GTK_WIDGET (hbox), TRUE, TRUE, 0);
spacer = gtk_label_new(" ");
gtk_box_pack_start (GTK_BOX (hbox), spacer, FALSE, FALSE, 0);
- if (widget_type==KOLAB_CONTACT_WIDGET)
+ if (widget_type == KOLAB_WIDGET_TYPE_CONTACT)
tmp_str = g_strconcat (_("Contact Folder"), ":", NULL);
else
tmp_str = g_strconcat (_("Calendar Folder"), ":", NULL);
@@ -524,7 +524,7 @@ e_kolab_account_setup_backend_create (EPlugin *epl,
g_object_set_data_full(G_OBJECT(epl), KOLAB_EPLUGIN_WIDGET_NAME, uidata, destroy_ui_data);
g_signal_connect (uidata->kolab_box, "destroy", G_CALLBACK (gtk_widget_destroyed), &uidata->kolab_box);
- if (widget_type == KOLAB_CONTACT_WIDGET) {
+ if (widget_type == KOLAB_WIDGET_TYPE_CONTACT) {
g_signal_connect_swapped (G_OBJECT (uidata->kolab_username),
"changed",
G_CALLBACK (set_contact_source_from_ui_cb),
diff --git a/src/eplugin/e-kolab-account-setup.h b/src/eplugin/e-kolab-account-setup.h
index 68cca8e..04d88c2 100644
--- a/src/eplugin/e-kolab-account-setup.h
+++ b/src/eplugin/e-kolab-account-setup.h
@@ -37,12 +37,7 @@
#include <e-util/e-config.h>
#include <e-util/e-plugin.h>
-/*----------------------------------------------------------------------------*/
-
-typedef enum {
- KOLAB_CALENDAR_WIDGET,
- KOLAB_CONTACT_WIDGET
-} KolabWidgetType;
+#include "e-kolab-plugin-types.h"
/*----------------------------------------------------------------------------*/
@@ -55,7 +50,7 @@ e_kolab_account_setup_ensure_contacts_source_group (void);
GtkWidget*
e_kolab_account_setup_backend_create (EPlugin *epl,
EConfigHookItemFactoryData *data,
- KolabWidgetType widget_type);
+ KolabWidgetTypeID widget_type);
/*----------------------------------------------------------------------------*/
diff --git a/src/eplugin/e-kolab-plugin-types.h b/src/eplugin/e-kolab-plugin-types.h
new file mode 100644
index 0000000..0caba3c
--- /dev/null
+++ b/src/eplugin/e-kolab-plugin-types.h
@@ -0,0 +1,44 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/***************************************************************************
+ * e-kolab-plugin-types.h
+ *
+ * Thu Feb 16 17:35: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_TYPES_H_
+#define _E_KOLAB_PLUGIN_TYPES_H_
+
+/*----------------------------------------------------------------------------*/
+
+typedef enum {
+ KOLAB_WIDGET_TYPE_CALENDAR = 0,
+ KOLAB_WIDGET_TYPE_CONTACT,
+ KOLAB_WIDGET_LAST_TYPE
+} KolabWidgetTypeID;
+
+/*----------------------------------------------------------------------------*/
+
+#endif /* _E_KOLAB_PLUGIN_TYPES_H_ */
+
+/*----------------------------------------------------------------------------*/
diff --git a/src/eplugin/e-kolab-plugin.c b/src/eplugin/e-kolab-plugin.c
index 4311d38..a4b4a2d 100644
--- a/src/eplugin/e-kolab-plugin.c
+++ b/src/eplugin/e-kolab-plugin.c
@@ -29,6 +29,7 @@
#include <config.h>
#include "e-kolab-account-setup.h"
+#include "e-kolab-plugin-types.h"
#include "e-kolab-plugin-ui.h"
#include "e-kolab-plugin.h"
@@ -93,7 +94,7 @@ e_kolab_plugin_calendar_create (EPlugin *epl,
e_kolab_account_setup_backend_create (epl,
data,
- KOLAB_CALENDAR_WIDGET);
+ KOLAB_WIDGET_TYPE_CALENDAR);
return NULL;
}
@@ -133,7 +134,7 @@ e_kolab_plugin_addressbook_create (EPlugin *epl,
e_kolab_account_setup_backend_create (epl,
data,
- KOLAB_CONTACT_WIDGET);
+ KOLAB_WIDGET_TYPE_CONTACT);
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]