From 9b8314425718c09bab02e70cc0d2754857a30b21 Mon Sep 17 00:00:00 2001 From: "kiso.chang" Date: Sun, 16 Oct 2022 16:02:35 +0900 Subject: Fix crash in setting font type Change-Id: I7377f60805a3c6c3a66ea0ff8aff6366654f72d9 Signed-off-by: kiso.chang --- SettingMain/SettingContent_Display.cs | 3 ++- SettingMain/SettingContent_Fonttype.cs | 43 ++++++++++--------------------- packaging/org.tizen.cssettings-1.0.0.tpk | Bin 1142335 -> 1142464 bytes 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/SettingMain/SettingContent_Display.cs b/SettingMain/SettingContent_Display.cs index 3ce1589..52ac106 100644 --- a/SettingMain/SettingContent_Display.cs +++ b/SettingMain/SettingContent_Display.cs @@ -144,7 +144,8 @@ namespace SettingMain } - item = SettingItemCreator.CreateItemWithCheck(Resources.IDS_ST_BODY_THEME, SettingContent_Theme.GetThemeName()); + //item = SettingItemCreator.CreateItemWithCheck(Resources.IDS_ST_BODY_THEME, SettingContent_Theme.GetThemeName()); + item = SettingItemCreator.CreateItemWithCheck(Resources.IDS_ST_BODY_THEME); if (item != null) { item.Clicked += (o, e) => diff --git a/SettingMain/SettingContent_Fonttype.cs b/SettingMain/SettingContent_Fonttype.cs index 7a883db..d7c0d14 100644 --- a/SettingMain/SettingContent_Fonttype.cs +++ b/SettingMain/SettingContent_Fonttype.cs @@ -52,35 +52,9 @@ namespace SettingMain { FonttypeList = new ArrayList(); - FonttypeList.Add(SystemSettings.FontType); - -#if false - string sharedData = "/opt/usr/data"; - string type = sharedData + "/settings/Alerts"; - - Tizen.Log.Debug("NUI", String.Format("fonttype type : {0}", type)); - - System.IO.DirectoryInfo d = new System.IO.DirectoryInfo(type); - - int i = 0; - - FileInfo[] wavFiles = d.GetFiles("*.wav"); - foreach (FileInfo file in wavFiles) - { - Tizen.Log.Debug("NUI", String.Format("[{0}] {1}", i, file.Name)); - FonttypeList.Add(type +"/"+ file.Name); - i++; - } - - FileInfo[] mp3Files = d.GetFiles("*.mp3"); - foreach (FileInfo file in mp3Files) - { - Tizen.Log.Debug("NUI", String.Format("[{0}] {1}", i, file.Name)); - FonttypeList.Add(type + "/" + file.Name); - i++; - } -#endif + Tizen.Log.Debug("NUI", "SystemSettings.DefaultFontType : "+ SystemSettings.DefaultFontType); + Tizen.Log.Debug("NUI", "SystemSettings.FontType : " + SystemSettings.FontType); } @@ -178,7 +152,18 @@ namespace SettingMain private static void SetFonttype(string fonttype) { - SystemSettings.FontType = fonttype; + try + { + if (fonttype.Equals("Default")) { + fonttype = SystemSettings.DefaultFontType; + } + SystemSettings.FontType = fonttype; + } + catch (Exception e) + { + Tizen.Log.Debug("NUI", string.Format("error :({0}) {1} ", e.GetType().ToString(), e.Message)); + } + } public static string GetFonttype() diff --git a/packaging/org.tizen.cssettings-1.0.0.tpk b/packaging/org.tizen.cssettings-1.0.0.tpk index d8d9a39..6e3fb57 100644 Binary files a/packaging/org.tizen.cssettings-1.0.0.tpk and b/packaging/org.tizen.cssettings-1.0.0.tpk differ -- cgit v1.2.3