aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/exchange-operations
diff options
context:
space:
mode:
authorShakti Sen <shprasad@novell.com>2005-07-18 19:57:37 +0800
committerShakti Prasad Sen <shaktis@src.gnome.org>2005-07-18 19:57:37 +0800
commitc1fa3c9668c19b6cb7ea45ff21f6e612e51b4c3c (patch)
tree89706f088f98f5574db2a27584f9f0abc6d9d175 /plugins/exchange-operations
parenta7120007fd48336faeb2011d5f74dc7206d637eb (diff)
downloadgsoc2013-evolution-c1fa3c9668c19b6cb7ea45ff21f6e612e51b4c3c.tar
gsoc2013-evolution-c1fa3c9668c19b6cb7ea45ff21f6e612e51b4c3c.tar.gz
gsoc2013-evolution-c1fa3c9668c19b6cb7ea45ff21f6e612e51b4c3c.tar.bz2
gsoc2013-evolution-c1fa3c9668c19b6cb7ea45ff21f6e612e51b4c3c.tar.lz
gsoc2013-evolution-c1fa3c9668c19b6cb7ea45ff21f6e612e51b4c3c.tar.xz
gsoc2013-evolution-c1fa3c9668c19b6cb7ea45ff21f6e612e51b4c3c.tar.zst
gsoc2013-evolution-c1fa3c9668c19b6cb7ea45ff21f6e612e51b4c3c.zip
Added the functions org_gnome_exchange_calendar_permissions() and
2005-07-15 Shakti Sen <shprasad@novell.com> * exchange-folder-permission.c: Added the functions org_gnome_exchange_calendar_permissions() and org_gnome_exchange_addressbook_permissions() to support 'Folder Permissions' for 'Calendar', 'Tasks' and 'Contacts' components. Also taken care of a bug #310493. * org-gnome-exchange-operations.eplug.in: Added the class hooks. Fixes bug#310479. Fixes bug#310493 as well. svn path=/trunk/; revision=29791
Diffstat (limited to 'plugins/exchange-operations')
-rw-r--r--plugins/exchange-operations/ChangeLog12
-rw-r--r--plugins/exchange-operations/exchange-folder-permission.c113
-rw-r--r--plugins/exchange-operations/exchange-permissions-dialog.c3
-rw-r--r--plugins/exchange-operations/org-gnome-exchange-operations.eplug.in12
4 files changed, 127 insertions, 13 deletions
diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog
index 83a3a65cb4..a9cd120d4b 100644
--- a/plugins/exchange-operations/ChangeLog
+++ b/plugins/exchange-operations/ChangeLog
@@ -1,3 +1,15 @@
+2005-07-15 Shakti Sen <shprasad@novell.com>
+
+ * exchange-folder-permission.c: Added the functions
+ org_gnome_exchange_calendar_permissions() and
+ org_gnome_exchange_addressbook_permissions() to support
+ 'Folder Permissions' for 'Calendar', 'Tasks' and 'Contacts' components.
+ Also taken care of a bug #310493.
+ * org-gnome-exchange-operations.eplug.in: Added the class hooks.
+
+ Fixes bug#310479.
+ Fixes bug#310493 as well.
+
2005-07-18 Praveen Kumar <kpraveen@novell.com>
* exchange-account-setup.c (btn_chpass_clicked) : Handle the case
diff --git a/plugins/exchange-operations/exchange-folder-permission.c b/plugins/exchange-operations/exchange-folder-permission.c
index 885eb11493..e7aef33877 100644
--- a/plugins/exchange-operations/exchange-folder-permission.c
+++ b/plugins/exchange-operations/exchange-folder-permission.c
@@ -30,20 +30,25 @@
#include <libedataserver/e-xml-hash-utils.h>
#include <exchange/exchange-account.h>
#include <e-util/e-dialog-utils.h>
-#include "exchange-config-listener.h"
-#include "exchange-operations.h"
+#include <calendar/gui/e-cal-popup.h>
+#include <libedataserverui/e-source-selector.h>
#include <mail/em-popup.h>
#include <mail/em-menu.h>
+#include "exchange-config-listener.h"
+#include "exchange-operations.h"
#include "exchange-permissions-dialog.h"
+#include "addressbook/gui/widgets/eab-popup.h"
static void org_folder_permissions_cb (EPopup *ep, EPopupItem *p, void *data);
void org_gnome_exchange_folder_permissions (EPlugin *ep, EMPopupTargetFolder *t);
void org_gnome_exchange_menu_folder_permissions (EPlugin *ep, EMMenuTargetSelect *target);
+void org_gnome_exchange_calendar_permissions (EPlugin *ep, ECalPopupTargetSource *target);
+void org_gnome_exchange_addressbook_permissions (EPlugin *ep, EABPopupTargetSource *target);
gchar *selected_exchange_folder_uri = NULL;
static EPopupItem popup_items[] = {
- { E_POPUP_ITEM, "40.emc.30", N_("Permissions..."), org_folder_permissions_cb, NULL, "stock_new-dir", 0, EM_POPUP_FOLDER_INFERIORS }
+ { E_POPUP_ITEM, "30.emc.10", N_("Permissions..."), org_folder_permissions_cb, NULL, "stock_new-dir", 0, EM_POPUP_FOLDER_INFERIORS }
};
static void
@@ -53,14 +58,105 @@ popup_free (EPopup *ep, GSList *items, void *data)
}
void
+org_gnome_exchange_calendar_permissions (EPlugin *ep, ECalPopupTargetSource *target)
+{
+ GSList *menus = NULL;
+ int i = 0;
+ static int first =0;
+ ExchangeAccount *account = NULL;
+ EFolder *folder = NULL;
+ ESource *source = NULL;
+ gchar *uri = NULL;
+
+ source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector));
+ uri = (gchar *) e_source_get_uri (source);
+
+ if (! g_strrstr (uri, "exchange://")) {
+ return ;
+ }
+
+ account = exchange_operations_get_exchange_account ();
+
+ if (!account)
+ return;
+
+ folder = exchange_account_get_folder (account, uri);
+
+ if (!folder)
+ return;
+
+ selected_exchange_folder_uri = uri;
+
+ /* for translation*/
+ if (!first) {
+ popup_items[0].label = _(popup_items[0].label);
+ first++;
+
+ }
+
+ for (i = 0; i < sizeof (popup_items) / sizeof (popup_items[0]); i++)
+ menus = g_slist_prepend (menus, &popup_items[i]);
+
+ e_popup_add_items (target->target.popup, menus, NULL, popup_free, NULL);
+
+}
+
+void
+org_gnome_exchange_addressbook_permissions (EPlugin *ep, EABPopupTargetSource *target)
+{
+ GSList *menus = NULL;
+ int i = 0;
+ static int first =0;
+ ExchangeAccount *account = NULL;
+ EFolder *folder = NULL;
+ ESource *source = NULL;
+ gchar *uri = NULL;
+
+ source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector));
+ uri = (gchar *) e_source_get_uri (source);
+
+ if (! g_strrstr (uri, "exchange://")) {
+ return ;
+ }
+
+ account = exchange_operations_get_exchange_account ();
+
+ if (!account)
+ return;
+
+
+ folder = exchange_account_get_folder (account, uri);
+
+ if (!folder) {
+ return;
+ }
+
+ selected_exchange_folder_uri = uri;
+
+ /* for translation*/
+ if (!first) {
+ popup_items[0].label = _(popup_items[0].label);
+ first++;
+ }
+
+ for (i = 0; i < sizeof (popup_items) / sizeof (popup_items[0]); i++)
+ menus = g_slist_prepend (menus, &popup_items[i]);
+
+ e_popup_add_items (target->target.popup, menus, NULL, popup_free, NULL);
+}
+
+void
org_gnome_exchange_folder_permissions (EPlugin *ep, EMPopupTargetFolder *t)
{
GSList *menus = NULL;
int i = 0;
- static int first =1;
+ static int first =0;
ExchangeAccount *account = NULL;
EFolder *folder = NULL;
+ if (! g_strrstr (t->uri, "exchange://"))
+ return ;
+
account = exchange_operations_get_exchange_account ();
if (!account)
@@ -72,18 +168,13 @@ org_gnome_exchange_folder_permissions (EPlugin *ep, EMPopupTargetFolder *t)
if (!folder)
return;
- if (! g_strrstr (t->uri, "exchange://") && !folder)
- return ;
-
selected_exchange_folder_uri = t->uri;
/* for translation*/
- if (first) {
+ if (!first) {
popup_items[0].label = _(popup_items[0].label);
-
+ first++;
}
- first++;
-
for (i = 0; i < sizeof (popup_items) / sizeof (popup_items[0]); i++)
menus = g_slist_prepend (menus, &popup_items[i]);
diff --git a/plugins/exchange-operations/exchange-permissions-dialog.c b/plugins/exchange-operations/exchange-permissions-dialog.c
index ca4f8ba307..8571d3630f 100644
--- a/plugins/exchange-operations/exchange-permissions-dialog.c
+++ b/plugins/exchange-operations/exchange-permissions-dialog.c
@@ -560,8 +560,7 @@ display_role (ExchangePermissionsDialog *dialog)
-1);
if (role == E2K_PERMISSIONS_ROLE_CUSTOM) {
- gtk_widget_show (dialog->priv->separator);
- gtk_widget_show (dialog->priv->custom);
+ /* FIXME: To show Custom */
role = E2K_PERMISSIONS_ROLE_NUM_ROLES + 1;
}
gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->role_optionmenu), role);
diff --git a/plugins/exchange-operations/org-gnome-exchange-operations.eplug.in b/plugins/exchange-operations/org-gnome-exchange-operations.eplug.in
index ed2feef62f..6538c980b7 100644
--- a/plugins/exchange-operations/org-gnome-exchange-operations.eplug.in
+++ b/plugins/exchange-operations/org-gnome-exchange-operations.eplug.in
@@ -78,6 +78,18 @@
<menu id="org.gnome.evolution.mail.foldertree.popup" target="folder" factory = "org_gnome_exchange_folder_permissions">
</menu>
</hook>
+ <hook class="org.gnome.evolution.calendar.popup:1.0">
+ <menu id="org.gnome.evolution.calendar.source.popup" target="source" factory="org_gnome_exchange_calendar_permissions">
+ </menu>
+ </hook>
+ <hook class="org.gnome.evolution.calendar.popup:1.0">
+ <menu id="org.gnome.evolution.tasks.source.popup" target="source" factory="org_gnome_exchange_calendar_permissions">
+ </menu>
+ </hook>
+ <hook class="org.gnome.evolution.addressbook.popup:1.0">
+ <menu id="org.gnome.evolution.addressbook.source.popup" target="source" factory="org_gnome_exchange_addressbook_permissions">
+ </menu>
+ </hook>
<hook class="org.gnome.evolution.mail.bonobomenu:1.0">
<menu id="org.gnome.evolution.mail.browser" target="select">
<ui file="@PLUGINDIR@/org-gnome-folder-permissions.xml"/>