aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-08-13 10:27:13 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-08-13 10:27:13 +0800
commit311c8dd1226555f81c2eaca738969f5d9e123d1f (patch)
tree2c808669bf76465c7d24f23cf80d35cfcf3ce4e9 /modules
parent88aa930c58ad27858453a2109cc899f34df21056 (diff)
downloadgsoc2013-evolution-311c8dd1226555f81c2eaca738969f5d9e123d1f.tar
gsoc2013-evolution-311c8dd1226555f81c2eaca738969f5d9e123d1f.tar.gz
gsoc2013-evolution-311c8dd1226555f81c2eaca738969f5d9e123d1f.tar.bz2
gsoc2013-evolution-311c8dd1226555f81c2eaca738969f5d9e123d1f.tar.lz
gsoc2013-evolution-311c8dd1226555f81c2eaca738969f5d9e123d1f.tar.xz
gsoc2013-evolution-311c8dd1226555f81c2eaca738969f5d9e123d1f.tar.zst
gsoc2013-evolution-311c8dd1226555f81c2eaca738969f5d9e123d1f.zip
Add new preferences missed during the 2.27.90 merge.
Diffstat (limited to 'modules')
-rw-r--r--modules/addressbook/Makefile.am2
-rw-r--r--modules/addressbook/autocompletion-config.c71
-rw-r--r--modules/addressbook/e-book-shell-backend.c4
-rw-r--r--modules/addressbook/e-book-shell-settings.c34
-rw-r--r--modules/addressbook/e-book-shell-settings.h33
-rw-r--r--modules/calendar/e-cal-shell-settings.c2
-rw-r--r--modules/calendar/e-cal-shell-settings.h8
7 files changed, 145 insertions, 9 deletions
diff --git a/modules/addressbook/Makefile.am b/modules/addressbook/Makefile.am
index d7cd8c7c4e..5ba744dee6 100644
--- a/modules/addressbook/Makefile.am
+++ b/modules/addressbook/Makefile.am
@@ -40,6 +40,8 @@ libevolution_module_addressbook_la_SOURCES = \
e-book-shell-content.h \
e-book-shell-migrate.c \
e-book-shell-migrate.h \
+ e-book-shell-settings.c \
+ e-book-shell-settings.h \
e-book-shell-sidebar.c \
e-book-shell-sidebar.h \
e-book-shell-view.c \
diff --git a/modules/addressbook/autocompletion-config.c b/modules/addressbook/autocompletion-config.c
index 1ce9e707fa..68e276d1c7 100644
--- a/modules/addressbook/autocompletion-config.c
+++ b/modules/addressbook/autocompletion-config.c
@@ -92,22 +92,83 @@ initialize_selection (ESourceSelector *source_selector)
}
}
+static GtkWidget *
+add_section (GtkWidget *container,
+ const gchar *caption,
+ gboolean expand)
+{
+ GtkWidget *widget;
+ gchar *markup;
+
+ widget = gtk_vbox_new (FALSE, 6);
+ gtk_box_pack_start (GTK_BOX (container), widget, expand, expand, 0);
+ gtk_widget_show (widget);
+
+ container = widget;
+
+ markup = g_markup_printf_escaped ("<b>%s</b>", caption);
+ widget = gtk_label_new (markup);
+ gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
+ gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
+ gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+ gtk_widget_show (widget);
+ g_free (markup);
+
+ widget = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (widget), 0, 0, 12, 0);
+ gtk_box_pack_start (GTK_BOX (container), widget, expand, expand, 0);
+ gtk_widget_show (widget);
+
+ container = widget;
+
+ widget = gtk_vbox_new (FALSE, 6);
+ gtk_container_add (GTK_CONTAINER (container), widget);
+ gtk_widget_show (widget);
+
+ return widget;
+}
+
void
autocompletion_config_init (EShell *shell)
{
+ EShellSettings *shell_settings;
ESourceList *source_list;
GtkWidget *scrolled_window;
GtkWidget *source_selector;
GtkWidget *preferences_window;
+ GtkWidget *itembox;
+ GtkWidget *widget;
+ GtkWidget *vbox;
g_return_if_fail (E_IS_SHELL (shell));
+ shell_settings = e_shell_get_shell_settings (shell);
+
source_list = e_source_list_new_for_gconf_default (
"/apps/evolution/addressbook/sources");
- /* XXX should we watch for the source list to change and
- update it in the control? what about our local changes? */
- /* g_signal_connect (ac->source_list, "changed", G_CALLBACK (source_list_changed), ac); */
+ vbox = gtk_vbox_new (FALSE, 12);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
+ gtk_widget_show (vbox);
+
+ itembox = add_section (vbox, _("Date/Time Format"), FALSE);
+
+ widget = gtk_table_new (1, 3, FALSE);
+ gtk_box_pack_start (GTK_BOX (itembox), widget, TRUE, TRUE, 0);
+ e_datetime_format_add_setup_widget (
+ widget, 0, "addressbook", "table",
+ DTFormatKindDateTime, _("Table column:"));
+ gtk_widget_show (widget);
+
+ itembox = add_section (vbox, _("Autocompletion"), TRUE);
+
+ widget = gtk_check_button_new_with_mnemonic (
+ _("Always _show address of the autocompleted contact"));
+ e_mutual_binding_new (
+ G_OBJECT (shell_settings), "book-completion-show-address",
+ G_OBJECT (widget), "active");
+ gtk_box_pack_start (GTK_BOX (itembox), widget, FALSE, FALSE, 0);
+ gtk_widget_show (widget);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (
@@ -124,6 +185,8 @@ autocompletion_config_init (EShell *shell)
gtk_container_add (GTK_CONTAINER (scrolled_window), source_selector);
gtk_widget_show (source_selector);
+ gtk_box_pack_start (GTK_BOX (itembox), scrolled_window, TRUE, TRUE, 0);
+
initialize_selection (E_SOURCE_SELECTOR (source_selector));
preferences_window = e_shell_get_preferences_window (shell);
@@ -133,6 +196,6 @@ autocompletion_config_init (EShell *shell)
"contacts",
"preferences-autocompletion",
_("Contacts"),
- scrolled_window,
+ vbox,
200);
}
diff --git a/modules/addressbook/e-book-shell-backend.c b/modules/addressbook/e-book-shell-backend.c
index 9fe000aea8..87ac638822 100644
--- a/modules/addressbook/e-book-shell-backend.c
+++ b/modules/addressbook/e-book-shell-backend.c
@@ -44,6 +44,7 @@
#include "autocompletion-config.h"
#include "e-book-shell-migrate.h"
+#include "e-book-shell-settings.h"
#include "e-book-shell-view.h"
#ifdef ENABLE_SMIME
@@ -509,6 +510,9 @@ book_shell_backend_constructed (GObject *object)
G_CALLBACK (book_shell_backend_window_created_cb),
shell_backend);
+ /* Initialize settings before initializing preferences,
+ * since the preferences bind to the shell settings. */
+ e_book_shell_backend_init_settings (shell);
autocompletion_config_init (shell);
}
diff --git a/modules/addressbook/e-book-shell-settings.c b/modules/addressbook/e-book-shell-settings.c
new file mode 100644
index 0000000000..7a9544d721
--- /dev/null
+++ b/modules/addressbook/e-book-shell-settings.c
@@ -0,0 +1,34 @@
+/*
+ * e-book-shell-settings.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ */
+
+#include "e-book-shell-settings.h"
+
+void
+e_book_shell_backend_init_settings (EShell *shell)
+{
+ EShellSettings *shell_settings;
+
+ shell_settings = e_shell_get_shell_settings (shell);
+
+ e_shell_settings_install_property_for_key (
+ "book-completion-show-address",
+ "/apps/evolution/addressbook/completion/show_address");
+}
diff --git a/modules/addressbook/e-book-shell-settings.h b/modules/addressbook/e-book-shell-settings.h
new file mode 100644
index 0000000000..9e05de41df
--- /dev/null
+++ b/modules/addressbook/e-book-shell-settings.h
@@ -0,0 +1,33 @@
+/*
+ * e-book-shell-settings.h
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ */
+
+#ifndef E_BOOK_SHELL_SETTINGS_H
+#define E_BOOK_SHELL_SETTINGS_H
+
+#include <shell/e-shell.h>
+
+G_BEGIN_DECLS
+
+void e_book_shell_backend_init_settings (EShell *shell);
+
+G_END_DECLS
+
+#endif /* E_CAL_SHELL_SETTINGS_H */
diff --git a/modules/calendar/e-cal-shell-settings.c b/modules/calendar/e-cal-shell-settings.c
index be50c8e7b3..c6d3c984fb 100644
--- a/modules/calendar/e-cal-shell-settings.c
+++ b/modules/calendar/e-cal-shell-settings.c
@@ -1,5 +1,5 @@
/*
- * e-cal-shell-backend-settings.c
+ * e-cal-shell-settings.c
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
diff --git a/modules/calendar/e-cal-shell-settings.h b/modules/calendar/e-cal-shell-settings.h
index de8b22888b..5f7293bbed 100644
--- a/modules/calendar/e-cal-shell-settings.h
+++ b/modules/calendar/e-cal-shell-settings.h
@@ -1,5 +1,5 @@
/*
- * e-cal-shell-backend-settings.h
+ * e-cal-shell-settings.h
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -19,8 +19,8 @@
*
*/
-#ifndef E_CAL_SHELL_BACKEND_SETTINGS_H
-#define E_CAL_SHELL_BACKEND_SETTINGS_H
+#ifndef E_CAL_SHELL_SETTINGS_H
+#define E_CAL_SHELL_SETTINGS_H
#include <shell/e-shell.h>
@@ -30,4 +30,4 @@ void e_cal_shell_backend_init_settings (EShell *shell);
G_END_DECLS
-#endif /* E_CAL_SHELL_BACKEND_SETTINGS_H */
+#endif /* E_CAL_SHELL_SETTINGS_H */