From 65ef60b46c83091f7ac32900059afc2ea3dc8a73 Mon Sep 17 00:00:00 2001 From: Sushma Rai Date: Thu, 15 Jun 2006 10:59:05 +0000 Subject: On successful connection, checking if the OOF state is set in the server, and if it is set, asking the user if he wants to change it to in-office during login. Fixes #344650. svn path=/trunk/; revision=32152 --- plugins/exchange-operations/ChangeLog | 9 + plugins/exchange-operations/Makefile.am | 3 +- .../exchange-operations/exchange-config-listener.c | 43 +- plugins/exchange-operations/exchange-oof.glade | 530 +++++++++++++++++++++ 4 files changed, 581 insertions(+), 4 deletions(-) create mode 100644 plugins/exchange-operations/exchange-oof.glade (limited to 'plugins') diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog index cb48b6fced..6a5765c87e 100644 --- a/plugins/exchange-operations/ChangeLog +++ b/plugins/exchange-operations/ChangeLog @@ -1,3 +1,12 @@ +2006-06-15 Sushma Rai + + * Makefile.am: Added exchange-oof.glade to the list of glade files. + + * exchange-config-listener.c (exchange_config_listener_authenticate): + On successful connection, checking if the OOF state is set in the + server, and if it is set, asking the user if he wants to change it + to in-office during login. Fixes #344650. + 2006-06-13 Sushma Rai * org-gnome-exchange-operations.error.xml: defined a new error code and diff --git a/plugins/exchange-operations/Makefile.am b/plugins/exchange-operations/Makefile.am index 3efa32d475..9fc60d4f50 100644 --- a/plugins/exchange-operations/Makefile.am +++ b/plugins/exchange-operations/Makefile.am @@ -59,7 +59,8 @@ glade_DATA = \ exchange-folder-tree.glade \ exchange-permissions-dialog.glade \ e-foreign-folder-dialog.glade \ - exchange-passwd-expiry.glade + exchange-passwd-expiry.glade \ + exchange-oof.glade error_DATA = org-gnome-exchange-operations.error errordir = $(privdatadir)/errors diff --git a/plugins/exchange-operations/exchange-config-listener.c b/plugins/exchange-operations/exchange-config-listener.c index 146151c262..7dc2f04879 100644 --- a/plugins/exchange-operations/exchange-config-listener.c +++ b/plugins/exchange-operations/exchange-config-listener.c @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -733,8 +734,13 @@ exchange_config_listener_authenticate (ExchangeConfigListener *ex_conf_listener, e_passwords_forget_password ("Exchange", key); exchange_account_set_save_password (account, FALSE); } + exchange_account_connect (account, password, &result); + g_free (password); + g_free (key); + camel_url_free (camel_url); + if (result == EXCHANGE_ACCOUNT_PASSWORD_EXPIRED) { #ifdef HAVE_KRB5 new_password = get_new_exchange_password (account); @@ -784,7 +790,6 @@ exchange_config_listener_authenticate (ExchangeConfigListener *ex_conf_listener, * expiry warning period */ result = EXCHANGE_ACCOUNT_CONNECT_SUCCESS; - } if (result == EXCHANGE_ACCOUNT_CONNECT_SUCCESS) { int max_pwd_age_days; @@ -794,9 +799,41 @@ exchange_config_listener_authenticate (ExchangeConfigListener *ex_conf_listener, if (max_pwd_age_days >= 0) { display_passwd_expiry_message (max_pwd_age_days, account); } + + /* check for oof state */ + + GladeXML *xml; + GtkWidget *dialog; + GtkResponseType response; + gboolean oof; + + if (exchange_oof_get (account, &oof, NULL)) { + if (oof) { + /* OOF state is set, check if user wants to set it back to in-office */ + xml = glade_xml_new (CONNECTOR_GLADEDIR "/exchange-oof.glade", + "oof_dialog", NULL); + if (!xml) { + e_error_run (NULL, "org-gnome-exchange-operations:state-update-error", NULL); + return result; + } + + dialog = glade_xml_get_widget (xml, "oof_dialog"); + if (!dialog) { + e_error_run (NULL, "org-gnome-exchange-operations:state-update-error", NULL); + g_object_unref (xml); + return result; + } + + response = gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + g_object_unref (xml); + + if (response == GTK_RESPONSE_YES) + if (!exchange_oof_set (account, FALSE, NULL)) + e_error_run (NULL, "org-gnome-exchange-operations:state-update-error", NULL); + } + } } - g_free (key); - camel_url_free (camel_url); return result; } diff --git a/plugins/exchange-operations/exchange-oof.glade b/plugins/exchange-operations/exchange-oof.glade new file mode 100644 index 0000000000..28294f795e --- /dev/null +++ b/plugins/exchange-operations/exchange-oof.glade @@ -0,0 +1,530 @@ + + + + + + + 6 + Out of Office Assistant + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + True + + + + True + False + 6 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + GTK_RELIEF_NORMAL + -9 + + + + True + 0.5 + 0.5 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-no + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + No, Don't Change Status + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + + + + True + True + True + GTK_RELIEF_NORMAL + -8 + + + + True + 0.5 + 0.5 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-yes + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Yes, Change Status + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 6 + + + + True + gtk-dialog-question + 6 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + True + + + + + + True + <b>Currently, your status is "Out of the Office". </b> + +Would you like to change your status to "In the Office"? + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + True + Out of Office Assistant + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + -6 + + + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 6 + + + + True + False + 6 + + + + True + gtk-dialog-info + 5 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + <small>The message specified below will be automatically sent to each person who sends +mail to you while you are out of the office.</small> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + + 6 + True + 2 + 2 + False + 6 + 6 + + + + True + <b>Status:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + True + I am currently in the office + True + GTK_RELIEF_NORMAL + False + False + True + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + True + I am currently out of the office + True + GTK_RELIEF_NORMAL + False + False + True + oof_no_radio + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + 6 + True + False + 6 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_OUT + GTK_CORNER_TOP_LEFT + + + + True + True + True + GTK_JUSTIFY_LEFT + GTK_WRAP_WORD + True + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0 + True + True + + + + + + + + True + <b>Out of Office Message:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + -- cgit v1.2.3