Opened 4 years ago

Closed 3 years ago

#1113 closed enhancement/feature request (fixed)

I made a patch to search POI's in Gtk. Please commit it

Reported by: me.yahoo.com/a/_ij44v97roulszbeztrzcqzaaiyvlg--#9d14a Owned by: cp15
Priority: major Milestone: version 0.5.0
Component: gui/gtk Version: git master
Severity: normal Keywords: gtk, poi, search
Cc:

Description

Hi I made a path to give support to search POI's in GTK
You can put the distance and select the category
If some poi is found and you select it, you can see the map, set destination and visit before your destination.
I hope you like it and commit it soon
See you

Attachments (1)

gtk_gui_poi.diff (23.8 KB) - added by me.yahoo.com/a/_ij44v97roulszbeztrzcqzaaiyvlg--#9d14a 4 years ago.

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by me.yahoo.com/a/_ij44v97roulszbeztrzcqzaaiyvlg--#9d14a

comment:1 Changed 4 years ago by me.yahoo.com/a/_ij44v97roulszbeztrzcqzaaiyvlg--#9d14a

Hi I attach again the gtk_gui_poi.diff, due to there was a conflict with later svn changes.
The patch works now with release 5463

comment:2 Changed 4 years ago by me.yahoo.com/a/_ij44v97roulszbeztrzcqzaaiyvlg--#9d14a

  • Owner turulomio deleted

comment:3 Changed 4 years ago by usul

  • Keywords gtk poi search added
  • Owner set to cp15

Thanks for your commit :)

Please wait for feedback on the final code review.

comment:4 Changed 3 years ago by sleske

  • Severity set to normal

I'll have a look at the patch. Sorry this took so long. I'll post an update in the next days.

comment:5 Changed 3 years ago by sleske

The patch looks fine, except for a few details. I fixed some cosmetic issues (comments, variable names, some UI strings). I'll probably commit everything shortly.

One question about the code in the patch:

In gui_gtk_poi.c, function model_poi there is this code:

 //Searches if vehicle has coord_geo to show distance from vehicle.
 //If vehicle hasn't coord_geo show distance from center of screen
 navit_get_attr(search->nav,attr_vehicle, &vehicle_attr,NULL);
 v=vehicle_attr.u.vehicle;

 vehicle_get_attr(v,attr_position_coord_geo, &attr, NULL);
 if (attr.u.coord_geo->lng==0.0f && attr.u.coord_geo->lat==0.0f){
         p.x=navit_get_width(search->nav)/2;
         p.y=navit_get_height(search->nav)/2;
         gtk_label_set_text(GTK_LABEL(search->label_distance),
                _("Distance from center screen (Km)"));
 }else{
         printf("%f\n",attr.u.coord_geo->lng);
         
         p.x=navit_get_width(search->nav)/2;
         p.y=navit_get_height(search->nav)*4/5;
         gtk_label_set_text(GTK_LABEL(search->label_distance),
                _("Distance from vehicle cursor (Km)"));
       }

The comment seems to indicate that we want to show distance from the vehicle position if a position is available. However, in the code the vehicle position is not actually used (except for the printf) - the if and else branches do practically the same thing.

How is that supposed to work? Should I just delete it?

comment:6 Changed 3 years ago by sleske

  • Resolution set to fixed
  • Status changed from new to closed

The patch has been committed as rev. 5859. I also committed some additional fixes and small additions in the following commits.

For now I have deleted the code indicated in the previous comment (the vehicle position check), as it did not seem useful. If we can use it later, we can always get it back.

Thanks for the patch, and sorry it took so long.

Note: See TracTickets for help on using tickets.