From 44f182eecda0fc1e2f9bd387efe86f116664e860 Mon Sep 17 00:00:00 2001 From: Andrew Dodd Date: Sat, 7 Jul 2012 11:15:24 -0400 Subject: n7000: Sync DeviceSettings with merged galaxys2 I was a bit too lazy about translation patches... Copy the whole thing over from GS2 and rename to GalaxyNoteSettings. Change-Id: Ia6ca5cbf474edecb4a77e5bb77b847829910a4a1 --- DeviceSettings/res/values-de/arrays.xml | 32 ++++---- DeviceSettings/res/values-de/strings.xml | 2 +- DeviceSettings/res/values-es/arrays.xml | 9 ++- DeviceSettings/res/values-es/strings.xml | 9 ++- DeviceSettings/res/values-fi/arrays.xml | 9 +++ DeviceSettings/res/values-fi/strings.xml | 7 +- DeviceSettings/res/values-fr/arrays.xml | 50 ++++++------ DeviceSettings/res/values-fr/strings.xml | 2 +- DeviceSettings/res/values-hu/arrays.xml | 94 +++++++++++----------- DeviceSettings/res/values-hu/strings.xml | 15 ++-- DeviceSettings/res/values-nl/arrays.xml | 50 ++++++++++++ DeviceSettings/res/values-nl/strings.xml | 40 +++++++++ DeviceSettings/res/values-pt-rBR/arrays.xml | 2 +- DeviceSettings/res/values-pt-rBR/strings.xml | 10 +-- DeviceSettings/res/values/arrays.xml | 62 +++++++------- DeviceSettings/res/values/strings.xml | 2 +- .../settings/device/SensorsFragmentActivity.java | 9 ++- .../com/cyanogenmod/settings/device/Startup.java | 1 + .../src/com/cyanogenmod/settings/device/Utils.java | 82 ++++++++++++++++--- 19 files changed, 337 insertions(+), 150 deletions(-) create mode 100644 DeviceSettings/res/values-nl/arrays.xml create mode 100644 DeviceSettings/res/values-nl/strings.xml diff --git a/DeviceSettings/res/values-de/arrays.xml b/DeviceSettings/res/values-de/arrays.xml index 6f5dda7..3b7cd82 100644 --- a/DeviceSettings/res/values-de/arrays.xml +++ b/DeviceSettings/res/values-de/arrays.xml @@ -2,30 +2,30 @@ Kamera (Standard) - Video - Video warm - Video kalt - UI - Navigation - Gallerie + Video + Video warm + Video kalt + UI + Navigation + Gallerie VT - Standard - Dynamisch + Standard + Dynamisch Natürlich - Film + Film - Normal - Invertiert + Normal + Invertiert - Deaktiviert - Aktiviert + Deaktiviert + Aktiviert @@ -51,9 +51,9 @@ - Nur UMTS - Nur HSDPA - HSDPA + HSUPA + Nur UMTS + Nur HSDPA + HSDPA + HSUPA diff --git a/DeviceSettings/res/values-de/strings.xml b/DeviceSettings/res/values-de/strings.xml index 4d0589e..1528f8e 100644 --- a/DeviceSettings/res/values-de/strings.xml +++ b/DeviceSettings/res/values-de/strings.xml @@ -1,6 +1,6 @@ - Galaxy Note Einstellungen + Galaxy S II Einstellungen Farben Bildschirm diff --git a/DeviceSettings/res/values-es/arrays.xml b/DeviceSettings/res/values-es/arrays.xml index 3bc45b7..8cf4fd9 100644 --- a/DeviceSettings/res/values-es/arrays.xml +++ b/DeviceSettings/res/values-es/arrays.xml @@ -2,7 +2,7 @@ Solo UMTS - solo HSDPA + Solo HSDPA HSDPA + HSUPA @@ -48,4 +48,11 @@ 100 + + 0% + 25% + 50% (Predeterminado) + 75% + 100% + diff --git a/DeviceSettings/res/values-es/strings.xml b/DeviceSettings/res/values-es/strings.xml index 95d05ca..44d2a69 100644 --- a/DeviceSettings/res/values-es/strings.xml +++ b/DeviceSettings/res/values-es/strings.xml @@ -1,6 +1,6 @@ - Ajustes de Galaxy Note + Ajustes de Galaxy S II Radio HSPA @@ -27,8 +27,13 @@ Usar datos de calibración Usar los datos de calibración del giroscopio. ¡Calibrar despues de activar! Calibrar - Poner el dispositivo de una superficie plana y pulsar para calibrar + Colocar el dispositivo en una superficie plana y pulsar para calibrar Botones Táctiles Activar iluminación Iluminar los botones táctiles al encender la pantalla + + Háptica + Vibración + Intensidad de vibración + Establecer la intensidad de la vibración diff --git a/DeviceSettings/res/values-fi/arrays.xml b/DeviceSettings/res/values-fi/arrays.xml index eeebd7a..aaa4d82 100644 --- a/DeviceSettings/res/values-fi/arrays.xml +++ b/DeviceSettings/res/values-fi/arrays.xml @@ -48,4 +48,13 @@ HSDPA + HSUPA + + 0% + 25% + 50% (Oletus) + 75% + 100% + + + diff --git a/DeviceSettings/res/values-fi/strings.xml b/DeviceSettings/res/values-fi/strings.xml index 188371d..88e234a 100644 --- a/DeviceSettings/res/values-fi/strings.xml +++ b/DeviceSettings/res/values-fi/strings.xml @@ -1,6 +1,6 @@ - Galaxy Note-asetukset + Galaxy S II-asetukset Värit Näyttö @@ -29,6 +29,11 @@ Ota näppäinvalot käyttöön Valot syttyvät kun näyttö on päällä + Haptinen + Värinä + Värinän voimakkuus + Säädä värinän voimakkuutta + Radio HSPA Ota HSDPA/HSUPA käyttöön diff --git a/DeviceSettings/res/values-fr/arrays.xml b/DeviceSettings/res/values-fr/arrays.xml index 124f531..d421873 100644 --- a/DeviceSettings/res/values-fr/arrays.xml +++ b/DeviceSettings/res/values-fr/arrays.xml @@ -1,36 +1,36 @@ - - Caméra (Par défaut) - Vidéo - Vidéo (chaud) - Video (froid) - UI - Navigation - Gallerie - VT + + Caméra (Par défaut) + Vidéo + Vidéo (chaud) + Video (froid) + UI + Navigation + Gallerie + VT - - Standard (Par défaut) - Dynamique - Naturel - Vidéo + + Standard (Par défaut) + Dynamique + Naturel + Vidéo - - Normal - Inversé + + Normal + Inversé - - Inactif (Par défaut) - Actif + + Inactif (Par défaut) + Actif - 2.2 (Par défaut) - 1.9 + 2.2 (Par défaut) + 1.9 @@ -43,9 +43,9 @@ - UMTS seulement - HSDPA seulement - HSDPA + HSUPA + UMTS seulement + HSDPA seulement + HSDPA + HSUPA diff --git a/DeviceSettings/res/values-fr/strings.xml b/DeviceSettings/res/values-fr/strings.xml index c11f8cf..25dd5ad 100644 --- a/DeviceSettings/res/values-fr/strings.xml +++ b/DeviceSettings/res/values-fr/strings.xml @@ -1,6 +1,6 @@ - Paramètres GalaxyNote + Paramètres Galaxy S II Ecran Couleurs diff --git a/DeviceSettings/res/values-hu/arrays.xml b/DeviceSettings/res/values-hu/arrays.xml index ab52e04..ee1f831 100644 --- a/DeviceSettings/res/values-hu/arrays.xml +++ b/DeviceSettings/res/values-hu/arrays.xml @@ -1,51 +1,51 @@ - - Kamera (Alapbeállítás) - Videó - Videó (Meleg árnyalat) - Videó (Hideg árnyalat) - Felhasználói felület - Navigáció - Galéria - VT - - - - Hagyományos (Alapbeállítás) - Dinamikus - Természetes - Film - - - - Hagyományos - Fordított - - - - Kikapcsolva (Alapbeállítás) - Bekapcsolva - - - - 2.2 (Alapbeállítás) - 1.9 - - - - 10 - 20 - 30 - 50 (Alapbeállítás) - 70 - 100 - - - - UMTS - HSDPA - HSDPA + HSUPA - + + Kamera (Alapbeállítás) + Videó + Videó (Meleg árnyalat) + Videó (Hideg árnyalat) + Felhasználói felület + Navigáció + Galéria + VT + + + + Hagyományos (Alapbeállítás) + Dinamikus + Természetes + Film + + + + Hagyományos + Fordított + + + + Kikapcsolva (Alapbeállítás) + Bekapcsolva + + + + 2.2 (Alapbeállítás) + 1.9 + + + + 10 + 20 + 30 + 50 (Alapbeállítás) + 70 + 100 + + + + UMTS + HSDPA + HSDPA + HSUPA + diff --git a/DeviceSettings/res/values-hu/strings.xml b/DeviceSettings/res/values-hu/strings.xml index 54197e0..d6a5f8c 100644 --- a/DeviceSettings/res/values-hu/strings.xml +++ b/DeviceSettings/res/values-hu/strings.xml @@ -1,6 +1,6 @@ - Galaxy Note Beállítások + Galaxy S II Beállítások Színek Kijelző @@ -17,18 +17,23 @@ Érintőképernyő Érzékenység - Állítsd be az érintőképernyő érzékenységét + Érintőképernyő érzékenységének beállítása Szenzorok Giroszkóp - Használd a kalibrálási értékeket - Használd a kalibrálási értékeket. Készíts kalibrációt ha ezt bepipálod! + Kalibrálási érték használata + Kalibrálási érték használata. Érdemes újra kalibrálni, ha ez a funkció használatban van! Kalibrálás - Tedd a telefont egy vízszintes felületre, és nyomd meg ezt a gombot a kalibráláshoz + Kalibráláshoz a telefont vízszintes felületre kell helyezni, és megérinteni ezt a gombot Érintőgombok Érintőgombok háttérvilágítása Bekapcsolja az érintőgombok háttérvilágítását bekapcsolt képernyőnél + Érintési visszajelzés + Rezgés + Rezgés erőssége + Rezgés erősségének beállítása + GSM rádió HSPA HSDPA/HSUPA engedélyezése diff --git a/DeviceSettings/res/values-nl/arrays.xml b/DeviceSettings/res/values-nl/arrays.xml new file mode 100644 index 0000000..ab28dc7 --- /dev/null +++ b/DeviceSettings/res/values-nl/arrays.xml @@ -0,0 +1,50 @@ + + + Camera (standaard) + Video + Video (warm) + Video (koud) + Uiterlijk + Navigatie + Galerij + VT + + + Standaard + Dynamisch + Natuurlijk + Film + + + Normaal + Omgedraaid + + + Uit (standaard) + Aan + + + 2,2 (standaard) + 1,9 + + + 10 + 20 + 30 + 50 (standaard) + 70 + 100 + + + 0% + 25% + 50% (standaard) + 75% + 100% + + + Alleen UMTS + Alleen HSDPA + HSDPA & HSUPA + + diff --git a/DeviceSettings/res/values-nl/strings.xml b/DeviceSettings/res/values-nl/strings.xml new file mode 100644 index 0000000..bd7e50b --- /dev/null +++ b/DeviceSettings/res/values-nl/strings.xml @@ -0,0 +1,40 @@ + + + Galaxy S II-instellingen + + Kleuren + Scherm + Scenario + mDNIe-scenario instellen + Modus + mDNIe-modus instellen + Negatieve modus + Negatieve kleuren in-/uitschakelen + Buitenmodus + Buitenmodus in-/uitschakelen + Schermgamma + Schermgammawaarden instellen + + Aanraakscherm + Aanraakgevoeligheid + Gevoeligheid aanraakscherm instellen + + Sensoren + Gyroscoop + Kalibratiegegevens gebruiken + Gebruik de kalibratiewaarden van de gyroscoop. Gelieve hierna een kalibratie te doen. + Kalibreren + Plaats de telefoon op een vlakke ondergrond en tik hier om te kalibreren + Aanraakknop + Achtergrondlicht bij knoppen inschakelen + Aanraakknoppen oplichten indien scherm aan is + + Haptisch + Trillen + Trilintensiteit + Trilintensiteit instellen + + Radio + HSPA + HSDPA/HSUPA inschakelen + diff --git a/DeviceSettings/res/values-pt-rBR/arrays.xml b/DeviceSettings/res/values-pt-rBR/arrays.xml index 75c3ac5..e98a6c6 100755 --- a/DeviceSettings/res/values-pt-rBR/arrays.xml +++ b/DeviceSettings/res/values-pt-rBR/arrays.xml @@ -48,4 +48,4 @@ HSDPA + HSUPA - \ No newline at end of file + diff --git a/DeviceSettings/res/values-pt-rBR/strings.xml b/DeviceSettings/res/values-pt-rBR/strings.xml index 5208649..fad81b2 100755 --- a/DeviceSettings/res/values-pt-rBR/strings.xml +++ b/DeviceSettings/res/values-pt-rBR/strings.xml @@ -1,6 +1,6 @@ - Config. Galaxy Note + Config. Galaxy S II Cores Tela Cenário @@ -12,10 +12,10 @@ Modo Ao Ar Livre Ativar/Desativar modo ao ar livre Gama da Tela - Define valor da gama da tela + Definir valor da gama da tela Tela sensível ao toque Sensitividade do toque - Definir a sensitividade do toque na tela + Define a sensitividade do toque na tela Sensores Giroscópio Usar dados de calibração @@ -24,12 +24,12 @@ Coloque seu telefone em uma superfície plana, e pressione isto para calibrar Tecla sensível ao toque Ativar luz de fundo das teclas - Acende as teclas sensíveis ao toque quando a tela estiver ligada + Acender as teclas sensíveis ao toque quando a tela estiver ligada Rádio HSPA Ativar HSDPA/HSUPA Resposta Tátil Vibração - Intesidade da Vibração + Intensidade da Vibração Define a intensidade da vibração \ No newline at end of file diff --git a/DeviceSettings/res/values/arrays.xml b/DeviceSettings/res/values/arrays.xml index e75ee6e..a86899a 100644 --- a/DeviceSettings/res/values/arrays.xml +++ b/DeviceSettings/res/values/arrays.xml @@ -1,59 +1,59 @@ - Camera (Default) - Video - Video Warm - Video Cold - UI - Navigation - Gallery + Camera (Default) + Video + Video Warm + Video Cold + UI + Navigation + Gallery VT - 4 - 1 - 2 - 3 - 0 - 5 - 6 + 4 + 1 + 2 + 3 + 0 + 5 + 6 7 - Standard (Default) - Dynamic + Standard (Default) + Dynamic Natural - Movie + Movie - 1 - 0 + 1 + 0 2 - 3 + 3 - Normal - Inverted + Normal + Inverted 0 - 1 + 1 - Off (Default) - On + Off (Default) + On - 0 - 1 + 0 + 1 @@ -101,13 +101,13 @@ - UMTS Only - HSDPA Only - HSDPA + HSUPA + UMTS Only + HSDPA Only + HSDPA + HSUPA - 21 + 21 22 23 diff --git a/DeviceSettings/res/values/strings.xml b/DeviceSettings/res/values/strings.xml index 5c38440..08ee90c 100644 --- a/DeviceSettings/res/values/strings.xml +++ b/DeviceSettings/res/values/strings.xml @@ -1,6 +1,6 @@ - Galaxy Note Settings + Galaxy S II Settings Colors Screen diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/SensorsFragmentActivity.java b/DeviceSettings/src/com/cyanogenmod/settings/device/SensorsFragmentActivity.java index 015dd7b..bc42a95 100644 --- a/DeviceSettings/src/com/cyanogenmod/settings/device/SensorsFragmentActivity.java +++ b/DeviceSettings/src/com/cyanogenmod/settings/device/SensorsFragmentActivity.java @@ -80,14 +80,15 @@ public class SensorsFragmentActivity extends PreferenceFragment { public static void restore(Context context) { SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); - String gyroCalib = sharedPrefs.getString(DeviceSettings.KEY_USE_GYRO_CALIBRATION, "1"); + boolean gyroCalib = sharedPrefs.getBoolean(DeviceSettings.KEY_USE_GYRO_CALIBRATION, true); // When use gyro calibration value is set to 1, calibration is done at the same time, which // means it is reset at each boot, providing wrong calibration most of the time at each reboot. // So we only set it to "0" if user wants it, as it defaults to 1 at boot - if (gyroCalib.compareTo("1") != 0) - Utils.writeValue(FILE_USE_GYRO_CALIB, gyroCalib); + if (!gyroCalib) + Utils.writeValue(FILE_USE_GYRO_CALIB, "0"); - Utils.writeValue(FILE_TOUCHKEY_LIGHT, sharedPrefs.getString(DeviceSettings.KEY_TOUCHKEY_LIGHT, "1")); + boolean light = sharedPrefs.getBoolean(DeviceSettings.KEY_TOUCHKEY_LIGHT, true); + Utils.writeValue(FILE_TOUCHKEY_LIGHT, light); } } diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/Startup.java b/DeviceSettings/src/com/cyanogenmod/settings/device/Startup.java index 7566273..a3b5135 100644 --- a/DeviceSettings/src/com/cyanogenmod/settings/device/Startup.java +++ b/DeviceSettings/src/com/cyanogenmod/settings/device/Startup.java @@ -31,6 +31,7 @@ public class Startup extends BroadcastReceiver { RadioFragmentActivity.restore(context); HapticFragmentActivity.restore(context); VibratorIntensity.restore(context); + SensorsFragmentActivity.restore(context); } } diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/Utils.java b/DeviceSettings/src/com/cyanogenmod/settings/device/Utils.java index 9d4176c..237ea0f 100644 --- a/DeviceSettings/src/com/cyanogenmod/settings/device/Utils.java +++ b/DeviceSettings/src/com/cyanogenmod/settings/device/Utils.java @@ -16,32 +16,96 @@ package com.cyanogenmod.settings.device; +import android.util.Log; + import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; +import java.io.SyncFailedException; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Context; public class Utils { + private static final String TAG = "GalaxyNoteSettings_Utils"; + private static final String TAG_READ = "GalaxyNoteSettings_Utils_Read"; + private static final String TAG_WRITE = "GalaxyNoteSettings_Utils_Write"; + /** * Write a string value to the specified file. - * @param filename The filename - * @param value The value + * + * @param filename The filename + * @param value The value */ public static void writeValue(String filename, String value) { + FileOutputStream fos = null; try { - FileOutputStream fos = new FileOutputStream(new File(filename)); + fos = new FileOutputStream(new File(filename), false); fos.write(value.getBytes()); fos.flush(); - fos.getFD().sync(); - fos.close(); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); + // fos.getFD().sync(); + } catch (FileNotFoundException ex) { + Log.w(TAG, "file " + filename + " not found: " + ex); + } catch (SyncFailedException ex) { + Log.w(TAG, "file " + filename + " sync failed: " + ex); + } catch (IOException ex) { + Log.w(TAG, "IOException trying to sync " + filename + ": " + ex); + } catch (RuntimeException ex) { + Log.w(TAG, "exception while syncing file: ", ex); + } finally { + if (fos != null) { + try { + Log.w(TAG_WRITE, "file " + filename + ": " + value); + fos.close(); + } catch (IOException ex) { + Log.w(TAG, "IOException while closing synced file: ", ex); + } catch (RuntimeException ex) { + Log.w(TAG, "exception while closing file: ", ex); + } + } + } + + } + + /** + * Write a string value to the specified file. + * + * @param filename The filename + * @param value The value + */ + public static void writeValue(String filename, Boolean value) { + FileOutputStream fos = null; + String sEnvia; + try { + fos = new FileOutputStream(new File(filename), false); + if (value) + sEnvia = "1"; + else + sEnvia = "0"; + fos.write(sEnvia.getBytes()); + fos.flush(); + // fos.getFD().sync(); + } catch (FileNotFoundException ex) { + Log.w(TAG, "file " + filename + " not found: " + ex); + } catch (SyncFailedException ex) { + Log.w(TAG, "file " + filename + " sync failed: " + ex); + } catch (IOException ex) { + Log.w(TAG, "IOException trying to sync " + filename + ": " + ex); + } catch (RuntimeException ex) { + Log.w(TAG, "exception while syncing file: ", ex); + } finally { + if (fos != null) { + try { + Log.w(TAG_WRITE, "file " + filename + ": " + value); + fos.close(); + } catch (IOException ex) { + Log.w(TAG, "IOException while closing synced file: ", ex); + } catch (RuntimeException ex) { + Log.w(TAG, "exception while closing file: ", ex); + } + } } } -- cgit v1.1