aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/eab-popup.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2006-04-26 13:32:01 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2006-04-26 13:32:01 +0800
commit57b27c587e386ae2c66a9088c2b1e46f4046b157 (patch)
treeca819172b832b73129a9a862a88fe6b1fede0213 /addressbook/gui/widgets/eab-popup.c
parent7a39173f57d7d37ab856638b983a20b739fbdabc (diff)
downloadgsoc2013-evolution-57b27c587e386ae2c66a9088c2b1e46f4046b157.tar
gsoc2013-evolution-57b27c587e386ae2c66a9088c2b1e46f4046b157.tar.gz
gsoc2013-evolution-57b27c587e386ae2c66a9088c2b1e46f4046b157.tar.bz2
gsoc2013-evolution-57b27c587e386ae2c66a9088c2b1e46f4046b157.tar.lz
gsoc2013-evolution-57b27c587e386ae2c66a9088c2b1e46f4046b157.tar.xz
gsoc2013-evolution-57b27c587e386ae2c66a9088c2b1e46f4046b157.tar.zst
gsoc2013-evolution-57b27c587e386ae2c66a9088c2b1e46f4046b157.zip
Committing patch for bug #317512.
svn path=/trunk/; revision=31895
Diffstat (limited to 'addressbook/gui/widgets/eab-popup.c')
-rw-r--r--addressbook/gui/widgets/eab-popup.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/addressbook/gui/widgets/eab-popup.c b/addressbook/gui/widgets/eab-popup.c
index 4a745a41f2..8da9241624 100644
--- a/addressbook/gui/widgets/eab-popup.c
+++ b/addressbook/gui/widgets/eab-popup.c
@@ -60,6 +60,11 @@ eabp_target_free(EPopup *ep, EPopupTarget *t)
g_object_unref(s->book);
break; }
+ case EAB_POPUP_TARGET_URI: {
+ EABPopupTargetURI *s = (EABPopupTargetURI *)t;
+
+ g_free(s->uri);
+ break; }
case EAB_POPUP_TARGET_SOURCE: {
EABPopupTargetSource *s = (EABPopupTargetSource *)t;
@@ -129,6 +134,32 @@ EABPopup *eab_popup_new(const char *menuid)
*
* Return value:
**/
+
+
+EABPopupTargetURI *
+eab_popup_target_new_uri(EABPopup *emp, const char *uri)
+{
+ EABPopupTargetURI *t = e_popup_target_new(&emp->popup, EAB_POPUP_TARGET_URI, sizeof(*t));
+ guint32 mask = ~0;
+
+ t->uri = g_strdup(uri);
+
+ if (g_ascii_strncasecmp(uri, "http:", 5) == 0
+ || g_ascii_strncasecmp(uri, "https:", 6) == 0)
+ mask &= ~EAB_POPUP_URI_HTTP;
+ if (g_ascii_strncasecmp(uri, "internal-mailto:", 16) == 0)
+ mask &= ~EAB_POPUP_URI_MAILTO;
+ else
+ mask &= ~EAB_POPUP_URI_NOT_MAILTO;
+
+ t->target.mask = mask;
+
+ return t;
+}
+
+
+
+
EABPopupTargetSelect *
eab_popup_target_new_select(EABPopup *eabp, struct _EBook *book, int readonly, GPtrArray *cards)
{
@@ -276,12 +307,20 @@ static const EPopupHookTargetMask eabph_source_masks[] = {
{ 0 }
};
+static const EPopupHookTargetMask eabph_uri_masks[] = {
+ { "http", EAB_POPUP_URI_HTTP },
+ { "internal-mailto", EAB_POPUP_URI_MAILTO },
+ { "notmailto", EAB_POPUP_URI_NOT_MAILTO },
+ { 0 }
+};
+
static const EPopupHookTargetMask eabph_select_names_masks[] = {
{ 0 }
};
static const EPopupHookTargetMap eabph_targets[] = {
{ "select", EAB_POPUP_TARGET_SELECT, eabph_select_masks },
+ { "uri", EAB_POPUP_TARGET_URI, eabph_uri_masks },
{ "source", EAB_POPUP_TARGET_SOURCE, eabph_source_masks },
{ "select-names", EAB_POPUP_TARGET_SELECT_NAMES, eabph_select_names_masks },
{ 0 }