aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/subject-thread/subject-thread.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@novell.com>2004-10-20 13:17:18 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-10-20 13:17:18 +0800
commitd07cf0b56e7b9ea11510894b0c0f676dd64d5235 (patch)
tree4d7194710642e4f6a682207205b8ad8cab65e466 /plugins/subject-thread/subject-thread.c
parent7a63b8258e7df770fe185e7dc02e1b05118ce391 (diff)
downloadgsoc2013-evolution-d07cf0b56e7b9ea11510894b0c0f676dd64d5235.tar.gz
gsoc2013-evolution-d07cf0b56e7b9ea11510894b0c0f676dd64d5235.tar.zst
gsoc2013-evolution-d07cf0b56e7b9ea11510894b0c0f676dd64d5235.zip
implement
2004-10-20 JP Rosevear <jpr@novell.com> * subject-thread.c: implement * org-gnome-subject-thread.eplug.in: define the subject-thread plugin * Makefile.am: build the subject thread plugin svn path=/trunk/; revision=27639
Diffstat (limited to 'plugins/subject-thread/subject-thread.c')
-rw-r--r--plugins/subject-thread/subject-thread.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/plugins/subject-thread/subject-thread.c b/plugins/subject-thread/subject-thread.c
new file mode 100644
index 0000000000..e464c01f4c
--- /dev/null
+++ b/plugins/subject-thread/subject-thread.c
@@ -0,0 +1,67 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Authors: JP Rosevear <jpr@novell.com>
+ *
+ * Copyright 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 Street #330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+#include <glib.h>
+#include <gtk/gtk.h>
+#include <libgnome/gnome-i18n.h>
+#include <gconf/gconf-client.h>
+#include <e-util/e-config.h>
+#include <mail/em-config.h>
+
+#define GCONF_KEY "/apps/evolution/mail/display/thread_subject"
+
+GtkWidget *subject_thread_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data);
+
+static void
+toggled_cb (GtkWidget *widget, EConfig *config)
+{
+ EMConfigTargetPrefs *target = (EMConfigTargetPrefs *) config->target;
+
+ /* Save the new setting to gconf */
+ gconf_client_set_bool (target->gconf, GCONF_KEY, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)), NULL);
+}
+
+GtkWidget *
+subject_thread_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data)
+{
+ GtkWidget *check;
+ EMConfigTargetPrefs *target = (EMConfigTargetPrefs *) hook_data->config->target;
+
+ /* Create the checkbox we will display, complete with mnemonic that is unique in the dialog */
+ check = gtk_check_button_new_with_mnemonic (_("Fall back to threading messages by sub_ject"));
+
+ /* Set the toggle button to the current gconf setting */
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gconf_client_get_bool (target->gconf, GCONF_KEY, NULL));
+
+ /* Listen for the item being toggled on and off */
+ g_signal_connect (GTK_TOGGLE_BUTTON (check), "toggled", G_CALLBACK (toggled_cb), hook_data->config);
+
+ /* Pack the checkbox in the parent widget and show it */
+ gtk_box_pack_start (GTK_BOX (hook_data->parent), check, FALSE, FALSE, 0);
+ gtk_widget_show (check);
+
+ return check;
+}