aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--plugins/exchange-account-setup/ChangeLog236
-rw-r--r--plugins/exchange-account-setup/Makefile.am25
-rw-r--r--plugins/exchange-account-setup/exchange-account-setup.c800
-rw-r--r--plugins/exchange-account-setup/exchange-ask-password.c357
-rw-r--r--plugins/exchange-account-setup/exchange-change-password.c134
-rw-r--r--plugins/exchange-account-setup/exchange-change-password.glade243
-rw-r--r--plugins/exchange-account-setup/exchange-change-password.h21
-rw-r--r--plugins/exchange-account-setup/exchange-delegates-user.c332
-rw-r--r--plugins/exchange-account-setup/exchange-delegates-user.h70
-rw-r--r--plugins/exchange-account-setup/exchange-delegates.c972
-rw-r--r--plugins/exchange-account-setup/exchange-delegates.glade628
-rw-r--r--plugins/exchange-account-setup/exchange-delegates.h21
-rw-r--r--plugins/exchange-account-setup/exchange-folder-size.c343
-rw-r--r--plugins/exchange-account-setup/exchange-folder-size.h56
-rw-r--r--plugins/exchange-account-setup/exchange-folder-tree.glade92
-rw-r--r--plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in51
17 files changed, 5 insertions, 4381 deletions
diff --git a/ChangeLog b/ChangeLog
index f658d1be6b..5ded7b6aca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-11 Sarfraaz Ahmed <asarfraaz@novell.com>
+
+ * plugins/exchange-account-setup : Removed this directory. This
+ functionality has now been moved to exchange-operations.
+
2005-07-11 Srinivasa Ragavan <sragavan@novell.com>
* configure.in: Added gnome-vfs-module-2.0 to E_WIDGETS_CFLAGS
diff --git a/plugins/exchange-account-setup/ChangeLog b/plugins/exchange-account-setup/ChangeLog
deleted file mode 100644
index 9fe95d08ce..0000000000
--- a/plugins/exchange-account-setup/ChangeLog
+++ /dev/null
@@ -1,236 +0,0 @@
-2005-06-10 Sarfraaz Ahmed <asarfraaz@novell.com>
-
- * exchange-account-setup.c (e_plugin_lib_enable)
- (free_exchange_listener)(e_plugin_lib_enable) : Added new to
- initialise the config listener.
- (update_state) : Now updates the state directly from the server and not
- from the file as earlier.
- (owa_authenticate_user) : Authenticates and validates directly from
- the server instead of using the camel APIs as earlier.
- (set_oof_info) : Sets the state directly on the server
- * Makefile.am : Use CAMEL_EXCHANGE CFLAGS and LIBS
-
-2005-05-21 Sarfraaz Ahmed <asarfraaz@novell.com>
-
- Added a bunch of files to create exchange plugins for UI changes
- * exchange-change-password.[ch]/.glade
- * exchange-delegates.[ch]/.glade
- * exchange-delegate-user.[ch]
- * exchange-folder-size.[ch]
- * exchange-folder-tree.glade
-
-2005-05-16 Not Zed <NotZed@Ximian.com>
-
- * exchange-account-setup.c: moved e-error to e-util
-
-2005-03-18 Sushma Rai <rsushma@novell.com>
-
- * exchange-account-setup.c (org_gnome_exchange_owa_url): When the
- Exchange account doesn't contain OWA url parameter, setting the OWA
- url value in the receive page and saving it.
- (construct_owa_url): Forming OWA url, from the existing parameters for
- hostname, ssl, OWA path and mailbox name.
- see #73627
-
-2005-03-17 Sushma Rai <rsushma@novell.com>
-
- * exchange-account-setup.c (exchange_authtype_changed): Setting the
- authentication mechanism to both transport and source urls.
-
-2005-03-05 Sushma Rai <rsushma@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: Added the commit function
- to save OOF data. This got missed in the previous commit. Also removed
- duplicate accountWizard definition.
-
-2005-02-28 JP Rosevear <jpr@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: add account wizard item
-
-2005-02-27 Sushma Rai <rsushma@novell.com>
-
- * exchange-account-setup.c (org_gnome_exchange_settings): Storing the
- oof data enterted by user to a file, displaying the existing data on
- this page.
- (toggled_state): Signal hander for radiobutton, that sets the oof state.
- (update_state): Signal handler that reads the oof message entered.
- (org_gnome_exchange_commit): Stores the oof data and does cleanup.
- (store_oof_info): Checks for the oof information file, writes the
- oof state and message to the file.
- (destroy_oof_data): Frees OOFData.
-
-2005-02-26 Sushma Rai <rsushma@novell.com>
-
- * exchange-account-setup.c (org_gnome_exchange_check_options):
- Returning FALSE on NULL host name or set to "" for receive page,
- so that one can proceed with the account creation only after
- hostname is retrived and set by validate().
-
-2005-02-24 Björn Torkelsson <torkel@acc.umu.se>
-
- * org-gnome-exchange-account-setup.eplug.in: Added author and
- fixed description.
-
-2005-02-21 Not Zed <NotZed@Ximian.com>
-
- * exchange-account-setup.c (org_gnome_exchange_owa_url): if the
- host is null in the url, set it to "", so it has a non-null value.
-
-2005-02-07 Sushma Rai <rsushma@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: Added plugin for adding
- auth type section to editor.
-
- * exchange-account-setup.c (org_gnome_exchange_auth_section): Adding
- and handling authentication type for exchange account.
-
-2005-01-28 Not Zed <NotZed@Ximian.com>
-
- ** related to bug #71520.
-
- * exchange-account-setup.c: All but re-written.
- Fixed the license of the file.
- Fixed a translation string.
- Modified return condition check.
- Fixed problem over writing current account with the old data.
- Removed duplicated code.
- Removed the hack for handling NULL hostname, now using
- CAMEL_URL_HIDDEN_HOST url flag in the provider.
- Using E_ACCOUNT_SOURCE_SAVE_PASSWD for remember password.
- Removed the way owa url entry was added to table in config section,
- Now econfig supports tables.
-
- * exchange-ask-password.c: removed, functionality moved to
- exchange-account-setup.c.
-
-2005-01-25 Sushma Rai <rsushma@novell.com>
-
- * exchange-account-setup.c (create_page): Fixed empty
- string being marked for translation problem. #71644
-
-2005-01-23 Sushma Rai <rsushma@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: Added plugins
- for handling hiding auth type section in druid.
-
- * exchange-account-setup.c (add_owa_entry_to_editor): Changed the
- button label to "Authenticate" from OK
-
- * exchange-ask-password.c (add_owa_entry): Changed the button label
- to Authenticate.
- (org_gnome_exchange_handle_auth): Hiding Auth section in receive page.
- (org_gnome_exchange_handle_send_auth_option): Hiding the Auth section
- in send page
-
-2005-01-22 Sushma Rai <rsushma@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: Added
- org_gnome_exchange_check_options plugin.
-
- * exchange-ask-password.c (org_gnome_exchange_check_options):
- Reads OWA URL value and sets use_ssl and owa_url values for source
- account url.
-
- * exchange-account-setup.c (org_gnome_exchange_set_url)
- (add_owa_entry_to_editor): Reading owa url value from gconf and setting
- owa url value in the account editor. Fixes #71378
-
-2005-01-19 Sushma Rai <rsushma@novell.com>
-
- * exchange-ask-password.c (validate_exchange_user): Fix for remembering
- password if user has selected that option, while creating the account.
-
-2005-01-18 Sushma Rai <rsushma@novell.com>
-
- * exchange-ask-password.c (validate_exchange_user): Reading the return
- value of user validation function. Fixes #71385
-
-2005-01-18 Sushma Rai <rsushma@novell.com>
-
- * exchange-ask-password.c (validate_exchange_user): Filling up
- user name so that page check doesn't fail. Fixes #71384
-
-2005-01-18 Sushma Rai <rsushma@novell.com>
-
- * exchange-ask-password.c (org_gnome_exchange_read_url):
- Setting dummy host name, which will be reset to proper
- hostname once the user is authenticated.
-
-2005-01-18 Sushma Rai <rsushma@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: Moved two account
- editor plugins unser same hook class.
-
- * exchange-ask-password.c: Reorganized the code.
- Used accessor functions to read and set EAccount values.
- Removed editor specific factory function add_owa_entry_to_editor()
- from here.
-
- * exchange-account-setup.c: Reorganized the code.
- Moved add_owa_entry_to_editor() and it's sub functions into this file.
- (org_gnome_exchange_account_setup): Reading source url and transport
- url values stored in gconf and filling up the EAccount structure.
- This fixes the problem of page check failure, as improper source url
- and transport url values, as we don't read host name in the editor.
- (org_gnome_exchange_set_url): Similar.
-
-2005-01-17 Sushma Rai <rsushma@novell.com>
-
- * Makefile.am: Linking to camel libs. Fixes plugin loading problem
- due to undefined camel symbol, during evolution startup.
-
-2005-01-13 Sushma Rai <rsushma@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: Combined
- all the plugins into one.
-
-2005-01-12 Sushma Rai <rsushma@novell.com>
-
- * exchange-ask-password.c: (validate_exchange_user):
- Added one more error condition check.
-
-2005-01-12 Sushma Rai <rsushma@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: Factory
- method to add owa url entry to account editor.
-
- * exchange-ask-password.c: (org_gnome_exchange_set_url)
- (add_owa_entry_to_editor): Adds owa url entry to the
- account editor for Exchange account.
- (validate_exchange_user): Using the CamelProvider private
- function defined by Exchange camel provider.
-
-2005-01-11 Sushma Rai <rsushma@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: Removed page check plugin
-
- * exchange-ask-password.c: Added a button to prompt for password
- instead of listening on page next signal
-
-2005-01-11 Not Zed <NotZed@Ximian.com>
-
- * Makefile.am: fix LDFLAGS variable name.
-
-2005-01-10 Sushma Rai <rsushma@novell.com>
-
- * exchange-ask-password.c: (validate_exchange_user):
- Corrected argument order.
-
-2005-01-10 Sushma Rai <rsushma@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: Added plugin to read
- OWA url entry to the account set up druid.
-
- * exchange-ask-password.c: Create a entry for OWA URL and reads the
- URL value.
-
-2005-01-09 Sushma Rai <rsushma@novell.com>
-
- * exchange-ask-password.c: Pops up password dialog and validates
- user credentials once owa url and user name are entered.
-
- * org-gnome-exchange-account-setup.eplug.in: Added page check plugin.
-
-2005-01-09 Sushma Rai <rsushma@novell.com>
-
- * Intial ckeckin, Plugin for Exchange account specific settings
diff --git a/plugins/exchange-account-setup/Makefile.am b/plugins/exchange-account-setup/Makefile.am
deleted file mode 100644
index 23b0f71392..0000000000
--- a/plugins/exchange-account-setup/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-INCLUDES = -I . \
- -I$(top_srcdir) \
- $(EVOLUTION_MAIL_CFLAGS) \
- $(CAMEL_EXCHANGE_CFLAGS) \
- $(CAMEL_CFLAGS) \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\"
-
-@EVO_PLUGIN_RULE@
-
-plugin_DATA = org-gnome-exchange-account-setup.eplug
-plugin_LTLIBRARIES = liborg-gnome-exchange-account-settings.la
-
-liborg_gnome_exchange_account_settings_la_SOURCES = \
- exchange-account-setup.c
-
-liborg_gnome_exchange_account_settings_la_LIBADD = \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/widgets/misc/libemiscwidgets.la \
- $(CAMEL_EXCHANGE_LIBS) \
- $(LDAP_LIBS) \
- $(CAMEL_LIBS)
-
-liborg_gnome_exchange_account_settings_la_LDFLAGS = -module -avoid-version
-
-EXTRA_DIST = org-gnome-exchange-account-setup.eplug.in
diff --git a/plugins/exchange-account-setup/exchange-account-setup.c b/plugins/exchange-account-setup/exchange-account-setup.c
deleted file mode 100644
index 0893f872fa..0000000000
--- a/plugins/exchange-account-setup/exchange-account-setup.c
+++ /dev/null
@@ -1,800 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Sushma Rai <rsushma@novell.com>
- * Copyright (C) 2004 Novell, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "e-util/e-account.h"
-#include "e-util/e-error.h"
-
-#include <string.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <glib/gi18n.h>
-#include <glade/glade.h>
-#include <gtk/gtk.h>
-#include <gtk/gtkdialog.h>
-#include <gconf/gconf-client.h>
-#include <camel/camel-provider.h>
-#include <camel/camel-url.h>
-#include <camel/camel-service.h>
-#include <libedataserver/e-xml-hash-utils.h>
-#include <exchange/e2k-validate.h>
-#include <exchange/exchange-oof.h>
-#include <e-util/e-dialog-utils.h>
-#include <exchange/exchange-config-listener.h>
-#include "mail/em-account-editor.h"
-#include "mail/em-config.h"
-
-
-static ExchangeConfigListener *exchange_global_config_listener = NULL;
-
-int e_plugin_lib_enable (EPluginLib *eplib, int enable);
-GtkWidget* org_gnome_exchange_settings(EPlugin *epl, EConfigHookItemFactoryData *data);
-GtkWidget *org_gnome_exchange_owa_url(EPlugin *epl, EConfigHookItemFactoryData *data);
-gboolean org_gnome_exchange_check_options(EPlugin *epl, EConfigHookPageCheckData *data);
-GtkWidget *org_gnome_exchange_auth_section (EPlugin *epl, EConfigHookItemFactoryData *data);
-void org_gnome_exchange_commit (EPlugin *epl, EConfigHookItemFactoryData *data);
-
-/* NB: This should be given a better name, it is NOT a camel service, it is only a camel-exchange one */
-typedef gboolean (CamelProviderValidateUserFunc) (CamelURL *camel_url, const char *url, gboolean *remember_password, CamelException *ex);
-
-#define OOF_INFO_FILE_NAME "oof_info.xml"
-
-typedef struct {
- CamelProviderValidateUserFunc *validate_user;
-}CamelProviderValidate;
-
-CamelServiceAuthType camel_exchange_ntlm_authtype = {
- /* i18n: "Secure Password Authentication" is an Outlookism */
- N_("Secure Password"),
-
- /* i18n: "NTLM" probably doesn't translate */
- N_("This option will connect to the Exchange server using "
- "secure password (NTLM) authentication."),
-
- "",
- TRUE
-};
-
-CamelServiceAuthType camel_exchange_password_authtype = {
- N_("Plaintext Password"),
-
- N_("This option will connect to the Exchange server using "
- "standard plaintext password authentication."),
-
- "Basic",
- TRUE
-};
-
-
-typedef struct {
- gboolean state;
- char *message;
- GtkWidget *text_view;
-}OOFData;
-
-OOFData *oof_data;
-
-static void
-free_exchange_listener (void)
-{
- g_object_unref (exchange_global_config_listener);
-}
-
-int
-e_plugin_lib_enable (EPluginLib *eplib, int enable)
-{
- if (!exchange_global_config_listener) {
- exchange_global_config_listener = exchange_config_listener_new ();
- g_atexit (free_exchange_listener);
- }
-
- return 0;
-}
-
-static void
-update_state (GtkTextBuffer *buffer, gpointer data)
-{
- if (gtk_text_buffer_get_modified (buffer)) {
- GtkTextIter start, end;
- if (oof_data->message)
- g_free (oof_data->message);
- gtk_text_buffer_get_bounds (buffer, &start, &end);
- oof_data->message = gtk_text_buffer_get_text (buffer, &start,
- &end, FALSE);
- gtk_text_buffer_set_modified (buffer, FALSE);
- }
-}
-
-static void
-toggled_state (GtkToggleButton *button, gpointer data)
-{
- gboolean current_oof_state = gtk_toggle_button_get_active (button);
-
- if (current_oof_state == oof_data->state)
- return;
- oof_data->state = current_oof_state;
- gtk_widget_set_sensitive (oof_data->text_view, current_oof_state);
-}
-
-
-/* only used in editor */
-GtkWidget *
-org_gnome_exchange_settings(EPlugin *epl, EConfigHookItemFactoryData *data)
-{
- EMConfigTargetAccount *target_account;
- const char *source_url;
- CamelURL *url;
- GtkWidget *oof_page;
- GtkWidget *oof_table;
- GtkWidget *oof_description, *label_status, *label_empty;
- GtkWidget *radiobutton_inoff, *radiobutton_oof;
- GtkWidget *vbox_oof, *vbox_oof_message;
- GtkWidget *oof_frame;
- GtkWidget *scrolledwindow_oof;
- GtkWidget *textview_oof;
- GtkTextBuffer *buffer;
- GtkTextIter start, end;
- char *txt, *oof_message;
- gboolean oof_state;
- ExchangeAccount *account = NULL;
- GSList *accounts = NULL;
- GSList *acc = NULL;
- gchar *message = NULL;
-
- target_account = (EMConfigTargetAccount *)data->config->target;
- source_url = e_account_get_string (target_account->account, E_ACCOUNT_SOURCE_URL);
- url = camel_url_new(source_url, NULL);
- if (url == NULL
- || strcmp(url->protocol, "exchange") != 0) {
- if (url)
- camel_url_free(url);
- return NULL;
- }
-
- if (data->old) {
- camel_url_free(url);
- return data->old;
- }
-
- accounts = exchange_config_listener_get_accounts (exchange_global_config_listener);
- for (acc = accounts; acc; acc = acc->next) {
- printf ("Inside loop\n");
- account = acc->data;
- }
- oof_data = g_new0 (OOFData, 1);
-
- oof_data->state = FALSE;
- oof_data->message = NULL;
- oof_data->text_view = NULL;
-
- /* See if oof info found already */
-
- if (!exchange_oof_get (account, &oof_state, &message)) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
- _("Could not read out-of-office state"));
- return NULL;
- }
-
- if (message && *message)
- oof_data->message = g_strdup (message);
- else
- oof_data->message = NULL;
- oof_data->state = oof_state;
-
-
- /* construct page */
- oof_page = gtk_vbox_new (FALSE, 6);
- gtk_container_set_border_width (GTK_CONTAINER (oof_page), 12);
-
- /* Description section */
-
- oof_description = gtk_label_new (_("The message specified below will be automatically sent to \neach person who sends mail to you while you are out of the office."));
- gtk_label_set_justify (GTK_LABEL (oof_description), GTK_JUSTIFY_LEFT);
- gtk_label_set_line_wrap (GTK_LABEL (oof_description), TRUE);
- gtk_misc_set_alignment (GTK_MISC (oof_description), 0.5, 0.5);
- gtk_misc_set_padding (GTK_MISC (oof_description), 0, 18);
-
- gtk_box_pack_start (GTK_BOX (oof_page), oof_description, FALSE, TRUE, 0);
-
- /* Table with out of office radio buttons */
-
- oof_table = gtk_table_new (2, 2, FALSE);
- gtk_table_set_col_spacings (GTK_TABLE (oof_table), 6);
- gtk_table_set_row_spacings (GTK_TABLE (oof_table), 6);
- gtk_box_pack_start (GTK_BOX (oof_page), oof_table, FALSE, FALSE, 0);
-
- /* translators: exchange out of office status header */
- txt = g_strdup_printf("<b>%s</b>", _("Status:"));
- label_status = gtk_label_new (txt);
- g_free(txt);
- gtk_label_set_justify (GTK_LABEL (label_status), GTK_JUSTIFY_CENTER);
- gtk_misc_set_alignment (GTK_MISC (label_status), 0, 0.5);
- gtk_misc_set_padding (GTK_MISC (label_status), 0, 0);
- gtk_label_set_use_markup (GTK_LABEL (label_status), TRUE);
- gtk_table_attach (GTK_TABLE (oof_table), label_status, 0, 1, 0, 1,
- GTK_FILL, GTK_FILL, 0, 0);
-
- if (oof_data->state) {
- radiobutton_oof = gtk_radio_button_new_with_label (NULL,
- _("I am out of the office"));
- radiobutton_inoff = gtk_radio_button_new_with_label_from_widget (
- GTK_RADIO_BUTTON (radiobutton_oof),
- _("I am in the office"));
- }
- else {
- radiobutton_inoff = gtk_radio_button_new_with_label (NULL,
- _("I am in the office"));
- radiobutton_oof = gtk_radio_button_new_with_label_from_widget (
- GTK_RADIO_BUTTON (radiobutton_inoff),
- _("I am out of the office"));
- }
-
- gtk_table_attach (GTK_TABLE (oof_table), radiobutton_inoff, 1, 2, 0, 1,
- GTK_FILL, GTK_FILL, 0, 0);
-
- label_empty = gtk_label_new ("");
- gtk_label_set_justify (GTK_LABEL (label_empty), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment (GTK_MISC (label_empty), 0, 0.5);
- gtk_misc_set_padding (GTK_MISC (label_empty), 0, 0);
- gtk_label_set_use_markup (GTK_LABEL (label_empty), FALSE);
- gtk_table_attach (GTK_TABLE (oof_table), label_empty, 0, 1, 1, 2,
- GTK_FILL, GTK_FILL, 0, 0);
- gtk_table_attach (GTK_TABLE (oof_table), radiobutton_oof, 1, 2, 1, 2,
- GTK_FILL, GTK_FILL, 0, 0);
-
- g_signal_connect (radiobutton_oof, "toggled", G_CALLBACK (toggled_state), NULL);
-
- /* frame containg oof message text box */
-
- vbox_oof = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (oof_page), vbox_oof, FALSE, FALSE, 0);
-
- oof_frame = gtk_frame_new ("");
- gtk_container_set_border_width (GTK_CONTAINER (oof_frame), 1);
- gtk_frame_set_shadow_type (GTK_FRAME (oof_frame), GTK_SHADOW_ETCHED_IN);
- gtk_frame_set_label (GTK_FRAME (oof_frame), _("Out of office Message:"));
- gtk_box_pack_start (GTK_BOX (vbox_oof), oof_frame, FALSE, FALSE, 0);
-
- vbox_oof_message = gtk_vbox_new (FALSE, 6);
- gtk_container_add (GTK_CONTAINER (oof_frame), vbox_oof_message);
-
- scrolledwindow_oof = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_oof),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (
- GTK_SCROLLED_WINDOW (scrolledwindow_oof),
- GTK_SHADOW_IN);
- gtk_box_pack_start (GTK_BOX (vbox_oof_message),
- scrolledwindow_oof, TRUE, TRUE, 0);
-
- textview_oof = gtk_text_view_new();
- gtk_text_view_set_justification (GTK_TEXT_VIEW (textview_oof),
- GTK_JUSTIFY_LEFT);
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (textview_oof),
- GTK_WRAP_WORD);
- gtk_text_view_set_editable (GTK_TEXT_VIEW (textview_oof), TRUE);
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview_oof));
- gtk_text_buffer_get_bounds (buffer, &start, &end);
- oof_message = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
- if (oof_message && *oof_message) {
- /* Will this ever happen? */
- oof_data->message = oof_message;
- }
- if (oof_data->message) {
- /* previuosly set message */
- gtk_text_buffer_set_text (buffer, oof_data->message, -1);
- gtk_text_view_set_buffer (GTK_TEXT_VIEW (textview_oof), buffer);
-
- }
- if (!oof_data->state)
- gtk_widget_set_sensitive (textview_oof, FALSE);
- oof_data->text_view = textview_oof;
- g_signal_connect (buffer, "changed", G_CALLBACK (update_state), NULL);
-
- gtk_container_add (GTK_CONTAINER (scrolledwindow_oof), textview_oof);
- gtk_widget_show_all (scrolledwindow_oof);
-
- gtk_widget_show_all (oof_page);
- gtk_notebook_insert_page (GTK_NOTEBOOK (data->parent), oof_page, gtk_label_new(_("Exchange Settings")), 4);
- return oof_page;
-}
-
-static void
-owa_authenticate_user(GtkWidget *button, EConfig *config)
-{
- EMConfigTargetAccount *target_account = (EMConfigTargetAccount *)config->target;
- CamelURL *url=NULL;
- gboolean remember_password;
- char *url_string;
- const char *source_url, *id_name;
- char *at, *user;
- gboolean valid = FALSE;
- ExchangeParams *exchange_params;
-
- exchange_params = g_new0 (ExchangeParams, 1);
- exchange_params->host = NULL;
- exchange_params->ad_server = NULL;
- exchange_params->mailbox = NULL;
- exchange_params->owa_path = NULL;
- exchange_params->is_ntlm = TRUE;
-
-
- source_url = e_account_get_string (target_account->account, E_ACCOUNT_SOURCE_URL);
-
- url = camel_url_new(source_url, NULL);
- if (url->user == NULL) {
- id_name = e_account_get_string (target_account->account, E_ACCOUNT_ID_ADDRESS);
- if (id_name) {
- at = strchr(id_name, '@');
- user = g_alloca(at-id_name+1);
- memcpy(user, id_name, at-id_name);
- user[at-id_name] = 0;
- camel_url_set_user (url, user);
- }
- }
-
- /* validate_user() CALLS GTK!!!
-
- THIS IS TOTALLY UNNACCEPTABLE!!!!!!!!
-
- It must use camel_session_ask_password, and it should return an exception for any problem,
- which should then be shown using e-error */
-
- valid = e2k_validate_user ((const char *)camel_url_get_param (url, "owa_url"),
- url->user, exchange_params, &remember_password);
- camel_url_set_host (url, valid ? exchange_params->host : "");
-
- if (valid)
- camel_url_set_authmech (url, exchange_params->is_ntlm ? "NTLM" : "Basic");
- camel_url_set_param (url, "ad_server", valid ? exchange_params->ad_server: NULL);
- camel_url_set_param (url, "mailbox", valid ? exchange_params->mailbox : NULL);
- camel_url_set_param (url, "owa_path", valid ? exchange_params->owa_path : NULL);
-
- g_free (exchange_params->owa_path);
- g_free (exchange_params->mailbox);
- g_free (exchange_params);
-
- if (valid) {
- url_string = camel_url_to_string (url, 0);
- e_account_set_string (target_account->account, E_ACCOUNT_SOURCE_URL, url_string);
- e_account_set_string (target_account->account, E_ACCOUNT_TRANSPORT_URL, url_string);
- e_account_set_bool (target_account->account, E_ACCOUNT_SOURCE_SAVE_PASSWD, remember_password);
- g_free (url_string);
- }
- camel_url_free (url);
-}
-
-static void
-owa_editor_entry_changed(GtkWidget *entry, EConfig *config)
-{
- const char *uri, *ssl = NULL;
- CamelURL *url, *owaurl = NULL;
- char *url_string;
- EMConfigTargetAccount *target = (EMConfigTargetAccount *)config->target;
- GtkWidget *button = g_object_get_data((GObject *)entry, "authenticate-button");
- int active = FALSE;
-
- /* NB: we set the button active only if we have a parsable uri entered */
-
- url = camel_url_new(e_account_get_string(target->account, E_ACCOUNT_SOURCE_URL), NULL);
- uri = gtk_entry_get_text((GtkEntry *)entry);
- if (uri && uri[0]) {
- camel_url_set_param(url, "owa_url", uri);
- owaurl = camel_url_new(uri, NULL);
- if (owaurl) {
- active = TRUE;
-
- /* Reading the owa url and setting use_ssl paramemter */
- if (!strcmp(owaurl->protocol, "https"))
- ssl = "always";
- camel_url_free(owaurl);
- }
- } else {
- camel_url_set_param(url, "owa_url", NULL);
- }
-
- camel_url_set_param(url, "use_ssl", ssl);
- gtk_widget_set_sensitive(button, active);
-
- url_string = camel_url_to_string(url, 0);
- e_account_set_string(target->account, E_ACCOUNT_SOURCE_URL, url_string);
- g_free(url_string);
-}
-
-static void
-destroy_label(GtkWidget *old, GtkWidget *label)
-{
- gtk_widget_destroy(label);
-}
-
-static char *
-construct_owa_url (CamelURL *url)
-{
- const char *owa_path, *use_ssl = NULL;
- const char *protocol = "http", *mailbox_name;
- char *owa_url;
-
- use_ssl = camel_url_get_param (url, "use_ssl");
- if (use_ssl) {
- if (!strcmp (use_ssl, "always"))
- protocol = "https";
- }
-
- owa_path = camel_url_get_param (url, "owa_path");
- if (!owa_path)
- owa_path = "/exchange";
- mailbox_name = camel_url_get_param (url, "mailbox");
-
- if (mailbox_name)
- owa_url = g_strdup_printf("%s://%s%s/%s", protocol, url->host, owa_path, mailbox_name);
- else
- owa_url = g_strdup_printf("%s://%s%s", protocol, url->host, owa_path );
-
- return owa_url;
-}
-
-/* used by editor and druid - same code */
-GtkWidget *
-org_gnome_exchange_owa_url(EPlugin *epl, EConfigHookItemFactoryData *data)
-{
- EMConfigTargetAccount *target_account;
- const char *source_url;
- char *owa_url = NULL;
- GtkWidget *owa_entry;
- CamelURL *url;
- int row;
- GtkWidget *hbox, *label, *button;
-
- target_account = (EMConfigTargetAccount *)data->config->target;
- source_url = e_account_get_string (target_account->account, E_ACCOUNT_SOURCE_URL);
- url = camel_url_new(source_url, NULL);
- if (url == NULL
- || strcmp(url->protocol, "exchange") != 0) {
- if (url)
- camel_url_free(url);
-
- if (data->old
- && (label = g_object_get_data((GObject *)data->old, "authenticate-label")))
- gtk_widget_destroy(label);
-
- /* TODO: we could remove 'owa-url' from the url,
- but that will lose it if we come back. Maybe a commit callback could do it */
-
- return NULL;
- }
-
- if (data->old) {
- camel_url_free(url);
- return data->old;
- }
-
- owa_url = g_strdup (camel_url_get_param(url, "owa_url"));
-
- /* if the host is null, then user+other info is dropped silently, force it to be kept */
- if (url->host == NULL) {
- char *uri;
-
- camel_url_set_host(url, "");
- uri = camel_url_to_string(url, 0);
- e_account_set_string(target_account->account, E_ACCOUNT_SOURCE_URL, uri);
- g_free(uri);
- }
-
- row = ((GtkTable *)data->parent)->nrows;
-
- hbox = gtk_hbox_new (FALSE, 6);
- label = gtk_label_new_with_mnemonic(_("_OWA Url:"));
- gtk_widget_show(label);
-
- owa_entry = gtk_entry_new();
-
- if (!owa_url) {
- if (url->host[0] != 0) {
- char *uri;
-
- /* url has hostname but not owa_url.
- * Account has been created using x-c-s or evo is upgraded to 2.2
- * When invoked from druid, hostname will get set after validation,
- * so this condition will never be true during account creation.
- */
- owa_url = construct_owa_url (url);
- camel_url_set_param (url, "owa_url", owa_url);
- uri = camel_url_to_string(url, 0);
- e_account_set_string(target_account->account, E_ACCOUNT_SOURCE_URL, uri);
- g_free(uri);
- }
- }
- if (owa_url)
- gtk_entry_set_text(GTK_ENTRY (owa_entry), owa_url);
- gtk_label_set_mnemonic_widget((GtkLabel *)label, owa_entry);
-
- button = gtk_button_new_with_mnemonic (_("A_uthenticate"));
- gtk_widget_set_sensitive (button, owa_url && owa_url[0]);
-
- gtk_box_pack_start (GTK_BOX (hbox), owa_entry, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
- gtk_widget_show_all(hbox);
-
- gtk_table_attach (GTK_TABLE (data->parent), label, 0, 1, row, row+1, 0, 0, 0, 0);
- gtk_table_attach (GTK_TABLE (data->parent), hbox, 1, 2, row, row+1, GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
-
- g_signal_connect (owa_entry, "changed", G_CALLBACK(owa_editor_entry_changed), data->config);
- g_object_set_data((GObject *)owa_entry, "authenticate-button", button);
- g_signal_connect (button, "clicked", G_CALLBACK(owa_authenticate_user), data->config);
-
- /* Track the authenticate label, so we can destroy it if e-config is to destroy the hbox */
- g_object_set_data((GObject *)hbox, "authenticate-label", label);
-
- g_free (owa_url);
- return hbox;
-}
-
-gboolean
-org_gnome_exchange_check_options(EPlugin *epl, EConfigHookPageCheckData *data)
-{
- EMConfigTargetAccount *target = (EMConfigTargetAccount *)data->config->target;
- int status = TRUE;
-
- /* We assume that if the host is set, then the setting is valid.
- The host gets set when the provider validate() call is made */
- /* We do this check for receive page also, so that user can
- * proceed with the account set up only after user is validated,
- * and host name is reset by validate() call
- */
- if (data->pageid == NULL ||
- strcmp (data->pageid, "10.receive") == 0 ||
- strcmp (data->pageid, "20.receive_options") == 0) {
- CamelURL *url;
-
- url = camel_url_new(e_account_get_string(target->account, E_ACCOUNT_SOURCE_URL), NULL);
- /* Note: we only care about exchange url's, we WILL get called on all other url's too. */
- if (url != NULL
- && strcmp(url->protocol, "exchange") == 0
- && (url->host == NULL || url->host[0] == 0))
- status = FALSE;
-
- if (url)
- camel_url_free(url);
- }
-
- return status;
-}
-
-static void
-set_oof_info ()
-{
- GSList *accounts, *acc;
- ExchangeAccount *account = NULL;
-
- accounts = exchange_config_listener_get_accounts (exchange_global_config_listener);
- for (acc = accounts; acc; acc = acc->next) {
- account = acc->data;
- }
-
- if (!exchange_oof_set (account, oof_data->state, oof_data->message)) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
- _("Could not update out-of-office state"));
- }
-
-}
-
-static void
-destroy_oof_data ()
-{
- if (oof_data->message)
- g_free (oof_data->message);
- g_free (oof_data);
-}
-
-void
-org_gnome_exchange_commit (EPlugin *epl, EConfigHookItemFactoryData *data)
-{
- EMConfigTargetAccount *target_account;
- target_account = (EMConfigTargetAccount *)data->config->target;
- const char *source_url;
- CamelURL *url;
-
- source_url = e_account_get_string (target_account->account, E_ACCOUNT_SOURCE_URL);
- url = camel_url_new (source_url, NULL);
- if (url == NULL
- || strcmp (url->protocol, "exchange") != 0) {
- if (url)
- camel_url_free (url);
-
- return;
- }
- if (data->old) {
- camel_url_free(url);
- return;
- }
-
- /* Set oof data in exchange account */
- set_oof_info ();
- destroy_oof_data ();
- return;
-}
-
-static void
-exchange_check_authtype (GtkWidget *w, EConfig *config)
-{
- return;
-}
-
-static void
-exchange_authtype_changed (GtkComboBox *dropdown, EConfig *config)
-{
- EMConfigTargetAccount *target = (EMConfigTargetAccount *)config->target;
- int id = gtk_combo_box_get_active(dropdown);
- GtkTreeModel *model;
- GtkTreeIter iter;
- CamelServiceAuthType *authtype;
- CamelURL *url_source, *url_transport;
- const char *source_url, *transport_url;
- char *source_url_string, *transport_url_string;
-
- source_url = e_account_get_string (target->account,
- E_ACCOUNT_SOURCE_URL);
- if (id == -1)
- return;
-
- url_source = camel_url_new (source_url, NULL);
-
- transport_url = e_account_get_string (target->account,
- E_ACCOUNT_TRANSPORT_URL);
- url_transport = camel_url_new (transport_url, NULL);
-
- model = gtk_combo_box_get_model(dropdown);
- if (gtk_tree_model_iter_nth_child(model, &iter, NULL, id)) {
- gtk_tree_model_get(model, &iter, 1, &authtype, -1);
- if (authtype) {
- camel_url_set_authmech(url_source, authtype->authproto);
- camel_url_set_authmech(url_transport, authtype->authproto);
- }
- else {
- camel_url_set_authmech(url_source, NULL);
- camel_url_set_authmech(url_transport, NULL);
- }
-
- source_url_string = camel_url_to_string(url_source, 0);
- transport_url_string = camel_url_to_string(url_transport, 0);
- e_account_set_string(target->account, E_ACCOUNT_SOURCE_URL, source_url_string);
- e_account_set_string(target->account, E_ACCOUNT_TRANSPORT_URL, transport_url_string);
- g_free(source_url_string);
- g_free(transport_url_string);
- }
- camel_url_free(url_source);
- camel_url_free(url_transport);
-}
-
-
-GtkWidget *
-org_gnome_exchange_auth_section (EPlugin *epl, EConfigHookItemFactoryData *data)
-{
- EMConfigTargetAccount *target_account;
- const char *source_url;
- char *label_text;
- CamelURL *url;
- GtkWidget *hbox, *button, *auth_label, *vbox, *label_hide;
- GtkComboBox *dropdown;
- GtkTreeIter iter;
- GtkListStore *store;
- int i, active=0, auth_changed_id = 0;
- GList *authtypes, *l, *ll;
-
- target_account = (EMConfigTargetAccount *)data->config->target;
- source_url = e_account_get_string (target_account->account,
- E_ACCOUNT_SOURCE_URL);
- url = camel_url_new (source_url, NULL);
- if (url == NULL
- || strcmp (url->protocol, "exchange") != 0) {
- if (url)
- camel_url_free (url);
-
- return NULL;
- }
-
- if (data->old) {
- camel_url_free(url);
- return data->old;
- }
-
- vbox = gtk_vbox_new (FALSE, 6);
-
- label_text = g_strdup_printf("<b>%s</b>", _("Authentication Type"));
- auth_label = gtk_label_new (label_text);
- g_free (label_text);
- gtk_label_set_justify (GTK_LABEL (auth_label), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment (GTK_MISC (auth_label), 0, 0.5);
- gtk_misc_set_padding (GTK_MISC (auth_label), 0, 0);
- gtk_label_set_use_markup (GTK_LABEL (auth_label), TRUE);
-
- label_hide = gtk_label_new("\n");
-
- hbox = gtk_hbox_new (FALSE, 6);
-
- dropdown = (GtkComboBox * )gtk_combo_box_new ();
-
- button = gtk_button_new_with_mnemonic (_("Ch_eck for Supported Types"));
-
- authtypes = g_list_prepend (g_list_prepend (NULL, &camel_exchange_password_authtype),
- &camel_exchange_ntlm_authtype);
- store = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN);
-
- for (i=0, l=authtypes; l; l=l->next, i++) {
- CamelServiceAuthType *authtype = l->data;
- int avail = TRUE;
-
- if (authtypes) {
- for (ll = authtypes; ll; ll = g_list_next(ll))
- if (!strcmp(authtype->authproto,
- ((CamelServiceAuthType *)ll->data)->authproto))
- break;
- avail = ll != NULL;
- }
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, authtype->name, 1,
- authtype, 2, !avail, -1);
-
- if (url && url->authmech && !strcmp(url->authmech, authtype->authproto))
- active = i;
- }
-
- gtk_combo_box_set_model (dropdown, (GtkTreeModel *)store);
- gtk_combo_box_set_active (dropdown, -1);
-
- if (auth_changed_id == 0) {
- GtkCellRenderer *cell = gtk_cell_renderer_text_new();
-
- gtk_cell_layout_pack_start ((GtkCellLayout *)dropdown, cell, TRUE);
- gtk_cell_layout_set_attributes ((GtkCellLayout *)dropdown, cell,
- "text", 0, "strikethrough", 2, NULL);
-
- auth_changed_id = g_signal_connect (dropdown,
- "changed",
- G_CALLBACK (exchange_authtype_changed),
- data->config);
- g_signal_connect (button,
- "clicked",
- G_CALLBACK(exchange_check_authtype),
- data->config);
- }
-
- gtk_combo_box_set_active(dropdown, active);
-
- gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (dropdown), FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
-
- gtk_box_pack_start (GTK_BOX (vbox), auth_label, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), label_hide, TRUE, TRUE, 0);
- gtk_widget_show_all (vbox);
-
- gtk_box_pack_start (GTK_BOX (data->parent), vbox, TRUE, TRUE, 0);
-
- if (url)
- camel_url_free(url);
- g_list_free (authtypes);
-
- return vbox;
-}
diff --git a/plugins/exchange-account-setup/exchange-ask-password.c b/plugins/exchange-account-setup/exchange-ask-password.c
deleted file mode 100644
index c21bd67c07..0000000000
--- a/plugins/exchange-account-setup/exchange-ask-password.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Sushma Rai <rsushma@novell.com>
- * Copyright (C) 2004 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <string.h>
-#include <libgnome/gnome-i18n.h>
-#include <glade/glade.h>
-#include <gtk/gtk.h>
-#include <gtk/gtkdialog.h>
-#include <camel/camel-provider.h>
-#include <camel/camel-url.h>
-#include "mail/em-account-editor.h"
-#include "mail/em-config.h"
-#include "e-util/e-account.h"
-#include "e-util/e-passwords.h"
-#include "e-util/e-config.h"
-
-int e_plugin_lib_enable (EPluginLib *ep, int enable);
-void exchange_options_commit (EPlugin *epl, EConfigHookItemFactoryData *data);
-GtkWidget *org_gnome_exchange_read_url (EPlugin *epl, EConfigHookItemFactoryData *data);
-gboolean org_gnome_exchange_check_options (EPlugin *epl, EConfigHookPageCheckData *data);
-
-const char *owa_entry_text = NULL;
-
-typedef gboolean (CamelProviderValidateUserFunc) (CamelURL *camel_url, const char *url, gboolean *remember_password, CamelException *ex);
-
-typedef struct {
- CamelProviderValidateUserFunc *validate_user;
-}CamelProviderValidate;
-
-int
-e_plugin_lib_enable (EPluginLib *ep, int enable)
-{
- if (enable) {
- }
- return 0;
-}
-
-void
-exchange_options_commit (EPlugin *epl, EConfigHookItemFactoryData *data)
-{
- return;
-}
-
-static gboolean
-validate_exchange_user (void *data)
-{
- EMConfigTargetAccount *target_account = data;
- CamelProviderValidate *validate;
- CamelURL *url=NULL;
- CamelProvider *provider = NULL;
- gboolean valid = FALSE, *remember_password;
- char *account_url, *url_string;
- const char *source_url, *id_name;
- static int count = 0;
- char *at, *user;
-
- if (count)
- return valid;
-
- source_url = e_account_get_string (target_account->account,
- E_ACCOUNT_SOURCE_URL);
- account_url = g_strdup (source_url);
- provider = camel_provider_get (account_url, NULL);
- if (!provider) {
- return FALSE; /* This should never happen */
- }
- url = camel_url_new_with_base (NULL, account_url);
- validate = provider->priv;
- if (validate) {
-
- if (url->user == NULL) {
- id_name = e_account_get_string (target_account->account,
- E_ACCOUNT_ID_ADDRESS);
- if (id_name) {
- at = strchr(id_name, '@');
- user = g_alloca(at-id_name+1);
- memcpy(user, id_name, at-id_name);
- user[at-id_name] = 0;
-
- camel_url_set_user (url, user);
- }
- }
- valid = validate->validate_user (url, owa_entry_text,
- remember_password, NULL);
- }
-
- /* FIXME: need to check for return value */
- if (valid) {
- count ++;
- url_string = camel_url_to_string (url, 0);
- e_account_set_string (target_account->account,
- E_ACCOUNT_SOURCE_URL, url_string);
- e_account_set_string (target_account->account,
- E_ACCOUNT_TRANSPORT_URL, url_string);
- target_account->account->source->save_passwd = *remember_password;
- }
-
- camel_url_free (url);
- g_free (account_url);
- return valid;
-}
-
-static void
-ok_button_clicked (GtkWidget *button, void *data)
-{
- gboolean valid = FALSE;
-
- valid = validate_exchange_user (data); // FIXME: return value
-}
-
-static void
-owa_entry_changed (GtkWidget *entry, void *data)
-{
- GtkWidget *button = data;
-
- /* FIXME: return owa_entry_text instead of making it global */
- owa_entry_text = gtk_entry_get_text (GTK_ENTRY (entry));
- if (owa_entry_text)
- gtk_widget_set_sensitive (button, TRUE);
-}
-
-static GtkWidget *
-add_owa_entry (GtkWidget *parent,
- EConfig *config,
- EMConfigTargetAccount *target_account)
-{
- GtkWidget *section, *owa_entry;
- GtkWidget *hbox, *hbox_inner, *label, *button;
- GList *container_list, *l;
- GValue rows = { 0, };
- GValue cols = { 0, };
- gint n_rows, n_cols;
-
- /* Since configure section in the receive page is not plugin enabled
- * traversing through the container hierarchy to get the reference
- * to the table, to which owa_url entry has to be added.
- * This needs to be changed once we can access configure section from
- * the plugin.
- */
-
- container_list = gtk_container_get_children (GTK_CONTAINER (parent));
- l = g_list_nth (container_list, 1); /* vboxsourceborder */
- container_list = gtk_container_get_children (GTK_CONTAINER (l->data));
- l = g_list_nth (container_list, 0); /* sourcevbox */
- container_list = gtk_container_get_children (GTK_CONTAINER (l->data));
- l = g_list_nth (container_list, 2); /* source frame */
- container_list = gtk_container_get_children (GTK_CONTAINER (l->data));
- l = g_list_nth (container_list, 1); /* hbox173 */
- container_list = gtk_container_get_children (GTK_CONTAINER (l->data));
- l = g_list_nth (container_list, 1); /* table 13 */
- container_list = gtk_container_get_children (GTK_CONTAINER (l->data));
- l = g_list_nth (container_list, 0); /* table 4*/
-
- g_value_init (&rows, G_TYPE_INT);
- g_value_init (&cols, G_TYPE_INT);
- g_object_get_property (G_OBJECT (l->data), "n-rows", &rows);
- g_object_get_property (G_OBJECT (l->data), "n-columns", &cols);
- n_rows = g_value_get_int (&rows);
- n_cols = g_value_get_int (&cols);
-
- hbox = gtk_hbox_new (FALSE, 6);
- gtk_widget_show (hbox);
-
- hbox_inner = gtk_hbox_new (FALSE, 6);
- gtk_widget_show (hbox_inner);
-
- owa_entry = gtk_entry_new ();
- gtk_widget_show (owa_entry);
-
- button = gtk_button_new_with_mnemonic (_("A_uthenticate"));
- gtk_widget_set_sensitive (button, FALSE);
- gtk_widget_show (button);
-
- gtk_box_pack_start (GTK_BOX (hbox_inner), owa_entry, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (hbox_inner), button, TRUE, TRUE, 0);
-
- label = gtk_label_new_with_mnemonic(_("_OWA Url:"));
- gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
- gtk_widget_show (label);
-
- gtk_box_pack_start (GTK_BOX (hbox), hbox_inner, TRUE, TRUE, 0);
-
- gtk_table_attach (GTK_TABLE (l->data), label, 0, n_cols-1, n_rows, n_rows+1, GTK_FILL, GTK_FILL, 0, 0);
- gtk_table_attach (GTK_TABLE (l->data), hbox, n_cols-1, n_cols, n_rows, n_rows+1, GTK_FILL, GTK_FILL, 0, 0);
-
- gtk_widget_show (GTK_WIDGET (l->data));
-
- g_signal_connect (owa_entry, "changed",
- G_CALLBACK (owa_entry_changed), button);
- g_signal_connect (button, "clicked",
- G_CALLBACK (ok_button_clicked), target_account);
-
- section = gtk_vbox_new (FALSE, 0);
- gtk_widget_hide (section);
- return section; /* FIXME: return entry */
-}
-
-GtkWidget *
-org_gnome_exchange_read_url (EPlugin *epl, EConfigHookItemFactoryData *data)
-{
- EMConfigTargetAccount *target_account;
- EConfig *config;
- char *account_url = NULL, *exchange_url = NULL;
- const char *source_url;
- GtkWidget *owa_entry = NULL, *parent;
-
- config = data->config;
- target_account = (EMConfigTargetAccount *)data->config->target;
-
- source_url = e_account_get_string (target_account->account,
- E_ACCOUNT_SOURCE_URL);
- account_url = g_strdup (source_url);
- exchange_url = g_strrstr (account_url, "exchange");
-
- if (exchange_url) {
- if (data->old)
- return data->old;
-
- parent = data->parent;
- owa_entry = add_owa_entry (parent, config, target_account);
- }
- g_free (account_url);
- return owa_entry;
-}
-
-
-GtkWidget *
-org_gnome_exchange_handle_auth (EPlugin *epl, EConfigHookItemFactoryData *data)
-{
- EMConfigTargetAccount *target_account;
- EConfig *config;
- char *account_url = NULL, *exchange_url = NULL, *url_string;
- const char *source_url;
- char *auth_type;
- GtkWidget *auth_section=NULL, *parent, *section;
-
- config = data->config;
- target_account = (EMConfigTargetAccount *)data->config->target;
-
- source_url = e_account_get_string (target_account->account,
- E_ACCOUNT_SOURCE_URL);
- account_url = g_strdup (source_url);
- exchange_url = g_strrstr (account_url, "exchange");
-
- if (exchange_url) {
- parent = data->parent;
-
- /* We don't need auth section while creating the account. But
- * we need that in the Editor. And since we get the child vbox
- * from the plugin, we are finding the parent section and
- * hiding it. This is a temporary fix and this needs to be handled
- * in the proper way. */
- section = gtk_widget_get_parent (gtk_widget_get_parent (parent));
- gtk_widget_hide (section);
- }
- auth_section = gtk_entry_new ();
- gtk_widget_hide (auth_section);
- return auth_section;
-}
-
-GtkWidget *
-org_gnome_exchange_handle_send_auth_option (EPlugin *epl, EConfigHookItemFactoryData *data)
-{
- EMConfigTargetAccount *target_account;
- EConfig *config;
- char *account_url = NULL, *exchange_url = NULL, *url_string;
- const char *source_url;
- char *auth_type;
- GtkWidget *auth_section=NULL, *parent, *section;
-
- config = data->config;
- target_account = (EMConfigTargetAccount *)data->config->target;
-
- source_url = e_account_get_string (target_account->account,
- E_ACCOUNT_SOURCE_URL);
- account_url = g_strdup (source_url);
- exchange_url = g_strrstr (account_url, "exchange");
-
- if (exchange_url) {
- parent = data->parent;
- /* We don't need auth section while creating the account. But
- * we need that in the Editor. And since we get the child vbox
- * from the plugin, we are finding the parent section and
- * hiding it. This is a temporary fix and this needs to be handled
- * in the proper way. */
- section = gtk_widget_get_parent (
- gtk_widget_get_parent (gtk_widget_get_parent(parent)));
- gtk_widget_hide (section);
- }
- auth_section = gtk_entry_new ();
- gtk_widget_hide (auth_section);
- return auth_section;
-}
-
-gboolean
-org_gnome_exchange_check_options (EPlugin *epl, EConfigHookPageCheckData *data)
-{
- EMConfigTargetAccount *target_account;
- EConfig *config;
- char *account_url = NULL, *exchange_url = NULL, *url_string;
- char *use_ssl = NULL;
- static int page_check_count = 0;
- CamelURL *url;
-
- if ((strcmp (data->pageid, "20.receive_options")) || page_check_count)
- return TRUE;
-
- config = data->config;
- target_account = (EMConfigTargetAccount *)data->config->target;
- account_url = g_strdup (target_account->account->source->url);
- exchange_url = g_strrstr (account_url, "exchange");
-
- if (exchange_url) {
- page_check_count ++;
-
- if (owa_entry_text){
- if (!strncmp (owa_entry_text, "https:", 6))
- use_ssl = "always";
-
- url = camel_url_new_with_base (NULL, account_url);
-
- if (use_ssl)
- camel_url_set_param (url, "use_ssl", use_ssl);
- camel_url_set_param (url, "owa_url", owa_entry_text);
-
- url_string = camel_url_to_string (url, 0);
- e_account_set_string (target_account->account,
- E_ACCOUNT_SOURCE_URL, url_string);
- camel_url_free (url);
- }
- }
- return TRUE;
-}
diff --git a/plugins/exchange-account-setup/exchange-change-password.c b/plugins/exchange-account-setup/exchange-change-password.c
deleted file mode 100644
index 0e1e13265b..0000000000
--- a/plugins/exchange-account-setup/exchange-change-password.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* Copyright (C) 2004 Novell, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* exchange-change-password: Change Password code */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "exchange-change-password.h"
-#include <exchange-account.h>
-#include <e2k-utils.h>
-
-#include <glade/glade-xml.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtklabel.h>
-
-#define FILENAME EVOLUTION_GLADEDIR "/exchange-change-password.glade"
-#define ROOTNODE "pass_dialog"
-#define STARTNODE "pass_vbox"
-
-static void
-entry_changed (GtkEntry *entry, gpointer user_data)
-{
- GladeXML *xml = user_data;
- GtkEntry *new_entry, *confirm_entry;
- GtkWidget *ok_button;
- const char *text;
-
- new_entry = GTK_ENTRY (glade_xml_get_widget (xml, "new_pass_entry"));
- confirm_entry = GTK_ENTRY (glade_xml_get_widget (xml, "confirm_pass_entry"));
- ok_button = glade_xml_get_widget (xml, "okbutton1");
-
- text = gtk_entry_get_text (new_entry);
- if (!text || !*text) {
- gtk_widget_set_sensitive (ok_button, FALSE);
- return;
- }
-
- text = gtk_entry_get_text (confirm_entry);
- if (!text || !*text) {
- gtk_widget_set_sensitive (ok_button, FALSE);
- return;
- }
-
- gtk_widget_set_sensitive (ok_button, TRUE);
-}
-
-/**
- * exchange_get_new_password:
- * @existing_password: The user's current password
- * @voluntary: %TRUE if the user has chosen "Change Password",
- * %FALSE if their old password has expired.
- *
- * Prompt the user for a new password.
- */
-char *
-exchange_get_new_password (const char *existing_password, gboolean voluntary)
-{
- GladeXML *xml;
- GtkWidget *top_widget;
- GtkEntry *cur_entry, *new_entry, *confirm_entry;
- GtkResponseType response;
- GtkLabel *top_label;
- char *new_pass;
-
- xml = glade_xml_new (FILENAME, ROOTNODE, NULL);
- top_widget = glade_xml_get_widget (xml, ROOTNODE);
-
- cur_entry = GTK_ENTRY (glade_xml_get_widget (xml, "current_pass_entry"));
- new_entry = GTK_ENTRY (glade_xml_get_widget (xml, "new_pass_entry"));
- g_signal_connect (new_entry, "changed",
- G_CALLBACK (entry_changed), xml);
- confirm_entry = GTK_ENTRY (glade_xml_get_widget (xml, "confirm_pass_entry"));
- g_signal_connect (confirm_entry, "changed",
- G_CALLBACK (entry_changed), xml);
- entry_changed (NULL, xml);
-
- top_label = GTK_LABEL (glade_xml_get_widget (xml, "pass_label"));
- if (voluntary)
- gtk_widget_hide (GTK_WIDGET (top_label));
-
-run_dialog_again:
- response = gtk_dialog_run (GTK_DIALOG (top_widget));
- if (response == GTK_RESPONSE_OK) {
- const char *cur_pass, *new_pass1, *new_pass2;
-
- cur_pass = gtk_entry_get_text (cur_entry);
- new_pass1 = gtk_entry_get_text (new_entry);
- new_pass2 = gtk_entry_get_text (confirm_entry);
-
- if (existing_password) {
- if (strcmp (cur_pass, existing_password) != 0) {
- /* User entered a wrong existing
- * password. Prompt him again.
- */
- gtk_label_set_text (top_label, _("The current password does not match the existing password for your account. Please enter the correct password"));
- gtk_widget_show (GTK_WIDGET (top_label));
- goto run_dialog_again;
- }
- }
-
- if (strcmp (new_pass1, new_pass2) != 0) {
- gtk_label_set_text (top_label, _("The two passwords do not match. Please re-enter the passwords."));
- gtk_widget_show (GTK_WIDGET (top_label));
- goto run_dialog_again;
- }
-
- new_pass = g_strdup (new_pass1);
- } else
- new_pass = NULL;
-
- gtk_widget_destroy (top_widget);
- g_object_unref (xml);
-
- return new_pass;
-}
diff --git a/plugins/exchange-account-setup/exchange-change-password.glade b/plugins/exchange-account-setup/exchange-change-password.glade
deleted file mode 100644
index fa49da6270..0000000000
--- a/plugins/exchange-account-setup/exchange-change-password.glade
+++ /dev/null
@@ -1,243 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="pass_dialog">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Change Password</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">True</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
-
- <child>
- <widget class="GtkButton" id="cancelbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="okbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="pass_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Your current password has expired. Please change your password now.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0.52</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">6</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="current_pass_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Current Password:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="new_pass_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">New Password:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="confirm_pass_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Confirm Password:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="new_pass_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">False</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="confirm_pass_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">False</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="current_pass_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">False</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_padding">12</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/plugins/exchange-account-setup/exchange-change-password.h b/plugins/exchange-account-setup/exchange-change-password.h
deleted file mode 100644
index 155fff897b..0000000000
--- a/plugins/exchange-account-setup/exchange-change-password.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* Copyright (C) 2004 Novell, Inc. */
-
-#ifndef __EXCHANGE_CHANGE_PASSWORD_H__
-#define __EXCHANGE_CHANGE_PASSWORD_H__
-
-#include <exchange/exchange-types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-char *exchange_get_new_password (const char *existing_password,
- gboolean voluntary);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __EXCHANGE_CHANGE_PASSWORD_H__ */
diff --git a/plugins/exchange-account-setup/exchange-delegates-user.c b/plugins/exchange-account-setup/exchange-delegates-user.c
deleted file mode 100644
index 38166747f4..0000000000
--- a/plugins/exchange-account-setup/exchange-delegates-user.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* Copyright (C) 2002-2004 Novell, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* ExchangeDelegatesUser: A single delegate */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "exchange-delegates-user.h"
-
-#include "e2k-global-catalog.h"
-#include "e2k-marshal.h"
-#include "e2k-sid.h"
-#include "e2k-utils.h"
-
-#include <e-util/e-dialog-utils.h>
-#include <e-util/e-dialog-widgets.h>
-#include <e-util/e-gtk-utils.h>
-#include <glade/glade.h>
-#include <gtk/gtkbox.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkmenuitem.h>
-#include <gtk/gtkmenushell.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtktogglebutton.h>
-
-#undef GTK_DISABLE_DEPRECATED
-#include <gtk/gtkoptionmenu.h>
-
-#include <string.h>
-
-#define EXCHANGE_DELEGATES_USER_SEPARATOR -2
-#define EXCHANGE_DELEGATES_USER_CUSTOM -3
-/* Can't use E2K_PERMISSIONS_ROLE_CUSTOM, because it's -1, which
- * means "end of list" to e_dialog_option_menu_get/set
- */
-
-static const int exchange_perm_map[] = {
- E2K_PERMISSIONS_ROLE_NONE,
- E2K_PERMISSIONS_ROLE_REVIEWER,
- E2K_PERMISSIONS_ROLE_AUTHOR,
- E2K_PERMISSIONS_ROLE_EDITOR,
-
- EXCHANGE_DELEGATES_USER_SEPARATOR,
- EXCHANGE_DELEGATES_USER_CUSTOM,
-
- -1
-};
-
-const char *exchange_delegates_user_folder_names[] = {
- "calendar", "tasks", "inbox", "contacts"
-};
-static const char *widget_names[] = {
- "calendar_perms", "task_perms", "inbox_perms", "contact_perms",
-};
-
-
-enum {
- EDITED,
- LAST_SIGNAL
-};
-
-static guint signals [LAST_SIGNAL] = { 0 };
-
-#define PARENT_TYPE G_TYPE_OBJECT
-static GObjectClass *parent_class = NULL;
-
-static void
-finalize (GObject *object)
-{
- ExchangeDelegatesUser *user = EXCHANGE_DELEGATES_USER (object);
-
- if (user->display_name)
- g_free (user->display_name);
- if (user->dn)
- g_free (user->dn);
- if (user->entryid)
- g_byte_array_free (user->entryid, TRUE);
- if (user->sid)
- g_object_unref (user->sid);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-class_init (GObjectClass *object_class)
-{
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->finalize = finalize;
-
- /* signals */
- signals[EDITED] =
- g_signal_new ("edited",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ExchangeDelegatesUserClass, edited),
- NULL, NULL,
- e2k_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-}
-
-E2K_MAKE_TYPE (exchange_delegates_user, ExchangeDelegatesUser, class_init, NULL, PARENT_TYPE)
-
-static inline gboolean
-is_delegate_role (E2kPermissionsRole role)
-{
- return (role == E2K_PERMISSIONS_ROLE_NONE ||
- role == E2K_PERMISSIONS_ROLE_REVIEWER ||
- role == E2K_PERMISSIONS_ROLE_AUTHOR ||
- role == E2K_PERMISSIONS_ROLE_EDITOR);
-}
-
-static void
-set_perms (GtkWidget *omenu, E2kPermissionsRole role)
-{
- if (!is_delegate_role (role)) {
- GtkWidget *menu, *item;
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (omenu));
-
- item = gtk_menu_item_new ();
- gtk_widget_set_sensitive (item, FALSE);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-
- item = gtk_menu_item_new_with_label (_("Custom"));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-
- gtk_widget_show_all (menu);
-
- role = EXCHANGE_DELEGATES_USER_CUSTOM;
- }
-
- e_dialog_option_menu_set (omenu, role, exchange_perm_map);
-}
-
-static void
-parent_window_destroyed (gpointer dialog, GObject *where_parent_window_was)
-{
- gtk_dialog_response (dialog, GTK_RESPONSE_CANCEL);
-}
-
-/**
- * exchange_delegates_user_edit:
- * @user: a delegate
- * @parent_window: parent window for the editor dialog
- *
- * Brings up a dialog to edit @user's permissions as a delegate.
- * An %edited signal will be emitted if anything changed.
- *
- * Return value: %TRUE for "OK", %FALSE for "Cancel".
- **/
-gboolean
-exchange_delegates_user_edit (ExchangeDelegatesUser *user,
- GtkWidget *parent_window)
-{
- GladeXML *xml;
- GtkWidget *dialog, *table, *label, *menu, *check;
- char *title;
- int button, i;
- E2kPermissionsRole role;
- gboolean modified;
-
- g_return_val_if_fail (EXCHANGE_IS_DELEGATES_USER (user), FALSE);
- g_return_val_if_fail (E2K_IS_SID (user->sid), FALSE);
-
- /* Grab the Glade widgets */
- xml = glade_xml_new (
- CONNECTOR_GLADEDIR "/exchange-delegates.glade",
- "delegate_permissions", PACKAGE);
- g_return_val_if_fail (xml, FALSE);
-
- title = g_strdup_printf (_("Permissions for %s"), user->display_name);
-
- dialog = glade_xml_get_widget (xml, "delegate_permissions");
- gtk_window_set_title (GTK_WINDOW (dialog), title);
- e_dialog_set_transient_for (GTK_WINDOW (dialog), parent_window);
-
- table = glade_xml_get_widget (xml, "toplevel_table");
- gtk_widget_reparent (table, GTK_DIALOG (dialog)->vbox);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 6);
-
- label = glade_xml_get_widget (xml, "delegate_label");
- gtk_label_set_text (GTK_LABEL (label), title);
- g_free (title);
-
- /* Set up the permissions */
- for (i = 0; i < EXCHANGE_DELEGATES_LAST; i++) {
- menu = glade_xml_get_widget (xml, widget_names[i]);
- set_perms (menu, user->role[i]);
- }
- check = glade_xml_get_widget (xml, "see_private_checkbox");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
- user->see_private);
-
- /* Run the dialog, while watching its parent. */
- g_object_weak_ref (G_OBJECT (parent_window),
- parent_window_destroyed, dialog);
- g_object_add_weak_pointer (G_OBJECT (parent_window),
- (void **)&parent_window);
- button = gtk_dialog_run (GTK_DIALOG (dialog));
- if (parent_window) {
- g_object_remove_weak_pointer (G_OBJECT (parent_window),
- (void **)&parent_window);
- g_object_weak_unref (G_OBJECT (parent_window),
- parent_window_destroyed, dialog);
- }
-
- if (button != GTK_RESPONSE_OK) {
- gtk_widget_destroy (dialog);
- return FALSE;
- }
-
- /* And update */
- modified = FALSE;
- for (i = 0; i < EXCHANGE_DELEGATES_LAST; i++) {
- menu = glade_xml_get_widget (xml, widget_names[i]);
- role = e_dialog_option_menu_get (menu, exchange_perm_map);
-
- if (is_delegate_role (user->role[i]) &&
- user->role[i] != role) {
- user->role[i] = role;
- modified = TRUE;
- }
- }
- check = glade_xml_get_widget (xml, "see_private_checkbox");
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)) !=
- user->see_private) {
- user->see_private = !user->see_private;
- modified = TRUE;
- }
-
- g_object_unref (xml);
- gtk_widget_destroy (dialog);
-
- if (modified)
- g_signal_emit (user, signals[EDITED], 0);
-
- return TRUE;
-}
-
-/**
- * exchange_delegates_user_new:
- * @display_name: the delegate's (UTF8) display name
- *
- * Return value: a new delegate user with default permissions (but
- * with most of the internal data blank).
- **/
-ExchangeDelegatesUser *
-exchange_delegates_user_new (const char *display_name)
-{
- ExchangeDelegatesUser *user;
- int i;
-
- user = g_object_new (EXCHANGE_TYPE_DELEGATES_USER, NULL);
- user->display_name = g_strdup (display_name);
-
- for (i = 0; i < EXCHANGE_DELEGATES_LAST; i++) {
- if (i == EXCHANGE_DELEGATES_CALENDAR ||
- i == EXCHANGE_DELEGATES_TASKS)
- user->role[i] = E2K_PERMISSIONS_ROLE_EDITOR;
- else
- user->role[i] = E2K_PERMISSIONS_ROLE_NONE;
- }
-
- return user;
-}
-
-/**
- * exchange_delegates_user_new_from_gc:
- * @gc: the global catalog object
- * @email: email address of the new delegate
- * @creator_entryid: The value of the PR_CREATOR_ENTRYID property
- * on the LocalFreebusy file.
- *
- * Return value: a new delegate user with default permissions and
- * internal data filled in from the global catalog.
- **/
-ExchangeDelegatesUser *
-exchange_delegates_user_new_from_gc (E2kGlobalCatalog *gc,
- const char *email,
- GByteArray *creator_entryid)
-{
- E2kGlobalCatalogStatus status;
- E2kGlobalCatalogEntry *entry;
- ExchangeDelegatesUser *user;
- guint8 *p;
-
- status = e2k_global_catalog_lookup (
- gc, NULL, /* FIXME: cancellable */
- E2K_GLOBAL_CATALOG_LOOKUP_BY_EMAIL, email,
- (E2K_GLOBAL_CATALOG_LOOKUP_SID |
- E2K_GLOBAL_CATALOG_LOOKUP_LEGACY_EXCHANGE_DN),
- &entry);
- if (status != E2K_GLOBAL_CATALOG_OK)
- return NULL;
-
- user = exchange_delegates_user_new (e2k_sid_get_display_name (entry->sid));
- user->dn = g_strdup (entry->dn);
- user->sid = entry->sid;
- g_object_ref (user->sid);
-
- user->entryid = g_byte_array_new ();
- p = creator_entryid->data + creator_entryid->len - 2;
- while (p > creator_entryid->data && *p)
- p--;
- g_byte_array_append (user->entryid, creator_entryid->data,
- p - creator_entryid->data + 1);
- g_byte_array_append (user->entryid, entry->legacy_exchange_dn,
- strlen (entry->legacy_exchange_dn));
- g_byte_array_append (user->entryid, "", 1);
-
- return user;
-}
diff --git a/plugins/exchange-account-setup/exchange-delegates-user.h b/plugins/exchange-account-setup/exchange-delegates-user.h
deleted file mode 100644
index 2b5b291e13..0000000000
--- a/plugins/exchange-account-setup/exchange-delegates-user.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* Copyright (C) 2002-2004 Novell, Inc. */
-
-#ifndef __EXCHANGE_DELEGATES_USER_H__
-#define __EXCHANGE_DELEGATES_USER_H__
-
-#include <exchange-types.h>
-#include <e2k-security-descriptor.h>
-#include <gtk/gtkwidget.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define EXCHANGE_TYPE_DELEGATES_USER (exchange_delegates_user_get_type ())
-#define EXCHANGE_DELEGATES_USER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXCHANGE_TYPE_DELEGATES_USER, ExchangeDelegatesUser))
-#define EXCHANGE_DELEGATES_USER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXCHANGE_TYPE_DELEGATES_USER, ExchangeDelegatesUserClass))
-#define EXCHANGE_IS_DELEGATES_USER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXCHANGE_TYPE_DELEGATES_USER))
-#define EXCHANGE_IS_DELEGATES_USER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EXCHANGE_TYPE_DELEGATES_USER))
-
-
-typedef struct _ExchangeDelegatesUser ExchangeDelegatesUser;
-typedef struct _ExchangeDelegatesUserPrivate ExchangeDelegatesUserPrivate;
-typedef struct _ExchangeDelegatesUserClass ExchangeDelegatesUserClass;
-
-enum {
- EXCHANGE_DELEGATES_CALENDAR,
- EXCHANGE_DELEGATES_TASKS,
- EXCHANGE_DELEGATES_INBOX,
- EXCHANGE_DELEGATES_CONTACTS,
- EXCHANGE_DELEGATES_LAST
-};
-
-struct _ExchangeDelegatesUser {
- GObject parent;
-
- char *display_name, *dn;
- GByteArray *entryid;
-
- E2kSid *sid;
- E2kPermissionsRole role[EXCHANGE_DELEGATES_LAST];
- gboolean see_private;
-};
-
-struct _ExchangeDelegatesUserClass {
- GObjectClass parent_class;
-
- /* signals */
- void (*edited) (ExchangeDelegatesUser *, gpointer);
-};
-
-
-
-GType exchange_delegates_user_get_type (void);
-
-ExchangeDelegatesUser *exchange_delegates_user_new (const char *display_name);
-ExchangeDelegatesUser *exchange_delegates_user_new_from_gc (E2kGlobalCatalog *gc,
- const char *email,
- GByteArray *creator_entryid);
-
-gboolean exchange_delegates_user_edit (ExchangeDelegatesUser *user,
- GtkWidget *parent_window);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __EXCHANGE_DELEGATES_USER_H__ */
diff --git a/plugins/exchange-account-setup/exchange-delegates.c b/plugins/exchange-account-setup/exchange-delegates.c
deleted file mode 100644
index c868eb64b9..0000000000
--- a/plugins/exchange-account-setup/exchange-delegates.c
+++ /dev/null
@@ -1,972 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* Copyright (C) 2002-2004 Novell, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* ExchangeDelegates: Exchange delegate handling.
- *
- * FIXME: make this instant-apply
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-
-#include "exchange-delegates.h"
-#include "exchange-delegates-user.h"
-#include "exchange-account.h"
-#include "e2k-propnames.h"
-#include "e2k-security-descriptor.h"
-#include "e2k-sid.h"
-#include "e2k-uri.h"
-#include "e2k-user-dialog.h"
-#include "e2k-utils.h"
-
-#include <e-util/e-dialog-utils.h>
-#include <glade/glade-xml.h>
-#include <gtk/gtkbox.h>
-#include <gtk/gtkcellrenderertext.h>
-#include <gtk/gtkliststore.h>
-#include <gtk/gtkmessagedialog.h>
-#include <gtk/gtktreeselection.h>
-#include <gtk/gtktreeview.h>
-
-typedef struct {
- const char *uri;
- E2kSecurityDescriptor *sd;
- gboolean changed;
-} ExchangeDelegatesFolder;
-
-typedef struct {
- ExchangeAccount *account;
- char *self_dn;
-
- GladeXML *xml;
- GtkWidget *dialog, *parent;
-
- GtkListStore *model;
- GtkWidget *table;
-
- GByteArray *creator_entryid;
- GPtrArray *users, *added_users, *removed_users;
- gboolean loaded_folders;
- ExchangeDelegatesFolder folder[EXCHANGE_DELEGATES_LAST];
- ExchangeDelegatesFolder freebusy_folder;
-} ExchangeDelegates;
-
-extern const char *exchange_delegates_user_folder_names[];
-
-const char *exchange_localfreebusy_path = "NON_IPM_SUBTREE/Freebusy%20Data/LocalFreebusy.EML";
-
-static void set_perms_for_user (ExchangeDelegatesUser *user, gpointer user_data);
-
-static void
-set_sd_for_href (ExchangeDelegates *delegates,
- const char *href,
- E2kSecurityDescriptor *sd)
-{
- int i;
-
- for (i = 0; i < EXCHANGE_DELEGATES_LAST; i++) {
- if (!delegates->folder[i].uri)
- continue;
-
- if (!strcmp (href, delegates->folder[i].uri)) {
- delegates->folder[i].sd = sd;
- return;
- }
- }
-
- /* else, it's the freebusy folder */
- delegates->freebusy_folder.uri = g_strdup (href);
- delegates->freebusy_folder.sd = sd;
-}
-
-/* Given an array of ExchangeDelegatesUser containing display names
- * and entryids, and an array of E2kSecurityDescriptors containing
- * SIDs (which contain display names), add SIDs to the delegates. In
- * the easy case, we can just match the SIDs up with their
- * corresponding user by display name. However, there are two things
- * that can go wrong:
- *
- * 1. Some users may have been removed from the SDs
- * 2. Two users may have the same display name
- *
- * In both cases, we fall back to using the GC.
- */
-static gboolean
-fill_in_sids (ExchangeDelegates *delegates)
-{
- int u, u2, sd, needed_sids;
- ExchangeDelegatesUser *user, *user2;
- GList *sids, *s;
- E2kSid *sid;
- E2kGlobalCatalog *gc;
- E2kGlobalCatalogStatus status;
- E2kGlobalCatalogEntry *entry;
- gboolean ok = TRUE;
-
- needed_sids = 0;
-
- /* Mark users with duplicate names and count the number of
- * non-duplicate names.
- */
- for (u = 0; u < delegates->users->len; u++) {
- user = delegates->users->pdata[u];
- if (user->sid == (E2kSid *)-1)
- continue;
- for (u2 = u + 1; u2 < delegates->users->len; u2++) {
- user2 = delegates->users->pdata[u2];
- if (!strcmp (user->display_name, user2->display_name))
- user->sid = user2->sid = (E2kSid *)-1;
- }
- if (!user->sid)
- needed_sids++;
- }
-
- /* Scan security descriptors trying to match SIDs until we're
- * not expecting to find any more.
- */
- for (sd = 0; sd < EXCHANGE_DELEGATES_LAST && needed_sids; sd++) {
- sids = e2k_security_descriptor_get_sids (delegates->folder[sd].sd);
- for (s = sids; s && needed_sids; s = s->next) {
- sid = s->data;
- for (u = 0; u < delegates->users->len; u++) {
- user = delegates->users->pdata[u];
- if (user->sid)
- continue;
- if (!strcmp (user->display_name,
- e2k_sid_get_display_name (sid))) {
- user->sid = sid;
- g_object_ref (sid);
- needed_sids--;
- }
- }
- }
- g_list_free (sids);
- }
-
- /* Now for each user whose SID hasn't yet been found, look it up. */
- gc = exchange_account_get_global_catalog (delegates->account);
- for (u = 0; u < delegates->users->len; u++) {
- user = delegates->users->pdata[u];
- if (user->sid && user->sid != (E2kSid *)-1)
- continue;
-
- status = e2k_global_catalog_lookup (
- gc, NULL, /* FIXME: cancellable */
- E2K_GLOBAL_CATALOG_LOOKUP_BY_LEGACY_EXCHANGE_DN,
- e2k_entryid_to_dn (user->entryid),
- E2K_GLOBAL_CATALOG_LOOKUP_SID, &entry);
- if (status != E2K_GLOBAL_CATALOG_OK) {
- user->sid = NULL;
- ok = FALSE;
- continue;
- }
- user->sid = entry->sid;
- g_object_ref (user->sid);
- e2k_global_catalog_entry_free (gc, entry);
- }
-
- return ok;
-}
-
-static const char *sd_props[] = {
- E2K_PR_EXCHANGE_SD_BINARY,
- E2K_PR_EXCHANGE_SD_XML
-};
-static const int n_sd_props = sizeof (sd_props) / sizeof (sd_props[0]);
-
-/* Read the folder security descriptors and match them up with the
- * list of delegates.
- */
-static gboolean
-get_folder_security (ExchangeDelegates *delegates)
-{
- GPtrArray *hrefs;
- E2kContext *ctx;
- E2kHTTPStatus status;
- E2kResultIter *iter;
- E2kResult *result;
- xmlNode *xml_form;
- GByteArray *binary_form;
- ExchangeDelegatesUser *user;
- guint32 perms;
- int i, u;
-
- /* If we've been here before, just return the success or
- * failure result from last time.
- */
- if (delegates->freebusy_folder.uri)
- return delegates->loaded_folders;
-
- if (!exchange_account_get_global_catalog (delegates->account)) {
- e_notice (delegates->table, GTK_MESSAGE_ERROR,
- _("No Global Catalog server configured for this account.\nUnable to edit delegates."));
- return FALSE;
- }
-
- ctx = exchange_account_get_context (delegates->account);
-
- hrefs = g_ptr_array_new ();
- for (i = 0; i < EXCHANGE_DELEGATES_LAST; i++) {
- delegates->folder[i].uri = exchange_account_get_standard_uri (
- delegates->account, exchange_delegates_user_folder_names[i]);
- if (delegates->folder[i].uri) {
- g_ptr_array_add (hrefs, (char *)e2k_uri_relative (
- delegates->account->home_uri,
- delegates->folder[i].uri));
- }
- }
- g_ptr_array_add (hrefs, (char *)exchange_localfreebusy_path);
-
- iter = e2k_context_bpropfind_start (
- ctx, NULL, delegates->account->home_uri,
- (const char **)hrefs->pdata, hrefs->len,
- sd_props, n_sd_props);
- g_ptr_array_free (hrefs, TRUE);
-
- while ((result = e2k_result_iter_next (iter))) {
- xml_form = e2k_properties_get_prop (result->props,
- E2K_PR_EXCHANGE_SD_XML);
- binary_form = e2k_properties_get_prop (result->props,
- E2K_PR_EXCHANGE_SD_BINARY);
-
- if (xml_form && binary_form) {
- set_sd_for_href (delegates, result->href,
- e2k_security_descriptor_new (xml_form, binary_form));
- }
- }
- status = e2k_result_iter_free (iter);
-
- if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status)) {
- e_notice (delegates->table, GTK_MESSAGE_ERROR,
- _("Could not read folder permissions.\nUnable to edit delegates."));
- return FALSE;
- }
-
- if (!fill_in_sids (delegates)) {
- delegates->loaded_folders = FALSE;
- e_notice (delegates->table, GTK_MESSAGE_ERROR,
- _("Could not determine folder permissions for delegates.\nUnable to edit delegates."));
- return FALSE;
- }
-
- /* Fill in delegate structures from the security descriptors */
- for (i = 0; i < EXCHANGE_DELEGATES_LAST; i++) {
- for (u = 0; u < delegates->users->len; u++) {
- user = delegates->users->pdata[u];
- perms = e2k_security_descriptor_get_permissions (
- delegates->folder[i].sd, user->sid);
- user->role[i] = e2k_permissions_role_find (perms);
- }
- }
-
- delegates->loaded_folders = TRUE;
- return TRUE;
-}
-
-
-static const char *delegation_props[] = {
- PR_DELEGATES_DISPLAY_NAMES,
- PR_DELEGATES_ENTRYIDS,
- PR_DELEGATES_SEE_PRIVATE,
- PR_CREATOR_ENTRYID
-};
-static const int n_delegation_props = sizeof (delegation_props) / sizeof (delegation_props[0]);
-
-/* Fetch the list of delegates from the freebusy message. */
-static gboolean
-get_user_list (ExchangeDelegates *delegates)
-{
- E2kContext *ctx;
- E2kResultIter *iter;
- E2kResult *result;
- GPtrArray *display_names, *entryids, *privflags;
- GByteArray *entryid;
- ExchangeDelegatesUser *user;
- int i;
-
- ctx = exchange_account_get_context (delegates->account);
- iter = e2k_context_bpropfind_start (ctx, NULL,
- delegates->account->home_uri,
- &exchange_localfreebusy_path, 1,
- delegation_props, n_delegation_props);
- result = e2k_result_iter_next (iter);
- if (!result || !E2K_HTTP_STATUS_IS_SUCCESSFUL (result->status)) {
- e2k_result_iter_free (iter);
- return FALSE;
- }
-
- delegates->users = g_ptr_array_new ();
- delegates->added_users = g_ptr_array_new ();
- delegates->removed_users = g_ptr_array_new ();
-
- display_names = e2k_properties_get_prop (result->props, PR_DELEGATES_DISPLAY_NAMES);
- entryids = e2k_properties_get_prop (result->props, PR_DELEGATES_ENTRYIDS);
- privflags = e2k_properties_get_prop (result->props, PR_DELEGATES_SEE_PRIVATE);
-
- entryid = e2k_properties_get_prop (result->props, PR_CREATOR_ENTRYID);
- delegates->creator_entryid = g_byte_array_new ();
- g_byte_array_append (delegates->creator_entryid, entryid->data, entryid->len);
-
- if (!display_names || !entryids || !privflags) {
- e2k_result_iter_free (iter);
- return TRUE;
- }
-
- for (i = 0; i < display_names->len && i < entryids->len && i < privflags->len; i++) {
- user = exchange_delegates_user_new (display_names->pdata[i]);
- user->see_private = privflags->pdata[i] && atoi (privflags->pdata[i]);
- entryid = entryids->pdata[i];
- user->entryid = g_byte_array_new ();
- g_byte_array_append (user->entryid, entryid->data, entryid->len);
-
- g_signal_connect (user, "edited", G_CALLBACK (set_perms_for_user), delegates);
-
- g_ptr_array_add (delegates->users, user);
- }
-
- e2k_result_iter_free (iter);
- return TRUE;
-}
-
-/* Add or remove a delegate. Everyone must be in one of three states:
- * 1. only in users (because they started and ended there)
- * 2. in users and added_users (because they weren't in
- * users to begin with, but got added)
- * 3. only in removed_users (because they were in users to
- * begin with and got removed).
- * If you're added and then removed, or removed and then added, you have
- * to end up in state 1. That's what this is for.
- */
-static void
-add_remove_user (ExchangeDelegatesUser *user,
- GPtrArray *to_array, GPtrArray *from_array)
-{
- ExchangeDelegatesUser *match;
- int i;
-
- for (i = 0; i < from_array->len; i++) {
- match = from_array->pdata[i];
- if (e2k_sid_binary_sid_equal (e2k_sid_get_binary_sid (match->sid),
- e2k_sid_get_binary_sid (user->sid))) {
- g_ptr_array_remove_index_fast (from_array, i);
- g_object_unref (match);
- return;
- }
- }
-
- g_ptr_array_add (to_array, user);
- g_object_ref (user);
-}
-
-static void
-set_perms_for_user (ExchangeDelegatesUser *user, gpointer user_data)
-{
- ExchangeDelegates *delegates = user_data;
- int i, role;
- guint32 perms;
-
- for (i = 0; i < EXCHANGE_DELEGATES_LAST; i++) {
- perms = e2k_permissions_role_get_perms (user->role[i]);
- e2k_security_descriptor_set_permissions (delegates->folder[i].sd,
- user->sid, perms);
- }
- role = user->role[EXCHANGE_DELEGATES_CALENDAR];
- if (role == E2K_PERMISSIONS_ROLE_AUTHOR)
- role = E2K_PERMISSIONS_ROLE_EDITOR;
- perms = e2k_permissions_role_get_perms (role);
- e2k_security_descriptor_set_permissions (delegates->freebusy_folder.sd,
- user->sid, perms);
-}
-
-static void
-add_button_clicked_cb (GtkWidget *widget, gpointer data)
-{
- ExchangeDelegates *delegates = data;
- E2kGlobalCatalog *gc;
- GtkWidget *dialog, *parent_window;
- const char *delegate_exchange_dn;
- char *email;
- ExchangeDelegatesUser *user, *match;
- int response, u;
- GtkTreeIter iter;
-
- if (!get_folder_security (delegates))
- return;
-
- gc = exchange_account_get_global_catalog (delegates->account);
-
- parent_window = gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW);
- dialog = e2k_user_dialog_new (parent_window,
- _("Delegate To:"), _("Delegate To"));
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- if (response != GTK_RESPONSE_OK) {
- gtk_widget_destroy (dialog);
- return;
- }
- email = e2k_user_dialog_get_user (E2K_USER_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (email == NULL)
- return;
-
- user = exchange_delegates_user_new_from_gc (gc, email,
- delegates->creator_entryid);
- if (!user) {
- e_notice (parent_window, GTK_MESSAGE_ERROR,
- _("Could not make %s a delegate"), email);
- g_free (email);
- return;
- }
- g_free (email);
-
- delegate_exchange_dn = e2k_entryid_to_dn (user->entryid);
- if (delegate_exchange_dn && !g_ascii_strcasecmp (delegate_exchange_dn, delegates->account->legacy_exchange_dn)) {
- g_object_unref (user);
- e_notice (parent_window, GTK_MESSAGE_ERROR,
- _("You cannot make yourself your own delegate"));
- return;
- }
-
- for (u = 0; u < delegates->users->len; u++) {
- match = delegates->users->pdata[u];
- if (e2k_sid_binary_sid_equal (e2k_sid_get_binary_sid (user->sid),
- e2k_sid_get_binary_sid (match->sid))) {
- e_notice (parent_window, GTK_MESSAGE_INFO,
- _("%s is already a delegate"),
- user->display_name);
- g_object_unref (user);
- exchange_delegates_user_edit (match, parent_window);
- return;
- }
- }
-
- if (!exchange_delegates_user_edit (user, parent_window)) {
- g_object_unref (user);
- return;
- }
- set_perms_for_user (user, delegates);
- g_signal_connect (user, "edited",
- G_CALLBACK (set_perms_for_user), delegates);
-
- add_remove_user (user, delegates->added_users, delegates->removed_users);
- g_ptr_array_add (delegates->users, user);
-
- /* Add the user to the table */
- gtk_list_store_append (delegates->model, &iter);
- gtk_list_store_set (delegates->model, &iter,
- 0, user->display_name,
- -1);
-}
-
-static int
-get_selected_row (GtkWidget *tree_view, GtkTreeIter *iter)
-{
- GtkTreeSelection *selection;
- GtkTreeModel *model;
- GtkTreePath *path;
- int *indices, row;
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
- if (!gtk_tree_selection_get_selected (selection, &model, iter))
- return -1;
-
- path = gtk_tree_model_get_path (model, iter);
- indices = gtk_tree_path_get_indices (path);
- row = indices[0];
- gtk_tree_path_free (path);
-
- return row;
-}
-
-static void
-edit_button_clicked_cb (GtkWidget *widget, gpointer data)
-{
- ExchangeDelegates *delegates = data;
- GtkWidget *parent_window;
- GtkTreeIter iter;
- int row;
-
- if (!get_folder_security (delegates))
- return;
-
- row = get_selected_row (delegates->table, &iter);
- g_return_if_fail (row >= 0 && row < delegates->users->len);
-
- parent_window = gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW);
- exchange_delegates_user_edit (delegates->users->pdata[row],
- parent_window);
-}
-
-static gboolean
-table_click_cb (GtkWidget *widget, GdkEventButton *event, gpointer data)
-{
- ExchangeDelegates *delegates = data;
- GtkWidget *parent_window;
- GtkTreeIter iter;
- int row;
-
- if (event->type != GDK_2BUTTON_PRESS)
- return FALSE;
-
- row = get_selected_row (delegates->table, &iter);
- if (row < 0 || row >= delegates->users->len)
- return FALSE;
-
- if (!get_folder_security (delegates))
- return FALSE;
-
- parent_window = gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW);
- exchange_delegates_user_edit (delegates->users->pdata[row],
- parent_window);
- return TRUE;
-}
-
-static void
-remove_button_clicked_cb (GtkWidget *widget, gpointer data)
-{
- ExchangeDelegates *delegates = data;
- ExchangeDelegatesUser *user;
- GtkWidget *dialog;
- int row, btn, i;
- GtkTreeIter iter;
-
- if (!get_folder_security (delegates))
- return;
-
- row = get_selected_row (delegates->table, &iter);
- g_return_if_fail (row >= 0 && row < delegates->users->len);
-
- user = delegates->users->pdata[row];
-
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO,
- _("Remove the delegate %s?"),
- user->display_name);
- e_dialog_set_transient_for (GTK_WINDOW (dialog), widget);
-
- btn = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- if (btn != GTK_RESPONSE_YES)
- return;
-
- add_remove_user (user, delegates->removed_users, delegates->added_users);
-
- for (i = 0; i < EXCHANGE_DELEGATES_LAST; i++) {
- e2k_security_descriptor_remove_sid (delegates->folder[i].sd,
- user->sid);
- }
- e2k_security_descriptor_remove_sid (delegates->freebusy_folder.sd,
- user->sid);
-
- /* Remove the user from the table */
- gtk_list_store_remove (delegates->model, &iter);
- g_ptr_array_remove_index (delegates->users, row);
- g_object_unref (user);
-}
-
-
-static gboolean
-proppatch_sd (E2kContext *ctx, ExchangeDelegatesFolder *folder)
-{
- GByteArray *binsd;
- E2kProperties *props;
- const char *href = "";
- E2kResultIter *iter;
- E2kResult *result;
- E2kHTTPStatus status;
-
- binsd = e2k_security_descriptor_to_binary (folder->sd);
- if (!binsd)
- return FALSE;
-
- props = e2k_properties_new ();
- e2k_properties_set_binary (props, E2K_PR_EXCHANGE_SD_BINARY, binsd);
-
- iter = e2k_context_bproppatch_start (ctx, NULL, folder->uri,
- &href, 1, props, FALSE);
- e2k_properties_free (props);
-
- result = e2k_result_iter_next (iter);
- if (result) {
- status = result->status;
- e2k_result_iter_free (iter);
- } else
- status = e2k_result_iter_free (iter);
-
- return E2K_HTTP_STATUS_IS_SUCCESSFUL (status);
-}
-
-static gboolean
-get_user_dn (E2kGlobalCatalog *gc, ExchangeDelegatesUser *user)
-{
- E2kGlobalCatalogEntry *entry;
- E2kGlobalCatalogStatus status;
- const char *exchange_dn;
-
- exchange_dn = e2k_entryid_to_dn (user->entryid);
- status = e2k_global_catalog_lookup (
- gc, NULL, /* FIXME: cancellable */
- E2K_GLOBAL_CATALOG_LOOKUP_BY_LEGACY_EXCHANGE_DN,
- exchange_dn, 0, &entry);
- if (status != E2K_GLOBAL_CATALOG_OK)
- return FALSE;
-
- user->dn = g_strdup (entry->dn);
- e2k_global_catalog_entry_free (gc, entry);
- return TRUE;
-}
-
-static void
-delegates_apply (ExchangeDelegates *delegates)
-{
- ExchangeDelegatesUser *user;
- E2kGlobalCatalog *gc;
- E2kContext *ctx;
- GPtrArray *display_names, *entryids, *privflags;
- GByteArray *entryid_dup;
- char *error = NULL;
- E2kProperties *props;
- int i, status;
-
- if (!delegates->loaded_folders)
- return;
-
- /* We can't do this atomically/transactionally, so we need to
- * make sure that if we fail at any step, things are still in
- * a semi-consistent state. So we do:
- *
- * 1. Remove old delegates from AD
- * 2. Update LocalFreebusy.EML (the canonical list of delegates)
- * 3. Add new delegates to AD
- * 4. Update security descriptors
- *
- * If step 1 fails, nothing is changed.
- *
- * If step 2 fails, delegates who should have been removed
- * will have been removed from AD but nothing else, so they
- * will still show up as being delegates and the user can try
- * to remove them again later.
- *
- * If step 3 fails, delegates who should have been added will
- * not be in AD, but will be listed as delegates, so the user
- * can remove them and try adding them again later.
- *
- * If step 4 fails, the user can still correct the folder
- * permissions by hand.
- */
-
- gc = exchange_account_get_global_catalog (delegates->account);
- if (!gc) {
- error = g_strdup (_("Could not access Active Directory"));
- goto done;
- }
-
- if ((delegates->removed_users || delegates->added_users) && !delegates->self_dn) {
- E2kGlobalCatalog *gc;
- E2kGlobalCatalogStatus status;
- E2kGlobalCatalogEntry *entry;
-
- gc = exchange_account_get_global_catalog (delegates->account);
- status = e2k_global_catalog_lookup (
- gc, NULL, /* FIXME: cancellable */
- E2K_GLOBAL_CATALOG_LOOKUP_BY_LEGACY_EXCHANGE_DN,
- delegates->account->legacy_exchange_dn, 0, &entry);
- if (status != E2K_GLOBAL_CATALOG_OK) {
- error = g_strdup (_("Could not find self in Active Directory"));
- goto done;
- }
-
- delegates->self_dn = g_strdup (entry->dn);
- e2k_global_catalog_entry_free (gc, entry);
- }
-
- /* 1. Remove old delegates from AD */
- while (delegates->removed_users && delegates->removed_users->len) {
- user = delegates->removed_users->pdata[0];
- if (!user->dn && !get_user_dn (gc, user)) {
- error = g_strdup_printf (
- _("Could not find delegate %s in Active Directory"),
- user->display_name);
- goto done;
- }
-
- /* FIXME: cancellable */
- status = e2k_global_catalog_remove_delegate (gc, NULL,
- delegates->self_dn,
- user->dn);
- if (status != E2K_GLOBAL_CATALOG_OK &&
- status != E2K_GLOBAL_CATALOG_NO_DATA) {
- error = g_strdup_printf (
- _("Could not remove delegate %s"),
- user->display_name);
- goto done;
- }
-
- g_object_unref (user);
- g_ptr_array_remove_index_fast (delegates->removed_users, 0);
- }
-
- /* 2. Update LocalFreebusy.EML */
- ctx = exchange_account_get_context (delegates->account);
-
- if (delegates->users->len) {
- display_names = g_ptr_array_new ();
- entryids = g_ptr_array_new ();
- privflags = g_ptr_array_new ();
-
- for (i = 0; i < delegates->users->len; i++) {
- user = delegates->users->pdata[i];
- g_ptr_array_add (display_names, g_strdup (user->display_name));
- entryid_dup = g_byte_array_new ();
- g_byte_array_append (entryid_dup, user->entryid->data,
- user->entryid->len);
- g_ptr_array_add (entryids, entryid_dup);
- g_ptr_array_add (privflags, g_strdup_printf ("%d", user->see_private));
- }
-
- props = e2k_properties_new ();
- e2k_properties_set_string_array (
- props, PR_DELEGATES_DISPLAY_NAMES, display_names);
- e2k_properties_set_binary_array (
- props, PR_DELEGATES_ENTRYIDS, entryids);
- e2k_properties_set_int_array (
- props, PR_DELEGATES_SEE_PRIVATE, privflags);
- } else if (delegates->removed_users) {
- props = e2k_properties_new ();
- e2k_properties_remove (props, PR_DELEGATES_DISPLAY_NAMES);
- e2k_properties_remove (props, PR_DELEGATES_ENTRYIDS);
- e2k_properties_remove (props, PR_DELEGATES_SEE_PRIVATE);
- } else
- props = NULL;
-
- if (props) {
- E2kResultIter *iter;
- E2kResult *result;
-
- iter = e2k_context_bproppatch_start (
- ctx, NULL, delegates->account->home_uri,
- &exchange_localfreebusy_path, 1,
- props, FALSE);
- e2k_properties_free (props);
-
- result = e2k_result_iter_next (iter);
- if (result) {
- status = result->status;
- e2k_result_iter_free (iter);
- } else
- status = e2k_result_iter_free (iter);
-
- if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status)) {
- error = g_strdup (_("Could not update list of delegates."));
- goto done;
- }
- }
-
- /* 3. Add new delegates to AD */
- while (delegates->added_users && delegates->added_users->len) {
- user = delegates->added_users->pdata[0];
- /* An added user must have come from the GC so
- * we know user->dn is set.
- */
- /* FIXME: cancellable */
- status = e2k_global_catalog_add_delegate (gc, NULL,
- delegates->self_dn,
- user->dn);
- if (status != E2K_GLOBAL_CATALOG_OK &&
- status != E2K_GLOBAL_CATALOG_EXISTS) {
- error = g_strdup_printf (
- _("Could not add delegate %s"),
- user->display_name);
- goto done;
- }
- g_ptr_array_remove_index_fast (delegates->added_users, 0);
- g_object_unref (user);
- }
-
- /* 4. Update security descriptors */
- for (i = 0; i < EXCHANGE_DELEGATES_LAST; i++)
- proppatch_sd (ctx, &delegates->folder[i]);
- proppatch_sd (ctx, &delegates->freebusy_folder);
-
- done:
- if (error) {
- e_notice (delegates->table, GTK_MESSAGE_ERROR,
- _("Failed to update delegates:\n%s"), error);
- g_free (error);
- }
-}
-
-static void parent_destroyed (gpointer user_data, GObject *ex_parent);
-
-static void
-delegates_destroy (ExchangeDelegates *delegates)
-{
- int i;
-
- g_object_unref (delegates->account);
-
- if (delegates->parent) {
- g_object_weak_unref (G_OBJECT (delegates->parent),
- parent_destroyed, delegates);
- }
- if (delegates->dialog)
- gtk_widget_destroy (delegates->dialog);
-
- if (delegates->model)
- g_object_unref (delegates->model);
-
- if (delegates->self_dn)
- g_free (delegates->self_dn);
- if (delegates->creator_entryid)
- g_byte_array_free (delegates->creator_entryid, TRUE);
-
- if (delegates->users) {
- for (i = 0; i < delegates->users->len; i++)
- g_object_unref (delegates->users->pdata[i]);
- g_ptr_array_free (delegates->users, TRUE);
- }
- if (delegates->added_users) {
- for (i = 0; i < delegates->added_users->len; i++)
- g_object_unref (delegates->added_users->pdata[i]);
- g_ptr_array_free (delegates->added_users, TRUE);
- }
- if (delegates->removed_users) {
- for (i = 0; i < delegates->removed_users->len; i++)
- g_object_unref (delegates->removed_users->pdata[i]);
- g_ptr_array_free (delegates->removed_users, TRUE);
- }
-
- for (i = 0; i < EXCHANGE_DELEGATES_LAST; i++) {
- if (delegates->folder[i].sd)
- g_object_unref (delegates->folder[i].sd);
- }
- if (delegates->freebusy_folder.sd)
- g_object_unref (delegates->freebusy_folder.sd);
- if (delegates->freebusy_folder.uri)
- g_free ((char *)delegates->freebusy_folder.uri);
-
- if (delegates->xml)
- g_object_unref (delegates->xml);
-
- g_free (delegates);
-}
-
-
-static void
-dialog_response (GtkDialog *dialog, int response, gpointer user_data)
-{
- ExchangeDelegates *delegates = user_data;
-
- if (response == GTK_RESPONSE_OK)
- delegates_apply (delegates);
- delegates_destroy (delegates);
-}
-
-static void
-parent_destroyed (gpointer user_data, GObject *ex_parent)
-{
- ExchangeDelegates *delegates = user_data;
-
- gtk_widget_destroy (delegates->dialog);
- delegates_destroy (delegates);
-}
-
-void
-exchange_delegates (ExchangeAccount *account, GtkWidget *parent)
-{
- ExchangeDelegates *delegates;
- GtkWidget *button;
- ExchangeDelegatesUser *user;
- GtkTreeViewColumn *column;
- GtkTreeIter iter;
- int i;
-
- g_return_if_fail (GTK_IS_WIDGET (parent));
- g_return_if_fail (EXCHANGE_IS_ACCOUNT (account));
-
- delegates = g_new0 (ExchangeDelegates, 1);
- delegates->account = g_object_ref (account);
-
- delegates->xml = glade_xml_new (CONNECTOR_GLADEDIR "/exchange-delegates.glade", NULL, NULL);
- g_return_if_fail (delegates->xml != NULL);
-
- delegates->dialog = glade_xml_get_widget (delegates->xml, "delegates");
- g_return_if_fail (delegates->dialog != NULL);
-
- g_signal_connect (delegates->dialog, "response",
- G_CALLBACK (dialog_response), delegates);
-
- e_dialog_set_transient_for (GTK_WINDOW (delegates->dialog), parent);
- delegates->parent = parent;
- g_object_weak_ref (G_OBJECT (parent), parent_destroyed, delegates);
-
- /* Set up the buttons */
- button = glade_xml_get_widget (delegates->xml, "add_button");
- g_signal_connect (button, "clicked",
- G_CALLBACK (add_button_clicked_cb), delegates);
- button = glade_xml_get_widget (delegates->xml, "edit_button");
- g_signal_connect (button, "clicked",
- G_CALLBACK (edit_button_clicked_cb), delegates);
- button = glade_xml_get_widget (delegates->xml, "remove_button");
- g_signal_connect (button, "clicked",
- G_CALLBACK (remove_button_clicked_cb), delegates);
-
- /* Set up the table */
- delegates->model = gtk_list_store_new (1, G_TYPE_STRING);
- delegates->table = glade_xml_get_widget (delegates->xml, "delegates_table");
- column = gtk_tree_view_column_new_with_attributes (
- _("Name"), gtk_cell_renderer_text_new (), "text", 0, NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (delegates->table),
- column);
- gtk_tree_view_set_model (GTK_TREE_VIEW (delegates->table),
- GTK_TREE_MODEL (delegates->model));
-
- /* Get list of delegate users */
- if (get_user_list (delegates)) {
- for (i = 0; i < delegates->users->len; i++) {
- user = delegates->users->pdata[i];
-
- gtk_list_store_append (delegates->model, &iter);
- gtk_list_store_set (delegates->model, &iter,
- 0, user->display_name,
- -1);
- }
- g_signal_connect (delegates->table,
- "button_press_event",
- G_CALLBACK (table_click_cb), delegates);
- } else {
- button = glade_xml_get_widget (delegates->xml, "add_button");
- gtk_widget_set_sensitive (button, FALSE);
- button = glade_xml_get_widget (delegates->xml, "edit_button");
- gtk_widget_set_sensitive (button, FALSE);
- button = glade_xml_get_widget (delegates->xml, "remove_button");
- gtk_widget_set_sensitive (button, FALSE);
-
- gtk_list_store_append (delegates->model, &iter);
- gtk_list_store_set (delegates->model, &iter,
- 0, _("Error reading delegates list."),
- -1);
- }
-
- gtk_widget_show (delegates->dialog);
-}
diff --git a/plugins/exchange-account-setup/exchange-delegates.glade b/plugins/exchange-account-setup/exchange-delegates.glade
deleted file mode 100644
index 4b2e0e7695..0000000000
--- a/plugins/exchange-account-setup/exchange-delegates.glade
+++ /dev/null
@@ -1,628 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="delegates">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Delegates</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="cancelbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="okbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox2">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">These users will be able to send mail on your behalf
-and access your folders with the permissions you give them.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="delegate_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTreeView" id="delegates_table">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="add_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="edit_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Edit</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="remove_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-remove</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="delegate_permissions">
- <property name="title" translatable="yes">Delegate Permissions</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area2">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="cancelbutton2">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="okbutton2">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox3">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="delegate_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Permissions for</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="folders_table">
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="calendar_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">C_alendar:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">calendar_perms</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="task_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Tasks:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">task_perms</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="inbox_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Inbox:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">inbox_perms</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="contact_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Co_ntacts:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">contact_perms</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="calendar_perms">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">None</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Reviewer (read-only)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Author (read, create)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Editor (read, create, edit)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="task_perms">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget6">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">None</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Reviewer (read-only)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Author (read, create)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Editor (read, create, edit)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="inbox_perms">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget11">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget12">
- <property name="visible">True</property>
- <property name="label" translatable="yes">None</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget13">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Reviewer (read-only)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget14">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Author (read, create)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget15">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Editor (read, create, edit)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="contact_perms">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget16">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget17">
- <property name="visible">True</property>
- <property name="label" translatable="yes">None</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget18">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Reviewer (read-only)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget19">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Author (read, create)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Editor (read, create, edit)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="see_private_checkbox">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Delegate can see private items</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/plugins/exchange-account-setup/exchange-delegates.h b/plugins/exchange-account-setup/exchange-delegates.h
deleted file mode 100644
index be8f4f89e3..0000000000
--- a/plugins/exchange-account-setup/exchange-delegates.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* Copyright (C) 2002-2004 Novell, Inc. */
-
-#ifndef __EXCHANGE_DELEGATES_H__
-#define __EXCHANGE_DELEGATES_H__
-
-#include <exchange-types.h>
-#include <gtk/gtkwidget.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-void exchange_delegates (ExchangeAccount *account, GtkWidget *parent);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __EXCHANGE_DELEGATES_CONTROL_H__ */
diff --git a/plugins/exchange-account-setup/exchange-folder-size.c b/plugins/exchange-account-setup/exchange-folder-size.c
deleted file mode 100644
index 694155f54d..0000000000
--- a/plugins/exchange-account-setup/exchange-folder-size.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* Copyright (C) 2002-2004 Novell, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* ExchangeFolderSize: Display the folder tree with the folder sizes */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-
-#include <e-util/e-dialog-utils.h>
-#include <glade/glade-xml.h>
-#include <gtk/gtkbox.h>
-#include <gtk/gtkcellrenderertext.h>
-#include <gtk/gtkliststore.h>
-#include <gtk/gtkmessagedialog.h>
-#include <gtk/gtktreeselection.h>
-#include <gtk/gtktreeview.h>
-
-#include "exchange-hierarchy-webdav.h"
-#include "e-folder-exchange.h"
-#include "exchange-folder-size.h"
-
-#define PARENT_TYPE G_TYPE_OBJECT
-static GObjectClass *parent_class = NULL;
-
-typedef struct {
- char *folder_name;
- gdouble folder_size;
-} folder_info;
-
-
-struct _ExchangeFolderSizePrivate {
-
- GHashTable *table;
- GtkListStore *model;
- GHashTable *row_refs;
-};
-
-enum {
- COLUMN_NAME,
- COLUMN_SIZE,
- NUM_COLUMNS
-};
-
-static gboolean
-free_fsize_table (gpointer key, gpointer value, gpointer data)
-{
- folder_info *f_info = (folder_info *) value;
-
- g_free (key);
- g_free (f_info->folder_name);
- g_free (f_info);
- return TRUE;
-}
-
-static gboolean
-free_row_refs (gpointer key, gpointer value, gpointer user_data)
-{
- g_free (key);
- gtk_tree_row_reference_free (value);
- return TRUE;
-}
-
-static void
-finalize (GObject *object)
-{
- ExchangeFolderSize *fsize = EXCHANGE_FOLDER_SIZE (object);
-
- g_hash_table_foreach_remove (fsize->priv->table, free_fsize_table, NULL);
- g_hash_table_destroy (fsize->priv->table);
- g_hash_table_foreach_remove (fsize->priv->row_refs, free_row_refs, NULL);
- g_hash_table_destroy (fsize->priv->row_refs);
- if (fsize->priv->model)
- g_object_unref (fsize->priv->model);
- g_free (fsize->priv);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-dispose (GObject *object)
-{
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-class_init (GObjectClass *object_class)
-{
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- /* override virtual methods */
- object_class->dispose = dispose;
- object_class->finalize = finalize;
-
-}
-
-static void
-init (GObject *object)
-{
- ExchangeFolderSize *fsize = EXCHANGE_FOLDER_SIZE (object);
-
- fsize->priv = g_new0 (ExchangeFolderSizePrivate, 1);
- fsize->priv->table = g_hash_table_new (g_str_hash, g_str_equal);
- fsize->priv->model = gtk_list_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_DOUBLE);
- fsize->priv->row_refs = g_hash_table_new (g_str_hash, g_str_equal);
-}
-
-E2K_MAKE_TYPE (exchange_folder_size, ExchangeFolderSize, class_init, init, PARENT_TYPE)
-
-/**
- * exchange_folder_size_new:
- * @display_name: the delegate's (UTF8) display name
- *
- * Return value: a foldersize object with the table initialized
- **/
-ExchangeFolderSize *
-exchange_folder_size_new (void)
-{
- ExchangeFolderSize *fsize;
-
- fsize = g_object_new (EXCHANGE_TYPE_FOLDER_SIZE, NULL);
-
- return fsize;
-}
-
-void
-exchange_folder_size_update (ExchangeFolderSize *fsize,
- const char *folder_name,
- gdouble folder_size)
-{
- folder_info *f_info, *cached_info;
- ExchangeFolderSizePrivate *priv;
- GHashTable *folder_size_table;
- GtkTreeRowReference *row;
- GtkTreeIter iter;
- GtkTreePath *path;
-
- g_return_if_fail (EXCHANGE_IS_FOLDER_SIZE (fsize));
-
- priv = fsize->priv;
- folder_size_table = priv->table;
-
- cached_info = g_hash_table_lookup (folder_size_table, folder_name);
- if (cached_info) {
- if (cached_info->folder_size == folder_size) {
- return;
- } else {
- cached_info->folder_size = folder_size;
- row = g_hash_table_lookup (priv->row_refs, folder_name);
- path = gtk_tree_row_reference_get_path (row);
- if (gtk_tree_model_get_iter (GTK_TREE_MODEL (fsize->priv->model), &iter, path)) {
- gtk_list_store_set (fsize->priv->model, &iter,
- COLUMN_NAME, cached_info->folder_name,
- COLUMN_SIZE, cached_info->folder_size,
- -1);
- }
- gtk_tree_path_free (path);
- return;
- }
- } else {
- f_info = g_new0(folder_info, 1);
- f_info->folder_name = g_strdup (folder_name);
- f_info->folder_size = folder_size;
- g_hash_table_insert (folder_size_table, f_info->folder_name, f_info);
-
- gtk_list_store_append (fsize->priv->model, &iter);
- gtk_list_store_set (fsize->priv->model, &iter,
- COLUMN_NAME, f_info->folder_name,
- COLUMN_SIZE, f_info->folder_size,
- -1);
-
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (fsize->priv->model), &iter);
- row = gtk_tree_row_reference_new (GTK_TREE_MODEL (fsize->priv->model), path);
- gtk_tree_path_free (path);
-
- g_hash_table_insert (fsize->priv->row_refs, g_strdup (folder_name), row);
- }
-}
-
-void
-exchange_folder_size_remove (ExchangeFolderSize *fsize,
- const char *folder_name)
-{
- ExchangeFolderSizePrivate *priv;
- GHashTable *folder_size_table;
- folder_info *cached_info;
- GtkTreeRowReference *row;
- GtkTreeIter iter;
- GtkTreePath *path;
-
- g_return_if_fail (EXCHANGE_IS_FOLDER_SIZE (fsize));
- g_return_if_fail (folder_name != NULL);
-
- priv = fsize->priv;
- folder_size_table = priv->table;
-
- cached_info = g_hash_table_lookup (folder_size_table, folder_name);
- if (cached_info) {
- row = g_hash_table_lookup (priv->row_refs, folder_name);
- path = gtk_tree_row_reference_get_path (row);
- g_hash_table_remove (folder_size_table, folder_name);
- if (gtk_tree_model_get_iter (GTK_TREE_MODEL (fsize->priv->model), &iter, path)) {
- gtk_list_store_remove (fsize->priv->model, &iter);
- }
- g_hash_table_remove (priv->row_refs, row);
- gtk_tree_path_free (path);
- }
-}
-
-gdouble
-exchange_folder_size_get (ExchangeFolderSize *fsize,
- const char *folder_name)
-{
- ExchangeFolderSizePrivate *priv;
- GHashTable *folder_size_table;
- folder_info *cached_info;
-
- g_return_val_if_fail (EXCHANGE_IS_FOLDER_SIZE (fsize), -1);
-
- priv = fsize->priv;
- folder_size_table = priv->table;
-
- cached_info = g_hash_table_lookup (folder_size_table, folder_name);
- if (cached_info) {
- return cached_info->folder_size;
- }
- return -1;
-}
-
-static void
-format_size_func (GtkTreeViewColumn *col,
- GtkCellRenderer *renderer,
- GtkTreeModel *model,
- GtkTreeIter *iter,
- gpointer user_data)
-{
- GtkCellRendererText *cell = (GtkCellRendererText *)renderer;
- gdouble folder_size;
- char * new_text;
-
- gtk_tree_model_get(model, iter, COLUMN_SIZE, &folder_size, -1);
-
- if (folder_size)
- new_text = g_strdup_printf ("%.2f", folder_size);
- else
- new_text = g_strdup ("0");
-
- g_object_set (cell, "text", new_text, NULL);
- g_free (new_text);
-}
-
-static void
-parent_destroyed (gpointer dialog, GObject *ex_parent)
-{
- gtk_dialog_response (dialog, GTK_RESPONSE_CANCEL);
-}
-
-void
-exchange_folder_size_display (EFolder *folder, GtkWidget *parent)
-{
- ExchangeFolderSizePrivate *priv;
- ExchangeFolderSize *fsize;
- ExchangeHierarchy *hier;
- GtkTreeViewColumn *column;
- GtkTreeSortable *sortable;
- GtkCellRenderer *cell;
- GHashTable *folder_size_table;
- GladeXML *xml;
- GtkWidget *dialog, *table;
- GList *l;
- char *col_name;
- int response;
-
- g_return_if_fail (GTK_IS_WIDGET (parent));
-
- hier = e_folder_exchange_get_hierarchy (folder);
- if (!hier)
- return;
- /* FIXME: This should be a more generic query and not just
- specifically for webdav */
- fsize = exchange_hierarchy_webdav_get_folder_size (EXCHANGE_HIERARCHY_WEBDAV (hier));
- if (!fsize)
- return;
- priv = fsize->priv;
- folder_size_table = priv->table;
-
- if (!g_hash_table_size (folder_size_table))
- return;
-
- xml = glade_xml_new (CONNECTOR_GLADEDIR "/exchange-folder-tree.glade", NULL, NULL);
- g_return_if_fail (xml != NULL);
- dialog = glade_xml_get_widget (xml, "folder_tree");
- table = glade_xml_get_widget (xml, "folder_treeview");
-
- e_dialog_set_transient_for (GTK_WINDOW (dialog), parent);
- /* fsize->parent = parent; */
- g_object_weak_ref (G_OBJECT (parent), parent_destroyed, dialog);
-
- /* Set up the table */
- sortable = GTK_TREE_SORTABLE (priv->model);
- gtk_tree_sortable_set_sort_column_id (sortable, COLUMN_SIZE, GTK_SORT_DESCENDING);
-
- column = gtk_tree_view_column_new_with_attributes (
- _("Folder Name"), gtk_cell_renderer_text_new (), "text", COLUMN_NAME, NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (table),
- column);
-
- col_name = g_strdup_printf ("%s (KB)", _("Folder Size"));
- column = gtk_tree_view_column_new_with_attributes (
- col_name, gtk_cell_renderer_text_new (), "text", COLUMN_SIZE, NULL);
- g_free (col_name);
-
- l = gtk_tree_view_column_get_cell_renderers (column);
- cell = (GtkCellRenderer *)l->data;
- gtk_tree_view_column_set_cell_data_func (column, cell, format_size_func, NULL, NULL );
- g_list_free (l);
-
- gtk_tree_view_append_column (GTK_TREE_VIEW (table),
- column);
- gtk_tree_view_set_model (GTK_TREE_VIEW (table),
- GTK_TREE_MODEL (priv->model));
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_object_unref (xml);
-}
diff --git a/plugins/exchange-account-setup/exchange-folder-size.h b/plugins/exchange-account-setup/exchange-folder-size.h
deleted file mode 100644
index 2d673902a1..0000000000
--- a/plugins/exchange-account-setup/exchange-folder-size.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* Copyright (C) 2002-2004 Novell, Inc. */
-
-#ifndef __EXCHANGE_FOLDER_SIZE_H__
-#define __EXCHANGE_FOLDER_SIZE_H__
-
-#include <exchange-types.h>
-#include <e2k-security-descriptor.h>
-#include <e-folder.h>
-#include <gtk/gtkwidget.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define EXCHANGE_TYPE_FOLDER_SIZE (exchange_folder_size_get_type ())
-#define EXCHANGE_FOLDER_SIZE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXCHANGE_TYPE_FOLDER_SIZE, ExchangeFolderSize))
-#define EXCHANGE_FOLDER_SIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXCHANGE_TYPE_FOLDER_SIZE, ExchangeFolderSizeClass))
-#define EXCHANGE_IS_FOLDER_SIZE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXCHANGE_TYPE_FOLDER_SIZE))
-#define EXCHANGE_IS_FOLDER_SIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EXCHANGE_TYPE_FOLDER_SIZE))
-
-
-typedef struct _ExchangeFolderSize ExchangeFolderSize;
-typedef struct _ExchangeFolderSizePrivate ExchangeFolderSizePrivate;
-typedef struct _ExchangeFolderSizeClass ExchangeFolderSizeClass;
-
-struct _ExchangeFolderSize {
- GObject parent;
-
- ExchangeFolderSizePrivate *priv;
-};
-
-struct _ExchangeFolderSizeClass {
- GObjectClass parent_class;
-
-};
-
-GType exchange_folder_size_get_type (void);
-
-ExchangeFolderSize *exchange_folder_size_new (void);
-
-void exchange_folder_size_update (ExchangeFolderSize *fsize,
- const char *folder_name,
- gdouble folder_size);
-void exchange_folder_size_remove (ExchangeFolderSize *fsize, const char *folder_name);
-
-gdouble exchange_folder_size_get (ExchangeFolderSize *fsize, const char *folder_name);
-
-void exchange_folder_size_display (EFolder *folder, GtkWidget *parent);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __EXCHANGE_FOLDER_SIZE_H__ */
diff --git a/plugins/exchange-account-setup/exchange-folder-tree.glade b/plugins/exchange-account-setup/exchange-folder-tree.glade
deleted file mode 100644
index 0505681a7b..0000000000
--- a/plugins/exchange-account-setup/exchange-folder-tree.glade
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="folder_tree">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Exchange Folder Tree</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">250</property>
- <property name="default_height">300</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="okbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="folder_tree_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="folder_treeview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in b/plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in
deleted file mode 100644
index bdd783f7ea..0000000000
--- a/plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<e-plugin-list>
- <e-plugin
- type="shlib"
- id="org.gnome.evolution.plugin.exchange-account-settings"
- location="@PLUGINDIR@/liborg-gnome-exchange-account-settings.so"
- load-on-startup="true"
- name="Exchange Account Setup">
- <author name="Sushma Rai" email="rsushma@novell.com"/>
- <description>A plugin for Exchange account specific settings.</description>
-
- <hook class="org.gnome.evolution.mail.config:1.0">
- <group
- target="account"
- id="org.gnome.evolution.mail.config.accountEditor"
- check="org_gnome_exchange_check_options"
- commit="org_gnome_exchange_commit">
- <item type="page"
- path="40.oof"
- label="Exchange Settings"
- factory="org_gnome_exchange_settings"/>
- <item type="item_table"
- path="10.receive/10.config/20.owa"
- factory="org_gnome_exchange_owa_url"/>
- <item type="section"
- path="10.receive/30.auth/00.exchange_auth"
- factory="org_gnome_exchange_auth_section"/>
- </group>
-
- <group
- target="account"
- id="org.gnome.evolution.mail.config.accountDruid"
- check="org_gnome_exchange_check_options">
- <item type="item_table"
- path="10.receive/10.config/20.owa"
- factory="org_gnome_exchange_owa_url"/>
- </group>
-
- <group
- target="account"
- id="org.gnome.evolution.mail.config.accountWizard"
- check="org_gnome_exchange_check_options">
- <item type="item_table"
- path="10.receive/10.config/20.owa"
- factory="org_gnome_exchange_owa_url"/>
- </group>
-
- </hook>
-
- </e-plugin>
-</e-plugin-list>