From ffb57199f660e2e039be65b1657519f77c38f32d Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Tue, 4 Jul 2017 00:58:41 +0200 Subject: [PATCH] Separate ContactEditor into several EditorElements. This allows us to have a modular Editor, while being able to remove the if/else-blocks spread throughout the code. TODO: fix saving current/new contacts. Summary of some changes: * Added all files wrt the editor into a separate folder. * Changed configure.ac so we can use subfolders. * Add new files to src/Makefile.am --- configure.ac | 2 +- data/ui/contacts-contact-editor.ui | 2 +- src/Makefile.am | 17 +- src/contacts-contact-editor.vala | 1039 ----------------- src/contacts-contact-pane.vala | 132 +-- .../contacts-editor-addresses-editor.vala | 119 ++ src/editor/contacts-editor-avatar-editor.vala | 87 ++ .../contacts-editor-birthday-editor.vala | 143 +++ .../contacts-editor-composite-editor.vala | 64 + .../contacts-editor-contact-editor.vala | 241 ++++ ...ontacts-editor-details-editor-factory.vala | 67 ++ .../contacts-editor-details-editor.vala | 126 ++ src/editor/contacts-editor-emails-editor.vala | 76 ++ .../contacts-editor-full-name-editor.vala | 52 + .../contacts-editor-nickname-editor.vala | 57 + src/editor/contacts-editor-notes-editor.vala | 78 ++ src/editor/contacts-editor-phones-editor.vala | 73 ++ src/editor/contacts-editor-urls-editor.vala | 71 ++ 18 files changed, 1307 insertions(+), 1139 deletions(-) delete mode 100644 src/contacts-contact-editor.vala create mode 100644 src/editor/contacts-editor-addresses-editor.vala create mode 100644 src/editor/contacts-editor-avatar-editor.vala create mode 100644 src/editor/contacts-editor-birthday-editor.vala create mode 100644 src/editor/contacts-editor-composite-editor.vala create mode 100644 src/editor/contacts-editor-contact-editor.vala create mode 100644 src/editor/contacts-editor-details-editor-factory.vala create mode 100644 src/editor/contacts-editor-details-editor.vala create mode 100644 src/editor/contacts-editor-emails-editor.vala create mode 100644 src/editor/contacts-editor-full-name-editor.vala create mode 100644 src/editor/contacts-editor-nickname-editor.vala create mode 100644 src/editor/contacts-editor-notes-editor.vala create mode 100644 src/editor/contacts-editor-phones-editor.vala create mode 100644 src/editor/contacts-editor-urls-editor.vala diff --git a/configure.ac b/configure.ac index 7b3fc9a..9c29ca6 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_INIT([gnome-contacts],[3.25.4],[http://bugzilla.gnome.org/enter_bug.cgi?produ AC_CONFIG_SRCDIR([src/main.vala]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([foreign tar-ustar dist-xz no-dist-gzip -Wno-portability]) +AM_INIT_AUTOMAKE([foreign tar-ustar dist-xz no-dist-gzip -Wno-portability subdir-objects]) # Enable silent rules is available AM_SILENT_RULES([yes]) diff --git a/data/ui/contacts-contact-editor.ui b/data/ui/contacts-contact-editor.ui index 06e37e8..0cd7b82 100644 --- a/data/ui/contacts-contact-editor.ui +++ b/data/ui/contacts-contact-editor.ui @@ -49,7 +49,7 @@ -