/* Category ID, Label */
cmb=gtk_combo_box_new_with_model(GTK_TREE_MODEL(gtk_list_store_new(2, G_TYPE_INT, G_TYPE_STRING)));
-/* Set up the view for the combo box. */
-renderer = gtk_cell_renderer_text_new();
+/* Set up the text view for the combo box. */
+renderer=gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(cmb), renderer, TRUE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(cmb), renderer, "text", 1, NULL);
+#if 0
+renderer=gtk_cell_renderer_pixbuf_new();
+column=gtk_tree_view_column_new_with_attributes(_("Icon"), renderer, "pixbuf", CAT_ICON, NULL);
+gtk_tree_view_append_column(GTK_TREE_VIEW(tree_view), column);
+#endif
+
return cmb;
}
*
*/
gboolean
-poi_info_dialog(guint poi_id)
+poi_info_dialog(GtkWidget *window, guint poi_id)
{
GtkWidget *dialog;
GtkWidget *info;
}
dialog=gtk_dialog_new_with_buttons(_("POI"),
- GTK_WINDOW(_window), GTK_DIALOG_MODAL,
+ GTK_WINDOW(window), GTK_DIALOG_MODAL,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
NULL);
GtkWidget *poi_quick_button_box(poi_quick_data *qpdata);
gboolean poi_quick_dialog(gdouble lat, gdouble lon);
-gboolean poi_info_dialog(guint poi_id);
+gboolean poi_info_dialog(GtkWidget *window, guint poi_id);
gboolean poi_category_dialog(guint cat_id);
gboolean poi_category_list();
#include "search.h"
#include "dialogs.h"
+typedef enum {
+ SBTN_INFO=1,
+ SBTN_GOTO=2,
+ SBTN_ROUTETO=3,
+ SBTN_EDIT=4,
+} search_action_e;
+
typedef struct _search_dialog search_dialog;
struct _search_dialog {
GtkWidget *dialog;
sd.dialog = gtk_dialog_new_with_buttons(_("Search"),
GTK_WINDOW(_window),
GTK_DIALOG_MODAL,
- _("Goto"), 1,
- _("Route to"), 2,
- _("Edit"), 3,
+ _("Info"), SBTN_INFO,
+ _("Goto"), SBTN_GOTO,
+ _("Route to"), SBTN_ROUTETO,
+ _("Edit"), SBTN_EDIT,
GTK_STOCK_CLOSE, GTK_RESPONSE_REJECT,
NULL);
gdouble lat, lon;
switch (res) {
- case 1:
+ case SBTN_INFO:
+ switch (sd.stype) {
+ case SEARCH_TYPE_POI:
+ poi_info_dialog(sd.dialog, search_get_list_item_id(sd.list));
+ break;
+ default:
+ popup_error(sd.dialog, _("No information available."));
+ break;
+ }
+ break;
+ case SBTN_GOTO:
if (search_get_list_item_latlon(sd.list, &lat, &lon)==FALSE) {
+#ifdef WITH_HILDON
+ hildon_banner_show_information(sd.dialog, NULL, _("Select a location from the list."));
+#else
popup_error(sd.dialog, _("Select a location from the list."));
+#endif
} else {
map_center_latlon(lat, lon);
g_idle_add_full(G_PRIORITY_HIGH_IDLE,(GSourceFunc)map_update_location_from_center, NULL, NULL);
}
continue;
break;
- case 2:
+ case SBTN_ROUTETO:
if (search_get_list_item_latlon(sd.list, &_dest.lat, &_dest.lon)==FALSE) {
+#ifdef WITH_HILDON
+ hildon_banner_show_information(sd.dialog, NULL, _("Select a location from the list."));
+#else
popup_error(sd.dialog, _("Select a location from the list."));
+#endif
} else {
_dest.valid=TRUE;
g_idle_add_full(G_PRIORITY_HIGH_IDLE,(GSourceFunc)map_update_location_from_center, NULL, NULL);
}
continue;
break;
- case 3:
+ case SBTN_EDIT:
switch (sd.stype) {
case SEARCH_TYPE_POI: {
poi_info *p=NULL;