aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShreyas Srinivasan <sshreyas@novell.com>2005-05-12 20:59:06 +0800
committerShreyas Srinivasan <shres@src.gnome.org>2005-05-12 20:59:06 +0800
commit6262536b11416a7d3737d400294b9b9524544564 (patch)
treeb3f65b30439b52c1a3a1f90f61d1414b5e36bb8b
parent4dd8375988405693682cda859ccfd8044a286e52 (diff)
downloadgsoc2013-evolution-6262536b11416a7d3737d400294b9b9524544564.tar
gsoc2013-evolution-6262536b11416a7d3737d400294b9b9524544564.tar.gz
gsoc2013-evolution-6262536b11416a7d3737d400294b9b9524544564.tar.bz2
gsoc2013-evolution-6262536b11416a7d3737d400294b9b9524544564.tar.lz
gsoc2013-evolution-6262536b11416a7d3737d400294b9b9524544564.tar.xz
gsoc2013-evolution-6262536b11416a7d3737d400294b9b9524544564.tar.zst
gsoc2013-evolution-6262536b11416a7d3737d400294b9b9524544564.zip
Fixed #272005
2005-05-12 Shreyas Srinivasan <sshreyas@novell.com> * e-send-options.c : Fixed #272005 svn path=/trunk/; revision=29340
-rw-r--r--widgets/misc/e-send-options.c56
1 files changed, 46 insertions, 10 deletions
diff --git a/widgets/misc/e-send-options.c b/widgets/misc/e-send-options.c
index 846131ae03..4d0f5b1cfe 100644
--- a/widgets/misc/e-send-options.c
+++ b/widgets/misc/e-send-options.c
@@ -18,11 +18,16 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Bangalore, MA 02111-1307, India.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <string.h>
#include <glib.h>
#include <gtk/gtksignal.h>
#include <gtk/gtktogglebutton.h>
#include <gtk/gtk.h>
+#include <libgnome/libgnome.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
#include <time.h>
@@ -89,12 +94,14 @@ struct _ESendOptionsDialogPrivate {
GtkWidget *accepted_label;
GtkWidget *completed_label;
GtkWidget *until_label;
+ char *help_section;
};
static void e_sendoptions_dialog_class_init (GObjectClass *object_class);
static void e_sendoptions_dialog_finalize (GObject *object);
static void e_sendoptions_dialog_init (GObject *object);
static void e_sendoptions_dialog_dispose (GObject *object);
+static void e_send_options_cb (GtkDialog *dialog, gint state, gpointer func_data);
static GObjectClass *parent_class = NULL;
@@ -379,6 +386,7 @@ init_widgets (ESendOptionsDialog *sod)
g_signal_connect (priv->delay_delivery, "toggled", G_CALLBACK (delay_delivery_toggled_cb), sod);
g_signal_connect (priv->create_sent, "toggled", G_CALLBACK (sent_item_toggled_cb), sod);
+ g_signal_connect (GTK_DIALOG (priv->main), "response", G_CALLBACK(e_send_options_cb), sod);
g_signal_connect (priv->delay_until, "changed", G_CALLBACK (delay_until_date_changed_cb), sod);
if (priv->global)
@@ -499,6 +507,7 @@ setup_widgets (ESendOptionsDialog *sod, Item_type type)
switch (type) {
case E_ITEM_MAIL:
+ priv->help_section = g_strdup ("usage-mail");
gtk_widget_hide (priv->accepted_label);
gtk_widget_hide (priv->when_accepted);
gtk_widget_hide (priv->completed_label);
@@ -506,9 +515,11 @@ setup_widgets (ESendOptionsDialog *sod, Item_type type)
gtk_label_set_text_with_mnemonic (GTK_LABEL (priv->declined_label), (_("When de_leted:")));
break;
case E_ITEM_CALENDAR:
+ priv->help_section = g_strdup ("usage-calendar");
gtk_widget_hide (priv->completed_label);
gtk_widget_hide (priv->when_completed);
case E_ITEM_TASK:
+ priv->help_section = g_strdup ("usage-calendar-todo");
gtk_widget_hide (priv->classification_label);
gtk_widget_hide (priv->classification);
gtk_widget_set_sensitive (priv->autodelete, FALSE);
@@ -568,12 +579,41 @@ e_sendoptions_set_global (ESendOptionsDialog *sod, gboolean set)
return TRUE;
}
+static void e_send_options_cb (GtkDialog *dialog, gint state, gpointer func_data)
+{
+
+ ESendOptionsDialogPrivate *priv;
+ ESendOptionsDialog *sod;
+ GError *error = NULL;
+
+ sod = func_data;
+ priv = sod->priv;
+
+ switch (state) {
+ case GTK_RESPONSE_OK:
+ e_send_options_get_widgets_data (sod);
+ case GTK_RESPONSE_CANCEL:
+ gtk_widget_hide (priv->main);
+ gtk_widget_destroy (priv->main);
+ g_object_unref (priv->xml);
+ break;
+ case GTK_RESPONSE_HELP:
+ gnome_help_display_desktop (NULL,
+ "evolution-" BASE_VERSION,
+ "evolution-" BASE_VERSION ".xml",
+ priv->help_section,
+ &error);
+ if (error != NULL)
+ g_warning ("%s", error->message);
+ break;
+ }
+}
+
gboolean
e_sendoptions_dialog_run (ESendOptionsDialog *sod, GtkWidget *parent, Item_type type)
{
ESendOptionsDialogPrivate *priv;
GtkWidget *toplevel;
- int result;
g_return_val_if_fail (sod != NULL || E_IS_SENDOPTIONS_DIALOG (sod), FALSE);
@@ -606,16 +646,10 @@ e_sendoptions_dialog_run (ESendOptionsDialog *sod, GtkWidget *parent, Item_type
e_send_options_fill_widgets_with_data (sod);
sensitize_widgets (sod);
init_widgets (sod);
-
- result = gtk_dialog_run (GTK_DIALOG (priv->main));
-
- if (result == GTK_RESPONSE_OK)
- e_send_options_get_widgets_data (sod);
+ gtk_window_set_modal ((GtkWindow *)priv->main, TRUE);
- gtk_widget_hide (priv->main);
- gtk_widget_destroy (priv->main);
- g_object_unref (priv->xml);
-
+ gtk_widget_show (priv->main);
+
return TRUE;
}
@@ -628,6 +662,8 @@ e_sendoptions_dialog_finalize (GObject *object)
g_return_if_fail (E_IS_SENDOPTIONS_DIALOG (sod));
priv = sod->priv;
+ g_free (priv->help_section);
+
if (sod->data->gopts) {
g_free (sod->data->gopts);
sod->data->gopts = NULL;