Bug 571667 - [3/3] Empathy should display my location
[3/3] Empathy should display my location
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Geolocation
2.25.x
Other Linux
: Normal enhancement
: ---
Assigned To: Pierre-Luc Beaudoin
:
Depends on: 571664 583566
Blocks:
  Show dependency tree
 
Reported: 2009-02-13 18:25 UTC by Pierre-Luc Beaudoin
Modified: 2009-05-27 18:28 UTC (History)
4 users (show)

See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed fix in branch geolocation-base http://git.collabora.co.uk/?p=user/pierlux/empathy.git;a=shortlog;h=refs/heads/geolocation-ui (49.65 KB, patch)
2009-02-13 19:00 UTC, Pierre-Luc Beaudoin
none Details | Diff | Review
Proposed fix in branch geolocation-ui http://git.collabora.co.uk/?p=user/pierlux/empathy.git;a=shortlog;h=refs/heads/geolocation-ui (51.62 KB, patch)
2009-04-07 22:15 UTC, Pierre-Luc Beaudoin
none Details | Diff | Review
Reworked branch geolocation-ui http://git.collabora.co.uk/?p=user/pierlux/empathy.git;a=shortlog;h=refs/heads/geolocation-ui (38.11 KB, patch)
2009-05-21 16:29 UTC, Pierre-Luc Beaudoin
none Details | Diff | Review
Proposed fix in branch geolocation-ui http://git.collabora.co.uk/?p=user/pierlux/empathy.git;a=shortlog;h=refs/heads/geolocation-ui (38.83 KB, patch)
2009-05-25 19:11 UTC, Pierre-Luc Beaudoin
reviewed Details | Diff | Review

Description Pierre-Luc Beaudoin 2009-02-13 18:25:55 UTC
Empathy should have support for
org.freedesktop.Telepathy.Connection.Interface.Location.DRAFT telepathy spec.

This third branch implements Location displaying using libchamplain.  A new dialog named "Contact Map View" is available under the Chat menu in the contact list, and a map is displayed (if location information is available for the contact) under its Contact Information dialog.
Comment 1 Pierre-Luc Beaudoin 2009-02-13 19:00:30 UTC
Created attachment 128664 [details] [review]
Proposed fix in branch geolocation-base http://git.collabora.co.uk/?p=user/pierlux/empathy.git;a=shortlog;h=refs/heads/geolocation-ui

 configure.ac                                |    5 +
 libempathy-gtk/Makefile.am                  |    2 +
 libempathy-gtk/empathy-conf.h               |    1 +
 libempathy-gtk/empathy-contact-dialogs.c    |    5 +
 libempathy-gtk/empathy-contact-widget.c     |  107 ++++++++
 libempathy-gtk/empathy-contact-widget.glade |  157 +++++++----
 libempathy-gtk/empathy-contact-widget.h     |    1 +
 src/Makefile.am                             |   21 ++-
 src/empathy-main-window.c                   |   22 ++
 src/empathy-main-window.glade               |    8 +
 src/empathy-map-view-marker.svg             |  109 ++++++++
 src/empathy-map-view.c                      |  378 +++++++++++++++++++++++++++
 src/empathy-map-view.glade                  |   60 +++++
 src/empathy-map-view.h                      |   33 +++
 src/empathy.c                               |    9 +
 15 files changed, 859 insertions(+), 59 deletions(-)
