diff --git a/source/ubinstall-gtk-ui-lang.c b/source/ubinstall-gtk-ui-lang.c index 2a5ff07..79e0184 100644 --- a/source/ubinstall-gtk-ui-lang.c +++ b/source/ubinstall-gtk-ui-lang.c @@ -119,6 +119,15 @@ int yon_char_parsed_compare(const void *a, const void *b){ return strcmp(*str_a,*str_b); } +gboolean on_languages_search_func(GtkTreeModel *model, gint ,const char *key, GtkTreeIter *iter, main_window *){ + char *language, *language_localised; + gtk_tree_model_get(model,iter,1,&language,4,&language_localised,-1); + if (strstr(language,key)||strstr(language_localised,key)){ + return 0; + } + return 1; +} + void set_locales_list(main_window *widgets){ gtk_list_store_clear(widgets->InstallerLanguageList); gtk_list_store_clear(widgets->InstallerCountryList); @@ -152,6 +161,7 @@ void set_locales_list(main_window *widgets){ 1,_(language), 2,lang_name, 3,locales[i], + 4,language, -1); } diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 2219bd0..f785b7b 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -870,6 +870,8 @@ void yon_main_window_create(main_window *widgets){ gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(widgets->InstallerCountryFilter),(GtkTreeModelFilterVisibleFunc)on_country_filter,widgets,NULL); + gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(widgets->LanguagesTree),(GtkTreeViewSearchEqualFunc)on_languages_search_func,widgets,NULL); + { widgets->EnableRDPMenuItem = gtk_menu_item_new(); GtkWidget *Box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index a8be308..d5cc5dd 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -1461,4 +1461,5 @@ void yon_source_update(source_window *window); void yon_main_window_update_locale(main_window *widgets); gboolean yon_progress_bar_start(main_window *widgets); void *yon_progress_file_buzyfy(void*); -void yon_startup_language_init(); \ No newline at end of file +void yon_startup_language_init(); +gboolean on_languages_search_func(GtkTreeModel *model, gint col,const char *key, GtkTreeIter *iter, main_window *widgets); \ No newline at end of file diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 4cb9099..4fbb1d6 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -108,6 +108,8 @@ + +