[gnome-contacts/wip/map-widget: 5/5] Add a map to the contacts sheet



commit 962457d2bd6348a5a3cba20455690ad7b60dd436
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Tue Dec 16 05:33:56 2014 -0500

    Add a map to the contacts sheet
    
    When pressing the map we will activate the 'show-contact' action
    on GNOME Maps.

 configure.ac                    |    3 ++-
 data/Makefile.am                |    1 +
 data/contacts.gresource.xml     |    1 +
 data/ui/style.css               |    5 +++++
 src/Makefile.am                 |    1 +
 src/contacts-contact-sheet.vala |    7 +++++++
 6 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7ad72f6..72c4f3b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,11 +50,12 @@ pkg_modules="gtk+-3.0 >= 3.12.0
             libedataserver-1.2 >= 3.5.3
             goa-1.0
             gee-0.8
+            champlain-gtk-0.12
             geocode-glib-1.0
             "
 PKG_CHECK_MODULES(CONTACTS, [$pkg_modules])
 
-CONTACTS_PACKAGES="--pkg gtk+-3.0 --pkg gio-2.0 --pkg gio-unix-2.0 --pkg folks --pkg folks-telepathy --pkg 
folks-eds --pkg libnotify --pkg geocode-glib-1.0"
+CONTACTS_PACKAGES="--pkg gtk+-3.0 --pkg gio-2.0 --pkg gio-unix-2.0 --pkg folks --pkg folks-telepathy --pkg 
folks-eds --pkg libnotify --pkg clutter-1.0 --pkg champlain-0.12 --pkg champlain-gtk-0.12 --pkg 
geocode-glib-1.0"
 AC_SUBST(CONTACTS_PACKAGES)
 
 # Optional dependency for the user accounts panel
diff --git a/data/Makefile.am b/data/Makefile.am
index 821828c..89fda4d 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -37,6 +37,7 @@ EXTRA_DIST = \
        org.gnome.Contacts.search-provider.ini.in.in \
        contacts.gresource.xml \
        ui/app-menu.ui \
+       ui/contacts-address-map.ui \
        ui/contacts-window.ui \
        ui/contacts-list-pane.ui \
        ui/style.css \
diff --git a/data/contacts.gresource.xml b/data/contacts.gresource.xml
index 2b1ba03..98bfee4 100644
--- a/data/contacts.gresource.xml
+++ b/data/contacts.gresource.xml
@@ -3,6 +3,7 @@
   <gresource prefix="/org/gnome/contacts">
     <file compressed="true">ui/style.css</file>
     <file compressed="true" preprocess="xml-stripblanks">ui/app-menu.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks">ui/contacts-address-map.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">ui/contacts-window.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">ui/contacts-list-pane.ui</file>
   </gresource>
diff --git a/data/ui/style.css b/data/ui/style.css
index 92647a7..8432977 100644
--- a/data/ui/style.css
+++ b/data/ui/style.css
@@ -10,6 +10,11 @@ ContactsListPane.frame:dir(rtl) {
   border-width: 0 0 0 1px;
 }
 
+.contacts-map {
+    background-color: @theme_bg_color;
+    color: gray;
+}
+
 /* contatcs view new color */
 .contacts-view {
   background-color: transparent;
diff --git a/src/Makefile.am b/src/Makefile.am
index a175980..87a4431 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,6 +25,7 @@ bin_PROGRAMS = gnome-contacts
 
 vala_sources = \
        contacts-app.vala \
+       contacts-address-map.vala \
        contacts-contact.vala \
        contacts-contact-sheet.vala \
        contacts-contact-editor.vala \
diff --git a/src/contacts-contact-sheet.vala b/src/contacts-contact-sheet.vala
index 0582615..37b7330 100644
--- a/src/contacts-contact-sheet.vala
+++ b/src/contacts-contact-sheet.vala
@@ -221,6 +221,13 @@ public class Contacts.ContactSheet : Grid {
          }
          add_row_with_label (ref i, TypeSet.general.format_type (addr), all_strs);
        }
+
+       if (addr_details.postal_addresses.size > 0) {
+         var map = new AddressMap (c, addr_details.postal_addresses);
+         map.load ();
+         attach (map, 1, i, 1, 1);
+         i++;
+       }
       }
 
       if (i != 3)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]