Comment 2 Guillaume Desmottes 2009-02-21 00:01:44 UTC
As libchamplain is not an official GNOME external dependency (yet ;) it should be optionnal.
Comment 3 Pierre-Luc Beaudoin 2009-03-03 10:02:41 UTC
Yeah, it is optionally built right now.  I do plan to have a more detailed UI (once all these patch goes in).  The detailed UI would explicitly list the Address fields, so someone without libchamplain would be able to get information.
Comment 4 André Klapper 2009-03-15 16:43:31 UTC
I don't consider this a GNOME 2.28 target blocker, it's "just" a very nice enhancement. Feel free to set the module specific target milestone though
Comment 5 Pierre-Luc Beaudoin 2009-04-07 22:15:59 UTC
Created attachment 132303 [details] [review]
Proposed fix in branch geolocation-ui http://git.collabora.co.uk/?p=user/pierlux/empathy.git;a=shortlog;h=refs/heads/geolocation-ui

 configure.ac                                |   36 +++
 libempathy-gtk/Makefile.am                  |    2 +
 libempathy-gtk/empathy-conf.h               |    1 +
 libempathy-gtk/empathy-contact-dialogs.c    |    5 +-
 libempathy-gtk/empathy-contact-widget.c     |  107 ++++++++
 libempathy-gtk/empathy-contact-widget.glade |  157 +++++++----
 libempathy-gtk/empathy-contact-widget.h     |    1 +
 src/Makefile.am                             |   21 ++-
 src/empathy-main-window.c                   |   22 ++
 src/empathy-main-window.glade               |    8 +
 src/empathy-map-view-marker.svg             |  109 ++++++++
 src/empathy-map-view.c                      |  386 +++++++++++++++++++++++++++
 src/empathy-map-view.glade                  |   60 ++++
 src/empathy-map-view.h                      |   33 +++
 src/empathy.c                               |    8 +
 15 files changed, 896 insertions(+), 60 deletions(-)
Comment 6 Pierre-Luc Beaudoin 2009-05-12 15:47:16 UTC
While I can't figure out geolocation-publish's problem, I updated this branch.  It doesn't depend on geolocation-publish anymore.

I also added a basic UI (that still needs to be made pretty) which will list the location information in tooltips and under the map.
Comment 7 Guillaume Desmottes 2009-05-13 10:34:16 UTC
This is a first review from someone who doesn't know anything about libchamplain.

