diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-08-02 14:25:50 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-08-02 14:25:50 +0800 |
commit | 18b20048a2813ef487b3dbb08343d1b84991a30e (patch) | |
tree | 0cdbb80085d6940d4859350bb7575e8e97470929 /addressbook/gui/widgets | |
parent | 77316d782f31a8c321dbe8ccb9220c0a85f7fc47 (diff) | |
download | gsoc2013-evolution-18b20048a2813ef487b3dbb08343d1b84991a30e.tar gsoc2013-evolution-18b20048a2813ef487b3dbb08343d1b84991a30e.tar.gz gsoc2013-evolution-18b20048a2813ef487b3dbb08343d1b84991a30e.tar.bz2 gsoc2013-evolution-18b20048a2813ef487b3dbb08343d1b84991a30e.tar.lz gsoc2013-evolution-18b20048a2813ef487b3dbb08343d1b84991a30e.tar.xz gsoc2013-evolution-18b20048a2813ef487b3dbb08343d1b84991a30e.tar.zst gsoc2013-evolution-18b20048a2813ef487b3dbb08343d1b84991a30e.zip |
Added ContactsSaveAsVCard, ContactsSendContactToOther, and
2001-08-02 Christopher James Lahey <clahey@ximian.com>
* gui/component/addressbook.c: Added ContactsSaveAsVCard,
ContactsSendContactToOther, and ContactsSendMessageToContact verbs
here.
* gui/widgets/e-addressbook-view.c (e_addressbook_view_save_as,
e_addressbook_view_send, e_addressbook_view_send_to): New
functions to allow outside users to cause the addressbook to save,
send, or send a message to its selection.
svn path=/trunk/; revision=11567
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 86 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.h | 6 |
2 files changed, 63 insertions, 29 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 4f39360045..05374e26fa 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -1206,6 +1206,33 @@ get_selected_cards (EAddressbookView *view) } void +e_addressbook_view_save_as (EAddressbookView *view) +{ + GList *list = get_selected_cards (view); + if (list) + e_contact_list_save_as (_("Save as VCard"), list); + g_list_free (list); +} + +void +e_addressbook_view_send (EAddressbookView *view) +{ + GList *list = get_selected_cards (view); + if (list) + e_card_list_send (list, E_CARD_DISPOSITION_AS_ATTACHMENT); + g_list_free (list); +} + +void +e_addressbook_view_send_to (EAddressbookView *view) +{ + GList *list = get_selected_cards (view); + if (list) + e_card_list_send (list, E_CARD_DISPOSITION_AS_TO); + g_list_free (list); +} + +void e_addressbook_view_cut (EAddressbookView *view) { e_addressbook_view_copy (view); @@ -1252,6 +1279,18 @@ e_addressbook_view_stop(EAddressbookView *view) e_addressbook_model_stop (view->model); } +static gboolean +e_addressbook_view_selection_nonempty (EAddressbookView *view) +{ + ESelectionModel *selection_model; + + selection_model = get_selection_model (view); + if (selection_model == NULL) + return FALSE; + + return e_selection_model_selected_count (selection_model) != 0; +} + gboolean e_addressbook_view_can_create (EAddressbookView *view) { @@ -1261,58 +1300,47 @@ e_addressbook_view_can_create (EAddressbookView *view) gboolean e_addressbook_view_can_print (EAddressbookView *view) { - ESelectionModel *selection_model; + return e_addressbook_view_selection_nonempty (view); +} - if (!e_addressbook_model_editable (view->model)) - return FALSE; +gboolean +e_addressbook_view_can_save_as (EAddressbookView *view) +{ + return e_addressbook_view_selection_nonempty (view); +} - selection_model = get_selection_model (view); - if (selection_model == NULL) - return FALSE; +gboolean e_addressbook_view_can_send (EAddressbookView *view) +{ + return e_addressbook_view_selection_nonempty (view); +} - return e_selection_model_selected_count (selection_model) != 0; +gboolean e_addressbook_view_can_send_to (EAddressbookView *view) +{ + return e_addressbook_view_selection_nonempty (view); } gboolean e_addressbook_view_can_delete (EAddressbookView *view) { - ESelectionModel *selection_model; - - if (!e_addressbook_model_editable (view->model)) - return FALSE; - - selection_model = get_selection_model (view); - if (selection_model == NULL) - return FALSE; - - return e_selection_model_selected_count (selection_model) != 0; + return e_addressbook_view_selection_nonempty (view) && e_addressbook_model_editable (view->model); } gboolean e_addressbook_view_can_cut (EAddressbookView *view) { - return (e_addressbook_view_can_copy (view) && e_addressbook_model_editable (view->model)); + return e_addressbook_view_selection_nonempty (view) && e_addressbook_model_editable (view->model); } gboolean e_addressbook_view_can_copy (EAddressbookView *view) { - ESelectionModel *selection_model; - - if (!e_addressbook_model_editable (view->model)) - return FALSE; - - selection_model = get_selection_model (view); - if (selection_model == NULL) - return FALSE; - - return e_selection_model_selected_count (selection_model) != 0; + return e_addressbook_view_selection_nonempty (view); } gboolean e_addressbook_view_can_paste (EAddressbookView *view) { - return TRUE; + return e_addressbook_model_editable (view->model); } gboolean diff --git a/addressbook/gui/widgets/e-addressbook-view.h b/addressbook/gui/widgets/e-addressbook-view.h index 0a594842d8..8fc807572a 100644 --- a/addressbook/gui/widgets/e-addressbook-view.h +++ b/addressbook/gui/widgets/e-addressbook-view.h @@ -101,6 +101,9 @@ void e_addressbook_view_setup_menus (EAddressbookView *view, BonoboUIComponent *uic); void e_addressbook_view_discard_menus (EAddressbookView *view); +void e_addressbook_view_save_as (EAddressbookView *view); +void e_addressbook_view_send (EAddressbookView *view); +void e_addressbook_view_send_to (EAddressbookView *view); void e_addressbook_view_print (EAddressbookView *view); void e_addressbook_view_delete_selection (EAddressbookView *view); void e_addressbook_view_cut (EAddressbookView *view); @@ -112,6 +115,9 @@ void e_addressbook_view_stop (EAddressbookView *view); gboolean e_addressbook_view_can_create (EAddressbookView *view); gboolean e_addressbook_view_can_print (EAddressbookView *view); +gboolean e_addressbook_view_can_save_as (EAddressbookView *view); +gboolean e_addressbook_view_can_send (EAddressbookView *view); +gboolean e_addressbook_view_can_send_to (EAddressbookView *view); gboolean e_addressbook_view_can_delete (EAddressbookView *view); gboolean e_addressbook_view_can_cut (EAddressbookView *view); gboolean e_addressbook_view_can_copy (EAddressbookView *view); |