From: kiso.chang Date: Sun, 16 Oct 2022 07:02:35 +0000 (+0900) Subject: Fix crash in setting font type X-Git-Tag: accepted/tizen/unified/20221016.171536^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_7.0_unified;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsettings.git Fix crash in setting font type Change-Id: I7377f60805a3c6c3a66ea0ff8aff6366654f72d9 Signed-off-by: kiso.chang --- 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