From 449e05f1b232fa2a1a92ae7c08c0f2b8870ac23a Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Wed, 29 Feb 2012 16:50:51 +0530 Subject: Move EAlert* and e-xml-utils to libevolution-utils. --- e-util/e-alert.c | 996 ------------------------------------------------------- 1 file changed, 996 deletions(-) delete mode 100644 e-util/e-alert.c (limited to 'e-util/e-alert.c') diff --git a/e-util/e-alert.c b/e-util/e-alert.c deleted file mode 100644 index 9ee7e05581..0000000000 --- a/e-util/e-alert.c +++ /dev/null @@ -1,996 +0,0 @@ -/* - * 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 - * - * - * Authors: - * Michael Zucchi - * Jonathon Jongsma - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * Copyright (C) 2009 Intel Corporation - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -#include -#include - -#include -#include - -#include - -#include "e-util.h" -#include "e-util-private.h" -#include "e-alert.h" -#include "e-alert-sink.h" - -#define d(x) - -#define E_ALERT_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_ALERT, EAlertPrivate)) - -typedef struct _EAlertButton EAlertButton; - -struct _e_alert { - const gchar *id; - GtkMessageType message_type; - gint default_response; - const gchar *primary_text; - const gchar *secondary_text; - EAlertButton *buttons; -}; - -struct _e_alert_table { - const gchar *domain; - const gchar *translation_domain; - GHashTable *alerts; -}; - -struct _EAlertButton { - EAlertButton *next; - const gchar *stock_id; - const gchar *label; - gint response_id; -}; - -static GHashTable *alert_table; - -/* ********************************************************************** */ - -static EAlertButton default_ok_button = { - NULL, GTK_STOCK_OK, NULL, GTK_RESPONSE_OK -}; - -static struct _e_alert default_alerts[] = { - { "error", GTK_MESSAGE_ERROR, GTK_RESPONSE_OK, - "{0}", "{1}", &default_ok_button }, - { "warning", GTK_MESSAGE_WARNING, GTK_RESPONSE_OK, - "{0}", "{1}", &default_ok_button } -}; - -/* ********************************************************************** */ - -struct _EAlertPrivate { - gchar *tag; - GPtrArray *args; - gchar *primary_text; - gchar *secondary_text; - struct _e_alert *definition; - GtkMessageType message_type; - gint default_response; - guint timeout_id; - - /* It may occur to one that we could use a GtkActionGroup here, - * but we need to preserve the button order and GtkActionGroup - * uses a hash table, which does not preserve order. */ - GQueue actions; -}; - -enum { - PROP_0, - PROP_ARGS, - PROP_TAG, - PROP_MESSAGE_TYPE, - PROP_PRIMARY_TEXT, - PROP_SECONDARY_TEXT -}; - -enum { - RESPONSE, - LAST_SIGNAL -}; - -static gulong signals[LAST_SIGNAL]; - -G_DEFINE_TYPE ( - EAlert, - e_alert, - G_TYPE_OBJECT) - -static gint -map_response (const gchar *name) -{ - GEnumClass *class; - GEnumValue *value; - - class = g_type_class_ref (GTK_TYPE_RESPONSE_TYPE); - value = g_enum_get_value_by_name (class, name); - g_type_class_unref (class); - - return (value != NULL) ? value->value : 0; -} - -static GtkMessageType -map_type (const gchar *nick) -{ - GEnumClass *class; - GEnumValue *value; - - class = g_type_class_ref (GTK_TYPE_MESSAGE_TYPE); - value = g_enum_get_value_by_nick (class, nick); - g_type_class_unref (class); - - return (value != NULL) ? value->value : GTK_MESSAGE_ERROR; -} - -/* - * XML format: - * - * - * Primary error text.? - * Secondary error text.? - *