[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH] setup: Schweizerdeutsche Tastaturbelegung



+ setup: Schweizerdeutsche Tastaturbelegung zur Auswahl stellen

Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
 src/modules/pas/setup/lang/lang_en.c     |    4 ++++
 src/modules/pas/setup/lang/resstr.h      |    1 +
 src/modules/pas/setup/setup_keyboard.pas |   25 ++++++++++++++++---------
 3 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/src/modules/pas/setup/lang/lang_en.c b/src/modules/pas/setup/lang/lang_en.c
index ed799ed..246a1fc 100644
--- a/src/modules/pas/setup/lang/lang_en.c
+++ b/src/modules/pas/setup/lang/lang_en.c
@@ -66,6 +66,10 @@ static const struct tms_strings dict[] = {
     &RESSTR_SETUP_KEYBOARD_RSGERMAN,
     "German (de)",
 
+    // Schweizerdeutsch
+    &RESSTR_SETUP_KEYBOARD_RSSWISSGERMAN,
+    "Swiss German (de_ch)",
+
     // US-Amerikanisch
     &RESSTR_SETUP_KEYBOARD_RSUSAMERICAN,
     "US American (us)",
diff --git a/src/modules/pas/setup/lang/resstr.h b/src/modules/pas/setup/lang/resstr.h
index 9fb1e07..ca7098f 100644
--- a/src/modules/pas/setup/lang/resstr.h
+++ b/src/modules/pas/setup/lang/resstr.h
@@ -38,6 +38,7 @@ extern void* RESSTR_MENU_RSQUIT;
 
 extern void* RESSTR_SETUP_KEYBOARD_RSTITLE;
 extern void* RESSTR_SETUP_KEYBOARD_RSGERMAN;
+extern void* RESSTR_SETUP_KEYBOARD_RSSWISSGERMAN;
 extern void* RESSTR_SETUP_KEYBOARD_RSUSAMERICAN;
 extern void* RESSTR_SETUP_KEYBOARD_RSBACK;
 extern void* RESSTR_SETUP_KEYBOARD_RSCHOOSELAYOUT;
diff --git a/src/modules/pas/setup/setup_keyboard.pas b/src/modules/pas/setup/setup_keyboard.pas
index 1e69ca2..ad9622d 100644
--- a/src/modules/pas/setup/setup_keyboard.pas
+++ b/src/modules/pas/setup/setup_keyboard.pas
@@ -11,8 +11,9 @@ uses sysutils, tyndur, crt, tui;
 resourcestring
     rsTitle = 'tyndur-Konfiguration: Tastaturbelegung';
 
-    rsGerman = 'Deutsch';
-    rsUSAmerican = 'US-Amerikanisch';
+    rsGerman = 'Deutsch (de)';
+    rsSwissGerman = 'Scheizerdeutsch (de_ch)';
+    rsUSAmerican = 'US-Amerikanisch (us)';
     rsBack = 'Zurück';
 
     rsChooseLayout = 'Bitte wähle aus dem Menü Deine Tastaturbelegung aus.';
@@ -84,9 +85,9 @@ begin
     f.obj := mainw;
 
     if back then begin
-        num_items := 4;
+        num_items := 5;
     end else begin
-        num_items := 2;
+        num_items := 3;
     end;
 
     a := TUIMenu.create(num_items);
@@ -95,6 +96,7 @@ begin
         color := 14;
 
         AddItem(rsGerman, nil);
+        AddItem(rsSwissGerman, nil);
         AddItem(rsUSAmerican, nil);
         if back then begin
             AddItem('', nil);
@@ -121,15 +123,15 @@ begin
                     SK_UP:
                         begin
                             a.selected := (a.selected + num_items - 1) mod num_items;
-                            if a.selected = 2 then begin
-                                a.selected := 1;
+                            if a.selected = 3 then begin
+                                a.selected := 2;
                             end;
                         end;
                     SK_DOWN:
                         begin
                             a.selected := (a.selected + 1) mod num_items;
-                            if a.selected = 2 then begin
-                                a.selected := 3;
+                            if a.selected = 3 then begin
+                                a.selected := 4;
                             end;
                         end;
                 end;
@@ -142,10 +144,15 @@ begin
                         end;
                     1:
                         begin
+                            SetLayout('de_ch');
+                            break;
+                        end;
+                    2:
+                        begin
                             SetLayout('us');
                             break;
                         end;
-                    3:  break;
+                    4:  break;
                 end;
         end;
     until false;
-- 
1.6.0.2