aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r--addressbook/gui/widgets/e-addressbook-reflow-adapter.c1
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c28
-rw-r--r--addressbook/gui/widgets/eab-popup-control.c1
-rw-r--r--addressbook/gui/widgets/eab-popup.c22
-rw-r--r--addressbook/gui/widgets/eab-popup.h20
5 files changed, 55 insertions, 17 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
index cf1667fec5..4d935198d1 100644
--- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
+++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
@@ -12,7 +12,6 @@
#include "eab-gui-util.h"
#include "e-minicard.h"
-#include <gal/widgets/e-popup-menu.h>
#include <gal/widgets/e-gui-utils.h>
#include "addressbook/printing/e-contact-print.h"
#include "addressbook/printing/e-contact-print-envelope.h"
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index f716ea8624..ed55f42a89 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -913,24 +913,24 @@ new_list (EPopup *ep, EPopupItem *pitem, void *data)
}
static EPopupItem eabv_popup_items[] = {
- { E_POPUP_ITEM, "10.new", N_("New Contact..."), new_card, NULL, "stock_contact", EAB_POPUP_SELECT_EDITABLE},
- { E_POPUP_ITEM, "15.newlist", N_("New Contact List..."), new_list, NULL, "stock_contact-list", EAB_POPUP_SELECT_EDITABLE },
+ { E_POPUP_ITEM, "10.new", N_("New Contact..."), new_card, NULL, "stock_contact", 0, EAB_POPUP_SELECT_EDITABLE},
+ { E_POPUP_ITEM, "15.newlist", N_("New Contact List..."), new_list, NULL, "stock_contact-list", 0, EAB_POPUP_SELECT_EDITABLE },
{ E_POPUP_BAR, "20.bar" },
- { E_POPUP_ITEM, "30.saveas", N_("Save as VCard..."), save_as, NULL, "stock_save-as", EAB_POPUP_SELECT_MANY },
- { E_POPUP_ITEM, "40.forward", N_("Forward Contact"), send_as, NULL, "stock_mail-forward", EAB_POPUP_SELECT_MANY },
- { E_POPUP_ITEM, "50.mailto", N_("Send Message to Contact"), send_to, NULL, "stock_mail-send", EAB_POPUP_SELECT_MANY|EAB_POPUP_SELECT_EMAIL },
- { E_POPUP_ITEM, "60.print", N_("Print"), print, NULL, "stock_print", EAB_POPUP_SELECT_MANY },
+ { E_POPUP_ITEM, "30.saveas", N_("Save as VCard..."), save_as, NULL, "stock_save-as", 0, EAB_POPUP_SELECT_MANY },
+ { E_POPUP_ITEM, "40.forward", N_("Forward Contact"), send_as, NULL, "stock_mail-forward", 0, EAB_POPUP_SELECT_MANY },
+ { E_POPUP_ITEM, "50.mailto", N_("Send Message to Contact"), send_to, NULL, "stock_mail-send", 0, EAB_POPUP_SELECT_MANY|EAB_POPUP_SELECT_EMAIL },
+ { E_POPUP_ITEM, "60.print", N_("Print"), print, NULL, "stock_print", 0, EAB_POPUP_SELECT_MANY },
{ E_POPUP_BAR, "70.bar" },
- { E_POPUP_ITEM, "80.copyto", N_("Copy to Address Book..."), copy_to_folder, NULL, NULL, EAB_POPUP_SELECT_MANY },
- { E_POPUP_ITEM, "90.moveto", N_("Move to Address Book..."), move_to_folder, NULL, NULL, EAB_POPUP_SELECT_MANY|EAB_POPUP_SELECT_EDITABLE },
+ { E_POPUP_ITEM, "80.copyto", N_("Copy to Address Book..."), copy_to_folder, NULL, NULL, 0, EAB_POPUP_SELECT_MANY },
+ { E_POPUP_ITEM, "90.moveto", N_("Move to Address Book..."), move_to_folder, NULL, NULL, 0, EAB_POPUP_SELECT_MANY|EAB_POPUP_SELECT_EDITABLE },
{ E_POPUP_BAR, "a0.bar" },
- { E_POPUP_BAR, "b0.cut", N_("Cut"), cut, NULL, "stock_cut", EAB_POPUP_SELECT_MANY|EAB_POPUP_SELECT_EDITABLE },
- { E_POPUP_ITEM, "c0.copy", N_("Copy"), copy, NULL, "stock_copy", EAB_POPUP_SELECT_MANY },
- { E_POPUP_ITEM, "d0.paste", N_("Paste"), paste, NULL, "stock_paste", EAB_POPUP_SELECT_EDITABLE },
- { E_POPUP_ITEM, "e0.delete", N_("Delete"), delete, NULL, "stock_delete", EAB_POPUP_SELECT_EDITABLE|EAB_POPUP_SELECT_MANY },
+ { E_POPUP_BAR, "b0.cut", N_("Cut"), cut, NULL, "stock_cut", 0, EAB_POPUP_SELECT_MANY|EAB_POPUP_SELECT_EDITABLE },
+ { E_POPUP_ITEM, "c0.copy", N_("Copy"), copy, NULL, "stock_copy", 0, EAB_POPUP_SELECT_MANY },
+ { E_POPUP_ITEM, "d0.paste", N_("Paste"), paste, NULL, "stock_paste", 0, EAB_POPUP_SELECT_EDITABLE },
+ { E_POPUP_ITEM, "e0.delete", N_("Delete"), delete, NULL, "stock_delete", 0, EAB_POPUP_SELECT_EDITABLE|EAB_POPUP_SELECT_MANY },
};
static void
@@ -991,9 +991,7 @@ do_popup_menu(EABView *view, GdkEvent *event)
e_popup_add_items((EPopup *)ep, menus, eabv_popup_free, contact_and_book);
- /* visibility is disabled, we only disable menu items */
- /* FIXME: when enable is implemented in e-popup */
- menu = e_popup_create_menu_once((EPopup *)ep, (EPopupTarget *)t, 0, t->target.mask);
+ menu = e_popup_create_menu_once((EPopup *)ep, (EPopupTarget *)t, 0);
gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event?event->button.button:0, event?event->button.time:gtk_get_current_event_time());
}
diff --git a/addressbook/gui/widgets/eab-popup-control.c b/addressbook/gui/widgets/eab-popup-control.c
index 1e34cf4a18..10ef769632 100644
--- a/addressbook/gui/widgets/eab-popup-control.c
+++ b/addressbook/gui/widgets/eab-popup-control.c
@@ -48,7 +48,6 @@
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-property-bag.h>
#include <bonobo/bonobo-generic-factory.h>
-#include <gal/widgets/e-popup-menu.h>
#include <addressbook/util/eab-book-util.h>
#include <addressbook/gui/contact-editor/e-contact-editor.h>
#include <addressbook/gui/contact-editor/e-contact-quick-add.h>
diff --git a/addressbook/gui/widgets/eab-popup.c b/addressbook/gui/widgets/eab-popup.c
index d2faa40fc5..92624cb4cd 100644
--- a/addressbook/gui/widgets/eab-popup.c
+++ b/addressbook/gui/widgets/eab-popup.c
@@ -65,6 +65,11 @@ eabp_target_free(EPopup *ep, EPopupTarget *t)
g_object_unref(s->selector);
break; }
+ case EAB_POPUP_TARGET_SELECT_NAMES: {
+ EABPopupTargetSelectNames *s = (EABPopupTargetSelectNames *)t;
+
+ g_object_unref(s->model);
+ break; }
}
((EPopupClass *)eabp_parent)->target_free(ep, t);
@@ -189,6 +194,18 @@ eab_popup_target_new_source(EABPopup *eabp, ESourceSelector *selector)
return t;
}
+EABPopupTargetSelectNames *
+eab_popup_target_new_select_names(EABPopup *eabp, struct _ESelectNamesModel *model, int row)
+{
+ EABPopupTargetSelectNames *t = e_popup_target_new(&eabp->popup, EAB_POPUP_TARGET_SELECT_NAMES, sizeof(*t));
+
+ t->model = model;
+ g_object_ref(model);
+ t->row = row;
+
+ return t;
+}
+
/* ********************************************************************** */
/* Popup menu plugin handler */
@@ -231,9 +248,14 @@ static const EPopupHookTargetMask eabph_source_masks[] = {
{ 0 }
};
+static const EPopupHookTargetMask eabph_select_names_masks[] = {
+ { 0 }
+};
+
static const EPopupHookTargetMap eabph_targets[] = {
{ "select", EAB_POPUP_TARGET_SELECT, eabph_select_masks },
{ "source", EAB_POPUP_TARGET_SOURCE, eabph_source_masks },
+ { "select-names", EAB_POPUP_TARGET_SELECT_NAMES, eabph_select_names_masks },
{ 0 }
};
diff --git a/addressbook/gui/widgets/eab-popup.h b/addressbook/gui/widgets/eab-popup.h
index 996cf78d6d..39df885de5 100644
--- a/addressbook/gui/widgets/eab-popup.h
+++ b/addressbook/gui/widgets/eab-popup.h
@@ -45,6 +45,7 @@ typedef struct _EABPopupClass EABPopupClass;
enum _eab_popup_target_t {
EAB_POPUP_TARGET_SELECT,
EAB_POPUP_TARGET_SOURCE,
+ EAB_POPUP_TARGET_SELECT_NAMES,
};
/**
@@ -77,6 +78,7 @@ enum _eab_popup_target_source_t {
typedef struct _EABPopupTargetSelect EABPopupTargetSelect;
typedef struct _EABPopupTargetSource EABPopupTargetSource;
+typedef struct _EABPopupTargetSelectNames EABPopupTargetSelectNames;
/**
* struct _EABPopupTargetSelect - A list of address cards.
@@ -109,6 +111,23 @@ struct _EABPopupTargetSource {
struct _ESourceSelector *selector;
};
+/**
+ * struct _EABPopupTargetSelectNames - A select names target.
+ *
+ * @target: Superclass.
+ * @model: Select names model.
+ * @row: Row of item selected.
+ *
+ * This target is used to represent an item selected in an
+ * ESelectNames model.
+ **/
+struct _EABPopupTargetSelectNames {
+ EPopupTarget target;
+
+ struct _ESelectNamesModel *model;
+ int row;
+};
+
typedef struct _EPopupItem EABPopupItem;
/* The object */
@@ -128,6 +147,7 @@ EABPopup *eab_popup_new(const char *menuid);
EABPopupTargetSelect *eab_popup_target_new_select(EABPopup *eabp, struct _EBook *book, int readonly, GPtrArray *cards);
EABPopupTargetSource *eab_popup_target_new_source(EABPopup *eabp, struct _ESourceSelector *selector);
+EABPopupTargetSelectNames *eab_popup_target_new_select_names(EABPopup *eabp, struct _ESelectNamesModel *model, int row);
/* ********************************************************************** */