aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
Diffstat (limited to 'e-util')
-rw-r--r--e-util/Makefile.am18
-rw-r--r--e-util/e-alert-dialog.c28
-rw-r--r--e-util/e-extensible.h59
-rw-r--r--e-util/e-marshal.list1
-rw-r--r--e-util/e-module.h75
-rw-r--r--e-util/e-plugin-ui.c3
-rw-r--r--e-util/e-plugin.c2
-rw-r--r--e-util/e-util.c41
-rw-r--r--e-util/e-util.h3
9 files changed, 32 insertions, 198 deletions
diff --git a/e-util/Makefile.am b/e-util/Makefile.am
index 53614e3b06..b5d4559cce 100644
--- a/e-util/Makefile.am
+++ b/e-util/Makefile.am
@@ -31,15 +31,12 @@ eutilinclude_HEADERS = \
e-dialog-utils.h \
e-dialog-widgets.h \
e-event.h \
- e-extensible.h \
- e-extension.h \
e-file-utils.h \
e-html-utils.h \
e-icon-factory.h \
e-import.h \
e-marshal.h \
e-mktemp.h \
- e-module.h \
e-poolv.h \
e-print.h \
e-plugin.h \
@@ -88,8 +85,8 @@ libeutil_la_CPPFLAGS = \
-DEVOLUTION_UIDIR=\""$(uidir)"\" \
-DEVOLUTION_RULEDIR=\"$(ruledir)\" \
-DG_LOG_DOMAIN=\"e-utils\" \
- $(GNOME_PLATFORM_CFLAGS) \
- $(E_UTIL_CFLAGS)
+ $(EVOLUTION_DATA_SERVER_CFLAGS) \
+ $(GNOME_PLATFORM_CFLAGS)
libeutil_la_SOURCES = \
$(eutilinclude_HEADERS) \
@@ -106,15 +103,12 @@ libeutil_la_SOURCES = \
e-dialog-utils.c \
e-dialog-widgets.c \
e-event.c \
- e-extensible.c \
- e-extension.c \
e-file-utils.c \
e-html-utils.c \
e-icon-factory.c \
e-import.c \
e-marshal.c \
e-mktemp.c \
- e-module.c \
e-poolv.c \
e-plugin.c \
e-plugin-ui.c \
@@ -139,10 +133,10 @@ libeutil_la_SOURCES = \
libeutil_la_LDFLAGS = $(NO_UNDEFINED)
-libeutil_la_LIBADD = \
- $(ICONV_LIBS) \
- $(E_UTIL_LIBS) \
- $(GNOME_PLATFORM_LIBS) \
+libeutil_la_LIBADD = \
+ $(ICONV_LIBS) \
+ $(EVOLUTION_DATA_SERVER_LIBS) \
+ $(GNOME_PLATFORM_LIBS) \
$(INTLLIBS)
error_DATA = e-system.error
diff --git a/e-util/e-alert-dialog.c b/e-util/e-alert-dialog.c
index 8696588ab2..70e53432f3 100644
--- a/e-util/e-alert-dialog.c
+++ b/e-util/e-alert-dialog.c
@@ -120,6 +120,7 @@ alert_dialog_constructed (GObject *object)
PangoAttrList *list;
GList *actions;
const gchar *primary, *secondary;
+ gint default_response;
gint min_width = -1, prefer_width = -1;
gint height;
@@ -129,6 +130,8 @@ alert_dialog_constructed (GObject *object)
dialog = E_ALERT_DIALOG (object);
alert = e_alert_dialog_get_alert (dialog);
+ default_response = e_alert_get_default_response (alert);
+
gtk_window_set_title (GTK_WINDOW (dialog), " ");
action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
@@ -149,15 +152,19 @@ alert_dialog_constructed (GObject *object)
actions = e_alert_peek_actions (alert);
while (actions != NULL) {
GtkWidget *button;
+ gpointer data;
/* These actions are already wired to trigger an
* EAlert::response signal when activated, which
* will in turn call to gtk_dialog_response(),
* so we can add buttons directly to the action
- * area without knowing their response IDs. */
+ * area without knowing their response IDs.
+ * (XXX Well, kind of. See below.) */
button = gtk_button_new ();
+ gtk_widget_set_can_default (button, TRUE);
+
gtk_activatable_set_related_action (
GTK_ACTIVATABLE (button),
GTK_ACTION (actions->data));
@@ -166,14 +173,23 @@ alert_dialog_constructed (GObject *object)
GTK_BOX (action_area),
button, FALSE, FALSE, 0);
+ /* This is set in e_alert_add_action(). */
+ data = g_object_get_data (
+ actions->data, "e-alert-response-id");
+
+ /* Normally GtkDialog sets the initial focus widget to
+ * the button corresponding to the default response, but
+ * because the buttons are not directly tied to response
+ * IDs, we have set both the default widget and the
+ * initial focus widget ourselves. */
+ if (GPOINTER_TO_INT (data) == default_response) {
+ gtk_widget_grab_default (button);
+ gtk_widget_grab_focus (button);
+ }
+
actions = g_list_next (actions);
}
- if (e_alert_get_default_response (alert))
- gtk_dialog_set_default_response (
- GTK_DIALOG (dialog),
- e_alert_get_default_response (alert));
-
widget = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (widget), 12);
gtk_box_pack_start (GTK_BOX (content_area), widget, FALSE, FALSE, 0);
diff --git a/e-util/e-extensible.h b/e-util/e-extensible.h
deleted file mode 100644
index 6dd6294212..0000000000
--- a/e-util/e-extensible.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * e-extensible.h
- *
- * 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 of the License, or (at your option) version 3.
- *
- * 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 the program; if not, see <http://www.gnu.org/licenses/>
- *
- */
-
-#ifndef E_EXTENSIBLE_H
-#define E_EXTENSIBLE_H
-
-#include <glib-object.h>
-
-/* Standard GObject macros */
-#define E_TYPE_EXTENSIBLE \
- (e_extensible_get_type ())
-#define E_EXTENSIBLE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST \
- ((obj), E_TYPE_EXTENSIBLE, EExtensible))
-#define E_EXTENSIBLE_INTERFACE(cls) \
- (G_TYPE_CHECK_CLASS_CAST \
- ((cls), E_TYPE_EXTENSIBLE, EExtensibleInterface))
-#define E_IS_EXTENSIBLE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE \
- ((obj), E_TYPE_EXTENSIBLE))
-#define E_IS_EXTENSIBLE_INTERFACE(cls) \
- (G_TYPE_CHECK_CLASS_TYPE \
- ((cls), E_TYPE_EXTENSIBLE))
-#define E_EXTENSIBLE_GET_INTERFACE(obj) \
- (G_TYPE_INSTANCE_GET_INTERFACE \
- ((obj), E_TYPE_EXTENSIBLE, EExtensibleInterface))
-
-G_BEGIN_DECLS
-
-typedef struct _EExtensible EExtensible;
-typedef struct _EExtensibleInterface EExtensibleInterface;
-
-struct _EExtensibleInterface {
- GTypeInterface parent_interface;
-};
-
-GType e_extensible_get_type (void);
-void e_extensible_load_extensions (EExtensible *extensible);
-GList * e_extensible_list_extensions (EExtensible *extensible,
- GType extension_type);
-
-G_END_DECLS
-
-#endif /* E_EXTENSIBLE_H */
diff --git a/e-util/e-marshal.list b/e-util/e-marshal.list
index ce8e393fce..c42078b2df 100644
--- a/e-util/e-marshal.list
+++ b/e-util/e-marshal.list
@@ -6,6 +6,7 @@ BOOLEAN:INT,INT,OBJECT,INT,INT,UINT
BOOLEAN:INT,POINTER,INT,BOXED
BOOLEAN:INT,POINTER,INT,OBJECT,INT,INT,UINT
BOOLEAN:NONE
+BOOLEAN:OBJECT
BOOLEAN:OBJECT,DOUBLE,DOUBLE,BOOLEAN
BOOLEAN:POINTER
BOOLEAN:POINTER,BOOLEAN,POINTER
diff --git a/e-util/e-module.h b/e-util/e-module.h
deleted file mode 100644
index dc96bb34d9..0000000000
--- a/e-util/e-module.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * e-module.h
- *
- * 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 of the License, or (at your option) version 3.
- *
- * 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 the program; if not, see <http://www.gnu.org/licenses/>
- *
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifndef E_MODULE_H
-#define E_MODULE_H
-
-#include <gmodule.h>
-#include <glib-object.h>
-
-/* Standard GObject macros */
-#define E_TYPE_MODULE \
- (e_module_get_type ())
-#define E_MODULE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST \
- ((obj), E_TYPE_MODULE, EModule))
-#define E_MODULE_CLASS(cls) \
- (G_TYPE_CHECK_CLASS_CAST \
- ((cls), E_TYPE_MODULE, EModuleClass))
-#define E_IS_MODULE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE \
- ((obj), E_TYPE_MODULE))
-#define E_IS_MODULE_CLASS(cls) \
- (G_TYPE_CHECK_CLASS_TYPE \
- ((cls), E_TYPE_MODULE))
-#define E_MODULE_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS \
- ((obj), E_TYPE_MODULE, EModuleClass))
-
-G_BEGIN_DECLS
-
-typedef struct _EModule EModule;
-typedef struct _EModuleClass EModuleClass;
-typedef struct _EModulePrivate EModulePrivate;
-
-/**
- * EModule:
- *
- * Contains only private data that should be read and manipulated using the
- * functions below.
- **/
-struct _EModule {
- GTypeModule parent;
- EModulePrivate *priv;
-};
-
-struct _EModuleClass {
- GTypeModuleClass parent_class;
-};
-
-GType e_module_get_type (void);
-EModule * e_module_new (const gchar *filename);
-const gchar * e_module_get_filename (EModule *module);
-GList * e_module_load_all_in_directory (const gchar *dirname);
-
-G_END_DECLS
-
-#endif /* E_MODULE_H */
diff --git a/e-util/e-plugin-ui.c b/e-util/e-plugin-ui.c
index 745a931954..3ac9eb92db 100644
--- a/e-util/e-plugin-ui.c
+++ b/e-util/e-plugin-ui.c
@@ -522,7 +522,8 @@ e_plugin_ui_hook_init (EPluginUIHook *hook)
(GDestroyNotify) g_free,
(GDestroyNotify) g_free);
- registry = g_hash_table_new (g_direct_hash, g_direct_equal);
+ registry = g_hash_table_new_full (g_direct_hash, g_direct_equal,
+ NULL, (GDestroyNotify) g_hash_table_destroy);
hook->priv = G_TYPE_INSTANCE_GET_PRIVATE (
hook, E_TYPE_PLUGIN_UI_HOOK, EPluginUIHookPrivate);
diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c
index 17650f045a..a19dc879b3 100644
--- a/e-util/e-plugin.c
+++ b/e-util/e-plugin.c
@@ -27,12 +27,12 @@
#include <gconf/gconf-client.h>
+#include <libebackend/e-module.h>
#include <libedataserver/e-data-server-util.h>
#include <libedataserver/e-xml-utils.h>
#include "e-plugin.h"
#include "e-util-private.h"
-#include "e-util.h"
/* plugin debug */
#define pd(x)
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 8ededeeb9d..cd489849e4 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -489,47 +489,6 @@ e_categories_add_change_hook (GHookFunc func,
}
/**
- * e_type_traverse:
- * @parent_type: the root #GType to traverse from
- * @func: the function to call for each visited #GType
- * @user_data: user data to pass to the function
- *
- * Calls @func for all instantiable subtypes of @parent_type.
- *
- * This is often useful for extending functionality by way of #EModule.
- * A module may register a subtype of @parent_type in its e_module_load()
- * function. Then later on the application will call e_type_traverse()
- * to instantiate all registered subtypes of @parent_type.
- **/
-void
-e_type_traverse (GType parent_type,
- ETypeFunc func,
- gpointer user_data)
-{
- GType *children;
- guint n_children, ii;
-
- g_return_if_fail (func != NULL);
-
- children = g_type_children (parent_type, &n_children);
-
- for (ii = 0; ii < n_children; ii++) {
- GType type = children[ii];
-
- /* Recurse over the child's children. */
- e_type_traverse (type, func, user_data);
-
- /* Skip abstract types. */
- if (G_TYPE_IS_ABSTRACT (type))
- continue;
-
- func (type, user_data);
- }
-
- g_free (children);
-}
-
-/**
* e_str_without_underscores:
* @string: the string to strip underscores from
*
diff --git a/e-util/e-util.h b/e-util/e-util.h
index 8463fd4a7b..cb88a90644 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -69,9 +69,6 @@ GtkRadioAction *e_radio_action_get_current_action
(GtkRadioAction *radio_action);
void e_categories_add_change_hook (GHookFunc func,
gpointer object);
-void e_type_traverse (GType parent_type,
- ETypeFunc func,
- gpointer user_data);
gchar * e_str_without_underscores (const gchar *string);
gint e_str_compare (gconstpointer x,