diff -Nru evolution-3.16.0/aclocal.m4 evolution-3.12.11/aclocal.m4
--- evolution-3.16.0/aclocal.m4 2015-03-23 06:59:14.000000000 +0000
+++ evolution-3.12.11/aclocal.m4 2015-02-09 08:21:51.000000000 +0000
@@ -20,187 +20,6 @@
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# SYNOPSIS
-#
-# AX_CODE_COVERAGE()
-#
-# DESCRIPTION
-#
-# Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be
-# included in the CFLAGS and LIBS/LDFLAGS variables of every build target
-# (program or library) which should be built with code coverage support.
-# Also defines CODE_COVERAGE_RULES which should be substituted in your
-# Makefile; and $enable_code_coverage which can be used in subsequent
-# configure output. CODE_COVERAGE_ENABLED is defined and substituted, and
-# corresponds to the value of the --enable-code-coverage option, which
-# defaults to being disabled.
-#
-# Note that all optimisation flags in CFLAGS must be disabled when code
-# coverage is enabled.
-#
-# Usage example:
-# configure.ac:
-# AX_CODE_COVERAGE
-#
-# Makefile.am:
-# @CODE_COVERAGE_RULES@
-# my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
-# my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
-#
-# This results in a “check-code-coverage” rule being added to any Makefile.am
-# which includes “@CODE_COVERAGE_RULES@” (assuming the module has been
-# configured with --enable-code-coverage). Running `make check-code-coverage`
-# in that directory will run the module’s test suite (`make check`) and build
-# a code coverage report detailing the code which was touched, then print the
-# URI for the report.
-#
-# LICENSE
-#
-# Copyright © 2012, 2014 Philip Withnall
-# Copyright © 2012 Xan Lopez
-# Copyright © 2012 Christian Persch
-# Copyright © 2012 Paolo Borelli
-# Copyright © 2012 Dan Winship
-#
-# Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
-# This file is licenced under LGPLv2.1+.
-
-#serial 1
-
-AC_DEFUN([AX_CODE_COVERAGE],[
- dnl Check for --enable-code-coverage
- AC_MSG_CHECKING([whether to build with code coverage support])
- AC_ARG_ENABLE([code-coverage], AS_HELP_STRING([--enable-code-coverage], [Whether to enable code coverage support]),, enable_code_coverage=no)
- AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
- AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
- AC_MSG_RESULT($enable_code_coverage)
-
- AS_IF([ test "$enable_code_coverage" = "yes" ], [
- dnl Check if gcc is being used
- AS_IF([ test "$GCC" = "no" ], [
- AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
- ])
-
- # List of supported lcov versions.
- lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11"
-
- AC_CHECK_PROG([LCOV], [lcov], [lcov])
- AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
-
- AS_IF([ test "$LCOV" ], [
- AC_CACHE_CHECK([for lcov version], ax_cv_lcov_version, [
- ax_cv_lcov_version=invalid
- lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
- for lcov_check_version in $lcov_version_list; do
- if test "$lcov_version" = "$lcov_check_version"; then
- ax_cv_lcov_version="$lcov_check_version (ok)"
- fi
- done
- ])
- ], [
- lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
- AC_MSG_ERROR([$lcov_msg])
- ])
-
- case $ax_cv_lcov_version in
- ""|invalid[)]
- lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
- AC_MSG_ERROR([$lcov_msg])
- LCOV="exit 0;"
- ;;
- esac
-
- AS_IF([ test -z "$GENHTML" ], [
- AC_MSG_ERROR([Could not find genhtml from the lcov package])
- ])
-
- dnl Build the code coverage flags
- CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
- CODE_COVERAGE_LDFLAGS="-lgcov"
-
- AC_SUBST([CODE_COVERAGE_CFLAGS])
- AC_SUBST([CODE_COVERAGE_LDFLAGS])
- ])
-
-CODE_COVERAGE_RULES='
-# Code coverage
-#
-# Optional:
-# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
-# (Default: $(top_builddir))
-# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
-# by lcov for code coverage. (Default:
-# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
-# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
-# reports to be created. (Default:
-# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
-# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the lcov instance.
-# (Default: empty)
-# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
-# instance. (Default: empty)
-# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
-#
-# The generated report will be titled using the $(PACKAGE_NAME) and
-# $(PACKAGE_VERSION). In order to add the current git hash to the title,
-# use the git-version-gen script, available online.
-
-# Optional variables
-CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
-CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
-CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
-CODE_COVERAGE_LCOV_OPTIONS ?=
-CODE_COVERAGE_GENHTML_OPTIONS ?=
-CODE_COVERAGE_IGNORE_PATTERN ?=
-
-code_coverage_quiet = $(code_coverage_quiet_$(V))
-code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
-code_coverage_quiet_0 = --quiet
-
-# Use recursive makes in order to ignore errors during check
-check-code-coverage:
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
- -$(MAKE) $(AM_MAKEFLAGS) -k check
- $(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
-else
- @echo "Need to reconfigure with --enable-code-coverage"
-endif
-
-# Capture code coverage data
-code-coverage-capture: code-coverage-capture-hook
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
- $(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS)
- $(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)"
- -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
- LANG=C $(GENHTML) $(code_coverage_quiet) --prefix $(CODE_COVERAGE_DIRECTORY) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
- @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
-else
- @echo "Need to reconfigure with --enable-code-coverage"
-endif
-
-# Hook rule executed before code-coverage-capture, overridable by the user
-code-coverage-capture-hook:
-
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
-clean: code-coverage-clean
-code-coverage-clean:
- -$(LCOV) --directory $(top_builddir) -z
- -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
- -find . -name "*.gcda" -o -name "*.gcov" -delete
-endif
-
-GITIGNOREFILES ?=
-GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
-
-DISTCHECK_CONFIGURE_FLAGS ?=
-DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
-
-.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
-'
-
- AC_SUBST([CODE_COVERAGE_RULES])
- m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])])
-])
-
# Configure paths for GLIB
# Owen Taylor 1997-2001
@@ -413,48 +232,6 @@
rm -f conf.glibtest
])
-dnl GNOME_CODE_COVERAGE
-dnl
-dnl Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be
-dnl included in the CFLAGS and LIBS/LDFLAGS variables of every build target
-dnl (program or library) which should be built with code coverage support.
-dnl Also defines GNOME_CODE_COVERAGE_RULES which should be substituted in your
-dnl Makefile; and $enable_code_coverage which can be used in subsequent
-dnl configure output.
-dnl
-dnl Note that all optimisation flags in CFLAGS must be disabled when code
-dnl coverage is enabled.
-dnl
-dnl Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
-dnl This file is licenced under LGPLv2.1+.
-dnl
-dnl Usage example:
-dnl configure.ac:
-dnl GNOME_CODE_COVERAGE
-dnl
-dnl Makefile.am:
-dnl @GNOME_CODE_COVERAGE_RULES@
-dnl my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
-dnl my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
-dnl
-dnl This results in a “check-code-coverage” rule being added to any Makefile.am
-dnl which includes “@GNOME_CODE_COVERAGE_RULES@” (assuming the module has been
-dnl configured with --enable-code-coverage). Running `make check-code-coverage`
-dnl in that directory will run the module’s test suite (`make check`) and build
-dnl a code coverage report detailing the code which was touched, then print the
-dnl URI for the report.
-
-AU_DEFUN([GNOME_CODE_COVERAGE],[
- AX_CODE_COVERAGE
- GNOME_CODE_COVERAGE_RULES=$CODE_COVERAGE_RULES
-
- AC_SUBST([GNOME_CODE_COVERAGE_RULES])
- m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([GNOME_CODE_COVERAGE_RULES])])
-],
-[[$0: This macro is deprecated. You should use AX_CODE_COVERAGE instead and
-replace uses of GNOME_CODE_COVERAGE_RULES with CODE_COVERAGE_RULES.
-See: http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html#ax_code_coverage]])
-
dnl GLIB_GSETTINGS
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
dnl the schema should be compiled
@@ -2166,7 +1943,6 @@
m4_include([m4/as-ac-expand.m4])
m4_include([m4/as-compiler-flag.m4])
-m4_include([m4/behave-installed-tests.m4])
m4_include([m4/evo_check_langinfo.m4])
m4_include([m4/evo_ldap_check.m4])
m4_include([m4/evo_purify_support.m4])
diff -Nru evolution-3.16.0/addressbook/addressbook.error.xml evolution-3.12.11/addressbook/addressbook.error.xml
--- evolution-3.16.0/addressbook/addressbook.error.xml 2014-05-12 14:59:18.000000000 +0000
+++ evolution-3.12.11/addressbook/addressbook.error.xml 2014-03-24 09:25:23.000000000 +0000
@@ -65,11 +65,6 @@
{0}
-
- <_primary>Failed to refresh address book '{0}'
- {1}
-
-
<_primary>Would you like to save your changes?
<_secondary>You have made modifications to this contact. Do you want to save these changes?
diff -Nru evolution-3.16.0/addressbook/gui/contact-editor/contact-editor.ui evolution-3.12.11/addressbook/gui/contact-editor/contact-editor.ui
--- evolution-3.16.0/addressbook/gui/contact-editor/contact-editor.ui 2014-09-24 06:50:29.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/contact-editor/contact-editor.ui 2014-03-24 09:25:23.000000000 +0000
@@ -307,38 +307,68 @@
vertical
10
-
-
-
- True
-
-
+
+
True
-
-
+ 4
+
+
True
- Telephone
+ Email
+
+ False
+ False
+ 0
+
-
-
- 0
-
-
-
-
- True
- 12
- vertical
- 6
-
+
+ 20
+ 20
True
+ True
+ False
+ none
+
+
+ Email
+
+
+
+
+ True
+ none
+
+
1
@@ -406,99 +509,424 @@
False
- 1
+ False
+ 0
-
+
True
+ vertical
-
+
True
-
-
+ 0
+ none
+
+
True
- SIP Address
-
-
-
+ 12
+ vertical
+ 6
+
+
+ True
+ 2
+ 4
+ 6
+ 6
+
+
+ True
+ True
+
+
+ 1
+ 2
+
+
+
+
+
+ True
+ True
+
+
+ 1
+ 2
+ 1
+ 2
+
+
+
+
+
+ True
+ True
+
+
+ 3
+ 4
+ 1
+ 2
+
+
+
+
+
+ True
+ True
+
+
+ 3
+ 4
+
+
+
+
+
+ True
+
+
+ GTK_FILL
+ GTK_FILL
+
+
+
+
+ True
+
+
+ 1
+ 2
+ GTK_FILL
+ GTK_FILL
+
+
+
+
+ True
+
+
+ 2
+ 3
+ GTK_FILL
+ GTK_FILL
+
+
+
+
+ True
+
+
+ 2
+ 3
+ 1
+ 2
+ GTK_FILL
+ GTK_FILL
+
+
+
+
+ False
+ 0
+
+
+
+
+ 2
+ 4
+ 6
+ 6
+
+
+ True
+ True
+
+
+ 1
+ 2
+
+
+
+
+
+ True
+ True
+
+
+ 1
+ 2
+ 1
+ 2
+
+
+
+
+
+ True
+ True
+
+
+ 3
+ 4
+
+
+
+
+
+ True
+ True
+
+
+ 3
+ 4
+ 1
+ 2
+
+
+
+
+
+ True
+
+
+ GTK_FILL
+ GTK_FILL
+
+
+
+
+ True
+
+
+ 1
+ 2
+ GTK_FILL
+ GTK_FILL
+
+
+
+
+ True
+
+
+ 2
+ 3
+ GTK_FILL
+ GTK_FILL
+
+
+
+
+ True
+
+
+ 2
+ 3
+ 1
+ 2
+ GTK_FILL
+ GTK_FILL
+
+
+
+
+ False
+ 1
+
+
-
-
- 0
-
-
-
-
- True
- 12
- vertical
- 6
-
-
+
+
True
+ 4
+
+
+ True
+ Telephone
+
+
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ 20
+ 20
+ True
+ True
+ False
+ none
+
+
+ Telephone
+
+
+
+
+ True
+ none
+
+
+
+
+ 1
+
+
-
- 0
-
- 1
+ False
+ 0
False
- 2
+ 1
-
+
True
+ 0
+ none
-
+
True
-
-
+ 12
+ 2
+ 4
+ 6
+ 6
+
+
True
- Instant Messaging
-
-
-
+ True
+
+ 1
+ 2
+ 0
+ 1
+
+
-
-
- 0
-
-
-
-
- True
- 12
- vertical
- 6
-
+
True
+ True
- 0
+ 1
+ 2
+ 1
+ 2
+
+
+
+
+
+ True
+ True
+
+
+ 3
+ 4
+ 0
+ 1
+
+
+
+
+
+ True
+ True
+
+
+ 3
+ 4
+ 1
+ 2
+
+
+
+
+
+ True
+
+
+ 0
+ 1
+ 0
+ 1
+ GTK_FILL
+ GTK_FILL
+
+
+
+
+ True
+
+
+ 0
+ 1
+ 1
+ 2
+ GTK_FILL
+ GTK_FILL
+
+
+
+
+ True
+
+
+ 2
+ 3
+ 0
+ 1
+ GTK_FILL
+ GTK_FILL
+
+
+
+
+ True
+
+
+ 2
+ 3
+ 1
+ 2
+ GTK_FILL
+ GTK_FILL
-
- 1
-
+
+
+
+ True
+ Instant Messaging
+
+
+
+
False
- 3
+ 2
@@ -522,7 +950,7 @@
-
+
True
True
automatic
@@ -539,10 +967,12 @@
True
12
vertical
- 0
+ 12
-
+
True
+ 0
+ none
True
@@ -711,12 +1141,45 @@
-
+
True
- Web Addresses
-
-
-
+ 4
+
+
+ True
+ Web Addresses
+
+
+
+
+
+ 0
+
+
+
+
+ 20
+ 20
+ True
+ True
+ False
+ none
+
+
+ Web addresses
+
+
+
+
+ True
+ none
+
+
+
+
+ 1
+
+
@@ -726,8 +1189,10 @@
-
+
True
+ 0
+ none
True
@@ -1134,7 +1599,7 @@
-
+
True
True
automatic
@@ -1151,13 +1616,11 @@
True
vertical
-
+
True
6
0
none
- FALSE
- GTK_ALIGN_START
True
@@ -1392,18 +1855,14 @@
0
- FALSE
- FALSE
-
+
True
6
0
none
- FALSE
- GTK_ALIGN_START
True
@@ -1638,8 +2097,6 @@
1
- FALSE
- FALSE
@@ -1647,8 +2104,6 @@
True
True
6
- FALSE
- GTK_ALIGN_START
True
@@ -1883,8 +2338,6 @@
2
- FALSE
- FALSE
@@ -1907,7 +2360,7 @@
-
+
True
True
12
@@ -1958,34 +2411,7 @@
False
False
- 4
-
-
-
-
-
- False
- False
- 1
+ 0
@@ -2001,7 +2427,7 @@
False
False
- 2
+ 1
@@ -2019,7 +2445,7 @@
False
False
- 3
+ 2
@@ -2037,108 +2463,4 @@
button-ok
-
-
-
diff -Nru evolution-3.16.0/addressbook/gui/contact-editor/e-contact-editor.c evolution-3.12.11/addressbook/gui/contact-editor/e-contact-editor.c
--- evolution-3.16.0/addressbook/gui/contact-editor/e-contact-editor.c 2014-11-13 07:31:44.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/contact-editor/e-contact-editor.c 2014-09-02 08:21:25.000000000 +0000
@@ -40,39 +40,18 @@
#include "addressbook/printing/e-contact-print.h"
#include "addressbook/gui/widgets/eab-gui-util.h"
-#include "addressbook/util/eab-book-util.h"
#include "eab-contact-merging.h"
#include "e-contact-editor-fullname.h"
-#include "e-contact-editor-dyntable.h"
-#define SLOTS_PER_LINE 2
-#define SLOTS_IN_COLLAPSED_STATE SLOTS_PER_LINE
-#define EMAIL_SLOTS 50
-#define PHONE_SLOTS 50
-#define SIP_SLOTS 4
-#define IM_SLOTS 50
+#define EMAIL_SLOTS 4
+#define PHONE_SLOTS 8
+#define IM_SLOTS 4
#define ADDRESS_SLOTS 3
-/* represents index in address_name */
-#define ADDRESS_SLOT_HOME 1
-#define ADDRESS_SLOT_WORK 0
-#define ADDRESS_SLOT_OTHER 2
-
#define EVOLUTION_UI_SLOT_PARAM "X-EVOLUTION-UI-SLOT"
-#define CHECK_PHONE 1
-#define CHECK_SIP 2
-#define CHECK_IM 3
-#define CHECK_HOME 4
-#define CHECK_WORK 5
-#define CHECK_OTHER 6
-#define CHECK_WEB 7
-#define CHECK_JOB 8
-#define CHECK_MISC 9
-#define CHECK_NOTE 10
-
/* IM columns */
enum {
COLUMN_IM_ICON,
@@ -137,7 +116,32 @@
DYNAMIC_LIST_ADDRESS
};
-/* Defaults selected from eab_phone_types */
+static struct {
+ EContactField field_id;
+ const gchar *type_1;
+ const gchar *type_2;
+}
+phones[] = {
+ { E_CONTACT_PHONE_ASSISTANT, EVC_X_ASSISTANT, NULL },
+ { E_CONTACT_PHONE_BUSINESS, "WORK", "VOICE" },
+ { E_CONTACT_PHONE_BUSINESS_FAX, "WORK", "FAX" },
+ { E_CONTACT_PHONE_CALLBACK, EVC_X_CALLBACK, NULL },
+ { E_CONTACT_PHONE_CAR, "CAR", NULL },
+ { E_CONTACT_PHONE_COMPANY, "X-EVOLUTION-COMPANY", NULL },
+ { E_CONTACT_PHONE_HOME, "HOME", "VOICE" },
+ { E_CONTACT_PHONE_HOME_FAX, "HOME", "FAX" },
+ { E_CONTACT_PHONE_ISDN, "ISDN", NULL },
+ { E_CONTACT_PHONE_MOBILE, "CELL", NULL },
+ { E_CONTACT_PHONE_OTHER, "VOICE", NULL },
+ { E_CONTACT_PHONE_OTHER_FAX, "FAX", NULL },
+ { E_CONTACT_PHONE_PAGER, "PAGER", NULL },
+ { E_CONTACT_PHONE_PRIMARY, "PREF", NULL },
+ { E_CONTACT_PHONE_RADIO, EVC_X_RADIO, NULL },
+ { E_CONTACT_PHONE_TELEX, EVC_X_TELEX, NULL },
+ { E_CONTACT_PHONE_TTYTDD, EVC_X_TTYTDD, NULL }
+};
+
+/* Defaults from the table above */
static const gint phones_default[] = { 1, 6, 9, 2, 7, 12, 10, 10 };
static EContactField addresses[] = {
@@ -158,31 +162,39 @@
"other"
};
-/*
- * keep fetch_set in sync with labels from eab_im_service
- */
-static EContactField
-im_service_fetch_set[] =
-{
- E_CONTACT_IM_AIM,
- E_CONTACT_IM_JABBER,
- E_CONTACT_IM_YAHOO,
- E_CONTACT_IM_GADUGADU,
- E_CONTACT_IM_MSN,
- E_CONTACT_IM_ICQ,
- E_CONTACT_IM_GROUPWISE,
- E_CONTACT_IM_SKYPE,
- E_CONTACT_IM_TWITTER,
- E_CONTACT_IM_GOOGLE_TALK
+static struct {
+ EContactField field;
+ const gchar *pretty_name;
+}
+im_service[] =
+{
+ { E_CONTACT_IM_AIM, N_ ("AIM") },
+ { E_CONTACT_IM_JABBER, N_ ("Jabber") },
+ { E_CONTACT_IM_YAHOO, N_ ("Yahoo") },
+ { E_CONTACT_IM_GADUGADU, N_ ("Gadu-Gadu") },
+ { E_CONTACT_IM_MSN, N_ ("MSN") },
+ { E_CONTACT_IM_ICQ, N_ ("ICQ") },
+ { E_CONTACT_IM_GROUPWISE, N_ ("GroupWise") },
+ { E_CONTACT_IM_SKYPE, N_ ("Skype") },
+ { E_CONTACT_IM_TWITTER, N_ ("Twitter") }
};
-/* Defaults selected from eab_get_im_type_labels */
+/* Defaults from the table above */
static const gint im_service_default[] = { 0, 2, 4, 5 };
+static struct {
+ const gchar *name;
+ const gchar *pretty_name;
+}
+common_location[] =
+{
+ { "WORK", N_ ("Work") },
+ { "HOME", N_ ("Home") },
+ { "OTHER", N_ ("Other") }
+};
/* Default from the table above */
static const gint email_default[] = { 0, 1, 2, 2 };
-static const gint sips_default[] = { 0, 1, 2, 2 };
#define STRING_IS_EMPTY(x) (!(x) || !(*(x)))
#define STRING_MAKE_NON_NULL(x) ((x) ? (x) : "")
@@ -254,14 +266,14 @@
{ "undo",
"edit-undo",
- N_("_Undo"),
+ N_("Undo"),
"z",
N_("Undo"),
NULL }, /* Handled by EFocusTracker */
{ "redo",
"edit-redo",
- N_("_Redo"),
+ N_("Redo"),
"y",
N_("Redo"),
NULL } /* Handled by EFocusTracker */
@@ -869,29 +881,170 @@
}
static void
-init_email_record_location (EContactEditor *editor)
+set_combo_box_active (EContactEditor *editor,
+ GtkComboBox *combo_box,
+ gint active)
{
- GtkWidget *w;
+ g_signal_handlers_block_matched (
+ combo_box, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor);
+ gtk_combo_box_set_active (combo_box, active);
+ g_signal_handlers_unblock_matched (
+ combo_box, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor);
+}
+
+static void
+init_email_record_location (EContactEditor *editor,
+ gint record)
+{
+ GtkComboBox *location_combo_box;
+ GtkWidget *email_entry;
+ gchar *widget_name;
+ gint i;
+ GtkTreeIter iter;
GtkListStore *store;
- gint i, n_elements;
- EContactEditorDynTable *dyntable;
- const EABTypeLabel *email_types = eab_get_email_type_labels (&n_elements);
-
- w = e_builder_get_widget (editor->priv->builder, "mail-dyntable");
- dyntable = E_CONTACT_EDITOR_DYNTABLE (w);
- store = e_contact_editor_dyntable_get_combo_store (dyntable);
- for (i = 0; i < n_elements; i++) {
- GtkTreeIter iter;
+ widget_name = g_strdup_printf ("entry-email-%d", record);
+ email_entry = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
+
+ widget_name = g_strdup_printf ("combobox-email-%d", record);
+ location_combo_box = GTK_COMBO_BOX (
+ e_builder_get_widget (editor->priv->builder, widget_name));
+ g_free (widget_name);
+
+ store = GTK_LIST_STORE (gtk_combo_box_get_model (location_combo_box));
+ gtk_list_store_clear (store);
+ for (i = 0; i < G_N_ELEMENTS (common_location); i++) {
gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- DYNTABLE_COMBO_COLUMN_TEXT, _(email_types[i].text),
- DYNTABLE_COMBO_COLUMN_SENSITIVE, TRUE,
- -1);
+ gtk_list_store_set (
+ store, &iter,
+ 0, _(common_location[i].pretty_name),
+ -1);
+ }
+
+ g_signal_connect_swapped (
+ location_combo_box, "changed",
+ G_CALLBACK (gtk_widget_grab_focus), email_entry);
+ g_signal_connect (
+ location_combo_box, "changed",
+ G_CALLBACK (object_changed), editor);
+ g_signal_connect (
+ email_entry, "changed",
+ G_CALLBACK (object_changed), editor);
+ g_signal_connect_swapped (
+ email_entry, "activate",
+ G_CALLBACK (entry_activated), editor);
+}
+
+static void
+fill_in_email_record (EContactEditor *editor,
+ gint record,
+ const gchar *address,
+ gint location)
+{
+ GtkWidget *location_combo_box;
+ GtkWidget *email_entry;
+ gchar *widget_name;
+
+ widget_name = g_strdup_printf ("combobox-email-%d", record);
+ location_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
+
+ widget_name = g_strdup_printf ("entry-email-%d", record);
+ email_entry = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
+
+ set_combo_box_active (
+ editor, GTK_COMBO_BOX (location_combo_box),
+ location >= 0 ? location : email_default[2]);
+ set_entry_text (editor, GTK_ENTRY (email_entry), address ? address : "");
+}
+
+static void
+extract_email_record (EContactEditor *editor,
+ gint record,
+ gchar **address,
+ gint *location)
+{
+ GtkWidget *location_combo_box;
+ GtkWidget *email_entry;
+ gchar *widget_name;
+ const gchar *text;
+
+ widget_name = g_strdup_printf ("combobox-email-%d", record);
+ location_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
+
+ widget_name = g_strdup_printf ("entry-email-%d", record);
+ email_entry = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
+
+ text = gtk_entry_get_text (GTK_ENTRY (email_entry));
+ *address = g_strstrip (g_strdup (text));
+ *location = gtk_combo_box_get_active (GTK_COMBO_BOX (location_combo_box));
+}
+
+static const gchar *
+email_index_to_location (gint index)
+{
+ return common_location[index].name;
+}
+
+static const gchar *
+im_index_to_location (gint index)
+{
+ return common_location[index].name;
+}
+
+static void
+phone_index_to_type (gint index,
+ const gchar **type_1,
+ const gchar **type_2)
+{
+ *type_1 = phones [index].type_1;
+ *type_2 = phones [index].type_2;
+}
+
+static gint
+get_email_location (EVCardAttribute *attr)
+{
+ gint i;
+
+ for (i = 0; i < G_N_ELEMENTS (common_location); i++) {
+ if (e_vcard_attribute_has_type (attr, common_location[i].name))
+ return i;
+ }
+
+ return -1;
+}
+
+static gint
+get_im_location (EVCardAttribute *attr)
+{
+ gint i;
+
+ for (i = 0; i < G_N_ELEMENTS (common_location); i++) {
+ if (e_vcard_attribute_has_type (attr, common_location[i].name))
+ return i;
+ }
+
+ return -1;
+}
+
+static gint
+get_phone_type (EVCardAttribute *attr)
+{
+ gint i;
+
+ for (i = 0; i < G_N_ELEMENTS (phones); i++) {
+ if (e_vcard_attribute_has_type (attr, phones[i].type_1) &&
+ (phones[i].type_2 == NULL ||
+ e_vcard_attribute_has_type (attr, phones[i].type_2)))
+ return i;
}
- e_contact_editor_dyntable_set_combo_defaults (dyntable, email_default, G_N_ELEMENTS (email_default));
+ return -1;
}
static EVCardAttributeParam *
@@ -956,55 +1109,99 @@
g_free (slot_str);
}
+static gint
+alloc_ui_slot (EContactEditor *editor,
+ const gchar *widget_base,
+ gint preferred_slot,
+ gint num_slots)
+{
+ gchar *widget_name;
+ GtkWidget *widget;
+ const gchar *entry_contents;
+ gint i;
+
+ /* See if we can get the preferred slot */
+
+ if (preferred_slot >= 1) {
+ widget_name = g_strdup_printf ("%s-%d", widget_base, preferred_slot);
+ widget = e_builder_get_widget (editor->priv->builder, widget_name);
+ entry_contents = gtk_entry_get_text (GTK_ENTRY (widget));
+ g_free (widget_name);
+
+ if (STRING_IS_EMPTY (entry_contents))
+ return preferred_slot;
+ }
+
+ /* Find first empty slot */
+
+ for (i = 1; i <= num_slots; i++) {
+ widget_name = g_strdup_printf ("%s-%d", widget_base, i);
+ widget = e_builder_get_widget (editor->priv->builder, widget_name);
+ entry_contents = gtk_entry_get_text (GTK_ENTRY (widget));
+ g_free (widget_name);
+
+ if (STRING_IS_EMPTY (entry_contents))
+ return i;
+ }
+
+ return -1;
+}
+
+static void
+free_attr_list (GList *attr_list)
+{
+ GList *l;
+
+ for (l = attr_list; l; l = g_list_next (l)) {
+ EVCardAttribute *attr = l->data;
+ e_vcard_attribute_free (attr);
+ }
+
+ g_list_free (attr_list);
+}
+
static void
fill_in_email (EContactEditor *editor)
{
GList *email_attr_list;
GList *l;
- GtkWidget *w;
- EContactEditorDynTable *dyntable;
- GtkListStore *data_store;
- GtkTreeIter iter;
-
- w = e_builder_get_widget (editor->priv->builder, "mail-dyntable");
- dyntable = E_CONTACT_EDITOR_DYNTABLE (w);
+ gint record_n;
/* Clear */
- e_contact_editor_dyntable_clear_data (dyntable);
+ for (record_n = 1; record_n <= EMAIL_SLOTS; record_n++) {
+ fill_in_email_record (
+ editor, record_n, NULL, email_default[record_n - 1]);
+ }
/* Fill in */
- data_store = e_contact_editor_dyntable_extract_data (dyntable);
-
email_attr_list = e_contact_get_attributes (
editor->priv->contact, E_CONTACT_EMAIL);
- for (l = email_attr_list; l; l = g_list_next (l)) {
+ for (record_n = 1, l = email_attr_list;
+ l && record_n <= EMAIL_SLOTS; l = g_list_next (l)) {
EVCardAttribute *attr = l->data;
gchar *email_address;
- gint email_location;
gint slot;
email_address = e_vcard_attribute_get_value (attr);
- email_location = eab_get_email_type_index (attr);
- slot = get_ui_slot (attr);
+ slot = alloc_ui_slot (
+ editor, "entry-email",
+ get_ui_slot (attr), EMAIL_SLOTS);
if (slot < 1)
- slot = EMAIL_SLOTS + 1; //add at the end
+ break;
+
+ fill_in_email_record (
+ editor, slot, email_address,
+ get_email_location (attr));
- gtk_list_store_append (data_store, &iter);
- gtk_list_store_set (data_store, &iter,
- DYNTABLE_STORE_COLUMN_SORTORDER, slot,
- DYNTABLE_STORE_COLUMN_SELECTED_ITEM, email_location,
- DYNTABLE_STORE_COLUMN_ENTRY_STRING, email_address,
- -1);
+ record_n++;
g_free (email_address);
}
g_list_free_full (email_attr_list, (GDestroyNotify) e_vcard_attribute_free);
-
- e_contact_editor_dyntable_fill_in_data (dyntable);
}
static void
@@ -1014,48 +1211,32 @@
GList *old_attr_list;
GList *ll;
gint i;
- GtkWidget *w;
- EContactEditorDynTable *dyntable;
- GtkListStore *data_store;
- GtkTreeModel *tree_model;
- GtkTreeIter iter;
- gboolean valid;
-
- w = e_builder_get_widget (editor->priv->builder, "mail-dyntable");
- dyntable = E_CONTACT_EDITOR_DYNTABLE (w);
- data_store = e_contact_editor_dyntable_extract_data (dyntable);
- tree_model = GTK_TREE_MODEL (data_store);
- valid = gtk_tree_model_get_iter_first (tree_model, &iter);
- while (valid) {
+ for (i = 1; i <= EMAIL_SLOTS; i++) {
gchar *address;
gint location;
- EVCardAttribute *attr;
- attr = e_vcard_attribute_new (
- "", e_contact_vcard_attribute (E_CONTACT_EMAIL));
+ extract_email_record (editor, i, &address, &location);
- gtk_tree_model_get (tree_model,&iter,
- DYNTABLE_STORE_COLUMN_SELECTED_ITEM, &location,
- DYNTABLE_STORE_COLUMN_ENTRY_STRING, &address,
- -1);
-
- if (location >= 0) {
- const gchar *type;
- eab_email_index_to_type (location, &type);
- e_vcard_attribute_add_param_with_value (
- attr,
- e_vcard_attribute_param_new (EVC_TYPE),
- type);
- }
+ if (!STRING_IS_EMPTY (address)) {
+ EVCardAttribute *attr;
+ attr = e_vcard_attribute_new (
+ "", e_contact_vcard_attribute (E_CONTACT_EMAIL));
+
+ if (location >= 0)
+ e_vcard_attribute_add_param_with_value (
+ attr,
+ e_vcard_attribute_param_new (EVC_TYPE),
+ email_index_to_location (location));
- e_vcard_attribute_add_value (attr, address);
+ e_vcard_attribute_add_value (attr, address);
+ set_ui_slot (attr, i);
- attr_list = g_list_prepend (attr_list, attr);
+ attr_list = g_list_append (attr_list, attr);
+ }
- valid = gtk_tree_model_iter_next (tree_model, &iter);
+ g_free (address);
}
- attr_list = g_list_reverse (attr_list);
/* Splice in the old attributes, minus the EMAIL_SLOTS first */
@@ -1070,976 +1251,624 @@
e_contact_set_attributes (editor->priv->contact, E_CONTACT_EMAIL, attr_list);
- g_list_free_full (attr_list, (GDestroyNotify) e_vcard_attribute_free);
+ free_attr_list (attr_list);
}
static void
-sensitize_email (EContactEditor *editor)
+sensitize_email_record (EContactEditor *editor,
+ gint record,
+ gboolean enabled)
{
- gboolean enabled = FALSE;
- GtkWidget *w;
- EContactEditorDynTable *dyntable;
- guint max_entries = SLOTS_IN_COLLAPSED_STATE;
-
- w = e_builder_get_widget (editor->priv->builder, "mail-dyntable");
- dyntable = E_CONTACT_EDITOR_DYNTABLE (w);
-
- if (editor->priv->target_editable) {
- if (is_field_supported (editor, E_CONTACT_EMAIL)) {
- enabled = TRUE;
- max_entries = EMAIL_SLOTS;
- } else if (is_field_supported (editor, E_CONTACT_EMAIL_4)) {
- enabled = TRUE;
- max_entries = 4;
- } else if (is_field_supported (editor, E_CONTACT_EMAIL_3)) {
- enabled = TRUE;
- max_entries = 3;
- } else if (is_field_supported (editor, E_CONTACT_EMAIL_2)) {
- enabled = TRUE;
- max_entries = 2;
- } else if (is_field_supported (editor, E_CONTACT_EMAIL_1)) {
- enabled = TRUE;
- max_entries = 1;
- }
- }
+ GtkWidget *location_combo_box;
+ GtkWidget *email_entry;
+ gchar *widget_name;
- gtk_widget_set_sensitive (w, enabled);
- e_contact_editor_dyntable_set_max_entries (dyntable, max_entries);
-}
+ widget_name = g_strdup_printf ("combobox-email-%d", record);
+ location_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
-static void
-row_added_cb (GtkExpander *expander)
-{
- /* newly added row is always visible, setting expanded=true */
- gtk_expander_set_expanded (expander, TRUE);
+ widget_name = g_strdup_printf ("entry-email-%d", record);
+ email_entry = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
+
+ gtk_widget_set_sensitive (location_combo_box, enabled);
+ gtk_editable_set_editable (GTK_EDITABLE (email_entry), enabled);
}
static void
-init_email (EContactEditor *editor)
+sensitize_email (EContactEditor *editor)
{
- EContactEditorDynTable *dyntable;
- GtkExpander *expander;
+ gint i;
- expander = GTK_EXPANDER (
- e_builder_get_widget (editor->priv->builder, "expander-contact-email"));
- dyntable = E_CONTACT_EDITOR_DYNTABLE (
- e_builder_get_widget (editor->priv->builder, "mail-dyntable"));
-
- e_contact_editor_dyntable_set_max_entries (dyntable, EMAIL_SLOTS);
- e_contact_editor_dyntable_set_num_columns (dyntable, SLOTS_PER_LINE, TRUE);
- e_contact_editor_dyntable_set_show_min (dyntable, SLOTS_IN_COLLAPSED_STATE);
+ for (i = 1; i <= EMAIL_SLOTS; i++) {
+ gboolean enabled = TRUE;
- g_signal_connect (
- dyntable, "changed",
- G_CALLBACK (object_changed), editor);
- g_signal_connect_swapped (
- dyntable, "activate",
- G_CALLBACK (entry_activated), editor);
- g_signal_connect_swapped (
- dyntable, "row-added",
- G_CALLBACK (row_added_cb), expander);
+ if (!editor->priv->target_editable)
+ enabled = FALSE;
- init_email_record_location (editor);
+ if (E_CONTACT_FIRST_EMAIL_ID + i - 1 <= E_CONTACT_LAST_EMAIL_ID &&
+ !is_field_supported (editor, E_CONTACT_FIRST_EMAIL_ID + i - 1))
+ enabled = FALSE;
- gtk_expander_set_expanded (expander, TRUE);
+ sensitize_email_record (editor, i, enabled);
+ }
}
static void
-fill_in_phone (EContactEditor *editor)
+init_item_sensitiveable_combo_box (GtkComboBox *combo)
{
- GList *tel_attr_list;
- GList *l;
- GtkWidget *w;
- EContactEditorDynTable *dyntable;
- GtkListStore *data_store;
- GtkTreeIter iter;
+ GtkCellRenderer *cell;
+ GtkListStore *store;
- w = e_builder_get_widget (editor->priv->builder, "phone-dyntable");
- dyntable = E_CONTACT_EDITOR_DYNTABLE (w);
+ g_return_if_fail (combo != NULL);
+ g_return_if_fail (GTK_IS_COMBO_BOX (combo));
- /* Clear */
+ store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_BOOLEAN);
+ gtk_combo_box_set_model (combo, GTK_TREE_MODEL (store));
+ g_object_unref (store);
- e_contact_editor_dyntable_clear_data (dyntable);
+ gtk_cell_layout_clear (GTK_CELL_LAYOUT (combo));
- /* Fill in */
+ cell = gtk_cell_renderer_text_new ();
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE);
+ gtk_cell_layout_set_attributes (
+ GTK_CELL_LAYOUT (combo), cell,
+ "text", 0, "sensitive", 1, NULL);
+}
- tel_attr_list = e_contact_get_attributes (editor->priv->contact, E_CONTACT_TEL);
+/* EContact can get attributes by field ID only,
+ * and there is none for TEL, so we need this */
+static GList *
+get_attributes_named (EVCard *vcard,
+ const gchar *attr_name)
+{
+ GList *attr_list_in;
+ GList *attr_list_out = NULL;
+ GList *l;
- data_store = e_contact_editor_dyntable_extract_data (dyntable);
+ attr_list_in = e_vcard_get_attributes (vcard);
- for (l = tel_attr_list; l; l = g_list_next (l)) {
+ for (l = attr_list_in; l; l = g_list_next (l)) {
EVCardAttribute *attr = l->data;
- gchar *phone;
- gint slot;
- gint phone_type;
+ const gchar *name;
- slot = get_ui_slot (attr);
- if (slot < 0)
- slot = PHONE_SLOTS + 1; /* append at the end */
+ name = e_vcard_attribute_get_name (attr);
- phone_type = eab_get_phone_type_index (attr);
- phone = e_vcard_attribute_get_value (attr);
-
- gtk_list_store_append (data_store, &iter);
- gtk_list_store_set (data_store,&iter,
- DYNTABLE_STORE_COLUMN_SORTORDER, slot,
- DYNTABLE_STORE_COLUMN_SELECTED_ITEM, phone_type,
- DYNTABLE_STORE_COLUMN_ENTRY_STRING, phone,
- -1);
-
- g_free (phone);
+ if (!g_ascii_strcasecmp (attr_name, name)) {
+ attr_list_out = g_list_append (
+ attr_list_out,
+ e_vcard_attribute_copy (attr));
+ }
}
- e_contact_editor_dyntable_fill_in_data (dyntable);
-
- g_list_free_full (tel_attr_list, (GDestroyNotify) e_vcard_attribute_free);
+ return attr_list_out;
}
+/* EContact can set attributes by field ID only,
+ * and there is none for TEL, so we need this */
static void
-extract_phone (EContactEditor *editor)
+set_attributes_named (EVCard *vcard,
+ const gchar *attr_name,
+ GList *attr_list)
{
- GList *tel_attr_list = NULL;
- GList *old_attr_list;
- GList *ll;
- gint i;
- GtkWidget *w;
- EContactEditorDynTable *dyntable;
- GtkListStore *data_store;
- GtkTreeModel *tree_model;
- GtkTreeIter iter;
- gboolean valid;
-
- w = e_builder_get_widget (editor->priv->builder, "phone-dyntable");
- dyntable = E_CONTACT_EDITOR_DYNTABLE (w);
- data_store = e_contact_editor_dyntable_extract_data (dyntable);
- tree_model = GTK_TREE_MODEL (data_store);
-
- valid = gtk_tree_model_get_iter_first (tree_model, &iter);
- while (valid) {
- gint phone_type;
- gchar *phone;
- EVCardAttribute *attr;
-
- gtk_tree_model_get (tree_model,&iter,
- DYNTABLE_STORE_COLUMN_SELECTED_ITEM, &phone_type,
- DYNTABLE_STORE_COLUMN_ENTRY_STRING, &phone,
- -1);
-
- attr = e_vcard_attribute_new ("", EVC_TEL);
- if (phone_type >= 0) {
- const gchar *type_1;
- const gchar *type_2;
-
- eab_phone_index_to_type (phone_type, &type_1, &type_2);
-
- e_vcard_attribute_add_param_with_value (
- attr, e_vcard_attribute_param_new (EVC_TYPE), type_1);
-
- if (type_2)
- e_vcard_attribute_add_param_with_value (
- attr, e_vcard_attribute_param_new (EVC_TYPE), type_2);
- }
-
- e_vcard_attribute_add_value (attr, phone);
-
- tel_attr_list = g_list_prepend (tel_attr_list, attr);
+ GList *l;
- valid = gtk_tree_model_iter_next (tree_model, &iter);
- }
+ e_vcard_remove_attributes (vcard, NULL, attr_name);
- /* Splice in the old attributes, minus the PHONE_SLOTS first */
+ for (l = attr_list; l; l = g_list_next (l)) {
+ EVCardAttribute *attr = l->data;
- tel_attr_list = g_list_reverse (tel_attr_list);
- old_attr_list = e_contact_get_attributes (editor->priv->contact, E_CONTACT_TEL);
- for (ll = old_attr_list, i = 1; ll && i <= PHONE_SLOTS; i++) {
- e_vcard_attribute_free (ll->data);
- ll = g_list_delete_link (ll, ll);
+ e_vcard_add_attribute (vcard, e_vcard_attribute_copy (attr));
}
+}
- old_attr_list = ll;
- tel_attr_list = g_list_concat (tel_attr_list, old_attr_list);
-
- e_contact_set_attributes (editor->priv->contact, E_CONTACT_TEL, tel_attr_list);
+static void
+set_arrow_image (EContactEditor *editor,
+ const gchar *arrow_widget,
+ gboolean expanded)
+{
+ GtkWidget *arrow;
- g_list_free_full (tel_attr_list, (GDestroyNotify) e_vcard_attribute_free);
+ arrow = e_builder_get_widget (editor->priv->builder, arrow_widget);
+ if (expanded)
+ gtk_arrow_set (
+ GTK_ARROW (arrow), GTK_ARROW_DOWN, GTK_SHADOW_NONE);
+ else
+ gtk_arrow_set (
+ GTK_ARROW (arrow), GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
}
static void
-init_phone_record_type (EContactEditor *editor)
+expand_widget_list (EContactEditor *editor,
+ const gchar **widget_names,
+ gboolean expanded)
{
- GtkWidget *w;
- GtkListStore *store;
- gint i, n_elements;
- EContactEditorDynTable *dyntable;
- const EABTypeLabel *eab_phone_types;
-
- w = e_builder_get_widget (editor->priv->builder, "phone-dyntable");
- dyntable = E_CONTACT_EDITOR_DYNTABLE (w);
- store = e_contact_editor_dyntable_get_combo_store (dyntable);
- eab_phone_types = eab_get_phone_type_labels (&n_elements);
+ gint i;
+ for (i = 0; widget_names[i]; i++)
+ gtk_widget_set_visible (
+ e_builder_get_widget (editor->priv->builder, widget_names[i]),
+ expanded);
+}
- for (i = 0; i < n_elements; i++) {
- GtkTreeIter iter;
+static void
+expand_web (EContactEditor *editor,
+ gboolean expanded)
+{
+ const gchar *names[] = {
+ "label-videourl", "label-fburl",
+ "entry-videourl", "entry-fburl",
+ NULL
+ };
+ set_arrow_image (editor, "arrow-web-expand", expanded);
+ expand_widget_list (editor, names, expanded);
+}
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- DYNTABLE_COMBO_COLUMN_TEXT, _(eab_phone_types[i].text),
- DYNTABLE_COMBO_COLUMN_SENSITIVE, TRUE,
- -1);
- }
+static void
+expand_phone (EContactEditor *editor,
+ gboolean expanded)
+{
+ const gchar *names[] = {
+ "entry-phone-3", "combobox-phone-3",
+ "entry-phone-4", "combobox-phone-4",
+ "table-phone-extended", NULL
+ };
+ set_arrow_image (editor, "arrow-phone-expand", expanded);
+ expand_widget_list (editor, names, expanded);
+}
- e_contact_editor_dyntable_set_combo_defaults (dyntable, phones_default, G_N_ELEMENTS (phones_default));
+static void
+expand_mail (EContactEditor *editor,
+ gboolean expanded)
+{
+ GtkTable *table;
+ GtkWidget *check;
+ const gchar *names[] = {
+ "entry-email-2", "combobox-email-2",
+ "entry-email-3", "combobox-email-3",
+ "entry-email-4", "combobox-email-4",
+ NULL
+ };
+ set_arrow_image (editor, "arrow-mail-expand", expanded);
+ expand_widget_list (editor, names, expanded);
+
+ /* move 'use html mail' into position */
+ check = e_builder_get_widget (editor->priv->builder, "checkbutton-htmlmail");
+ table = GTK_TABLE (e_builder_get_widget (editor->priv->builder, "email-table"));
+ if (check != NULL && table != NULL) {
+ GtkWidget *parent;
+
+ g_object_ref (check);
+ parent = gtk_widget_get_parent (check);
+ gtk_container_remove (GTK_CONTAINER (parent), check);
+ if (expanded)
+ gtk_table_attach_defaults (table, check, 0, 4, 2, 3);
+ else
+ gtk_table_attach_defaults (table, check, 2, 4, 0, 1);
+ g_object_unref (check);
+ }
}
static void
-init_phone (EContactEditor *editor)
+init_email (EContactEditor *editor)
{
- EContactEditorDynTable *dyntable;
- GtkExpander *expander;
-
- expander = GTK_EXPANDER (
- e_builder_get_widget (editor->priv->builder, "expander-contact-phone"));
- dyntable = E_CONTACT_EDITOR_DYNTABLE (
- e_builder_get_widget (editor->priv->builder, "phone-dyntable"));
-
- e_contact_editor_dyntable_set_max_entries (dyntable, PHONE_SLOTS);
- e_contact_editor_dyntable_set_num_columns (dyntable, SLOTS_PER_LINE, TRUE);
- e_contact_editor_dyntable_set_show_min (dyntable, SLOTS_IN_COLLAPSED_STATE);
-
- g_signal_connect (
- dyntable, "changed",
- G_CALLBACK (object_changed), editor);
- g_signal_connect_swapped (
- dyntable, "activate",
- G_CALLBACK (entry_activated), editor);
- g_signal_connect_swapped (
- dyntable, "row-added",
- G_CALLBACK (row_added_cb), expander);
+ gint i;
- init_phone_record_type (editor);
+ for (i = 1; i <= EMAIL_SLOTS; i++)
+ init_email_record_location (editor, i);
- gtk_expander_set_expanded (expander, TRUE);
+ expand_mail (editor, !editor->priv->compress_ui);
}
static void
-sensitize_phone_types (EContactEditor *editor)
+fill_in_phone_record (EContactEditor *editor,
+ gint record,
+ const gchar *phone,
+ gint phone_type)
{
- GtkWidget *w;
- GtkListStore *listStore;
- GtkTreeModel *model;
- GtkTreeIter iter;
- gint i, n_elements;
- gboolean valid;
- const EABTypeLabel *eab_phone_types;
-
- w = e_builder_get_widget (editor->priv->builder, "phone-dyntable");
- listStore = e_contact_editor_dyntable_get_combo_store (E_CONTACT_EDITOR_DYNTABLE (w));
- model = GTK_TREE_MODEL (listStore);
+ GtkWidget *phone_type_combo_box;
+ GtkWidget *phone_entry;
+ gchar *widget_name;
- valid = gtk_tree_model_get_iter_first (model, &iter);
+ widget_name = g_strdup_printf ("combobox-phone-%d", record);
+ phone_type_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
- eab_phone_types = eab_get_phone_type_labels (&n_elements);
- for (i = 0; i < n_elements; i++) {
- if (!valid) {
- g_warning (G_STRLOC ": Unexpected end of phone items in combo box");
- return;
- }
+ widget_name = g_strdup_printf ("entry-phone-%d", record);
+ phone_entry = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
- gtk_list_store_set (GTK_LIST_STORE (model), &iter,
- DYNTABLE_COMBO_COLUMN_SENSITIVE,
- is_field_supported (editor, eab_phone_types[i].field_id),
- -1);
+ set_combo_box_active (
+ editor, GTK_COMBO_BOX (phone_type_combo_box),
+ phone_type >= 0 ? phone_type : phones_default[record - 1]);
+ set_entry_text (editor, GTK_ENTRY (phone_entry), phone ? phone : "");
- valid = gtk_tree_model_iter_next (model, &iter);
- }
+ if (phone && *phone && record >= 3)
+ expand_phone (editor, TRUE);
}
static void
-sensitize_phone (EContactEditor *editor)
+extract_phone_record (EContactEditor *editor,
+ gint record,
+ gchar **phone,
+ gint *phone_type)
{
- GtkWidget *w;
- gboolean enabled = FALSE;
- gint i, n_elements;
- const EABTypeLabel *eab_phone_types;
-
- w = e_builder_get_widget (editor->priv->builder, "phone-dyntable");
-
- eab_phone_types = eab_get_phone_type_labels (&n_elements);
- if (editor->priv->target_editable) {
- enabled = is_field_supported (editor, E_CONTACT_TEL);
- for (i = 0; i < n_elements && !enabled; i++) {
- enabled = is_field_supported (editor, eab_phone_types[i].field_id);
- }
- }
+ GtkWidget *phone_type_combo_box;
+ GtkWidget *phone_entry;
+ gchar *widget_name;
- gtk_widget_set_sensitive (w, enabled);
+ widget_name = g_strdup_printf ("combobox-phone-%d", record);
+ phone_type_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
- sensitize_phone_types (editor);
+ widget_name = g_strdup_printf ("entry-phone-%d", record);
+ phone_entry = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
+
+ *phone = g_strdup (gtk_entry_get_text (GTK_ENTRY (phone_entry)));
+ *phone_type = gtk_combo_box_get_active (GTK_COMBO_BOX (phone_type_combo_box));
}
static void
-fill_in_sip (EContactEditor *editor)
+fill_in_phone (EContactEditor *editor)
{
- GList *sip_attr_list;
+ GList *phone_attr_list;
GList *l;
- GtkWidget *w;
- EContactEditorDynTable *dyntable;
- GtkListStore *data_store;
- GtkTreeIter iter;
-
- w = e_builder_get_widget (editor->priv->builder, "sip-dyntable");
- dyntable = E_CONTACT_EDITOR_DYNTABLE (w);
+ gint record_n;
/* Clear */
- e_contact_editor_dyntable_clear_data (dyntable);
+ for (record_n = 1; record_n <= PHONE_SLOTS; record_n++) {
+ fill_in_phone_record (editor, record_n, NULL, -1);
+ }
/* Fill in */
- sip_attr_list = e_contact_get_attributes (editor->priv->contact, E_CONTACT_SIP);
+ phone_attr_list = get_attributes_named (E_VCARD (editor->priv->contact), "TEL");
- data_store = e_contact_editor_dyntable_extract_data (dyntable);
-
- for (l = sip_attr_list; l; l = g_list_next (l)) {
+ for (record_n = 1, l = phone_attr_list;
+ l && record_n <= PHONE_SLOTS; l = g_list_next (l)) {
EVCardAttribute *attr = l->data;
- gchar *sip;
- gint sip_type;
+ gchar *phone;
+ gint slot;
- sip_type = eab_get_sip_type_index (attr);
- sip = e_vcard_attribute_get_value (attr);
+ phone = e_vcard_attribute_get_value (attr);
+ slot = alloc_ui_slot (editor, "entry-phone", get_ui_slot (attr), PHONE_SLOTS);
+ if (slot < 1)
+ break;
- if (sip_type < 0)
- sip_type = 2;
+ fill_in_phone_record (
+ editor, slot, phone, get_phone_type (attr));
- gtk_list_store_append (data_store, &iter);
- gtk_list_store_set (data_store,&iter,
- DYNTABLE_STORE_COLUMN_SORTORDER, -1,
- DYNTABLE_STORE_COLUMN_SELECTED_ITEM, sip_type,
- DYNTABLE_STORE_COLUMN_ENTRY_STRING, sip,
- -1);
+ record_n++;
- g_free (sip);
+ g_free (phone);
}
-
- e_contact_editor_dyntable_fill_in_data (dyntable);
- g_list_free_full (sip_attr_list, (GDestroyNotify) e_vcard_attribute_free);
}
static void
-extract_sip (EContactEditor *editor)
+extract_phone (EContactEditor *editor)
{
- GList *sip_attr_list = NULL;
+ GList *attr_list = NULL;
GList *old_attr_list;
GList *ll;
- gint i;
- GtkWidget *w;
- EContactEditorDynTable *dyntable;
- GtkListStore *data_store;
- GtkTreeModel *tree_model;
- GtkTreeIter iter;
- gboolean valid;
+ gint i;
- w = e_builder_get_widget (editor->priv->builder, "sip-dyntable");
- dyntable = E_CONTACT_EDITOR_DYNTABLE (w);
- data_store = e_contact_editor_dyntable_extract_data (dyntable);
- tree_model = GTK_TREE_MODEL (data_store);
-
- valid = gtk_tree_model_get_iter_first (tree_model, &iter);
- while (valid) {
- gint sip_type;
- gchar *sip;
- EVCardAttribute *attr;
+ for (i = 1; i <= PHONE_SLOTS; i++) {
+ gchar *phone;
+ gint phone_type;
- gtk_tree_model_get (tree_model,&iter,
- DYNTABLE_STORE_COLUMN_SELECTED_ITEM, &sip_type,
- DYNTABLE_STORE_COLUMN_ENTRY_STRING, &sip,
- -1);
-
- attr = e_vcard_attribute_new ("", EVC_X_SIP);
- if (sip_type >= 0) {
- const gchar *type_1;
+ extract_phone_record (editor, i, &phone, &phone_type);
- eab_sip_index_to_type (sip_type, &type_1);
+ if (!STRING_IS_EMPTY (phone)) {
+ EVCardAttribute *attr;
- e_vcard_attribute_add_param_with_value (
- attr, e_vcard_attribute_param_new (EVC_TYPE), type_1);
- }
+ attr = e_vcard_attribute_new ("", "TEL");
+
+ if (phone_type >= 0) {
+ const gchar *type_1;
+ const gchar *type_2;
- e_vcard_attribute_add_value (attr, sip);
+ phone_index_to_type (phone_type, &type_1, &type_2);
- sip_attr_list = g_list_prepend (sip_attr_list, attr);
+ e_vcard_attribute_add_param_with_value (
+ attr, e_vcard_attribute_param_new (EVC_TYPE), type_1);
+
+ if (type_2)
+ e_vcard_attribute_add_param_with_value (
+ attr, e_vcard_attribute_param_new (EVC_TYPE), type_2);
+
+ }
- valid = gtk_tree_model_iter_next (tree_model, &iter);
+ e_vcard_attribute_add_value (attr, phone);
+ set_ui_slot (attr, i);
+
+ attr_list = g_list_append (attr_list, attr);
+ }
+
+ g_free (phone);
}
- /* Splice in the old attributes, minus the SIP_SLOTS first */
+ /* Splice in the old attributes, minus the PHONE_SLOTS first */
- sip_attr_list = g_list_reverse (sip_attr_list);
- old_attr_list = e_contact_get_attributes (editor->priv->contact, E_CONTACT_SIP);
- for (ll = old_attr_list, i = 1; ll && i <= SIP_SLOTS; i++) {
+ old_attr_list = get_attributes_named (E_VCARD (editor->priv->contact), "TEL");
+ for (ll = old_attr_list, i = 1; ll && i <= PHONE_SLOTS; i++) {
e_vcard_attribute_free (ll->data);
ll = g_list_delete_link (ll, ll);
}
old_attr_list = ll;
- sip_attr_list = g_list_concat (sip_attr_list, old_attr_list);
+ attr_list = g_list_concat (attr_list, old_attr_list);
- e_contact_set_attributes (editor->priv->contact, E_CONTACT_SIP, sip_attr_list);
+ set_attributes_named (E_VCARD (editor->priv->contact), "TEL", attr_list);
- g_list_free_full (sip_attr_list, (GDestroyNotify) e_vcard_attribute_free);
+ free_attr_list (attr_list);
}
static void
-init_sip_record_type (EContactEditor *editor)
+init_phone_record_type (EContactEditor *editor,
+ gint record)
{
- GtkWidget *w;
+ GtkWidget *phone_type_combo_box;
+ GtkWidget *phone_entry;
+ gchar *widget_name;
+ gint i;
GtkListStore *store;
- gint i, n_elements;
- EContactEditorDynTable *dyntable;
- const EABTypeLabel *sip_types = eab_get_sip_type_labels (&n_elements);
-
- w = e_builder_get_widget (editor->priv->builder, "sip-dyntable");
- dyntable = E_CONTACT_EDITOR_DYNTABLE (w);
- store = e_contact_editor_dyntable_get_combo_store (dyntable);
- for (i = 0; i < n_elements; i++) {
- GtkTreeIter iter;
+ widget_name = g_strdup_printf ("entry-phone-%d", record);
+ phone_entry = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- DYNTABLE_COMBO_COLUMN_TEXT, _(sip_types[i].text),
- DYNTABLE_COMBO_COLUMN_SENSITIVE, TRUE,
- -1);
- }
+ widget_name = g_strdup_printf ("combobox-phone-%d", record);
+ phone_type_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
- e_contact_editor_dyntable_set_combo_defaults (dyntable, sips_default, G_N_ELEMENTS (sips_default));
-}
+ init_item_sensitiveable_combo_box (GTK_COMBO_BOX (phone_type_combo_box));
-static void
-init_sip (EContactEditor *editor)
-{
- EContactEditorDynTable *dyntable;
- GtkExpander *expander;
+ store = GTK_LIST_STORE (
+ gtk_combo_box_get_model (
+ GTK_COMBO_BOX (phone_type_combo_box)));
- expander = GTK_EXPANDER (
- e_builder_get_widget (editor->priv->builder, "expander-contact-sip"));
- dyntable = E_CONTACT_EDITOR_DYNTABLE (
- e_builder_get_widget (editor->priv->builder, "sip-dyntable"));
+ for (i = 0; i < G_N_ELEMENTS (phones); i++) {
+ GtkTreeIter iter;
- e_contact_editor_dyntable_set_max_entries (dyntable, SIP_SLOTS);
- e_contact_editor_dyntable_set_num_columns (dyntable, SLOTS_PER_LINE, TRUE);
- e_contact_editor_dyntable_set_show_min (dyntable, SLOTS_IN_COLLAPSED_STATE);
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (
+ store, &iter,
+ 0, e_contact_pretty_name (phones[i].field_id),
+ 1, TRUE,
+ -1);
+ }
+ g_signal_connect_swapped (
+ phone_type_combo_box, "changed",
+ G_CALLBACK (gtk_widget_grab_focus), phone_entry);
+ g_signal_connect (
+ phone_type_combo_box, "changed",
+ G_CALLBACK (object_changed), editor);
g_signal_connect (
- dyntable, "changed",
+ phone_entry, "changed",
G_CALLBACK (object_changed), editor);
g_signal_connect_swapped (
- dyntable, "activate",
+ phone_entry, "activate",
G_CALLBACK (entry_activated), editor);
- g_signal_connect_swapped (
- dyntable, "row-added",
- G_CALLBACK (row_added_cb), expander);
-
- init_sip_record_type (editor);
-
- gtk_expander_set_expanded (expander, TRUE);
-}
-
-static gboolean
-check_dyntable_for_data (EContactEditor *editor,
- const gchar *name)
-{
- EContactEditorDynTable *dyntable;
- GtkTreeModel *tree_model;
- GtkTreeIter iter;
-
- dyntable = E_CONTACT_EDITOR_DYNTABLE (e_builder_get_widget (editor->priv->builder, name));
- tree_model = GTK_TREE_MODEL (e_contact_editor_dyntable_extract_data (dyntable));
-
- return gtk_tree_model_get_iter_first (tree_model, &iter);
-}
-
-static void
-extract_address_textview (EContactEditor *editor,
- gint record,
- EContactAddress *address)
-{
- gchar *textview_name;
- GtkWidget *textview;
- GtkTextBuffer *text_buffer;
- GtkTextIter iter_1, iter_2;
-
- textview_name = g_strdup_printf ("textview-%s-address", address_name[record]);
- textview = e_builder_get_widget (editor->priv->builder, textview_name);
- g_free (textview_name);
-
- text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview));
- gtk_text_buffer_get_start_iter (text_buffer, &iter_1);
-
- /* Skip blank lines */
- while (gtk_text_iter_get_chars_in_line (&iter_1) < 1 &&
- !gtk_text_iter_is_end (&iter_1))
- gtk_text_iter_forward_line (&iter_1);
-
- if (gtk_text_iter_is_end (&iter_1))
- return;
-
- iter_2 = iter_1;
- gtk_text_iter_forward_to_line_end (&iter_2);
-
- /* Extract street (first line of text) */
- address->street = gtk_text_iter_get_text (&iter_1, &iter_2);
-
- iter_1 = iter_2;
- gtk_text_iter_forward_line (&iter_1);
-
- if (gtk_text_iter_is_end (&iter_1))
- return;
-
- gtk_text_iter_forward_to_end (&iter_2);
-
- /* Extract extended address (remaining lines of text) */
- address->ext = gtk_text_iter_get_text (&iter_1, &iter_2);
-}
-
-static gchar *
-extract_address_field (EContactEditor *editor,
- gint record,
- const gchar *widget_field_name)
-{
- gchar *entry_name;
- GtkWidget *entry;
-
- entry_name = g_strdup_printf (
- "entry-%s-%s", address_name[record], widget_field_name);
- entry = e_builder_get_widget (editor->priv->builder, entry_name);
- g_free (entry_name);
-
- return g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
-}
-
-static void
-extract_address_from_gui (EContactEditor* editor,
- EContactAddress* address,
- gint record)
-{
- extract_address_textview (editor, record, address);
- address->locality = extract_address_field (editor, record, "city");
- address->region = extract_address_field (editor, record, "state");
- address->code = extract_address_field (editor, record, "zip");
- address->country = extract_address_field (editor, record, "country");
- address->po = extract_address_field (editor, record, "pobox");
-}
-
-static gboolean
-check_address_for_data (EContactEditor *editor,
- gint record)
-{
- gboolean has_data = FALSE;
- EContactAddress *address;
-
- address = g_new0 (EContactAddress, 1);
-
- extract_address_from_gui (editor, address, record);
- if (!STRING_IS_EMPTY (address->street) ||
- !STRING_IS_EMPTY (address->ext) ||
- !STRING_IS_EMPTY (address->locality) ||
- !STRING_IS_EMPTY (address->region) ||
- !STRING_IS_EMPTY (address->code) ||
- !STRING_IS_EMPTY (address->po) ||
- !STRING_IS_EMPTY (address->country)) {
- has_data = TRUE;
- }
-
- g_free (address);
-
- return has_data;
-}
-
-static gboolean
-check_web_for_data (EContactEditor *editor)
-{
- GtkBuilder *b = editor->priv->builder;
-
- return !STRING_IS_EMPTY (gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (b, "entry-homepage")))) ||
- !STRING_IS_EMPTY (gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (b, "entry-weblog")))) ||
- !STRING_IS_EMPTY (gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (b, "entry-caluri")))) ||
- !STRING_IS_EMPTY (gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (b, "entry-fburl")))) ||
- !STRING_IS_EMPTY (gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (b, "entry-videourl")))) ;
-}
-
-static gboolean
-check_job_for_data (EContactEditor *editor)
-{
- GtkBuilder *b = editor->priv->builder;
-
- return !STRING_IS_EMPTY (gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (b, "entry-manager")))) ||
- !STRING_IS_EMPTY (gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (b, "entry-assistant")))) ||
- !STRING_IS_EMPTY (gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (b, "entry-profession")))) ||
- !STRING_IS_EMPTY (gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (b, "entry-jobtitle")))) ||
- !STRING_IS_EMPTY (gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (b, "entry-company")))) ||
- !STRING_IS_EMPTY (gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (b, "entry-department")))) ||
- !STRING_IS_EMPTY (gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (b, "entry-office"))));
-}
-
-static gboolean
-check_misc_for_data (EContactEditor *editor)
-{
- GtkBuilder *b = editor->priv->builder;
- gint year, month, day;
-
- return !STRING_IS_EMPTY (gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (b, "entry-spouse")))) ||
- e_date_edit_get_date (E_DATE_EDIT (e_builder_get_widget (b, "dateedit-birthday")), &year, &month, &day) ||
- e_date_edit_get_date (E_DATE_EDIT (e_builder_get_widget (b, "dateedit-anniversary")), &year, &month, &day);
-}
-
-static gboolean
-check_notes_for_data (EContactEditor *editor)
-{
- GtkWidget *tv = e_builder_get_widget (editor->priv->builder, "text-comments");
- GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tv));
-
- return gtk_text_buffer_get_char_count (buffer) > 0;
-}
-
-static gboolean
-check_section_for_data (EContactEditor *editor,
- gint check)
-{
- gboolean has_data = TRUE;
-
- switch (check) {
- case CHECK_PHONE:
- has_data = check_dyntable_for_data (editor, "phone-dyntable");
- break;
- case CHECK_SIP:
- has_data = check_dyntable_for_data (editor, "sip-dyntable");
- break;
- case CHECK_IM:
- has_data = check_dyntable_for_data (editor, "im-dyntable");
- break;
- case CHECK_HOME:
- has_data = check_address_for_data (editor, ADDRESS_SLOT_HOME);
- break;
- case CHECK_WORK:
- has_data = check_address_for_data (editor, ADDRESS_SLOT_WORK);
- break;
- case CHECK_OTHER:
- has_data = check_address_for_data (editor, ADDRESS_SLOT_OTHER);
- break;
- case CHECK_WEB:
- has_data = check_web_for_data (editor);
- break;
- case CHECK_JOB:
- has_data = check_job_for_data (editor);
- break;
- case CHECK_MISC:
- has_data = check_misc_for_data (editor);
- break;
- case CHECK_NOTE:
- has_data = check_notes_for_data (editor);
- break;
- default:
- g_warning ("unknown data check requested");
- }
-
- return has_data;
}
static void
-config_sensitize_item (EContactEditor *editor,
- const gchar *item_name,
- gint check)
-{
- GtkWidget *item;
- gboolean has_data;
-
- has_data = check_section_for_data (editor, check);
- item = e_builder_get_widget (editor->priv->builder, item_name);
-
- if (has_data) {
- gtk_widget_set_sensitive (item, FALSE);
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
- } else {
- gtk_widget_set_sensitive (item, TRUE);
- }
-}
-
-static void
-config_sensitize_cb (GtkWidget *button,
- EContactEditor *editor)
-{
- config_sensitize_item (editor, "menuitem-config-phone", CHECK_PHONE);
- config_sensitize_item (editor, "menuitem-config-sip", CHECK_SIP);
- config_sensitize_item (editor, "menuitem-config-im", CHECK_IM);
-
- config_sensitize_item (editor, "menuitem-config-web", CHECK_WEB);
- config_sensitize_item (editor, "menuitem-config-job", CHECK_JOB);
- config_sensitize_item (editor, "menuitem-config-misc", CHECK_MISC);
-
- config_sensitize_item (editor, "menuitem-config-home", CHECK_HOME);
- config_sensitize_item (editor, "menuitem-config-work", CHECK_WORK);
- config_sensitize_item (editor, "menuitem-config-other", CHECK_OTHER);
-
- config_sensitize_item (editor, "menuitem-config-notes", CHECK_NOTE);
-}
-
-/*
- * get the value from GSettings and check if there is data in the widget.
- * if no data is found set_visible (value), set_visible (true) otherwise
- *
- * Returns: the new visibility
- */
-static gboolean
-configure_widget_visibility (EContactEditor *editor,
- GSettings *settings,
- const gchar *widget_name,
- const gchar *settings_name,
- gint check)
+init_phone (EContactEditor *editor)
{
- gboolean config, has_data;
- GtkWidget *widget;
-
- config = g_settings_get_boolean (settings, settings_name);
- widget = e_builder_get_widget (editor->priv->builder, widget_name);
- has_data = check_section_for_data (editor, check);
+ gint i;
- gtk_widget_set_visible (widget, config || has_data);
+ expand_phone (editor, FALSE);
- return config || has_data;
+ for (i = 1; i <= PHONE_SLOTS; i++)
+ init_phone_record_type (editor, i);
}
static void
-configure_visibility (EContactEditor *editor)
+sensitize_phone_types (EContactEditor *editor,
+ GtkWidget *combo_box)
{
- gboolean show_tab;
- GSettings *settings = e_util_ref_settings ("org.gnome.evolution.addressbook");
-
- configure_widget_visibility (editor, settings, "vbox-contact-phone", "editor-show-contact-phone", CHECK_PHONE);
- configure_widget_visibility (editor, settings, "vbox-contact-sip", "editor-show-contact-sip", CHECK_SIP);
- configure_widget_visibility (editor, settings, "vbox-contact-im", "editor-show-contact-im", CHECK_IM);
-
- show_tab = configure_widget_visibility (editor, settings, "frame-mailing-home", "editor-show-mailing-home", CHECK_HOME);
- show_tab |= configure_widget_visibility (editor, settings, "frame-mailing-work", "editor-show-mailing-work", CHECK_WORK);
- show_tab |= configure_widget_visibility (editor, settings, "expander-address-other", "editor-show-mailing-other", CHECK_OTHER);
- gtk_widget_set_visible (
- e_builder_get_widget (editor->priv->builder, "scrolledwindow-mailing"),
- show_tab);
-
- show_tab = configure_widget_visibility (editor, settings, "expander-personal-web", "editor-show-personal-web", CHECK_WEB);
- show_tab |= configure_widget_visibility (editor, settings, "expander-personal-job", "editor-show-personal-job", CHECK_JOB);
- show_tab |= configure_widget_visibility (editor, settings, "expander-personal-misc", "editor-show-personal-misc", CHECK_MISC);
- gtk_widget_set_visible (
- e_builder_get_widget (editor->priv->builder, "scrolledwindow-personal"),
- show_tab);
-
- configure_widget_visibility (editor, settings, "scrolledwindow-notes", "editor-show-notes", CHECK_NOTE);
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gint i;
+ gboolean valid;
- g_object_unref (settings);
-}
+ model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo_box));
+ valid = gtk_tree_model_get_iter_first (model, &iter);
-static void
-config_menuitem_save (EContactEditor *editor,
- GSettings *settings,
- const gchar *item_name,
- const gchar *key)
-{
- GtkWidget *item;
- gboolean active, sensitive;
+ for (i = 0; i < G_N_ELEMENTS (phones); i++) {
+ if (!valid) {
+ g_warning (G_STRLOC ": Unexpected end of phone items in combo box");
+ return;
+ }
- item = e_builder_get_widget (editor->priv->builder, item_name);
- active = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item));
- sensitive = gtk_widget_get_sensitive (item);
+ gtk_list_store_set (
+ GTK_LIST_STORE (model), &iter,
+ 1, is_field_supported (editor, phones[i].field_id),
+ -1);
- if (sensitive)
- g_settings_set_boolean (settings, key, active);
+ valid = gtk_tree_model_iter_next (model, &iter);
+ }
}
static void
-config_save_cb (GtkWidget *button,
- EContactEditor *editor)
+sensitize_phone_record (EContactEditor *editor,
+ gint record,
+ gboolean enabled)
{
- GSettings *settings;
-
- settings = e_util_ref_settings ("org.gnome.evolution.addressbook");
-
- config_menuitem_save (editor, settings, "menuitem-config-phone", "editor-show-contact-phone");
- config_menuitem_save (editor, settings, "menuitem-config-sip", "editor-show-contact-sip");
- config_menuitem_save (editor, settings, "menuitem-config-im", "editor-show-contact-im");
-
- config_menuitem_save (editor, settings, "menuitem-config-web", "editor-show-personal-web");
- config_menuitem_save (editor, settings, "menuitem-config-job", "editor-show-personal-job");
- config_menuitem_save (editor, settings, "menuitem-config-misc", "editor-show-personal-misc");
+ GtkWidget *phone_type_combo_box;
+ GtkWidget *phone_entry;
+ gchar *widget_name;
- config_menuitem_save (editor, settings, "menuitem-config-home", "editor-show-mailing-home");
- config_menuitem_save (editor, settings, "menuitem-config-work", "editor-show-mailing-work");
- config_menuitem_save (editor, settings, "menuitem-config-other", "editor-show-mailing-other");
+ widget_name = g_strdup_printf ("combobox-phone-%d", record);
+ phone_type_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
- config_menuitem_save (editor, settings, "menuitem-config-notes", "editor-show-notes");
+ widget_name = g_strdup_printf ("entry-phone-%d", record);
+ phone_entry = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
- g_object_unref (settings);
+ gtk_widget_set_sensitive (phone_type_combo_box, enabled);
+ gtk_editable_set_editable (GTK_EDITABLE (phone_entry), enabled);
- configure_visibility (editor);
+ sensitize_phone_types (editor, phone_type_combo_box);
}
static void
-init_config_menuitem (EContactEditor *editor,
- GSettings *settings,
- const gchar *item_name,
- const gchar *key)
+sensitize_phone (EContactEditor *editor)
{
- gboolean show;
- GtkWidget *item;
+ gint i;
- show = g_settings_get_boolean (settings, key);
- item = e_builder_get_widget (editor->priv->builder, item_name);
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), show);
+ for (i = 1; i <= PHONE_SLOTS; i++) {
+ gboolean enabled = TRUE;
- g_signal_connect (
- item, "activate",
- G_CALLBACK (config_save_cb), editor);
+ if (!editor->priv->target_editable)
+ enabled = FALSE;
+
+ sensitize_phone_record (editor, i, enabled);
+ }
}
static void
-init_config (EContactEditor *editor)
+init_im_record_location (EContactEditor *editor,
+ gint record)
{
- GtkWidget *button, *menu;
- GSettings *settings;
- button = e_builder_get_widget (editor->priv->builder, "button-config");
- menu = e_builder_get_widget (editor->priv->builder, "menu-editor-config");
- gtk_menu_button_set_popup (GTK_MENU_BUTTON (button), menu);
-
- /* save resources by only doing the data checks and sensitizing upon request,
- * instead of doing it with each change in object_changed()
- */
- g_signal_connect (
- button, "clicked",
- G_CALLBACK (config_sensitize_cb), editor);
+#ifdef ENABLE_IM_LOCATION
+ GtkWidget *location_combo_box;
+ GtkListStore *store;
+ gint i;
+ gchar *widget_name;
- settings = e_util_ref_settings ("org.gnome.evolution.addressbook");
+ widget_name = g_strdup_printf ("combobox-im-location-%d", record);
+ location_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
- init_config_menuitem (editor, settings, "menuitem-config-phone", "editor-show-contact-phone");
- init_config_menuitem (editor, settings, "menuitem-config-sip", "editor-show-contact-sip");
- init_config_menuitem (editor, settings, "menuitem-config-im", "editor-show-contact-im");
+ init_item_sensitiveable_combo_box (GTK_COMBO_BOX (location_combo_box));
- init_config_menuitem (editor, settings, "menuitem-config-web", "editor-show-personal-web");
- init_config_menuitem (editor, settings, "menuitem-config-job", "editor-show-personal-job");
- init_config_menuitem (editor, settings, "menuitem-config-misc", "editor-show-personal-misc");
+ store = GTK_LIST_STORE (
+ gtk_combo_box_get_model (
+ GTK_COMBO_BOX (location_combo_box)));
- init_config_menuitem (editor, settings, "menuitem-config-home", "editor-show-mailing-home");
- init_config_menuitem (editor, settings, "menuitem-config-work", "editor-show-mailing-work");
- init_config_menuitem (editor, settings, "menuitem-config-other", "editor-show-mailing-other");
+ for (i = 0; i < G_N_ELEMENTS (common_location); i++) {
+ GtkTreeIter iter;
- init_config_menuitem (editor, settings, "menuitem-config-notes", "editor-show-notes");
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (
+ store, &iter,
+ 0, _(common_location[i].pretty_name),
+ 1, TRUE,
+ -1);
+ }
- g_object_unref (settings);
+ g_signal_connect (
+ location_combo_box, "changed",
+ G_CALLBACK (object_changed), editor);
+#endif
}
static void
-sensitize_sip_types (EContactEditor *editor)
+init_im_record_service (EContactEditor *editor,
+ gint record)
{
- GtkWidget *w;
- GtkListStore *listStore;
- GtkTreeModel *model;
- GtkTreeIter iter;
- gint i, n_elements;
- gboolean valid;
- const EABTypeLabel *sip_types = eab_get_sip_type_labels (&n_elements);
-
- w = e_builder_get_widget (editor->priv->builder, "sip-dyntable");
- listStore = e_contact_editor_dyntable_get_combo_store (E_CONTACT_EDITOR_DYNTABLE (w));
- model = GTK_TREE_MODEL (listStore);
-
- valid = gtk_tree_model_get_iter_first (model, &iter);
+ GtkWidget *service_combo_box;
+ GtkListStore *store;
+ GtkWidget *name_entry;
+ gchar *widget_name;
+ gint i;
- for (i = 0; i < n_elements; i++) {
- if (!valid) {
- g_warning (G_STRLOC ": Unexpected end of sip items in combo box");
- return;
- }
+ widget_name = g_strdup_printf ("entry-im-name-%d", record);
+ name_entry = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
- gtk_list_store_set (GTK_LIST_STORE (model), &iter,
- DYNTABLE_COMBO_COLUMN_SENSITIVE,
- is_field_supported (editor, sip_types[i].field_id),
- -1);
+ widget_name = g_strdup_printf ("combobox-im-service-%d", record);
+ service_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
- valid = gtk_tree_model_iter_next (model, &iter);
+ if (editor->priv->compress_ui && record > 2) {
+ gtk_widget_hide (name_entry);
+ gtk_widget_hide (service_combo_box);
}
-}
-static void
-sensitize_sip (EContactEditor *editor)
-{
- GtkWidget *w;
- gboolean enabled = TRUE;
+ init_item_sensitiveable_combo_box (GTK_COMBO_BOX (service_combo_box));
- w = e_builder_get_widget (editor->priv->builder, "sip-dyntable");
+ store = GTK_LIST_STORE (
+ gtk_combo_box_get_model (
+ GTK_COMBO_BOX (service_combo_box)));
- if (!editor->priv->target_editable ||
- !is_field_supported (editor, E_CONTACT_SIP))
- enabled = FALSE;
+ for (i = 0; i < G_N_ELEMENTS (im_service); i++) {
+ GtkTreeIter iter;
- gtk_widget_set_sensitive (w, enabled);
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (
+ store, &iter,
+ 0, _(im_service[i].pretty_name),
+ 1, TRUE,
+ -1);
+ }
- sensitize_sip_types (editor);
+ g_signal_connect_swapped (
+ service_combo_box, "changed",
+ G_CALLBACK (gtk_widget_grab_focus), name_entry);
+ g_signal_connect (
+ service_combo_box, "changed",
+ G_CALLBACK (object_changed), editor);
+ g_signal_connect (
+ name_entry, "changed",
+ G_CALLBACK (object_changed), editor);
+ g_signal_connect_swapped (
+ name_entry, "activate",
+ G_CALLBACK (entry_activated), editor);
}
static void
-init_im_record_type (EContactEditor *editor)
+init_im (EContactEditor *editor)
{
- GtkWidget *w;
- GtkListStore *store;
- gint i, n_elements;
- EContactEditorDynTable *dyntable;
- const EABTypeLabel *im_service;
-
- w = e_builder_get_widget (editor->priv->builder, "im-dyntable");
- dyntable = E_CONTACT_EDITOR_DYNTABLE (w);
- store = e_contact_editor_dyntable_get_combo_store (dyntable);
-
- im_service = eab_get_im_type_labels (&n_elements);
- for (i = 0; i < n_elements; i++) {
- GtkTreeIter iter;
+ gint i;
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- DYNTABLE_COMBO_COLUMN_TEXT, _(im_service[i].text),
- DYNTABLE_COMBO_COLUMN_SENSITIVE, TRUE,
- -1);
+ for (i = 1; i <= IM_SLOTS; i++) {
+ init_im_record_service (editor, i);
+ init_im_record_location (editor, i);
}
-
- e_contact_editor_dyntable_set_combo_defaults (dyntable, im_service_default, G_N_ELEMENTS (im_service_default));
}
static void
-init_im (EContactEditor *editor)
+fill_in_im_record (EContactEditor *editor,
+ gint record,
+ gint service,
+ const gchar *name,
+ gint location)
{
- EContactEditorDynTable *dyntable;
- GtkExpander *expander;
+ GtkWidget *service_combo_box;
+#ifdef ENABLE_IM_LOCATION
+ GtkWidget *location_combo_box;
+#endif
+ GtkWidget *name_entry;
+ gchar *widget_name;
- expander = GTK_EXPANDER (
- e_builder_get_widget (editor->priv->builder, "expander-contact-im"));
- dyntable = E_CONTACT_EDITOR_DYNTABLE (
- e_builder_get_widget (editor->priv->builder, "im-dyntable"));
-
- e_contact_editor_dyntable_set_max_entries (dyntable, IM_SLOTS);
- e_contact_editor_dyntable_set_num_columns (dyntable, SLOTS_PER_LINE, TRUE);
- e_contact_editor_dyntable_set_show_min (dyntable, SLOTS_IN_COLLAPSED_STATE);
+ widget_name = g_strdup_printf ("combobox-im-service-%d", record);
+ service_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
- g_signal_connect (
- dyntable, "changed",
- G_CALLBACK (object_changed), editor);
- g_signal_connect_swapped (
- dyntable, "activate",
- G_CALLBACK (entry_activated), editor);
- g_signal_connect_swapped (
- dyntable, "row-added",
- G_CALLBACK (row_added_cb), expander);
+#ifdef ENABLE_IM_LOCATION
+ widget_name = g_strdup_printf ("combobox-im-location-%d", record);
+ location_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
+#endif
- init_im_record_type (editor);
+ widget_name = g_strdup_printf ("entry-im-name-%d", record);
+ name_entry = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
- gtk_expander_set_expanded (expander, TRUE);
+#ifdef ENABLE_IM_LOCATION
+ set_combo_box_active (
+ editor, GTK_COMBO_BOX (location_combo_box),
+ location >= 0 ? location : 0);
+#endif
+ set_combo_box_active (
+ editor, GTK_COMBO_BOX (service_combo_box),
+ service >= 0 ? service : im_service_default[record - 1]);
+ set_entry_text (editor, GTK_ENTRY (name_entry), name ? name : "");
}
static void
@@ -2047,156 +1876,170 @@
{
GList *im_attr_list;
GList *l;
- GtkWidget *w;
- EContactEditorDynTable *dyntable;
- GtkListStore *data_store;
- GtkTreeIter iter;
-
- w = e_builder_get_widget (editor->priv->builder, "im-dyntable");
- dyntable = E_CONTACT_EDITOR_DYNTABLE (w);
+ gint record_n;
+ gint i;
/* Clear */
- e_contact_editor_dyntable_clear_data (dyntable);
+ for (record_n = 1; record_n <= IM_SLOTS; record_n++) {
+ fill_in_im_record (editor, record_n, -1, NULL, -1);
+ }
/* Fill in */
- data_store = e_contact_editor_dyntable_extract_data (dyntable);
-
- im_attr_list = e_contact_get_attributes_set (
- editor->priv->contact,
- im_service_fetch_set,
- G_N_ELEMENTS (im_service_fetch_set)
- );
+ for (record_n = 1, i = 0; i < G_N_ELEMENTS (im_service); i++) {
+ im_attr_list = e_contact_get_attributes (editor->priv->contact, im_service[i].field);
- for (l = im_attr_list; l; l = g_list_next(l)) {
- EVCardAttribute *attr = l->data;
- gchar *im_name;
- gint service_type;
- gint slot;
+ for (l = im_attr_list; l && record_n <= IM_SLOTS; l = g_list_next (l)) {
+ EVCardAttribute *attr = l->data;
+ gchar *im_name;
+ gint slot;
+
+ im_name = e_vcard_attribute_get_value (attr);
+ slot = alloc_ui_slot (
+ editor, "entry-im-name",
+ get_ui_slot (attr), IM_SLOTS);
+ if (slot < 1)
+ break;
- im_name = e_vcard_attribute_get_value (attr);
- service_type = eab_get_im_type_index (attr);
+ fill_in_im_record (
+ editor, slot, i, im_name,
+ get_im_location (attr));
- slot = get_ui_slot (attr);
- if (slot < 0)
- slot = IM_SLOTS + 1; //attach at the end
+ record_n++;
- gtk_list_store_append (data_store, &iter);
- gtk_list_store_set (data_store, &iter,
- DYNTABLE_STORE_COLUMN_SORTORDER, slot,
- DYNTABLE_STORE_COLUMN_SELECTED_ITEM, service_type,
- DYNTABLE_STORE_COLUMN_ENTRY_STRING, im_name,
- -1);
+ g_free (im_name);
+ }
- g_free (im_name);
+ g_list_free_full (im_attr_list, (GDestroyNotify) e_vcard_attribute_free);
}
+}
+
+static void
+extract_im_record (EContactEditor *editor,
+ gint record,
+ gint *service,
+ gchar **name,
+ gint *location)
+{
+ GtkWidget *service_combo_box;
+#ifdef ENABLE_IM_LOCATION
+ GtkWidget *location_combo_box;
+#endif
+ GtkWidget *name_entry;
+ gchar *widget_name;
+
+ widget_name = g_strdup_printf ("combobox-im-service-%d", record);
+ service_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
+
+#ifdef ENABLE_IM_LOCATION
+ widget_name = g_strdup_printf ("combobox-im-location-%d", record);
+ location_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
+#endif
- g_list_free_full (im_attr_list, (GDestroyNotify) e_vcard_attribute_free);
+ widget_name = g_strdup_printf ("entry-im-name-%d", record);
+ name_entry = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
- e_contact_editor_dyntable_fill_in_data (dyntable);
+ *name = g_strdup (gtk_entry_get_text (GTK_ENTRY (name_entry)));
+ *service = gtk_combo_box_get_active (GTK_COMBO_BOX (service_combo_box));
+#ifdef ENABLE_IM_LOCATION
+ *location = gtk_combo_box_get_active (GTK_COMBO_BOX (location_combo_box));
+#else
+ *location = 1; /* set everything to HOME */
+#endif
}
static void
extract_im (EContactEditor *editor)
{
- GList *attr_list = NULL;
- GList *old_attr_list = NULL;
- GList *ll;
- gint ii;
- GtkWidget *w;
- EContactEditorDynTable *dyntable;
- GtkListStore *data_store;
- GtkTreeModel *tree_model;
- GtkTreeIter iter;
- gboolean valid;
+ GList **service_attr_list;
+ gint remaining_slots = IM_SLOTS;
+ gint i;
- w = e_builder_get_widget (editor->priv->builder, "im-dyntable");
- dyntable = E_CONTACT_EDITOR_DYNTABLE (w);
- data_store = e_contact_editor_dyntable_extract_data (dyntable);
- tree_model = GTK_TREE_MODEL (data_store);
-
- valid = gtk_tree_model_get_iter_first (tree_model, &iter);
- while (valid) {
- gint service_type;
- gint slot;
- gchar *im_name;
+ service_attr_list = g_new0 (GList *, G_N_ELEMENTS (im_service));
+
+ for (i = 1; i <= IM_SLOTS; i++) {
EVCardAttribute *attr;
- const EABTypeLabel *im_service = eab_get_im_type_labels (&service_type);
+ gchar *name;
+ gint service;
+ gint location;
+
+ extract_im_record (editor, i, &service, &name, &location);
+
+ if (!STRING_IS_EMPTY (name)) {
+ attr = e_vcard_attribute_new (
+ "", e_contact_vcard_attribute (
+ im_service[service].field));
- gtk_tree_model_get (tree_model,&iter,
- DYNTABLE_STORE_COLUMN_SORTORDER, &slot,
- DYNTABLE_STORE_COLUMN_SELECTED_ITEM, &service_type,
- DYNTABLE_STORE_COLUMN_ENTRY_STRING, &im_name,
- -1);
+ if (location >= 0)
+ e_vcard_attribute_add_param_with_value (
+ attr,
+ e_vcard_attribute_param_new (EVC_TYPE),
+ im_index_to_location (location));
- attr = e_vcard_attribute_new ("",
- e_contact_vcard_attribute (
- im_service[service_type].field_id));
+ e_vcard_attribute_add_value (attr, name);
+ set_ui_slot (attr, i);
- /* older evolution versions (<=3.12) will crash if SLOT>4 is stored,
- * but if we don't store the slot we loose sortorder.
- * this works only for <=4 IM slots. for more, old evolution
- * will go through types (AIM, Jabber, ...) and stop after 4
- * no matter what x-evo-slot says.
- */
- if (slot < 4)
- set_ui_slot (attr, slot + 1);
+ service_attr_list[service] = g_list_append (
+ service_attr_list[service], attr);
+ }
- e_vcard_attribute_add_value (attr, im_name);
+ g_free (name);
+ }
- attr_list = g_list_prepend (attr_list, attr);
+ for (i = 0; i < G_N_ELEMENTS (im_service); i++) {
+ GList *old_service_attr_list;
+ gint filled_in_slots;
+ GList *ll;
+ gint j;
- valid = gtk_tree_model_iter_next (tree_model, &iter);
- }
- attr_list = g_list_reverse (attr_list);
+ /* Splice in the old attributes, minus the filled_in_slots first */
- /* Splice in the old attributes, minus the IM_SLOTS first */
+ old_service_attr_list = e_contact_get_attributes (
+ editor->priv->contact, im_service[i].field);
+ filled_in_slots = MIN (
+ remaining_slots,
+ g_list_length (old_service_attr_list));
+ remaining_slots -= filled_in_slots;
- old_attr_list = e_contact_get_attributes_set (
- editor->priv->contact,
- im_service_fetch_set,
- G_N_ELEMENTS (im_service_fetch_set)
- );
- for (ll = old_attr_list, ii = 0; ll && ii < IM_SLOTS; ii++) {
- e_vcard_attribute_free (ll->data);
- ll = g_list_delete_link (ll, ll);
- }
+ for (ll = old_service_attr_list, j = 0;
+ ll && j < filled_in_slots; j++) {
- old_attr_list = ll;
- attr_list = g_list_concat (attr_list, old_attr_list);
+ e_vcard_attribute_free (ll->data);
+ ll = g_list_delete_link (ll, ll);
+ }
- for (ii = 0; ii < G_N_ELEMENTS (im_service_fetch_set); ii++) {
- e_contact_set_attributes (editor->priv->contact, im_service_fetch_set[ii], NULL);
- }
+ old_service_attr_list = ll;
+ service_attr_list[i] = g_list_concat (
+ service_attr_list[i], old_service_attr_list);
+
+ e_contact_set_attributes (
+ editor->priv->contact,
+ im_service[i].field,
+ service_attr_list[i]);
- for (ll = attr_list; ll; ll = ll->next) {
- EVCard *vcard;
- vcard = E_VCARD (editor->priv->contact);
- e_vcard_append_attribute (vcard, e_vcard_attribute_copy ((EVCardAttribute *) ll->data));
+ free_attr_list (service_attr_list[i]);
}
- g_list_free_full (attr_list, (GDestroyNotify) e_vcard_attribute_free);
+ g_free (service_attr_list);
}
static void
-sensitize_im_types (EContactEditor *editor)
+sensitize_im_types (EContactEditor *editor,
+ GtkWidget *combo_box)
{
- GtkWidget *w;
- GtkListStore *list_store;
GtkTreeModel *model;
GtkTreeIter iter;
- gint i, n_elements;
+ gint i;
gboolean valid;
- const EABTypeLabel *im_service = eab_get_im_type_labels (&n_elements);
-
- w = e_builder_get_widget (editor->priv->builder, "im-dyntable");
- list_store = e_contact_editor_dyntable_get_combo_store (E_CONTACT_EDITOR_DYNTABLE (w));
- model = GTK_TREE_MODEL (list_store);
+ model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo_box));
valid = gtk_tree_model_get_iter_first (model, &iter);
- for (i = 0; i < n_elements; i++) {
+ for (i = 0; i < G_N_ELEMENTS (im_service); i++) {
if (!valid) {
g_warning (G_STRLOC ": Unexpected end of im items in combo box");
return;
@@ -2204,8 +2047,7 @@
gtk_list_store_set (
GTK_LIST_STORE (model), &iter,
- DYNTABLE_COMBO_COLUMN_SENSITIVE,
- is_field_supported (editor, im_service[i].field_id),
+ 1, is_field_supported (editor, im_service[i].field),
-1);
valid = gtk_tree_model_iter_next (model, &iter);
@@ -2213,19 +2055,51 @@
}
static void
+sensitize_im_record (EContactEditor *editor,
+ gint record,
+ gboolean enabled)
+{
+ GtkWidget *service_combo_box;
+#ifdef ENABLE_IM_LOCATION
+ GtkWidget *location_combo_box;
+#endif
+ GtkWidget *name_entry;
+ gchar *widget_name;
+
+ widget_name = g_strdup_printf ("combobox-im-service-%d", record);
+ service_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
+
+#ifdef ENABLE_IM_LOCATION
+ widget_name = g_strdup_printf ("combobox-im-location-%d", record);
+ location_combo_box = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
+#endif
+
+ widget_name = g_strdup_printf ("entry-im-name-%d", record);
+ name_entry = e_builder_get_widget (editor->priv->builder, widget_name);
+ g_free (widget_name);
+
+ gtk_widget_set_sensitive (service_combo_box, enabled);
+#ifdef ENABLE_IM_LOCATION
+ gtk_widget_set_sensitive (location_combo_box, enabled);
+#endif
+ gtk_editable_set_editable (GTK_EDITABLE (name_entry), enabled);
+ sensitize_im_types (editor, service_combo_box);
+}
+
+static void
sensitize_im (EContactEditor *editor)
{
- gint i, n_elements;
+ gint i;
gboolean enabled;
gboolean no_ims_supported;
- GtkWidget *w;
- const EABTypeLabel *im_service = eab_get_im_type_labels (&n_elements);
enabled = editor->priv->target_editable;
no_ims_supported = TRUE;
- for (i = 0; i < n_elements; i++)
- if (is_field_supported (editor, im_service[i].field_id)) {
+ for (i = 0; i < G_N_ELEMENTS (im_service); i++)
+ if (is_field_supported (editor, im_service[i].field)) {
no_ims_supported = FALSE;
break;
}
@@ -2233,10 +2107,20 @@
if (no_ims_supported)
enabled = FALSE;
- w = e_builder_get_widget (editor->priv->builder, "im-dyntable");
- gtk_widget_set_sensitive (w, enabled);
+ for (i = 1; i <= IM_SLOTS; i++) {
+ sensitize_im_record (editor, i, enabled);
+ }
+}
+
+static void
+init_personal (EContactEditor *editor)
+{
+ gtk_expander_set_expanded (
+ GTK_EXPANDER (e_builder_get_widget (
+ editor->priv->builder, "expander-personal-misc")),
+ !editor->priv->compress_ui);
- sensitize_im_types (editor);
+ expand_web (editor, !editor->priv->compress_ui);
}
static void
@@ -2301,8 +2185,9 @@
init_address_record (editor, i);
gtk_expander_set_expanded (
- GTK_EXPANDER (e_builder_get_widget (editor->priv->builder, "expander-address-other")),
- !editor->priv->compress_ui);
+ GTK_EXPANDER (e_builder_get_widget (
+ editor->priv->builder, "expander-address-other")),
+ !editor->priv->compress_ui);
}
static void
@@ -2410,6 +2295,65 @@
fill_in_address_record (editor, i);
}
+static void
+extract_address_textview (EContactEditor *editor,
+ gint record,
+ EContactAddress *address)
+{
+ gchar *textview_name;
+ GtkWidget *textview;
+ GtkTextBuffer *text_buffer;
+ GtkTextIter iter_1, iter_2;
+
+ textview_name = g_strdup_printf ("textview-%s-address", address_name[record]);
+ textview = e_builder_get_widget (editor->priv->builder, textview_name);
+ g_free (textview_name);
+
+ text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview));
+ gtk_text_buffer_get_start_iter (text_buffer, &iter_1);
+
+ /* Skip blank lines */
+ while (gtk_text_iter_get_chars_in_line (&iter_1) < 1 &&
+ !gtk_text_iter_is_end (&iter_1))
+ gtk_text_iter_forward_line (&iter_1);
+
+ if (gtk_text_iter_is_end (&iter_1))
+ return;
+
+ iter_2 = iter_1;
+ gtk_text_iter_forward_to_line_end (&iter_2);
+
+ /* Extract street (first line of text) */
+ address->street = gtk_text_iter_get_text (&iter_1, &iter_2);
+
+ iter_1 = iter_2;
+ gtk_text_iter_forward_line (&iter_1);
+
+ if (gtk_text_iter_is_end (&iter_1))
+ return;
+
+ gtk_text_iter_forward_to_end (&iter_2);
+
+ /* Extract extended address (remaining lines of text) */
+ address->ext = gtk_text_iter_get_text (&iter_1, &iter_2);
+}
+
+static gchar *
+extract_address_field (EContactEditor *editor,
+ gint record,
+ const gchar *widget_field_name)
+{
+ gchar *entry_name;
+ GtkWidget *entry;
+
+ entry_name = g_strdup_printf (
+ "entry-%s-%s", address_name[record], widget_field_name);
+ entry = e_builder_get_widget (editor->priv->builder, entry_name);
+ g_free (entry_name);
+
+ return g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
+}
+
static gchar *
append_to_address_label (gchar *address_label,
const gchar *part,
@@ -2445,7 +2389,7 @@
return;
}
- settings = e_util_ref_settings ("org.gnome.evolution.addressbook");
+ settings = g_settings_new ("org.gnome.evolution.addressbook");
format_address = g_settings_get_boolean (settings, "address-formatting");
g_object_unref (settings);
@@ -2486,7 +2430,13 @@
address = g_new0 (EContactAddress, 1);
- extract_address_from_gui (editor, address, record);
+ extract_address_textview (editor, record, address);
+ address->locality = extract_address_field (editor, record, "city");
+ address->region = extract_address_field (editor, record, "state");
+ address->code = extract_address_field (editor, record, "zip");
+ address->country = extract_address_field (editor, record, "country");
+ address->po = extract_address_field (editor, record, "pobox");
+
if (!STRING_IS_EMPTY (address->street) ||
!STRING_IS_EMPTY (address->ext) ||
!STRING_IS_EMPTY (address->locality) ||
@@ -3162,16 +3112,9 @@
fill_in_simple (editor);
fill_in_email (editor);
fill_in_phone (editor);
- fill_in_sip (editor);
fill_in_im (editor);
fill_in_address (editor);
- /* Visibility of sections and status of menuitems in the config-menu depend on data
- * they have to be initialized here instead of init_all() and sensitize_all()
- */
- configure_visibility (editor);
- config_sensitize_cb (NULL, editor);
-
if (weak_pointer) {
g_object_remove_weak_pointer (G_OBJECT (focused_widget), &weak_pointer);
gtk_widget_grab_focus (focused_widget);
@@ -3184,7 +3127,6 @@
extract_simple (editor);
extract_email (editor);
extract_phone (editor);
- extract_sip (editor);
extract_im (editor);
extract_address (editor);
}
@@ -3192,44 +3134,12 @@
static void
sensitize_all (EContactEditor *editor)
{
- GtkWidget *focused_widget;
- gpointer weak_pointer;
-
- /* Widget changes can cause focus widget change, thus remember the current
- widget and restore it after the fill is done; some fill operations
- can delete widgets, like the dyntable, thus do the weak_pointer as well.
- */
- focused_widget = gtk_window_get_focus (eab_editor_get_window (EAB_EDITOR (editor)));
- weak_pointer = focused_widget;
- if (focused_widget)
- g_object_add_weak_pointer (G_OBJECT (focused_widget), &weak_pointer);
-
sensitize_ok (editor);
sensitize_simple (editor);
sensitize_email (editor);
sensitize_phone (editor);
- sensitize_sip (editor);
sensitize_im (editor);
sensitize_address (editor);
-
- if (weak_pointer) {
- g_object_remove_weak_pointer (G_OBJECT (focused_widget), &weak_pointer);
- gtk_widget_grab_focus (focused_widget);
- }
-}
-
-static void
-init_personal (EContactEditor *editor)
-{
- gtk_expander_set_expanded (
- GTK_EXPANDER (e_builder_get_widget (editor->priv->builder, "expander-personal-web")),
- !editor->priv->compress_ui);
- gtk_expander_set_expanded (
- GTK_EXPANDER (e_builder_get_widget (editor->priv->builder, "expander-personal-job")),
- !editor->priv->compress_ui);
- gtk_expander_set_expanded (
- GTK_EXPANDER (e_builder_get_widget (editor->priv->builder, "expander-personal-misc")),
- !editor->priv->compress_ui);
}
static void
@@ -3243,11 +3153,9 @@
init_simple (editor);
init_email (editor);
init_phone (editor);
- init_sip (editor);
init_im (editor);
init_personal (editor);
init_address (editor);
- init_config (editor);
/* with so many scrolled windows, we need to
* do some manual sizing */
@@ -4256,56 +4164,31 @@
}
static void
-expand_dyntable (GtkExpander *expander,
- EContactEditorDynTable *dyntable,
- gint max_slots)
+expand_web_toggle (EContactEditor *ce)
{
- if (gtk_expander_get_expanded (expander)) {
- e_contact_editor_dyntable_set_show_max (dyntable, max_slots);
- } else {
- e_contact_editor_dyntable_set_show_max (dyntable,
- SLOTS_IN_COLLAPSED_STATE);
- }
-}
+ GtkWidget *widget;
-static void
-expander_contact_mail_cb (GObject *object,
- GParamSpec *param_spec,
- gpointer user_data)
-{
- expand_dyntable (GTK_EXPANDER (object),
- E_CONTACT_EDITOR_DYNTABLE (user_data),
- EMAIL_SLOTS);
+ widget = e_builder_get_widget (ce->priv->builder, "label-videourl");
+ expand_web (ce, !gtk_widget_get_visible (widget));
}
static void
-expander_contact_phone_cb (GObject *object,
- GParamSpec *param_spec,
- gpointer user_data)
+expand_phone_toggle (EContactEditor *ce)
{
- expand_dyntable (GTK_EXPANDER (object),
- E_CONTACT_EDITOR_DYNTABLE (user_data),
- PHONE_SLOTS);
-}
+ GtkWidget *phone_ext_table;
-static void
-expander_contact_sip_cb (GObject *object,
- GParamSpec *param_spec,
- gpointer user_data)
-{
- expand_dyntable (GTK_EXPANDER (object),
- E_CONTACT_EDITOR_DYNTABLE (user_data),
- SIP_SLOTS);
+ phone_ext_table = e_builder_get_widget (
+ ce->priv->builder, "table-phone-extended");
+ expand_phone (ce, !gtk_widget_get_visible (phone_ext_table));
}
static void
-expander_contact_im_cb (GObject *object,
- GParamSpec *param_spec,
- gpointer user_data)
+expand_mail_toggle (EContactEditor *ce)
{
- expand_dyntable (GTK_EXPANDER (object),
- E_CONTACT_EDITOR_DYNTABLE (user_data),
- IM_SLOTS);
+ GtkWidget *mail;
+
+ mail = e_builder_get_widget (ce->priv->builder, "entry-email-4");
+ expand_mail (ce, !gtk_widget_get_visible (mail));
}
static void
@@ -4329,7 +4212,7 @@
EShell *shell;
EClientCache *client_cache;
GtkWidget *container;
- GtkWidget *widget, *label, *dyntable;
+ GtkWidget *widget, *label;
GtkEntryCompletion *completion;
e_contact_editor->priv = G_TYPE_INSTANCE_GET_PRIVATE (
@@ -4356,7 +4239,6 @@
/* Make sure custom widget types are available */
g_type_ensure (E_TYPE_IMAGE_CHOOSER);
g_type_ensure (E_TYPE_CLIENT_COMBO_BOX);
- g_type_ensure (E_TYPE_CONTACT_EDITOR_DYNTABLE);
g_type_ensure (E_TYPE_URL_ENTRY);
g_type_ensure (E_TYPE_DATE_EDIT);
@@ -4420,34 +4302,21 @@
g_signal_connect (
widget, "clicked",
G_CALLBACK (show_help_cb), e_contact_editor);
-
- widget = e_builder_get_widget (
- e_contact_editor->priv->builder, "expander-contact-phone");
- dyntable = e_builder_get_widget (
- e_contact_editor->priv->builder, "phone-dyntable");
- g_signal_connect (widget, "notify::expanded",
- G_CALLBACK (expander_contact_phone_cb), dyntable);
-
widget = e_builder_get_widget (
- e_contact_editor->priv->builder, "expander-contact-sip");
- dyntable = e_builder_get_widget (
- e_contact_editor->priv->builder, "sip-dyntable");
- g_signal_connect (widget, "notify::expanded",
- G_CALLBACK (expander_contact_sip_cb), dyntable);
-
+ e_contact_editor->priv->builder, "button-web-expand");
+ g_signal_connect_swapped (
+ widget, "clicked",
+ G_CALLBACK (expand_web_toggle), e_contact_editor);
widget = e_builder_get_widget (
- e_contact_editor->priv->builder, "expander-contact-im");
- dyntable = e_builder_get_widget (
- e_contact_editor->priv->builder, "im-dyntable");
- g_signal_connect (widget, "notify::expanded",
- G_CALLBACK (expander_contact_im_cb), dyntable);
-
+ e_contact_editor->priv->builder, "button-phone-expand");
+ g_signal_connect_swapped (
+ widget, "clicked",
+ G_CALLBACK (expand_phone_toggle), e_contact_editor);
widget = e_builder_get_widget (
- e_contact_editor->priv->builder, "expander-contact-email");
- dyntable = e_builder_get_widget (
- e_contact_editor->priv->builder, "mail-dyntable");
- g_signal_connect (widget, "notify::expanded",
- G_CALLBACK (expander_contact_mail_cb), dyntable);
+ e_contact_editor->priv->builder, "button-mail-expand");
+ g_signal_connect_swapped (
+ widget, "clicked",
+ G_CALLBACK (expand_mail_toggle), e_contact_editor);
widget = e_builder_get_widget (
e_contact_editor->priv->builder, "entry-fullname");
diff -Nru evolution-3.16.0/addressbook/gui/contact-editor/e-contact-editor-dyntable.c evolution-3.12.11/addressbook/gui/contact-editor/e-contact-editor-dyntable.c
--- evolution-3.16.0/addressbook/gui/contact-editor/e-contact-editor-dyntable.c 2014-05-06 10:59:33.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/contact-editor/e-contact-editor-dyntable.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,754 +0,0 @@
-/*
- * e-contact-editor-dyntable.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.
- *
- * 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 Lesser General Public License
- * along with this program; if not, see .
- *
- */
-
-#include "e-contact-editor-dyntable.h"
-
-G_DEFINE_TYPE(EContactEditorDynTable, e_contact_editor_dyntable, GTK_TYPE_GRID)
-
-/* one position is occupied by two widgets: combo+entry */
-#define ENTRY_SIZE 2
-#define MAX_CAPACITY 100
-
-enum {
- CHANGED_SIGNAL,
- ACTIVATE_SIGNAL,
- ROW_ADDED_SIGNAL,
- LAST_SIGNAL
-};
-
-static guint dyntable_signals[LAST_SIGNAL];
-
-struct _EContactEditorDynTablePrivate {
-
- /* absolute max, dyntable will ignore the rest */
- guint max_entries;
-
- /* current number of entries with text or requested by user*/
- guint curr_entries;
-
- /* minimum to show, with or without text */
- guint show_min_entries;
-
- /* no matter how much data, show only */
- guint show_max_entries;
-
- /* number of entries (combo/text) per row */
- guint columns;
-
- /* if true, fill line with empty slots*/
- gboolean justified;
-
- GtkWidget *add_button;
- GtkListStore *combo_store;
- GtkListStore *data_store;
-
- /* array of default values for combo box */
- const gint *combo_defaults;
-
- /* number of elements in the array */
- size_t combo_defaults_n;
-};
-
-GtkWidget*
-e_contact_editor_dyntable_new (void)
-{
- GtkWidget* widget;
- widget = GTK_WIDGET (g_object_new (e_contact_editor_dyntable_get_type (), NULL));
- return widget;
-}
-
-static void
-set_combo_box_active (EContactEditorDynTable *dyntable,
- GtkComboBox *combo_box,
- gint active)
-{
- g_signal_handlers_block_matched (combo_box,
- G_SIGNAL_MATCH_DATA, 0, 0, NULL,
- NULL, dyntable);
- gtk_combo_box_set_active (combo_box, active);
- g_signal_handlers_unblock_matched (combo_box,
- G_SIGNAL_MATCH_DATA, 0, 0, NULL,
- NULL, dyntable);
-}
-
-/* translate position into column/row */
-static void
-position_to_grid (EContactEditorDynTable *dyntable,
- guint pos,
- guint *col,
- guint *row)
-{
- *row = pos / dyntable->priv->columns;
- *col = pos % dyntable->priv->columns * ENTRY_SIZE;
-}
-
-static void
-move_widget (GtkGrid *grid, GtkWidget *w, guint col, guint row)
-{
- GValue rowValue = G_VALUE_INIT, colValue = G_VALUE_INIT;
-
- g_value_init (&rowValue, G_TYPE_UINT);
- g_value_init (&colValue, G_TYPE_UINT);
-
- g_value_set_uint (&rowValue, row);
- g_value_set_uint (&colValue, col);
-
- gtk_container_child_set_property (GTK_CONTAINER (grid), w,
- "left-attach", &colValue);
- gtk_container_child_set_property (GTK_CONTAINER (grid), w,
- "top-attach", &rowValue);
-}
-
-static gboolean
-is_button_required (EContactEditorDynTable *dyntable)
-{
- if (dyntable->priv->curr_entries >= dyntable->priv->max_entries)
- return FALSE;
- if (dyntable->priv->curr_entries <= dyntable->priv->show_max_entries)
- return TRUE;
- else
- return FALSE;
-}
-
-static void
-sensitize_button (EContactEditorDynTable *dyntable)
-{
- guint row, col, current_entries;
- GtkWidget *w;
- GtkGrid *grid;
- EContactEditorDynTableClass *class;
- gboolean enabled;
-
- grid = GTK_GRID (dyntable);
- class = E_CONTACT_EDITOR_DYNTABLE_GET_CLASS (dyntable);
-
- current_entries = dyntable->priv->curr_entries;
- enabled = TRUE;
- if (current_entries > 0) {
- /* last entry */
- current_entries--;
- position_to_grid (dyntable, current_entries, &col, &row);
- w = gtk_grid_get_child_at (grid, col + 1, row);
-
- enabled = !class->widget_is_empty (dyntable, w);
- }
-
- gtk_widget_set_sensitive (dyntable->priv->add_button, enabled);
-}
-
-static void
-show_button (EContactEditorDynTable *dyntable)
-{
- guint col,row, pos;
- gboolean visible = FALSE;
- GtkGrid *grid;
-
- grid = GTK_GRID (dyntable);
-
- /* move button to end of current line */
- pos = dyntable->priv->curr_entries;
- if (pos > 0)
- pos--;
- position_to_grid(dyntable, pos, &col, &row);
- move_widget (grid, dyntable->priv->add_button,
- dyntable->priv->columns*ENTRY_SIZE+1, row);
-
- /* set visibility */
- if (is_button_required (dyntable))
- visible = TRUE;
-
- gtk_widget_set_visible (dyntable->priv->add_button, visible);
-
- sensitize_button (dyntable);
-}
-
-static void
-increment_counter (EContactEditorDynTable *dyntable)
-{
- dyntable->priv->curr_entries++;
- show_button (dyntable);
-}
-
-static void
-decrement_counter (EContactEditorDynTable *dyntable)
-{
- dyntable->priv->curr_entries--;
- show_button (dyntable);
-}
-
-static gint
-get_next_combo_index (EContactEditorDynTable *dyntable)
-{
- size_t array_size = dyntable->priv->combo_defaults_n;
- gint idx = 0;
-
- if (dyntable->priv->combo_defaults != NULL) {
- idx = dyntable->priv->combo_defaults[dyntable->priv->curr_entries % array_size];
- }
-
- return idx;
-}
-
-static GtkWidget*
-combo_box_create (EContactEditorDynTable *dyntable)
-{
- GtkWidget *w;
- GtkComboBox *combo;
- GtkListStore *store;
- GtkCellRenderer *cell;
-
- w = gtk_combo_box_new ();
- combo = GTK_COMBO_BOX (w);
- store = dyntable->priv->combo_store;
-
- gtk_combo_box_set_model (combo, GTK_TREE_MODEL(store));
-
- gtk_cell_layout_clear (GTK_CELL_LAYOUT (combo));
-
- cell = gtk_cell_renderer_text_new ();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell,
- "text", DYNTABLE_COMBO_COLUMN_TEXT,
- "sensitive", DYNTABLE_COMBO_COLUMN_SENSITIVE,
- NULL);
-
- gtk_combo_box_set_active (combo, get_next_combo_index (dyntable));
-
- return w;
-}
-
-static void
-emit_changed (EContactEditorDynTable *dyntable)
-{
- g_signal_emit (dyntable, dyntable_signals[CHANGED_SIGNAL], 0);
-}
-
-static void
-emit_activated (EContactEditorDynTable *dyntable)
-{
- g_signal_emit (dyntable, dyntable_signals[ACTIVATE_SIGNAL], 0);
-}
-
-static void
-emit_row_added (EContactEditorDynTable *dyntable)
-{
- g_signal_emit (dyntable, dyntable_signals[ROW_ADDED_SIGNAL], 0);
-}
-
-static void
-add_empty_entry (EContactEditorDynTable *dyntable)
-{
- GtkGrid *grid;
- guint row, col;
- GtkWidget *box, *entry;
- EContactEditorDynTableClass *class;
-
- if (dyntable->priv->curr_entries >= dyntable->priv->max_entries)
- return;
-
- grid = GTK_GRID (dyntable);
- position_to_grid (dyntable, dyntable->priv->curr_entries, &col, &row);
-
- /* create new entry at last position */
- class = E_CONTACT_EDITOR_DYNTABLE_GET_CLASS (dyntable);
- box = combo_box_create (dyntable);
- gtk_grid_attach (grid, box, col, row, 1, 1);
- gtk_widget_show (box);
-
- entry = class->widget_create (dyntable);
- g_object_set (entry, "margin-left", 2, NULL);
- g_object_set (entry, "margin-right", 5, NULL);
- gtk_widget_set_hexpand (entry, GTK_EXPAND);
- gtk_grid_attach (grid, entry, col + 1, row, 1, 1);
- gtk_widget_show (entry);
-
- g_signal_connect_swapped(box, "changed",
- G_CALLBACK (gtk_widget_grab_focus), entry);
- g_signal_connect_swapped(box, "changed",
- G_CALLBACK (emit_changed), dyntable);
- g_signal_connect_swapped(entry, "changed",
- G_CALLBACK (emit_changed), dyntable);
- g_signal_connect_swapped(entry, "changed",
- G_CALLBACK (sensitize_button), dyntable);
- g_signal_connect_swapped(entry, "activate",
- G_CALLBACK (emit_activated), dyntable);
-
- increment_counter (dyntable);
-
- if ( (dyntable->priv->justified && col < dyntable->priv->columns-1) ||
- (dyntable->priv->curr_entries < dyntable->priv->show_min_entries) )
- add_empty_entry (dyntable);
-
- gtk_widget_grab_focus (entry);
-}
-
-static void
-remove_empty_entries (EContactEditorDynTable *dyntable, gboolean fillup)
-{
- guint row, col, pos;
- GtkGrid* grid;
- GtkWidget* w;
- EContactEditorDynTableClass *class;
-
- grid = GTK_GRID (dyntable);
- class = E_CONTACT_EDITOR_DYNTABLE_GET_CLASS (dyntable);
-
- for (pos = 0; pos < dyntable->priv->curr_entries; pos++) {
- position_to_grid (dyntable, pos, &col, &row);
- w = gtk_grid_get_child_at (grid, col + 1, row);
-
- if (w != NULL && class->widget_is_empty (dyntable, w)) {
- guint pos2, next_col, next_row;
-
- gtk_widget_destroy (w);
- w = gtk_grid_get_child_at (grid, col, row);
- gtk_widget_destroy (w);
-
- /* now fill gap */
- for (pos2 = pos + 1; pos2 < dyntable->priv->curr_entries; pos2++) {
- position_to_grid (dyntable, pos2, &next_col, &next_row);
- w = gtk_grid_get_child_at (grid, next_col, next_row);
- move_widget (grid, w, col, row);
- w = gtk_grid_get_child_at (grid, next_col + 1, next_row);
- move_widget (grid, w, col + 1, row);
- col = next_col;
- row = next_row;
- }
- decrement_counter (dyntable);
- pos--; /* check the new widget on our current position */
- }
-
- }
-
- if (fillup
- && (dyntable->priv->curr_entries < dyntable->priv->show_min_entries
- || (dyntable->priv->justified && col < dyntable->priv->columns-1)))
- add_empty_entry (dyntable);
-
-}
-
-/* clears data, not the combo box list store */
-void
-e_contact_editor_dyntable_clear_data (EContactEditorDynTable *dyntable)
-{
- guint i, col, row;
- GtkGrid *grid;
- GtkWidget *w;
- EContactEditorDynTableClass *class;
-
- grid = GTK_GRID(dyntable);
- class = E_CONTACT_EDITOR_DYNTABLE_GET_CLASS(dyntable);
-
- for (i = 0; i < dyntable->priv->curr_entries; i++) {
- position_to_grid (dyntable, i, &col, &row);
- w = gtk_grid_get_child_at (grid, col + 1, row);
- class->widget_clear (dyntable, w);
- }
- remove_empty_entries (dyntable, TRUE);
-
- gtk_list_store_clear (dyntable->priv->data_store);
-}
-
-static void
-adjust_visibility_of_widgets (EContactEditorDynTable *dyntable)
-{
- guint pos, col, row;
- GtkGrid *grid;
- GtkWidget *w;
-
- grid = GTK_GRID (dyntable);
- for (pos = 0; pos < dyntable->priv->curr_entries; pos++) {
- gboolean visible = FALSE;
-
- if (pos < dyntable->priv->show_max_entries)
- visible = TRUE;
-
- position_to_grid (dyntable, pos, &col, &row);
- w = gtk_grid_get_child_at (grid, col, row);
- gtk_widget_set_visible (w, visible);
- w = gtk_grid_get_child_at (grid, col + 1, row);
- gtk_widget_set_visible (w, visible);
- }
-
- show_button (dyntable);
-}
-
-/* number of columns can only be set before any data is added to this dyntable */
-void e_contact_editor_dyntable_set_num_columns (EContactEditorDynTable *dyntable,
- guint number_of_columns,
- gboolean justified)
-{
- GtkTreeIter iter;
- GtkTreeModel *store;
- gboolean holds_data;
-
- g_return_if_fail (number_of_columns > 0);
-
- store = GTK_TREE_MODEL (dyntable->priv->data_store);
- holds_data = gtk_tree_model_get_iter_first (store, &iter);
- g_return_if_fail (!holds_data);
-
- remove_empty_entries(dyntable, FALSE);
-
- dyntable->priv->columns = number_of_columns;
- dyntable->priv->justified = justified;
-
- remove_empty_entries(dyntable, TRUE);
-}
-
-void
-e_contact_editor_dyntable_set_max_entries (EContactEditorDynTable *dyntable,
- guint max)
-{
- GtkTreeModel *store;
- gint n_children;
-
- g_return_if_fail (max > 0);
-
- store = GTK_TREE_MODEL (dyntable->priv->data_store);
-
- n_children = gtk_tree_model_iter_n_children (store, NULL);
- if (n_children > max) {
- g_warning ("Dyntable holds %i items, setting max to %i, instead of %i",
- n_children, n_children, max);
- max = n_children;
- }
-
- dyntable->priv->max_entries = max;
- if (dyntable->priv->show_max_entries>max)
- dyntable->priv->show_max_entries = max;
- if (dyntable->priv->show_min_entries>max)
- dyntable->priv->show_min_entries = max;
-
- remove_empty_entries (dyntable, TRUE);
- show_button (dyntable);
-}
-
-/* show at least number_of_entries, with or without data */
-void
-e_contact_editor_dyntable_set_show_min (EContactEditorDynTable *dyntable,
- guint number_of_entries)
-{
- if (number_of_entries > dyntable->priv->show_max_entries)
- dyntable->priv->show_min_entries = dyntable->priv->show_max_entries;
- else
- dyntable->priv->show_min_entries = number_of_entries;
-
- if (dyntable->priv->curr_entries < dyntable->priv->show_min_entries)
- add_empty_entry (dyntable);
-
- adjust_visibility_of_widgets (dyntable);
-}
-
-/* show no more than number_of_entries, hide the rest */
-void
-e_contact_editor_dyntable_set_show_max (EContactEditorDynTable *dyntable,
- guint number_of_entries)
-{
- if (number_of_entries > dyntable->priv->max_entries) {
- dyntable->priv->show_max_entries = dyntable->priv->max_entries;
- } else if (number_of_entries < dyntable->priv->show_min_entries) {
- dyntable->priv->show_max_entries = dyntable->priv->show_min_entries;
- } else {
- dyntable->priv->show_max_entries = number_of_entries;
- }
-
- adjust_visibility_of_widgets (dyntable);
-}
-
-/* use data_store to fill data into widgets */
-void
-e_contact_editor_dyntable_fill_in_data (EContactEditorDynTable *dyntable)
-{
- guint pos = 0, col, row;
- EContactEditorDynTableClass *class;
- GtkGrid *grid;
- GtkTreeIter iter;
- GtkTreeModel *store;
- GtkWidget *w;
- gboolean valid;
- gchar *str_data;
- gint int_data;
-
- class = E_CONTACT_EDITOR_DYNTABLE_GET_CLASS (dyntable);
- grid = GTK_GRID (dyntable);
- store = GTK_TREE_MODEL (dyntable->priv->data_store);
-
- valid = gtk_tree_model_get_iter_first (store, &iter);
- while (valid) {
- gtk_tree_model_get (store, &iter,
- DYNTABLE_STORE_COLUMN_ENTRY_STRING, &str_data,
- DYNTABLE_STORE_COLUMN_SELECTED_ITEM, &int_data,
- -1);
-
- if (pos >= dyntable->priv->curr_entries)
- add_empty_entry (dyntable);
-
- position_to_grid (dyntable, pos++, &col, &row);
- w = gtk_grid_get_child_at (grid, col, row);
- set_combo_box_active (dyntable, GTK_COMBO_BOX(w), int_data);
- w = gtk_grid_get_child_at (grid, col + 1, row);
- class->widget_fill (dyntable, w, str_data);
-
- valid = gtk_tree_model_iter_next (store, &iter);
-
- if (valid && pos >= dyntable->priv->max_entries) {
- g_warning ("dyntable is configured with max_entries = %i, ignoring the rest.", dyntable->priv->max_entries);
- break;
- }
- }
-
- /* fix visibility of added items */
- adjust_visibility_of_widgets (dyntable);
-}
-
-/* the model returned has 3 columns
- *
- * UINT: sort order
- * UINT: active combo item
- * STRING: data extracted with widget_extract()
- */
-GtkListStore*
-e_contact_editor_dyntable_extract_data (EContactEditorDynTable *dyntable)
-{
- EContactEditorDynTableClass *class;
- GtkGrid *grid;
- GtkListStore *data_store;
- GtkWidget *w;
- guint pos, col, row;
-
- grid = GTK_GRID(dyntable);
- class = E_CONTACT_EDITOR_DYNTABLE_GET_CLASS(dyntable);
- data_store = dyntable->priv->data_store;
-
- gtk_list_store_clear (data_store);
-
- for (pos = 0; pos < dyntable->priv->curr_entries; pos++) {
-
- position_to_grid (dyntable, pos, &col, &row);
- w = gtk_grid_get_child_at (grid, col + 1, row);
-
- if (!class->widget_is_empty (dyntable, w)) {
- GtkTreeIter iter;
- gchar *dup;
- gint combo_item;
- const gchar *data;
-
- data = class->widget_extract (dyntable, w);
- w = gtk_grid_get_child_at (grid, col, row);
- combo_item = gtk_combo_box_get_active (GTK_COMBO_BOX(w));
-
- dup = g_strdup (data);
- g_strstrip(dup);
-
- gtk_list_store_append (data_store, &iter);
- gtk_list_store_set (data_store, &iter,
- DYNTABLE_STORE_COLUMN_SORTORDER, pos,
- DYNTABLE_STORE_COLUMN_SELECTED_ITEM, combo_item,
- DYNTABLE_STORE_COLUMN_ENTRY_STRING, dup,
- -1);
-
- g_free (dup);
- }
- }
-
- return dyntable->priv->data_store;
-}
-
-/* the model returned has two columns
- *
- * STRING: bound to attribute "text"
- * BOOLEAN: bound to attribute "sensitive"
- */
-GtkListStore*
-e_contact_editor_dyntable_get_combo_store (EContactEditorDynTable *dyntable)
-{
- return dyntable->priv->combo_store;
-}
-
-void
-e_contact_editor_dyntable_set_combo_defaults (EContactEditorDynTable *dyntable,
- const gint *defaults,
- size_t defaults_n)
-{
- dyntable->priv->combo_defaults = defaults;
- dyntable->priv->combo_defaults_n = defaults_n;
-}
-
-static void
-dispose_impl (GObject *object)
-{
- GtkListStore *store;
- EContactEditorDynTable *dyntable;
-
- dyntable = E_CONTACT_EDITOR_DYNTABLE(object);
-
- store = dyntable->priv->data_store;
- if (store) {
- gtk_list_store_clear (store);
- g_object_unref (store);
- dyntable->priv->data_store = NULL;
- }
-
- store = dyntable->priv->combo_store;
- if (store) {
- g_object_unref (store);
- dyntable->priv->combo_store = NULL;
- }
-
- G_OBJECT_CLASS(e_contact_editor_dyntable_parent_class)->dispose (object);
-}
-
-static GtkWidget*
-default_impl_widget_create (EContactEditorDynTable *dyntable)
-{
- return gtk_entry_new ();
-}
-
-static void
-default_impl_widget_clear (EContactEditorDynTable *dyntable,
- GtkWidget *w)
-{
- GtkEntry *e;
- e = GTK_ENTRY(w);
- gtk_entry_set_text (e, "");
-}
-
-static const gchar*
-default_impl_widget_extract (EContactEditorDynTable *dyntable,
- GtkWidget *w)
-{
- GtkEntry *e;
-
- e = GTK_ENTRY(w);
- return gtk_entry_get_text (e);
-}
-
-static void
-default_impl_widget_fill (EContactEditorDynTable *dyntable,
- GtkWidget *w,
- const gchar *value)
-{
- GtkEntry *e;
-
- e = GTK_ENTRY(w);
- gtk_entry_set_text (e, value);
-}
-
-static gboolean
-default_impl_widget_is_empty (EContactEditorDynTable *dyntable,
- GtkWidget *w)
-{
- GtkEntry *e;
- const gchar *data;
- gchar * dup;
- size_t len = -1;
-
- e = GTK_ENTRY(w);
- if (0 == gtk_entry_get_text_length (e))
- return TRUE;
-
- data = gtk_entry_get_text (e);
-
- dup = g_strdup (data);
- g_strchug (dup);
- len = strlen (dup);
- g_free (dup);
-
- return len <= 0;
-}
-
-static void
-e_contact_editor_dyntable_init (EContactEditorDynTable *dyntable)
-{
- GtkGrid *grid;
-
- dyntable->priv = G_TYPE_INSTANCE_GET_PRIVATE(dyntable,
- E_TYPE_CONTACT_EDITOR_DYNTABLE,
- EContactEditorDynTablePrivate);
-
- /* fill in defaults */
- dyntable->priv->max_entries = MAX_CAPACITY;
- dyntable->priv->curr_entries = 0;
- dyntable->priv->show_min_entries = 0;
- dyntable->priv->show_max_entries = dyntable->priv->max_entries;
- dyntable->priv->columns = 2;
- dyntable->priv->justified = FALSE;
- dyntable->priv->combo_defaults = NULL;
-
- dyntable->priv->combo_store = gtk_list_store_new (DYNTABLE_COBMO_COLUMN_NUM_COLUMNS,
- G_TYPE_STRING, G_TYPE_BOOLEAN);
- dyntable->priv->data_store = gtk_list_store_new (DYNTABLE_STORE_COLUMN_NUM_COLUMNS,
- G_TYPE_UINT, G_TYPE_INT, G_TYPE_STRING);
- gtk_tree_sortable_set_sort_column_id (
- GTK_TREE_SORTABLE (dyntable->priv->data_store),
- DYNTABLE_STORE_COLUMN_SORTORDER,
- GTK_SORT_ASCENDING);
-
- dyntable->priv->add_button = gtk_button_new_with_label ("+");
- g_signal_connect_swapped (dyntable->priv->add_button, "clicked",
- G_CALLBACK (add_empty_entry), dyntable);
- g_signal_connect_swapped(dyntable->priv->add_button, "clicked",
- G_CALLBACK (emit_row_added), dyntable);
-
- grid = GTK_GRID (dyntable);
-
- gtk_grid_attach (grid, dyntable->priv->add_button, 0, 0, 1, 1);
- gtk_widget_set_valign (dyntable->priv->add_button, GTK_ALIGN_CENTER);
- gtk_widget_set_halign (dyntable->priv->add_button, GTK_ALIGN_START);
- gtk_widget_show (dyntable->priv->add_button);
-
- if (dyntable->priv->curr_entries < dyntable->priv->show_min_entries)
- add_empty_entry (dyntable);
-}
-
-static void
-e_contact_editor_dyntable_class_init (EContactEditorDynTableClass *class)
-{
- GObjectClass *object_class;
-
- g_type_class_add_private (class, sizeof(EContactEditorDynTablePrivate));
-
- dyntable_signals[CHANGED_SIGNAL] = g_signal_new ("changed",
- G_TYPE_FROM_CLASS(class), G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET(EContactEditorDynTableClass, changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
- dyntable_signals[ACTIVATE_SIGNAL] = g_signal_new ("activate",
- G_TYPE_FROM_CLASS(class), G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET(EContactEditorDynTableClass, activate),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
- dyntable_signals[ROW_ADDED_SIGNAL] = g_signal_new ("row-added",
- G_TYPE_FROM_CLASS(class), G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET(EContactEditorDynTableClass, row_added),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- object_class = G_OBJECT_CLASS (class);
- object_class->dispose = dispose_impl;
-
- /* virtual functions */
- class->widget_create = default_impl_widget_create;
- class->widget_is_empty = default_impl_widget_is_empty;
- class->widget_clear = default_impl_widget_clear;
- class->widget_extract = default_impl_widget_extract;
- class->widget_fill = default_impl_widget_fill;
-}
diff -Nru evolution-3.16.0/addressbook/gui/contact-editor/e-contact-editor-dyntable.h evolution-3.12.11/addressbook/gui/contact-editor/e-contact-editor-dyntable.h
--- evolution-3.16.0/addressbook/gui/contact-editor/e-contact-editor-dyntable.h 2014-04-29 11:48:18.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/contact-editor/e-contact-editor-dyntable.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,126 +0,0 @@
-/*
- * e-contact-editor-dyntable.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.
- *
- * 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 Lesser General Public License
- * along with this program; if not, see .
- *
- */
-
-#ifndef E_CONTACT_EDITOR_DYNTABLE_H_
-#define E_CONTACT_EDITOR_DYNTABLE_H_
-
-#include
-#include
-
-#define E_TYPE_CONTACT_EDITOR_DYNTABLE \
- (e_contact_editor_dyntable_get_type ())
-#define E_CONTACT_EDITOR_DYNTABLE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST \
- ((obj), E_TYPE_CONTACT_EDITOR_DYNTABLE, EContactEditorDynTable))
-#define E_CONTACT_EDITOR_DYNTABLE_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST \
- ((klass), E_TYPE_CONTACT_EDITOR_DYNTABLE, EContactEditorDynTableClass))
-#define E_IS_CONTACT_EDITOR_DYNTABLE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE \
- ((obj), E_TYPE_CONTACT_EDITOR_DYNTABLE))
-#define E_IS_CONTACT_EDITOR_DYNTABLE_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE \
- ((obj), E_TYPE_CONTACT_EDITOR_DYNTABLE))
-#define E_CONTACT_EDITOR_DYNTABLE_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS \
- (obj,E_TYPE_CONTACT_EDITOR_DYNTABLE, EContactEditorDynTableClass))
-
-G_BEGIN_DECLS
-
-typedef enum {
- DYNTABLE_STORE_COLUMN_SORTORDER,
- DYNTABLE_STORE_COLUMN_SELECTED_ITEM,
- DYNTABLE_STORE_COLUMN_ENTRY_STRING,
- DYNTABLE_STORE_COLUMN_NUM_COLUMNS
-} EContactEditorDynTableStoreColumns;
-
-typedef enum {
- DYNTABLE_COMBO_COLUMN_TEXT,
- DYNTABLE_COMBO_COLUMN_SENSITIVE,
- DYNTABLE_COBMO_COLUMN_NUM_COLUMNS
-} EContactEditorDynTableComboColumns;
-
-typedef struct _EContactEditorDynTable EContactEditorDynTable;
-typedef struct _EContactEditorDynTableClass EContactEditorDynTableClass;
-typedef struct _EContactEditorDynTablePrivate EContactEditorDynTablePrivate;
-
-struct _EContactEditorDynTableClass {
- GtkGridClass parent_class;
-
- /* Signals */
- void (*changed) (EContactEditorDynTable* dyntable);
- void (*activate) (EContactEditorDynTable* dyntable);
- void (*row_added) (EContactEditorDynTable* dyntable);
-
- /* virtual */
-
- /* defaults to GtkEntiy */
- GtkWidget* (*widget_create) (EContactEditorDynTable *dyntable);
-
- /* defaults to string_is_empty(txt) */
- gboolean (*widget_is_empty) (EContactEditorDynTable *dyntable,
- GtkWidget *w);
-
- /* defaults to entry_set_text("") */
- void (*widget_clear) (EContactEditorDynTable *dyntable,
- GtkWidget *w);
-
- /* default impl gtk_entry_set_text
- * other widgets may need to "parse" value before usage.
- */
- void (*widget_fill) (EContactEditorDynTable *dyntable,
- GtkWidget *w,
- const gchar *value);
-
- /* default impl returns gtk_entry_get_text
- * other widget may require some kind of "encoding"
- */
- const gchar* (*widget_extract) (EContactEditorDynTable *dyntable,
- GtkWidget *w);
-
-};
-
-struct _EContactEditorDynTable {
- GtkGrid parent;
-
- EContactEditorDynTablePrivate* priv;
-};
-
-GtkWidget* e_contact_editor_dyntable_new (void);
-GType e_contact_editor_dyntable_get_type (void) G_GNUC_CONST;
-void e_contact_editor_dyntable_set_show_min (EContactEditorDynTable *dyntable,
- guint number_of_entries);
-void e_contact_editor_dyntable_set_show_max (EContactEditorDynTable *dyntable,
- guint number_of_entries);
-void e_contact_editor_dyntable_set_num_columns (EContactEditorDynTable *dyntable,
- guint number_of_columns,
- gboolean justified);
-void e_contact_editor_dyntable_set_max_entries (EContactEditorDynTable *dyntable,
- guint max);
-
-GtkListStore* e_contact_editor_dyntable_get_combo_store (EContactEditorDynTable* dyntable);
-void e_contact_editor_dyntable_set_combo_defaults (EContactEditorDynTable* dyntable,
- const gint *defaults,
- size_t defaults_n);
-void e_contact_editor_dyntable_clear_data (EContactEditorDynTable *dyntable);
-void e_contact_editor_dyntable_fill_in_data (EContactEditorDynTable *dyntable);
-GtkListStore* e_contact_editor_dyntable_extract_data (EContactEditorDynTable *dyntable);
-
-G_END_DECLS
-
-#endif /* E_CONTACT_EDITOR_DYNTABLE_H_ */
diff -Nru evolution-3.16.0/addressbook/gui/contact-editor/e-contact-editor-fullname.c evolution-3.12.11/addressbook/gui/contact-editor/e-contact-editor-fullname.c
--- evolution-3.16.0/addressbook/gui/contact-editor/e-contact-editor-fullname.c 2015-03-09 14:21:55.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/contact-editor/e-contact-editor-fullname.c 2014-03-24 09:25:23.000000000 +0000
@@ -214,6 +214,7 @@
action_area = gtk_dialog_get_action_area (dialog);
content_area = gtk_dialog_get_content_area (dialog);
+ gtk_widget_realize (GTK_WIDGET (e_contact_editor_fullname));
gtk_container_set_border_width (GTK_CONTAINER (action_area), 12);
gtk_container_set_border_width (GTK_CONTAINER (content_area), 0);
diff -Nru evolution-3.16.0/addressbook/gui/contact-editor/e-contact-quick-add.c evolution-3.12.11/addressbook/gui/contact-editor/e-contact-quick-add.c
--- evolution-3.16.0/addressbook/gui/contact-editor/e-contact-quick-add.c 2015-02-02 12:58:06.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/contact-editor/e-contact-quick-add.c 2014-07-10 09:13:26.000000000 +0000
@@ -190,7 +190,7 @@
e_client_cache_get_client (
qa->client_cache, qa->source,
- E_SOURCE_EXTENSION_ADDRESS_BOOK, 30,
+ E_SOURCE_EXTENSION_ADDRESS_BOOK,
qa->cancellable, merge_cb, qa);
}
@@ -337,7 +337,7 @@
e_client_cache_get_client (
qa->client_cache, qa->source,
- E_SOURCE_EXTENSION_ADDRESS_BOOK, 30,
+ E_SOURCE_EXTENSION_ADDRESS_BOOK,
qa->cancellable, ce_have_book, qa);
}
diff -Nru evolution-3.16.0/addressbook/gui/contact-editor/fullname.ui evolution-3.12.11/addressbook/gui/contact-editor/fullname.ui
--- evolution-3.16.0/addressbook/gui/contact-editor/fullname.ui 2015-03-09 14:21:55.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/contact-editor/fullname.ui 2014-03-24 09:25:23.000000000 +0000
@@ -9,7 +9,7 @@
-
+
Mr.
@@ -35,7 +35,7 @@
-
+
Sr.
diff -Nru evolution-3.16.0/addressbook/gui/contact-editor/Makefile.am evolution-3.12.11/addressbook/gui/contact-editor/Makefile.am
--- evolution-3.16.0/addressbook/gui/contact-editor/Makefile.am 2014-06-09 14:39:38.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/contact-editor/Makefile.am 2014-03-24 09:25:23.000000000 +0000
@@ -11,8 +11,7 @@
-DG_LOG_DOMAIN=\"contact-editor\" \
$(EVOLUTION_DATA_SERVER_CFLAGS) \
$(GNOME_PLATFORM_CFLAGS) \
- $(CODE_COVERAGE_CFLAGS) \
- $(NULL)
+ $(GTKHTML_CFLAGS)
libecontacteditor_la_SOURCES = \
eab-editor.c \
@@ -22,11 +21,9 @@
e-contact-editor.c \
e-contact-editor.h \
e-contact-quick-add.c \
- e-contact-quick-add.h \
- e-contact-editor-dyntable.h \
- e-contact-editor-dyntable.c
+ e-contact-quick-add.h
-libecontacteditor_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) $(CODE_COVERAGE_LDFLAGS)
+libecontacteditor_la_LDFLAGS = -avoid-version $(NO_UNDEFINED)
libecontacteditor_la_LIBADD = \
$(top_builddir)/e-util/libevolution-util.la \
@@ -36,7 +33,7 @@
$(EVOLUTION_ADDRESSBOOK_LIBS) \
$(EVOLUTION_DATA_SERVER_LIBS) \
$(GNOME_PLATFORM_LIBS) \
- $(NULL)
+ $(GTKHTML_LIBS)
ui_DATA = \
contact-editor.ui \
diff -Nru evolution-3.16.0/addressbook/gui/contact-editor/Makefile.in evolution-3.12.11/addressbook/gui/contact-editor/Makefile.in
--- evolution-3.16.0/addressbook/gui/contact-editor/Makefile.in 2015-03-23 06:59:16.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/contact-editor/Makefile.in 2015-02-09 08:21:53.000000000 +0000
@@ -85,7 +85,6 @@
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
$(top_srcdir)/m4/as-compiler-flag.m4 \
- $(top_srcdir)/m4/behave-installed-tests.m4 \
$(top_srcdir)/m4/evo_check_langinfo.m4 \
$(top_srcdir)/m4/evo_ldap_check.m4 \
$(top_srcdir)/m4/evo_purify_support.m4 \
@@ -135,12 +134,12 @@
$(top_builddir)/addressbook/util/libeabutil.la \
$(top_builddir)/addressbook/gui/widgets/libeabwidgets.la \
$(top_builddir)/addressbook/printing/libecontactprint.la \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
am_libecontacteditor_la_OBJECTS = libecontacteditor_la-eab-editor.lo \
libecontacteditor_la-e-contact-editor-fullname.lo \
libecontacteditor_la-e-contact-editor.lo \
- libecontacteditor_la-e-contact-quick-add.lo \
- libecontacteditor_la-e-contact-editor-dyntable.lo
+ libecontacteditor_la-e-contact-quick-add.lo
libecontacteditor_la_OBJECTS = $(am_libecontacteditor_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -221,14 +220,11 @@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
-AUTOAR_CFLAGS = @AUTOAR_CFLAGS@
-AUTOAR_LIBS = @AUTOAR_LIBS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_VERSION = @BASE_VERSION@
-BEHAVE_INSTALLED_TESTS_ENABLED = @BEHAVE_INSTALLED_TESTS_ENABLED@
BOGOFILTER = @BOGOFILTER@
CANBERRA_CFLAGS = @CANBERRA_CFLAGS@
CANBERRA_LIBS = @CANBERRA_LIBS@
@@ -241,9 +237,6 @@
CHAMPLAIN_LIBS = @CHAMPLAIN_LIBS@
CLUTTER_GTK_CFLAGS = @CLUTTER_GTK_CFLAGS@
CLUTTER_GTK_LIBS = @CLUTTER_GTK_LIBS@
-CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@
-CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
-CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -257,8 +250,6 @@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
-ENCHANT_CFLAGS = @ENCHANT_CFLAGS@
-ENCHANT_LIBS = @ENCHANT_LIBS@
EVOLUTION_DATA_SERVER_CFLAGS = @EVOLUTION_DATA_SERVER_CFLAGS@
EVOLUTION_DATA_SERVER_LIBS = @EVOLUTION_DATA_SERVER_LIBS@
EVOLUTION_DIR = @EVOLUTION_DIR@
@@ -269,7 +260,6 @@
FGREP = @FGREP@
GDATA_CFLAGS = @GDATA_CFLAGS@
GDATA_LIBS = @GDATA_LIBS@
-GENHTML = @GENHTML@
GEO_CFLAGS = @GEO_CFLAGS@
GEO_LIBS = @GEO_LIBS@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
@@ -296,6 +286,10 @@
GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
GTKDOC_MKPDF = @GTKDOC_MKPDF@
GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKHTML_CFLAGS = @GTKHTML_CFLAGS@
+GTKHTML_LIBS = @GTKHTML_LIBS@
+GTKIMAGEVIEW_CFLAGS = @GTKIMAGEVIEW_CFLAGS@
+GTKIMAGEVIEW_LIBS = @GTKIMAGEVIEW_LIBS@
GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@
GTKSPELL_LIBS = @GTKSPELL_LIBS@
GWEATHER_CFLAGS = @GWEATHER_CFLAGS@
@@ -319,13 +313,10 @@
INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@
ITSTOOL = @ITSTOOL@
KILL_PROCESS_CMD = @KILL_PROCESS_CMD@
-LCOV = @LCOV@
LD = @LD@
LDAP_CFLAGS = @LDAP_CFLAGS@
LDAP_LIBS = @LDAP_LIBS@
LDFLAGS = @LDFLAGS@
-LIBCRYPTUI_CFLAGS = @LIBCRYPTUI_CFLAGS@
-LIBCRYPTUI_LIBS = @LIBCRYPTUI_LIBS@
LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
LIBOBJS = @LIBOBJS@
@@ -473,8 +464,7 @@
-DG_LOG_DOMAIN=\"contact-editor\" \
$(EVOLUTION_DATA_SERVER_CFLAGS) \
$(GNOME_PLATFORM_CFLAGS) \
- $(CODE_COVERAGE_CFLAGS) \
- $(NULL)
+ $(GTKHTML_CFLAGS)
libecontacteditor_la_SOURCES = \
eab-editor.c \
@@ -484,11 +474,9 @@
e-contact-editor.c \
e-contact-editor.h \
e-contact-quick-add.c \
- e-contact-quick-add.h \
- e-contact-editor-dyntable.h \
- e-contact-editor-dyntable.c
+ e-contact-quick-add.h
-libecontacteditor_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) $(CODE_COVERAGE_LDFLAGS)
+libecontacteditor_la_LDFLAGS = -avoid-version $(NO_UNDEFINED)
libecontacteditor_la_LIBADD = \
$(top_builddir)/e-util/libevolution-util.la \
$(top_builddir)/addressbook/util/libeabutil.la \
@@ -497,7 +485,7 @@
$(EVOLUTION_ADDRESSBOOK_LIBS) \
$(EVOLUTION_DATA_SERVER_LIBS) \
$(GNOME_PLATFORM_LIBS) \
- $(NULL)
+ $(GTKHTML_LIBS)
ui_DATA = \
contact-editor.ui \
@@ -583,32 +571,28 @@
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecontacteditor_la-e-contact-editor-dyntable.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecontacteditor_la-e-contact-editor-fullname.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecontacteditor_la-e-contact-editor.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecontacteditor_la-e-contact-quick-add.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecontacteditor_la-eab-editor.Plo@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
-@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
-@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
@@ -641,13 +625,6 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libecontacteditor_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libecontacteditor_la-e-contact-quick-add.lo `test -f 'e-contact-quick-add.c' || echo '$(srcdir)/'`e-contact-quick-add.c
-libecontacteditor_la-e-contact-editor-dyntable.lo: e-contact-editor-dyntable.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libecontacteditor_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libecontacteditor_la-e-contact-editor-dyntable.lo -MD -MP -MF $(DEPDIR)/libecontacteditor_la-e-contact-editor-dyntable.Tpo -c -o libecontacteditor_la-e-contact-editor-dyntable.lo `test -f 'e-contact-editor-dyntable.c' || echo '$(srcdir)/'`e-contact-editor-dyntable.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libecontacteditor_la-e-contact-editor-dyntable.Tpo $(DEPDIR)/libecontacteditor_la-e-contact-editor-dyntable.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='e-contact-editor-dyntable.c' object='libecontacteditor_la-e-contact-editor-dyntable.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libecontacteditor_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libecontacteditor_la-e-contact-editor-dyntable.lo `test -f 'e-contact-editor-dyntable.c' || echo '$(srcdir)/'`e-contact-editor-dyntable.c
-
mostlyclean-libtool:
-rm -f *.lo
diff -Nru evolution-3.16.0/addressbook/gui/contact-list-editor/Makefile.am evolution-3.12.11/addressbook/gui/contact-list-editor/Makefile.am
--- evolution-3.16.0/addressbook/gui/contact-list-editor/Makefile.am 2014-06-09 14:39:38.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/contact-list-editor/Makefile.am 2014-03-24 09:25:23.000000000 +0000
@@ -11,8 +11,7 @@
-DG_LOG_DOMAIN=\"contact-list-editor\" \
$(EVOLUTION_DATA_SERVER_CFLAGS) \
$(GNOME_PLATFORM_CFLAGS) \
- $(CODE_COVERAGE_CFLAGS) \
- $(NULL)
+ $(GTKHTML_CFLAGS)
libecontactlisteditor_la_SOURCES = \
e-contact-list-editor.c \
@@ -20,7 +19,7 @@
e-contact-list-model.c \
e-contact-list-model.h
-libecontactlisteditor_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) $(CODE_COVERAGE_LDFLAGS)
+libecontactlisteditor_la_LDFLAGS = -avoid-version $(NO_UNDEFINED)
libecontactlisteditor_la_LIBADD = \
$(top_builddir)/addressbook/util/libeabutil.la \
@@ -29,7 +28,7 @@
$(top_builddir)/shell/libevolution-shell.la \
$(EVOLUTION_DATA_SERVER_LIBS) \
$(GNOME_PLATFORM_LIBS) \
- $(NULL)
+ $(GTKHTML_LIBS)
ui_DATA = contact-list-editor.ui
diff -Nru evolution-3.16.0/addressbook/gui/contact-list-editor/Makefile.in evolution-3.12.11/addressbook/gui/contact-list-editor/Makefile.in
--- evolution-3.16.0/addressbook/gui/contact-list-editor/Makefile.in 2015-03-23 06:59:16.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/contact-list-editor/Makefile.in 2015-02-09 08:21:53.000000000 +0000
@@ -85,7 +85,6 @@
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
$(top_srcdir)/m4/as-compiler-flag.m4 \
- $(top_srcdir)/m4/behave-installed-tests.m4 \
$(top_srcdir)/m4/evo_check_langinfo.m4 \
$(top_srcdir)/m4/evo_ldap_check.m4 \
$(top_srcdir)/m4/evo_purify_support.m4 \
@@ -135,7 +134,8 @@
$(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \
$(top_builddir)/e-util/libevolution-util.la \
$(top_builddir)/shell/libevolution-shell.la \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
am_libecontactlisteditor_la_OBJECTS = \
libecontactlisteditor_la-e-contact-list-editor.lo \
libecontactlisteditor_la-e-contact-list-model.lo
@@ -220,14 +220,11 @@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
-AUTOAR_CFLAGS = @AUTOAR_CFLAGS@
-AUTOAR_LIBS = @AUTOAR_LIBS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_VERSION = @BASE_VERSION@
-BEHAVE_INSTALLED_TESTS_ENABLED = @BEHAVE_INSTALLED_TESTS_ENABLED@
BOGOFILTER = @BOGOFILTER@
CANBERRA_CFLAGS = @CANBERRA_CFLAGS@
CANBERRA_LIBS = @CANBERRA_LIBS@
@@ -240,9 +237,6 @@
CHAMPLAIN_LIBS = @CHAMPLAIN_LIBS@
CLUTTER_GTK_CFLAGS = @CLUTTER_GTK_CFLAGS@
CLUTTER_GTK_LIBS = @CLUTTER_GTK_LIBS@
-CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@
-CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
-CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -256,8 +250,6 @@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
-ENCHANT_CFLAGS = @ENCHANT_CFLAGS@
-ENCHANT_LIBS = @ENCHANT_LIBS@
EVOLUTION_DATA_SERVER_CFLAGS = @EVOLUTION_DATA_SERVER_CFLAGS@
EVOLUTION_DATA_SERVER_LIBS = @EVOLUTION_DATA_SERVER_LIBS@
EVOLUTION_DIR = @EVOLUTION_DIR@
@@ -268,7 +260,6 @@
FGREP = @FGREP@
GDATA_CFLAGS = @GDATA_CFLAGS@
GDATA_LIBS = @GDATA_LIBS@
-GENHTML = @GENHTML@
GEO_CFLAGS = @GEO_CFLAGS@
GEO_LIBS = @GEO_LIBS@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
@@ -295,6 +286,10 @@
GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
GTKDOC_MKPDF = @GTKDOC_MKPDF@
GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKHTML_CFLAGS = @GTKHTML_CFLAGS@
+GTKHTML_LIBS = @GTKHTML_LIBS@
+GTKIMAGEVIEW_CFLAGS = @GTKIMAGEVIEW_CFLAGS@
+GTKIMAGEVIEW_LIBS = @GTKIMAGEVIEW_LIBS@
GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@
GTKSPELL_LIBS = @GTKSPELL_LIBS@
GWEATHER_CFLAGS = @GWEATHER_CFLAGS@
@@ -318,13 +313,10 @@
INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@
ITSTOOL = @ITSTOOL@
KILL_PROCESS_CMD = @KILL_PROCESS_CMD@
-LCOV = @LCOV@
LD = @LD@
LDAP_CFLAGS = @LDAP_CFLAGS@
LDAP_LIBS = @LDAP_LIBS@
LDFLAGS = @LDFLAGS@
-LIBCRYPTUI_CFLAGS = @LIBCRYPTUI_CFLAGS@
-LIBCRYPTUI_LIBS = @LIBCRYPTUI_LIBS@
LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
LIBOBJS = @LIBOBJS@
@@ -472,8 +464,7 @@
-DG_LOG_DOMAIN=\"contact-list-editor\" \
$(EVOLUTION_DATA_SERVER_CFLAGS) \
$(GNOME_PLATFORM_CFLAGS) \
- $(CODE_COVERAGE_CFLAGS) \
- $(NULL)
+ $(GTKHTML_CFLAGS)
libecontactlisteditor_la_SOURCES = \
e-contact-list-editor.c \
@@ -481,7 +472,7 @@
e-contact-list-model.c \
e-contact-list-model.h
-libecontactlisteditor_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) $(CODE_COVERAGE_LDFLAGS)
+libecontactlisteditor_la_LDFLAGS = -avoid-version $(NO_UNDEFINED)
libecontactlisteditor_la_LIBADD = \
$(top_builddir)/addressbook/util/libeabutil.la \
$(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \
@@ -489,7 +480,7 @@
$(top_builddir)/shell/libevolution-shell.la \
$(EVOLUTION_DATA_SERVER_LIBS) \
$(GNOME_PLATFORM_LIBS) \
- $(NULL)
+ $(GTKHTML_LIBS)
ui_DATA = contact-list-editor.ui
EXTRA_DIST = $(ui_DATA)
@@ -576,25 +567,22 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecontactlisteditor_la-e-contact-list-model.Plo@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
-@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
-@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
diff -Nru evolution-3.16.0/addressbook/gui/Makefile.in evolution-3.12.11/addressbook/gui/Makefile.in
--- evolution-3.16.0/addressbook/gui/Makefile.in 2015-03-23 06:59:16.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/Makefile.in 2015-02-09 08:21:53.000000000 +0000
@@ -82,7 +82,6 @@
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
$(top_srcdir)/m4/as-compiler-flag.m4 \
- $(top_srcdir)/m4/behave-installed-tests.m4 \
$(top_srcdir)/m4/evo_check_langinfo.m4 \
$(top_srcdir)/m4/evo_ldap_check.m4 \
$(top_srcdir)/m4/evo_purify_support.m4 \
@@ -187,14 +186,11 @@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
-AUTOAR_CFLAGS = @AUTOAR_CFLAGS@
-AUTOAR_LIBS = @AUTOAR_LIBS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_VERSION = @BASE_VERSION@
-BEHAVE_INSTALLED_TESTS_ENABLED = @BEHAVE_INSTALLED_TESTS_ENABLED@
BOGOFILTER = @BOGOFILTER@
CANBERRA_CFLAGS = @CANBERRA_CFLAGS@
CANBERRA_LIBS = @CANBERRA_LIBS@
@@ -207,9 +203,6 @@
CHAMPLAIN_LIBS = @CHAMPLAIN_LIBS@
CLUTTER_GTK_CFLAGS = @CLUTTER_GTK_CFLAGS@
CLUTTER_GTK_LIBS = @CLUTTER_GTK_LIBS@
-CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@
-CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
-CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -223,8 +216,6 @@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
-ENCHANT_CFLAGS = @ENCHANT_CFLAGS@
-ENCHANT_LIBS = @ENCHANT_LIBS@
EVOLUTION_DATA_SERVER_CFLAGS = @EVOLUTION_DATA_SERVER_CFLAGS@
EVOLUTION_DATA_SERVER_LIBS = @EVOLUTION_DATA_SERVER_LIBS@
EVOLUTION_DIR = @EVOLUTION_DIR@
@@ -235,7 +226,6 @@
FGREP = @FGREP@
GDATA_CFLAGS = @GDATA_CFLAGS@
GDATA_LIBS = @GDATA_LIBS@
-GENHTML = @GENHTML@
GEO_CFLAGS = @GEO_CFLAGS@
GEO_LIBS = @GEO_LIBS@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
@@ -262,6 +252,10 @@
GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
GTKDOC_MKPDF = @GTKDOC_MKPDF@
GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKHTML_CFLAGS = @GTKHTML_CFLAGS@
+GTKHTML_LIBS = @GTKHTML_LIBS@
+GTKIMAGEVIEW_CFLAGS = @GTKIMAGEVIEW_CFLAGS@
+GTKIMAGEVIEW_LIBS = @GTKIMAGEVIEW_LIBS@
GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@
GTKSPELL_LIBS = @GTKSPELL_LIBS@
GWEATHER_CFLAGS = @GWEATHER_CFLAGS@
@@ -285,13 +279,10 @@
INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@
ITSTOOL = @ITSTOOL@
KILL_PROCESS_CMD = @KILL_PROCESS_CMD@
-LCOV = @LCOV@
LD = @LD@
LDAP_CFLAGS = @LDAP_CFLAGS@
LDAP_LIBS = @LDAP_LIBS@
LDFLAGS = @LDFLAGS@
-LIBCRYPTUI_CFLAGS = @LIBCRYPTUI_CFLAGS@
-LIBCRYPTUI_LIBS = @LIBCRYPTUI_LIBS@
LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
LIBOBJS = @LIBOBJS@
diff -Nru evolution-3.16.0/addressbook/gui/widgets/ea-addressbook.c evolution-3.12.11/addressbook/gui/widgets/ea-addressbook.c
--- evolution-3.16.0/addressbook/gui/widgets/ea-addressbook.c 2015-01-05 13:56:08.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/widgets/ea-addressbook.c 2014-03-24 09:25:23.000000000 +0000
@@ -79,10 +79,9 @@
GnomeCanvasItem *item = GNOME_CANVAS_ITEM (object);
ea_event = atk_gobject_accessible_for_object (object);
if (event->type == GDK_FOCUS_CHANGE) {
- if (E_IS_MINICARD (item->canvas->focused_item))
- atk_object_notify_state_change (ea_event,
- ATK_STATE_FOCUSED,
- event->focus_change.in);
+ if ((event->focus_change.in) &&
+ (E_IS_MINICARD (item->canvas->focused_item)))
+ atk_focus_tracker_notify (ea_event);
}
}
diff -Nru evolution-3.16.0/addressbook/gui/widgets/eab-contact-compare.c evolution-3.12.11/addressbook/gui/widgets/eab-contact-compare.c
--- evolution-3.16.0/addressbook/gui/widgets/eab-contact-compare.c 2015-02-02 12:58:06.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/widgets/eab-contact-compare.c 2014-03-24 09:25:23.000000000 +0000
@@ -831,7 +831,7 @@
source = e_source_registry_ref_default_address_book (registry);
- e_book_client_connect (source, 30, NULL, book_client_connect_cb, info);
+ e_book_client_connect (source, NULL, book_client_connect_cb, info);
g_object_unref (source);
}
diff -Nru evolution-3.16.0/addressbook/gui/widgets/eab-contact-formatter.c evolution-3.12.11/addressbook/gui/widgets/eab-contact-formatter.c
--- evolution-3.16.0/addressbook/gui/widgets/eab-contact-formatter.c 2015-02-27 11:40:10.000000000 +0000
+++ evolution-3.12.11/addressbook/gui/widgets/eab-contact-formatter.c 2014-07-17 10:47:57.000000000 +0000
@@ -64,8 +64,6 @@
struct _EABContactFormatterPrivate {
EABContactDisplayMode mode;
gboolean render_maps;
- gboolean supports_tel;
- gboolean supports_sip;
};
enum {
@@ -88,9 +86,6 @@
eab_contact_formatter,
G_TYPE_OBJECT);
-#define E_CREATE_TEL_URL (E_TEXT_TO_HTML_LAST_FLAG << 0)
-#define E_CREATE_SIP_URL (E_TEXT_TO_HTML_LAST_FLAG << 1)
-
static gboolean
icon_available (const gchar *icon)
{
@@ -290,36 +285,6 @@
g_free (value);
}
-/* Returns NULL if no replace had been done (and
- original 'str' should be used instead). Otherwise
- free the returned pointer with g_free().
-*/
-static gchar *
-maybe_create_url (const gchar *str,
- guint html_flags)
-{
- gchar *tmp = NULL;
- const gchar *url = NULL;
-
- g_return_val_if_fail (str != NULL, NULL);
-
- if ((html_flags & E_CREATE_TEL_URL) != 0) {
- /* RFC 3966 requires either the phone number begins with '+',
- or the URL contains a 'phone-context' parameter, but that
- also requires changing phone number for some countries, thus
- rather mandate the '+' at the beginning. */
- if (*str == '+')
- url = "tel:";
- } else if ((html_flags & E_CREATE_SIP_URL) != 0) {
- url = "sip:";
- }
-
- if (url && g_ascii_strncasecmp (str, url, strlen (url)) != 0)
- tmp = g_strconcat (url, str, NULL);
-
- return tmp;
-}
-
static void
accum_attribute (GString *buffer,
EContact *contact,
@@ -332,17 +297,8 @@
str = e_contact_get_const (contact, field);
- if (str != NULL && *str != '\0') {
- gchar *tmp = NULL;
-
- tmp = maybe_create_url (str, html_flags);
- if (tmp)
- str = tmp;
-
+ if (str != NULL && *str != '\0')
render_table_row (buffer, html_label, str, icon, html_flags);
-
- g_free (tmp);
- }
}
static void
@@ -380,125 +336,24 @@
{
GList *val_list, *l;
GString *val = g_string_new ("");
- const gchar *str;
- gchar *tmp;
val_list = e_contact_get (contact, field);
for (l = val_list; l; l = l->next) {
- str = l->data;
-
if (l != val_list)
g_string_append (val, "
");
- tmp = maybe_create_url (str, html_flags);
- if (tmp)
- str = tmp;
-
- if ((html_flags & E_TEXT_TO_HTML_CONVERT_URLS) != 0) {
- gchar *value = e_text_to_html (str, html_flags);
-
- if (value && *value)
- g_string_append (val, value);
-
- g_free (value);
- } else {
- g_string_append (val, str);
- }
-
- g_free (tmp);
+ g_string_append (val, l->data);
}
- if (val->str && *val->str) {
- if ((html_flags & E_TEXT_TO_HTML_CONVERT_URLS) != 0)
- html_flags = 0;
-
+ if (val->str && *val->str)
render_table_row (buffer, html_label, val->str, icon, html_flags);
- }
g_string_free (val, TRUE);
g_list_foreach (val_list, (GFunc) g_free, NULL);
g_list_free (val_list);
}
-typedef enum {
- EAB_CONTACT_FORMATTER_SIP_TYPE_HOME,
- EAB_CONTACT_FORMATTER_SIP_TYPE_WORK,
- EAB_CONTACT_FORMATTER_SIP_TYPE_OTHER
-} EABContactFormatterSIPType;
-
-static void
-accum_sip (GString *buffer,
- EContact *contact,
- EABContactFormatterSIPType use_sip_type,
- const gchar *icon,
- guint html_flags)
-{
- const gchar *html_label = _("SIP");
- GList *sip_attr_list, *l;
- GString *val = g_string_new ("");
- gchar *tmp;
-
- sip_attr_list = e_contact_get_attributes (contact, E_CONTACT_SIP);
- for (l = sip_attr_list; l; l = g_list_next (l)) {
- EVCardAttribute *attr = l->data;
- gchar *sip;
- const gchar *str;
- EABContactFormatterSIPType sip_type;
-
- if (e_vcard_attribute_has_type (attr, "HOME"))
- sip_type = EAB_CONTACT_FORMATTER_SIP_TYPE_HOME;
- else if (e_vcard_attribute_has_type (attr, "WORK"))
- sip_type = EAB_CONTACT_FORMATTER_SIP_TYPE_WORK;
- else
- sip_type = EAB_CONTACT_FORMATTER_SIP_TYPE_OTHER;
-
- if (sip_type != use_sip_type)
- continue;
-
- sip = e_vcard_attribute_get_value (attr);
- if (!sip || !*sip) {
- g_free (sip);
- continue;
- }
-
- tmp = maybe_create_url (sip, html_flags);
- if (tmp)
- str = tmp;
- else
- str = sip;
-
- if ((html_flags & E_TEXT_TO_HTML_CONVERT_URLS) != 0) {
- gchar *value = e_text_to_html (str, html_flags);
-
- if (value && *value) {
- if (val->len)
- g_string_append (val, "
");
- g_string_append (val, value);
- }
-
- g_free (value);
- } else {
- if (val->len)
- g_string_append (val, "
");
- g_string_append (val, str);
- }
-
- g_free (tmp);
- g_free (sip);
- }
-
- if (val->str && *val->str) {
- if ((html_flags & E_TEXT_TO_HTML_CONVERT_URLS) != 0)
- html_flags = 0;
-
- render_table_row (buffer, html_label, val->str, icon, html_flags);
- }
-
- g_string_free (val, TRUE);
- g_list_free_full (sip_attr_list, (GDestroyNotify) e_vcard_attribute_free);
-}
-
static const gchar *
get_email_location (EVCardAttribute *attr)
{
@@ -700,13 +555,6 @@
GList *email_list, *l, *email_attr_list, *al;
gint email_num = 0;
const gchar *nl;
- guint32 sip_flags = 0;
-
- if (formatter->priv->supports_sip)
- sip_flags = E_TEXT_TO_HTML_CONVERT_URLS |
- E_TEXT_TO_HTML_HIDE_URL_SCHEME |
- E_TEXT_TO_HTML_URL_IS_WHOLE_TEXT |
- E_CREATE_SIP_URL;
email = g_string_new ("");
nl = "";
@@ -748,8 +596,6 @@
if (email->len)
render_table_row (accum, _("Email"), email->str, NULL, 0);
- accum_sip (accum, contact, EAB_CONTACT_FORMATTER_SIP_TYPE_OTHER, NULL, sip_flags);
-
accum_attribute (accum, contact, _("Nickname"), E_CONTACT_NICKNAME, NULL, 0);
accum_attribute_multival (accum, contact, _("AIM"), E_CONTACT_IM_AIM, AIM_ICON, 0);
accum_attribute_multival (accum, contact, _("GroupWise"), E_CONTACT_IM_GROUPWISE, GROUPWISE_ICON, 0);
@@ -802,19 +648,6 @@
GString *buffer)
{
GString *accum = g_string_new ("");
- guint32 phone_flags = 0, sip_flags = 0;
-
- if (formatter->priv->supports_tel)
- phone_flags = E_TEXT_TO_HTML_CONVERT_URLS |
- E_TEXT_TO_HTML_HIDE_URL_SCHEME |
- E_TEXT_TO_HTML_URL_IS_WHOLE_TEXT |
- E_CREATE_TEL_URL;
-
- if (formatter->priv->supports_sip)
- sip_flags = E_TEXT_TO_HTML_CONVERT_URLS |
- E_TEXT_TO_HTML_HIDE_URL_SCHEME |
- E_TEXT_TO_HTML_URL_IS_WHOLE_TEXT |
- E_CREATE_SIP_URL;
accum_attribute (accum, contact, _("Company"), E_CONTACT_ORG, NULL, 0);
accum_attribute (accum, contact, _("Department"), E_CONTACT_ORG_UNIT, NULL, 0);
@@ -826,9 +659,8 @@
accum_attribute (accum, contact, _("Video Chat"), E_CONTACT_VIDEO_URL, VIDEOCONF_ICON, E_TEXT_TO_HTML_CONVERT_URLS);
accum_attribute (accum, contact, _("Calendar"), E_CONTACT_CALENDAR_URI, NULL, E_TEXT_TO_HTML_CONVERT_URLS);
accum_attribute (accum, contact, _("Free/Busy"), E_CONTACT_FREEBUSY_URL, NULL, E_TEXT_TO_HTML_CONVERT_URLS);
- accum_attribute (accum, contact, _("Phone"), E_CONTACT_PHONE_BUSINESS, NULL, phone_flags);
+ accum_attribute (accum, contact, _("Phone"), E_CONTACT_PHONE_BUSINESS, NULL, 0);
accum_attribute (accum, contact, _("Fax"), E_CONTACT_PHONE_BUSINESS_FAX, NULL, 0);
- accum_sip (accum, contact, EAB_CONTACT_FORMATTER_SIP_TYPE_WORK, NULL, sip_flags);
accum_address (accum, contact, _("Address"), E_CONTACT_ADDRESS_WORK, E_CONTACT_ADDRESS_LABEL_WORK);
if (formatter->priv->render_maps)
accum_address_map (accum, contact, E_CONTACT_ADDRESS_WORK);
@@ -851,25 +683,11 @@
GString *buffer)
{
GString *accum = g_string_new ("");
- guint32 phone_flags = 0, sip_flags = 0;
-
- if (formatter->priv->supports_tel)
- phone_flags = E_TEXT_TO_HTML_CONVERT_URLS |
- E_TEXT_TO_HTML_HIDE_URL_SCHEME |
- E_TEXT_TO_HTML_URL_IS_WHOLE_TEXT |
- E_CREATE_TEL_URL;
-
- if (formatter->priv->supports_sip)
- sip_flags = E_TEXT_TO_HTML_CONVERT_URLS |
- E_TEXT_TO_HTML_HIDE_URL_SCHEME |
- E_TEXT_TO_HTML_URL_IS_WHOLE_TEXT |
- E_CREATE_SIP_URL;
accum_attribute (accum, contact, _("Home Page"), E_CONTACT_HOMEPAGE_URL, NULL, E_TEXT_TO_HTML_CONVERT_URLS);
accum_attribute (accum, contact, _("Web Log"), E_CONTACT_BLOG_URL, NULL, E_TEXT_TO_HTML_CONVERT_URLS);
- accum_attribute (accum, contact, _("Phone"), E_CONTACT_PHONE_HOME, NULL, phone_flags);
- accum_attribute (accum, contact, _("Mobile Phone"), E_CONTACT_PHONE_MOBILE, NULL, phone_flags);
- accum_sip (accum, contact, EAB_CONTACT_FORMATTER_SIP_TYPE_HOME, NULL, sip_flags);
+ accum_attribute (accum, contact, _("Phone"), E_CONTACT_PHONE_HOME, NULL, 0);
+ accum_attribute (accum, contact, _("Mobile Phone"), E_CONTACT_PHONE_MOBILE, NULL, 0);
accum_address (accum, contact, _("Address"), E_CONTACT_ADDRESS_HOME, E_CONTACT_ADDRESS_LABEL_HOME);
accum_time_attribute (accum, contact, _("Birthday"), E_CONTACT_BIRTH_DATE, NULL, 0);
accum_time_attribute (accum, contact, _("Anniversary"), E_CONTACT_ANNIVERSARY, NULL, 0);
@@ -1205,21 +1023,6 @@
g_string_append (buffer, "