summaryrefslogtreecommitdiff
path: root/navit/gui/internal
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-03-24 11:36:01 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-03-24 11:36:01 +0000
commitbca565296b2ce7770aaadd718251b7cc91c8f38a (patch)
tree155819c089db00239b743a36f932a391bbe6a025 /navit/gui/internal
parent2ab03dbc8fa162eceb07d700a4f852070ca5d9dc (diff)
downloadnavit-bca565296b2ce7770aaadd718251b7cc91c8f38a.tar.gz
Add:gui_internal:Select cyrillian keyboard for cyrillic languages|Thanks alx
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5421 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/gui/internal')
-rw-r--r--navit/gui/internal/gui_internal_bookmark.c7
-rw-r--r--navit/gui/internal/gui_internal_command.c2
-rw-r--r--navit/gui/internal/gui_internal_html.c2
-rw-r--r--navit/gui/internal/gui_internal_keyboard.c20
-rw-r--r--navit/gui/internal/gui_internal_keyboard.h1
-rw-r--r--navit/gui/internal/gui_internal_poi.c3
-rw-r--r--navit/gui/internal/gui_internal_search.c3
7 files changed, 30 insertions, 8 deletions
diff --git a/navit/gui/internal/gui_internal_bookmark.c b/navit/gui/internal/gui_internal_bookmark.c
index f77903d50..4479c6d5a 100644
--- a/navit/gui/internal/gui_internal_bookmark.c
+++ b/navit/gui/internal/gui_internal_bookmark.c
@@ -15,7 +15,6 @@
#include "gui_internal_keyboard.h"
#include "gui_internal_bookmark.h"
-
static void
gui_internal_cmd_add_bookmark_do(struct gui_priv *this, struct widget *widget)
{
@@ -103,7 +102,7 @@ gui_internal_cmd_add_bookmark2(struct gui_priv *this, struct widget *wm, void *d
wl=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(w, wl);
if (this->keyboard)
- gui_internal_widget_append(w, gui_internal_keyboard(this,2));
+ gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
gui_internal_menu_render(this);
}
@@ -131,7 +130,7 @@ gui_internal_cmd_add_bookmark_folder2(struct gui_priv *this, struct widget *wm,
wl=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(w, wl);
if (this->keyboard)
- gui_internal_widget_append(w, gui_internal_keyboard(this,2));
+ gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
gui_internal_menu_render(this);
}
@@ -160,7 +159,7 @@ gui_internal_cmd_rename_bookmark(struct gui_priv *this, struct widget *wm, void
wl=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(w, wl);
if (this->keyboard)
- gui_internal_widget_append(w, gui_internal_keyboard(this,2));
+ gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
gui_internal_menu_render(this);
}
diff --git a/navit/gui/internal/gui_internal_command.c b/navit/gui/internal/gui_internal_command.c
index 688f6228b..0d168ea0b 100644
--- a/navit/gui/internal/gui_internal_command.c
+++ b/navit/gui/internal/gui_internal_command.c
@@ -827,7 +827,7 @@ gui_internal_cmd_log(struct gui_priv *this)
wl=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(w, wl);
if (this->keyboard)
- gui_internal_widget_append(w, gui_internal_keyboard(this,2));
+ gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
gui_internal_menu_render(this);
gui_internal_leave(this);
}
diff --git a/navit/gui/internal/gui_internal_html.c b/navit/gui/internal/gui_internal_html.c
index 21c3a193f..161bc8a6c 100644
--- a/navit/gui/internal/gui_internal_html.c
+++ b/navit/gui/internal/gui_internal_html.c
@@ -486,7 +486,7 @@ gui_internal_html_menu(struct gui_priv *this, const char *document, char *anchor
g_free(doc);
if (this->keyboard_required && this->keyboard) {
this->html_container->flags=gravity_center|orientation_vertical|flags_expand|flags_fill;
- gui_internal_widget_append(this->html_container, gui_internal_keyboard(this,2));
+ gui_internal_widget_append(this->html_container, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
}
gui_internal_menu_render(this);
graphics_draw_mode(this->gra, draw_mode_end);
diff --git a/navit/gui/internal/gui_internal_keyboard.c b/navit/gui/internal/gui_internal_keyboard.c
index a60e9090f..ad76fb41f 100644
--- a/navit/gui/internal/gui_internal_keyboard.c
+++ b/navit/gui/internal/gui_internal_keyboard.c
@@ -328,3 +328,23 @@ gui_internal_keyboard_change(struct gui_priv *this, struct widget *key, void *da
{
gui_internal_keyboard_do(this, key->data, key->datai);
}
+int
+gui_internal_keyboard_init_mode(void)
+{
+/*
+ Set cyrillic keyboard for Russia, Ukraine, Belarus, Kazakhstan
+*/
+ int ret;
+ char *lang;
+ lang=getenv("LANG");
+ ret=0;
+ if (strstr(lang,"RU"))
+ ret = 40;
+ if (strstr(lang,"UA"))
+ ret = 40;
+ if (strstr(lang,"BY"))
+ ret = 40;
+ if (strstr(lang,"KZ"))
+ ret = 40;
+ return ret;
+}
diff --git a/navit/gui/internal/gui_internal_keyboard.h b/navit/gui/internal/gui_internal_keyboard.h
index 642173a28..0e2fe90cd 100644
--- a/navit/gui/internal/gui_internal_keyboard.h
+++ b/navit/gui/internal/gui_internal_keyboard.h
@@ -3,4 +3,5 @@ struct gui_priv;
struct widget;
struct widget *gui_internal_keyboard_do(struct gui_priv *this, struct widget *wkbdb, int mode);
struct widget *gui_internal_keyboard(struct gui_priv *this, int mode);
+int gui_internal_keyboard_init_mode(void);
/* end of prototypes */
diff --git a/navit/gui/internal/gui_internal_poi.c b/navit/gui/internal/gui_internal_poi.c
index 636087298..b69f8a0cf 100644
--- a/navit/gui/internal/gui_internal_poi.c
+++ b/navit/gui/internal/gui_internal_poi.c
@@ -483,7 +483,8 @@ void
gui_internal_cmd_pois_filter(struct gui_priv *this, struct widget *wm, void *data)
{
struct widget *wb, *w, *wr, *wk, *we;
- int keyboard_mode=2;
+ int keyboard_mode;
+ keyboard_mode=2+gui_internal_keyboard_init_mode();
wb=gui_internal_menu(this,"Filter");
w=gui_internal_box_new(this, gravity_center|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(wb, w);
diff --git a/navit/gui/internal/gui_internal_search.c b/navit/gui/internal/gui_internal_search.c
index 7451d5e99..784927934 100644
--- a/navit/gui/internal/gui_internal_search.c
+++ b/navit/gui/internal/gui_internal_search.c
@@ -478,7 +478,8 @@ gui_internal_search(struct gui_priv *this, char *what, char *type, int flags)
{
struct widget *wb,*wk,*w,*wr,*we,*wl,*wnext=NULL;
char *country;
- int keyboard_mode=2;
+ int keyboard_mode;
+ keyboard_mode=2+gui_internal_keyboard_init_mode();
gui_internal_search_list_new(this);
wb=gui_internal_menu(this, what);
w=gui_internal_box_new(this, gravity_center|orientation_vertical|flags_expand|flags_fill);