• New UI file should be added to po/POTFILES.in (and new .c file probably too; even if it doesn't contain any translatable string atm)

empathy-contact-dialogs.c
• empathy_contact_edit_dialog_show: why did you remove this comment ?


empathy-contact-widget.c
• Please add a comment explaining why _GNU_SOURCE is needed
•  contact_widget_location_update: when checking if the EMPATHY_LOCATION_TIMESTAMP value if NULL, add { } in the if branch (to be coherent with the else branch)
• contact_widget_location_update: is the LAT and LON info really mandatory? I mean should we early return if we don't have these information? Could be worth to display, say, the city even if we don't have the precise location
• contact_widget_location_update: as you said, we should display a pretty name instead of the key
• +  if (/* information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP || */    Why is that part commented?
• contact_widget_location_update: the champlain objects created in this function are never freed


empathy.c
• +       gtk_clutter_init(&argc, &argv);    missing space before '('

empathy-map-view
• Update copyright in the header file
• I guess you should use your collabora address
• Don't use C++ style comments
• fix FIXME
• empathy_map_view_show: use g_slice_new_new ?
• empathy_builder_get_file and empathy_builder_connect are lot easier to read if you set only one paire by line
• champlain_view_center_on () where this 36 come from? A DEFINE would be better if it's a magic number
• window->layer is never freed
• Maybe EmpathyMapView should be a widget inheriting from GtkWindow?
• map_view_geocode_cb: why are you reffing/unreffing the hash table?
• map_view_geocode_cb: hash table is not unreffed if error != NULL
• map_view_geocode_cb: you could use tp_g_value_slice_new_double
• map_view_geocode_cb: some comments explaining what this function does would be good. It's not obvious for someone who doesn't know geoclue
• map_view_marker_update_position: is the address hash table destroyed at some point? and the GeoclueGeocode object?
• map_view_contacts_foreach: when is the marker freed?



Got this crash when trying to test your branch (without libchamplain):
Gtk-CRITICAL **: gtk_widget_hide: assertion `GTK_IS_WIDGET (widget)' failed
aborting...

Program received signal SIGABRT, Aborted.

Thread 139835388077984 (LWP 9516)

  • #0 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #1 *__GI_abort
    at abort.c line 88
  • #2 IA__g_logv
    at /build/buildd/glib2.0-2.20.1/glib/gmessages.c line 506
  • #3 IA__g_log
    at /build/buildd/glib2.0-2.20.1/glib/gmessages.c line 526
  • #4 empathy_main_window_show
    at empathy-main-window.c line 1172
  • #5 main
    at empathy.c line 555

    
Comment 8 Guillaume Desmottes 2009-05-13 15:24:00 UTC
As suggested on bug #562468 the "Show Contacts on a map" menu item should be in a "View" section.
Please record a patch adding this new section seperately so it can be easily cherry-picked.
Comment 9 Guillaume Desmottes 2009-05-18 15:26:04 UTC
Please update or rebase your branch on top of master and be sure that "make
check" works; it should perform some coding style checks.
Comment 10 Pierre-Luc Beaudoin 2009-05-21 16:29:02 UTC
Created attachment 135126 [details] [review]
Reworked branch geolocation-ui http://git.collabora.co.uk/?p=user/pierlux/empathy.git;a=shortlog;h=refs/heads/geolocation-ui

 configure.ac                             |   66 +++++
 libempathy-gtk/Makefile.am               |    4 +
 libempathy-gtk/empathy-contact-dialogs.c |    1 +
 libempathy-gtk/empathy-contact-widget.c  |  237 +++++++++++++++++++
 libempathy-gtk/empathy-contact-widget.h  |    1 +
 libempathy-gtk/empathy-contact-widget.ui |   62 +++++-
 po/POTFILES.in                           |    2 +
 src/Makefile.am                          |   16 +-
 src/empathy-main-window.c                |   19 ++
 src/empathy-main-window.ui               |    8 +
 src/empathy-map-view.c                   |  380 ++++++++++++++++++++++++++++++
 src/empathy-map-view.h                   |   32 +++
 src/empathy-map-view.ui                  |   59 +++++
 src/empathy.c                            |    8 +
 14 files changed, 890 insertions(+), 5 deletions(-)
Comment 11 Guillaume Desmottes 2009-05-22 15:34:41 UTC
location_key_to_label
Could be worth to use a hashtable for faster association
Comment 12 Guillaume Desmottes 2009-05-22 15:45:24 UTC
IMHO a button in the map view to go back to to max zoom out could be useful.
Comment 13 Guillaume Desmottes 2009-05-22 16:13:33 UTC
The "View contacts on a map" menu entry should be in the View menu once #583566 has been merged.
Comment 14 Pierre-Luc Beaudoin 2009-05-22 17:25:31 UTC
Midair colision reverted.
Comment 15 Guillaume Desmottes 2009-05-25 13:07:33 UTC
Empathy master now prints a configure report. Please upgrade it according the new optionnal dep(s).
Comment 16 Pierre-Luc Beaudoin 2009-05-25 19:11:38 UTC
Created attachment 135336 [details] [review]
Proposed fix in branch geolocation-ui http://git.collabora.co.uk/?p=user/pierlux/empathy.git;a=shortlog;h=refs/heads/geolocation-ui

 configure.ac                             |   68 ++++++
 libempathy-gtk/Makefile.am               |    4 +
 libempathy-gtk/empathy-contact-dialogs.c |    1 +
 libempathy-gtk/empathy-contact-widget.c  |  240 +++++++++++++++++++
 libempathy-gtk/empathy-contact-widget.h  |    1 +
 libempathy-gtk/empathy-contact-widget.ui |   62 +++++-
 po/POTFILES.in                           |    2 +
 src/Makefile.am                          |   16 +-
 src/empathy-main-window.c                |   19 ++
 src/empathy-main-window.ui               |    7 +
 src/empathy-map-view.c                   |  386 ++++++++++++++++++++++++++++++
 src/empathy-map-view.h                   |   32 +++
 src/empathy-map-view.ui                  |   59 +++++
 src/empathy.c                            |    8 +
 14 files changed, 900 insertions(+), 5 deletions(-)
Comment 17 Pierre-Luc Beaudoin 2009-05-25 19:12:37 UTC
This new patch places the menu option in View, fix a bug where markers were created for every user (and not only for users with a location) and print a report at the end of configure.
Comment 18 Pierre-Luc Beaudoin 2009-05-27 18:28:02 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

Note You need to log in before you can comment on or make changes to this bug.