diff options
author | jkoan <jkoan@users.noreply.github.com> | 2021-09-24 17:32:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-24 17:32:14 +0200 |
commit | a719525dfd20b2586ced44c287efc9a495e92b39 (patch) | |
tree | 5cc4abe21624f3496efa7b46f0494823c8b04e77 | |
parent | 510f60e7ef01c1b1f2b1d8f49f8cc446f4daa058 (diff) | |
parent | da80ff703d7a6319f3e8b94bd35d8daced649100 (diff) | |
download | navit-remove_unsupported_ports.tar.gz |
Merge branch 'trunk' into remove_unsupported_portsremove_unsupported_ports
-rw-r--r-- | navit/attr_def.h | 1 | ||||
-rw-r--r-- | navit/graphics/qt5/QNavitQuick.cpp | 7 | ||||
-rw-r--r-- | navit/graphics/qt5/QNavitWidget.cpp | 7 | ||||
-rw-r--r-- | navit/gui/gtk/destination.c | 11 | ||||
-rw-r--r-- | navit/gui/gtk/gui_gtk_action.c | 3 | ||||
-rw-r--r-- | navit/gui/internal/gui_internal.c | 8 | ||||
-rw-r--r-- | navit/gui/internal/gui_internal_priv.h | 1 | ||||
-rw-r--r-- | navit/gui/internal/gui_internal_search.c | 9 | ||||
-rw-r--r-- | navit/maptool/itembin.c | 3 | ||||
-rw-r--r-- | navit/navit.c | 6 |
10 files changed, 35 insertions, 21 deletions
diff --git a/navit/attr_def.h b/navit/attr_def.h index e5f3033ff..951b57060 100644 --- a/navit/attr_def.h +++ b/navit/attr_def.h @@ -267,6 +267,7 @@ ATTR(has_menu_button) ATTR(oneway) ATTR(tunnel_nightlayout) ATTR(layout_daynightauto) +ATTR(town_use_postal) ATTR2(0x0002ffff,type_int_end) ATTR2(0x00030000,type_string_begin) ATTR(type) diff --git a/navit/graphics/qt5/QNavitQuick.cpp b/navit/graphics/qt5/QNavitQuick.cpp index dcd0d2aa5..966072852 100644 --- a/navit/graphics/qt5/QNavitQuick.cpp +++ b/navit/graphics/qt5/QNavitQuick.cpp @@ -181,12 +181,7 @@ void QNavitQuick::geometryChanged(const QRectF& newGeometry, const QRectF& oldGe if (graphics_priv->pixmap == NULL) { graphics_priv->pixmap = new QPixmap(width(), height()); } - painter = new QPainter(graphics_priv->pixmap); - if (painter != NULL) { - QBrush brush; - painter->fillRect(0, 0, width(), height(), brush); - delete painter; - } + graphics_priv->pixmap->fill(Qt::transparent); dbg(lvl_debug, "size %fx%f", width(), height()); dbg(lvl_debug, "pixmap %p %dx%d", graphics_priv->pixmap, graphics_priv->pixmap->width(), graphics_priv->pixmap->height()); diff --git a/navit/graphics/qt5/QNavitWidget.cpp b/navit/graphics/qt5/QNavitWidget.cpp index 869d5f2ec..43c04d87f 100644 --- a/navit/graphics/qt5/QNavitWidget.cpp +++ b/navit/graphics/qt5/QNavitWidget.cpp @@ -105,12 +105,7 @@ void QNavitWidget::resizeEvent(QResizeEvent* event) { if (graphics_priv->pixmap == NULL) { graphics_priv->pixmap = new QPixmap(size()); } - painter = new QPainter(graphics_priv->pixmap); - if (painter != NULL) { - QBrush brush; - painter->fillRect(0, 0, width(), height(), brush); - delete painter; - } + graphics_priv->pixmap->fill(Qt::transparent); dbg(lvl_debug, "size %dx%d", width(), height()); dbg(lvl_debug, "pixmap %p %dx%d", graphics_priv->pixmap, graphics_priv->pixmap->width(), graphics_priv->pixmap->height()); diff --git a/navit/gui/gtk/destination.c b/navit/gui/gtk/destination.c index 34c840200..d34db2d44 100644 --- a/navit/gui/gtk/destination.c +++ b/navit/gui/gtk/destination.c @@ -262,6 +262,11 @@ static void changed(GtkWidget *widget, struct search_param *search) { return; set_columns(search, 2); } + if (widget == search->entry_number) { + dbg(lvl_debug,"street"); + search->attr.type=attr_house_number; + set_columns(search, 3); + } search_list_search(search->sl, &search->attr, search->partial); gtk_list_store_clear(search->liststore); @@ -293,7 +298,10 @@ static void changed(GtkWidget *widget, struct search_param *search) { gtk_list_store_set(search->liststore,&iter,4,res->street->name,-1); else gtk_list_store_set(search->liststore,&iter,4,"",-1); - + if (res->house_number) + gtk_list_store_set(search->liststore,&iter,5,res->house_number->house_number,-1); + else + gtk_list_store_set(search->liststore,&iter,5,"",-1); } } @@ -564,6 +572,7 @@ int destination_address(struct navit *nav) { if (country_attr) { cs=country_search_new(country_attr, 0); item=country_search_get_item(cs); + search->partial=0; // To enable city and initialize after first usage of the dialog if (item && item_attr_get(item, attr_country_name, &country_name)) gtk_entry_set_text(GTK_ENTRY(search->entry_country), country_name.u.str); country_search_destroy(cs); diff --git a/navit/gui/gtk/gui_gtk_action.c b/navit/gui/gtk/gui_gtk_action.c index 7b700c7d5..5563c88b0 100644 --- a/navit/gui/gtk/gui_gtk_action.c +++ b/navit/gui/gtk/gui_gtk_action.c @@ -212,7 +212,7 @@ static GtkActionEntry entries[] = { { "InfoAction", NULL, _n("_Info"), NULL, NULL, G_CALLBACK(info_action) }, #endif /*GTK_STOCK_INFO*/ { "DestinationAction", "flag_icon", _n("Set _destination"), "<control>D", _n("Opens address search dialog"), G_CALLBACK(destination_action) }, - { "POIAction", "flag_icon", _n("_POI search"), "<control>P", _n("Opens POI search dialog"), G_CALLBACK(poi_search_action) }, + { "POIAction", GTK_STOCK_INFO, _n("_POI search"), "<control>P", _n("Opens POI search dialog"), G_CALLBACK(poi_search_action) }, { "RouteClearAction", NULL, _n("_Stop Navigation"), "<control>S", NULL, G_CALLBACK(route_clear_action) }, { "Test", NULL, _n("Test"), NULL, NULL, G_CALLBACK(destination_action) }, { "QuitAction", GTK_STOCK_QUIT, _n("_Quit"), "<control>Q",_n("Quit the application"), G_CALLBACK (quit_action) } @@ -330,7 +330,6 @@ static const char * flag_xpm[] = { }; - static struct { gchar *stockid; const char **icon_xpm; diff --git a/navit/gui/internal/gui_internal.c b/navit/gui/internal/gui_internal.c index e8759f3d3..bb28c2e84 100644 --- a/navit/gui/internal/gui_internal.c +++ b/navit/gui/internal/gui_internal.c @@ -2294,6 +2294,9 @@ static int gui_internal_set_attr(struct gui_priv *this, struct attr *attr) { case attr_menu_on_map_click: this->menu_on_map_click=attr->u.num; return 1; + case attr_town_use_postal: + this->town_use_postal=attr->u.num; + return 1; case attr_on_map_click: g_free(this->on_map_click); this->on_map_click=g_strdup(attr->u.str); @@ -3282,6 +3285,11 @@ static struct gui_priv * gui_internal_new(struct navit *nav, struct gui_methods else this->hide_keys = 0; + if((attr=attr_search(attrs, attr_town_use_postal))) + this->town_use_postal = attr->u.num; + else + this->town_use_postal = 1; + this->data.priv=this; this->data.gui=&gui_internal_methods_ext; this->data.widget=&gui_internal_widget_methods; diff --git a/navit/gui/internal/gui_internal_priv.h b/navit/gui/internal/gui_internal_priv.h index d28cac649..ceb5db986 100644 --- a/navit/gui/internal/gui_internal_priv.h +++ b/navit/gui/internal/gui_internal_priv.h @@ -146,6 +146,7 @@ struct gui_priv { int hide_keys; //Flag to set the keyboard mode 1: hide impossible keys on search; 0: highlight them. int results_map_population; + int town_use_postal; }; struct menu_data { diff --git a/navit/gui/internal/gui_internal_search.c b/navit/gui/internal/gui_internal_search.c index 66524e407..12a941afb 100644 --- a/navit/gui/internal/gui_internal_search.c +++ b/navit/gui/internal/gui_internal_search.c @@ -428,8 +428,13 @@ static void gui_internal_search_changed(struct gui_priv *this, struct widget *wm dbg(lvl_debug,"process"); if (! strcmp(wm->name,"Country")) search_attr.type=attr_country_all; - if (! strcmp(wm->name,"Town")) - search_attr.type=attr_town_postal; /*attr_town_or_district_name to exclude zip code*/ + if (! strcmp(wm->name,"Town")) { + if(this->town_use_postal) { + search_attr.type=attr_town_postal; /*attr_town_or_district_name to exclude zip code*/ + } else { + search_attr.type=attr_town_or_district_name; + } + } if (! strcmp(wm->name,"Street")) search_attr.type=attr_street_name; if (! strcmp(wm->name,"House number")) diff --git a/navit/maptool/itembin.c b/navit/maptool/itembin.c index 3996d6f6a..5df29df77 100644 --- a/navit/maptool/itembin.c +++ b/navit/maptool/itembin.c @@ -85,13 +85,10 @@ void item_bin_copy_coord(struct item_bin *ib, struct item_bin *from, int dir) { for (i = 1 ; i <= count ; i++) item_bin_add_coord(ib, &c[count-i], 1); } - void item_bin_copy_attr(struct item_bin *ib, struct item_bin *from, enum attr_type attr) { struct attr_bin *ab=item_bin_get_attr_bin(from, attr, NULL); if (ab) item_bin_add_attr_data(ib, ab->type, (void *)(ab+1), (ab->len-1)*4); - assert(attr == attr_osm_wayid); - assert(item_bin_get_wayid(ib) == item_bin_get_wayid(from)); } void item_bin_add_coord_rect(struct item_bin *ib, struct rect *r) { diff --git a/navit/navit.c b/navit/navit.c index f80890e2c..14087c4ed 100644 --- a/navit/navit.c +++ b/navit/navit.c @@ -490,8 +490,12 @@ void navit_handle_resize(struct navit *this_, int w, int h) { graphics_set_rect(this_->gra, &sel.u.p_rect); if (callback) callback_list_call_attr_1(this_->attr_cbl, attr_graphics_ready, this_); - if (this_->ready == 3) + if (this_->ready == 3) { + /* About to resize. Cancel drawing whatever it is */ + graphics_draw_cancel(this_->gra, this_->displaylist); + /* draw again even if we did not cancel anything */ navit_draw_async(this_, 1); + } } static void navit_resize(void *data, int w, int h) { |