Add Some setting fuctions 77/282477/1
authorkiso.chang <kiso.chang@samsung.com>
Tue, 4 Oct 2022 06:37:52 +0000 (15:37 +0900)
committerkiso.chang <kiso.chang@samsung.com>
Tue, 4 Oct 2022 06:39:42 +0000 (15:39 +0900)
- DateTime, Display, Sound
- Sliders will work next time

Change-Id: Iddec6c88b4fd79a6536f7139c1dc05e164854df6
Signed-off-by: kiso.chang <kiso.chang@samsung.com>
37 files changed:
SettingAppTextResopurces/TextResources/Resources.Designer.cs
SettingAppTextResopurces/TextResources/Resources.en-US.resx
SettingAppTextResopurces/TextResources/Resources.ko-KR.resx
SettingAppTextResopurces/TextResources/Resources.resx
SettingMain/Interop/Interop.Alarm.cs [new file with mode: 0644]
SettingMain/SettingContent_AboutDevice.cs
SettingMain/SettingContent_Base.cs
SettingMain/SettingContent_DateTime.cs
SettingMain/SettingContent_DeviceStatus.cs
SettingMain/SettingContent_Display.cs
SettingMain/SettingContent_DisplayLanguage.cs
SettingMain/SettingContent_Font.cs [new file with mode: 0644]
SettingMain/SettingContent_LanguageInput.cs
SettingMain/SettingContent_NotificationSound.cs [new file with mode: 0644]
SettingMain/SettingContent_ScreenTimeout.cs [new file with mode: 0644]
SettingMain/SettingContent_SetDate.cs [new file with mode: 0644]
SettingMain/SettingContent_SetTime.cs [new file with mode: 0644]
SettingMain/SettingContent_SetTimezone.cs [new file with mode: 0644]
SettingMain/SettingContent_Sound.cs
SettingMain/SettingContent_Soundmode.cs [new file with mode: 0644]
SettingMain/SettingContent_Theme.cs [new file with mode: 0644]
SettingMain/SettingMain.cs
SettingMain/res/icons/brightness_icon/settings_ic_brightness_00.png
SettingMain/res/icons/brightness_icon/settings_ic_brightness_01.png
SettingMain/res/icons/brightness_icon/settings_ic_brightness_02.png
SettingMain/res/icons/brightness_icon/settings_ic_brightness_03.png
SettingMain/res/icons/brightness_icon/settings_ic_brightness_04.png
SettingMain/res/icons/brightness_icon/settings_ic_brightness_05.png
SettingMain/res/icons/brightness_icon/settings_ic_brightness_06.png
SettingMain/res/icons/brightness_icon/settings_ic_brightness_07.png
SettingMain/res/icons/brightness_icon/settings_ic_brightness_08.png
SettingMain/res/icons/brightness_icon/settings_ic_brightness_09.png
SettingMain/res/icons/brightness_icon/settings_ic_brightness_10.png
SettingMain/res/icons/brightness_icon/settings_ic_brightness_11.png
SettingMain/tizen-manifest.xml
SettingView/SettingView.cs
SettingView/SettingViewBorder.cs

index 1068be747b51058cea02a2c866bb4fa6e63d9e75..1ee17fddc8ad4c9e7927a0ad91fb5424890d1f6e 100644 (file)
@@ -2381,6 +2381,24 @@ namespace SettingAppTextResopurces.TextResources {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to Do you want change the date?.\r
+        /// </summary>\r
+        public static string IDS_ST_BODY_DO_YOU_WANT_CHANGE_THE_DATE {\r
+            get {\r
+                return ResourceManager.GetString("IDS_ST_BODY_DO_YOU_WANT_CHANGE_THE_DATE", resourceCulture);\r
+            }\r
+        }\r
+        \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to Do you want change the time?.\r
+        /// </summary>\r
+        public static string IDS_ST_BODY_DO_YOU_WANT_CHANGE_THE_TIME {\r
+            get {\r
+                return ResourceManager.GetString("IDS_ST_BODY_DO_YOU_WANT_CHANGE_THE_TIME", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to Don&apos;t ask again.\r
         /// </summary>\r
@@ -6131,6 +6149,15 @@ namespace SettingAppTextResopurces.TextResources {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to Mute.\r
+        /// </summary>\r
+        public static string IDS_ST_HEADER_MUTE {\r
+            get {\r
+                return ResourceManager.GetString("IDS_ST_HEADER_MUTE", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to Network restriction mode.\r
         /// </summary>\r
@@ -6536,6 +6563,15 @@ namespace SettingAppTextResopurces.TextResources {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to Vibrate.\r
+        /// </summary>\r
+        public static string IDS_ST_HEADER_VIBRATE {\r
+            get {\r
+                return ResourceManager.GetString("IDS_ST_HEADER_VIBRATE", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to Vision.\r
         /// </summary>\r
index 7c6362b3d843d26b028b3573daf2f642a847d1ce..0167c8248cf16694f1951a92d199bd81883c98b7 100644 (file)
   <data name="IDS_ST_BODY_SET_DATE" xml:space="preserve">\r
     <value>Set date</value>\r
   </data>\r
+  <data name="IDS_ST_BODY_DO_YOU_WANT_CHANGE_THE_DATE" xml:space="preserve">\r
+    <value>Do you want change the date?</value>\r
+  </data>\r
   <data name="IDS_ST_BODY_SET_DATE_AND_TIME" xml:space="preserve">\r
     <value>Set date and time</value>\r
   </data>\r
   <data name="IDS_ST_BODY_SET_TIME" xml:space="preserve">\r
     <value>Set time</value>\r
   </data>\r
+  <data name="IDS_ST_BODY_DO_YOU_WANT_CHANGE_THE_TIME" xml:space="preserve">\r
+    <value>Do you want change the time?</value>\r
+  </data>\r
   <data name="IDS_ST_BODY_SHOWS_BATTERY_PERCENTAGE_ON_INDICATOR" xml:space="preserve">\r
     <value>Shows battery percentage on indicator.</value>\r
   </data>\r
index 9c711703f07bbb9f8e09d96408892fc72ff017ec..5ad4aecd527abb241763da18a5fc5810af171355 100644 (file)
   <data name="IDS_ST_BODY_SET_DATE" xml:space="preserve">\r
     <value>날짜 설정</value>\r
   </data>\r
+  <data name="IDS_ST_BODY_DO_YOU_WANT_CHANGE_THE_DATE" xml:space="preserve">\r
+    <value>날짜를 변경할까요?</value>\r
+  </data>\r
   <data name="IDS_ST_BODY_SET_DATE_AND_TIME" xml:space="preserve">\r
     <value>날짜 및 시간 설정</value>\r
   </data>\r
   <data name="IDS_ST_BODY_SET_TIME" xml:space="preserve">\r
     <value>시간 설정</value>\r
   </data>\r
+  <data name="IDS_ST_BODY_DO_YOU_WANT_CHANGE_THE_TIME" xml:space="preserve">\r
+    <value>시간을 변경할까요?</value>\r
+  </data>\r
   <data name="IDS_ST_BODY_SHOWS_BATTERY_PERCENTAGE_ON_INDICATOR" xml:space="preserve">\r
     <value>상태표시줄에 사용 가능한 배터리 용량을 표시합니다.</value>\r
   </data>\r
index 895679e613d9d53bcd6c1e55825372c75faee203..1f1c763301f81b022af9348a6cc110410d0dccd9 100644 (file)
   <data name="IDS_ST_BODY_SET_DATE" xml:space="preserve">\r
     <value>Set date</value>\r
   </data>\r
+  <data name="IDS_ST_BODY_DO_YOU_WANT_CHANGE_THE_DATE" xml:space="preserve">\r
+    <value>Do you want change the date?</value>\r
+  </data>\r
   <data name="IDS_ST_BODY_SET_FONT_AS_PS_Q" xml:space="preserve">\r
     <value>Set font as %s?</value>\r
   </data>\r
   <data name="IDS_ST_BODY_SET_TIME" xml:space="preserve">\r
     <value>Set time</value>\r
   </data>\r
+  <data name="IDS_ST_BODY_DO_YOU_WANT_CHANGE_THE_TIME" xml:space="preserve">\r
+    <value>Do you want change the time?</value>\r
+  </data>\r
   <data name="IDS_ST_BODY_SHOWS_BATTERY_PERCENTAGE_ON_INDICATOR" xml:space="preserve">\r
     <value>Shows battery percentage on indicator.</value>\r
   </data>\r
   <data name="IDS_ST_HEADER_MOTION_UNLOCK" xml:space="preserve">\r
     <value>Motion unlock</value>\r
   </data>\r
+  <data name="IDS_ST_HEADER_MUTE" xml:space="preserve">\r
+    <value>Mute</value>\r
+  </data>\r
   <data name="IDS_ST_HEADER_NETWORK_RESTRICTION_MODE_ABB_JPN" xml:space="preserve">\r
     <value>Network restriction mode</value>\r
   </data>\r
   <data name="IDS_ST_HEADER_USER_SETTINGS_ABB" xml:space="preserve">\r
     <value>User settings</value>\r
   </data>\r
+  <data name="IDS_ST_HEADER_VIBRATE" xml:space="preserve">\r
+    <value>Vibrate</value>\r
+  </data>\r
   <data name="IDS_ST_HEADER_VISION" xml:space="preserve">\r
     <value>Vision</value>\r
   </data>\r
diff --git a/SettingMain/Interop/Interop.Alarm.cs b/SettingMain/Interop/Interop.Alarm.cs
new file mode 100644 (file)
index 0000000..f1193e5
--- /dev/null
@@ -0,0 +1,34 @@
+/*\r
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using static SettingMain.Vconf;\r
+\r
+namespace SettingMain\r
+{\r
+    internal static partial class Interop\r
+    {\r
+        internal static partial class Alarm\r
+        {\r
+            private const string LibraryAlarm = "libalarm.so.0";\r
+\r
+            [DllImport(LibraryAlarm, EntryPoint = "alarmmgr_set_systime64")]\r
+            internal static extern int Alarmmgr_SetSystime(Int64 utc_timestamp);\r
+\r
+        }\r
+    }\r
+}\r
index d8c1e04e76da06894ea3542bb5629ce1b0ddff8a..071218ecd65969e94e8ae464697086b5ca230216 100644 (file)
@@ -46,7 +46,7 @@ namespace SettingMain
                 {\r
                     // Update Widget Content by sending message to add the third page in advance.\r
                     Bundle nextBundle = new Bundle();\r
-                    nextBundle.AddItem("WIDGET_ID", "main@org.tizen.cssettings");\r
+                    nextBundle.AddItem("WIDGET_ID", "certificates@org.tizen.setting-certificates");\r
                     nextBundle.AddItem("WIDGET_WIDTH", window.Size.Width.ToString());\r
                     nextBundle.AddItem("WIDGET_HEIGHT", window.Size.Height.ToString());\r
                     nextBundle.AddItem("WIDGET_PAGE", "CONTENT_PAGE");\r
@@ -64,7 +64,7 @@ namespace SettingMain
                 {\r
                     // Update Widget Content by sending message to push the third page.\r
                     Bundle nextBundle = new Bundle();\r
-                    nextBundle.AddItem("WIDGET_ID", "content_legalinfo@org.tizen.cssettings");\r
+                    nextBundle.AddItem("WIDGET_ID", "legalinfo@org.tizen.cssettings");\r
                     nextBundle.AddItem("WIDGET_WIDTH", window.Size.Width.ToString());\r
                     nextBundle.AddItem("WIDGET_HEIGHT", window.Size.Height.ToString());\r
                     nextBundle.AddItem("WIDGET_PAGE", "CONTENT_PAGE");\r
@@ -140,11 +140,12 @@ namespace SettingMain
             item = CreateItemWithCheck(Resources.IDS_ST_BODY_STATUS, Resources.IDS_ST_BODY_SHOW_NETWORK_STATUS_AND_OTHER_INFORMATION);\r
             if (item != null)\r
             {\r
+\r
                 item.Clicked += (o, e) =>\r
                 {\r
                     // Update Widget Content by sending message to add the third page in advance.\r
                     Bundle nextBundle = new Bundle();\r
-                    nextBundle.AddItem("WIDGET_ID", "content_devicestatus@org.tizen.cssettings");\r
+                    nextBundle.AddItem("WIDGET_ID", "devicestatus@org.tizen.cssettings");\r
                     nextBundle.AddItem("WIDGET_WIDTH", window.Size.Width.ToString());\r
                     nextBundle.AddItem("WIDGET_HEIGHT", window.Size.Height.ToString());\r
                     nextBundle.AddItem("WIDGET_PAGE", "CONTENT_PAGE");\r
@@ -157,9 +158,10 @@ namespace SettingMain
 \r
             return content;\r
         }\r
-\r
     }\r
 \r
+\r
+\r
     class SettingDialog_Rename : Widget\r
     {\r
         protected override void OnCreate(string contentInfo, Window window)\r
index 63cd204e4844fa10b7940a0387157905e50758d8..a88f1d9b6a8d5f553d0d65c066994ede97e454f3 100644 (file)
@@ -11,10 +11,30 @@ namespace SettingMain
 {\r
     abstract class SettingContent_Base : Widget\r
     {\r
+\r
+\r
         protected static readonly string resPath = Tizen.Applications.Application.Current.DirectoryInfo.Resource;\r
         protected const string SETTING_ICON_PATH_CFG = "/icons/";\r
         protected const string SETTING_LIST_ICON_PATH_CFG = "/icons/list_icon/";\r
 \r
+        // Create an Static Text\r
+        protected DefaultLinearItem CreateItemStatic(string text)\r
+        {\r
+            var item = new DefaultLinearItem()\r
+            {\r
+                WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                Text = text,\r
+                IsSelectable = false, // Item should not be remained as selected state.\r
+            };\r
+            \r
+            PropertyMap titleStyle = new PropertyMap();\r
+            titleStyle.Add("weight", new PropertyValue(600));\r
+            item.Label.FontStyle = titleStyle;\r
+\r
+            return item;\r
+        }\r
+\r
+\r
         // Create an list item with checkbox.\r
         protected DefaultLinearItem CreateItemWithCheck(string text, string subText = null, bool icon = false, bool extra = false)\r
         {\r
@@ -57,18 +77,6 @@ namespace SettingMain
             if (extra)\r
             {\r
                 toggle = new Switch();\r
-                toggle.SelectedChanged += (o, e) =>\r
-                {\r
-                    if (e.IsSelected)\r
-                    {\r
-                        Tizen.Log.Debug("NUI", "toggle is selected!\n");\r
-                    }\r
-                    else\r
-                    {\r
-                        Tizen.Log.Debug("NUI", "toggle is unselected!\n");\r
-                    }\r
-                };\r
-                // Extra is placed at the end(right end) of the item.\r
                 item.Extra = toggle;\r
 \r
                 // Do not propagate Pressed/Selected states from item to item.Extra.\r
@@ -188,7 +196,7 @@ namespace SettingMain
             return item;\r
         }\r
 \r
-        protected View CreateSliderItem(string name, string iconpath)\r
+        protected View CreateSliderItem(string name, string iconpath, int levelcout)\r
         {\r
             //Create Linear Layout\r
             LinearLayout linearLayout = new LinearLayout\r
@@ -202,92 +210,62 @@ namespace SettingMain
             item.Name = name;\r
             item.Layout = linearLayout;\r
             {\r
-                var icon = new ImageView(iconpath);\r
-                icon.Size2D = new Size2D(32, 32);\r
-                //icon.CellVerticalAlignment = VerticalAlignmentType.Center;\r
+                var leftpadding = new View()\r
+                {\r
+                    Size2D = new Size2D(10, 5),\r
+                };\r
+                item.Add(leftpadding);\r
+\r
+                if (iconpath != null)\r
+                {\r
+                    var icon = new ImageView(iconpath);\r
+                    icon.Size2D = new Size2D(32, 32);\r
+                    item.Add(icon);\r
+                }\r
 \r
                 var slider = new Slider()\r
                 {\r
-                    //Size2D = new Size2D(500, 50),\r
+                    //WidthResizePolicy = ResizePolicyType.FillToParent,\r
+                    //Size2D = new Size2D(100, 32),\r
                     //Name = Program.ItemContentNameDescription,\r
 \r
-                    TrackThickness = 4,\r
+                    TrackThickness = 5,\r
                     BgTrackColor = new Color(0, 0, 0, 0.1f),\r
                     SlidedTrackColor = new Color(0.05f, 0.63f, 0.9f, 1),\r
                     ThumbSize = new Size(20, 20),\r
 \r
                     Direction = Slider.DirectionType.Horizontal,\r
                     MinValue = 0,\r
-                    MaxValue = 100,\r
+                    MaxValue = levelcout-1,\r
                     CurrentValue = 10,\r
 \r
                 };\r
-                //slider.CellVerticalAlignment = VerticalAlignmentType.Center;\r
-                //slider.LowIndicatorImageURL = resPath + SETTING_ICON_PATH_CFG + "settings_about_device.png.png";\r
-\r
                 slider.ValueChanged += OnValueChanged;\r
                 slider.SlidingStarted += OnSlidingStarted;\r
                 slider.SlidingFinished += OnSlidingFinished;\r
+                item.Add(slider);\r
+\r
+                var rightpadding = new View()\r
+                {\r
+                    Size2D = new Size2D(10, 5),\r
+                };\r
+                item.Add(rightpadding);\r
 \r
 \r
-                item.Add(icon);\r
-                item.Add(slider);\r
             }\r
             return item;\r
         }\r
 \r
         private void OnValueChanged(object sender, SliderValueChangedEventArgs args)\r
         {\r
-#if false\r
-            Slider source = sender as Slider;\r
-            if (source != null)\r
-            {\r
-                if (source == slider_style[0] || source == slider_style[1] || source == slider_style[2] || source == slider_style[3])\r
-                {\r
-                    inforText[1].Text = "currentValue = " + args.CurrentValue;\r
-                }\r
-                else\r
-                {\r
-                    inforText[0].Text = "currentValue = " + args.CurrentValue;\r
-                }\r
-            }\r
-#endif\r
         }\r
 \r
         private void OnSlidingStarted(object sender, SliderSlidingStartedEventArgs args)\r
         {\r
-#if false\r
-            Slider source = sender as Slider;\r
-            if (source != null)\r
-            {\r
-                if (source == slider_style[0] || source == slider_style[1] || source == slider_style[2] || source == slider_style[3])\r
-                {\r
-                    inforText[1].Text = "Started currentValue = " + args.CurrentValue;\r
-                }\r
-                else\r
-                {\r
-                    inforText[0].Text = "Started currentValue = " + args.CurrentValue;\r
-                }\r
-            }\r
-#endif\r
         }\r
 \r
         private void OnSlidingFinished(object sender, SliderSlidingFinishedEventArgs args)\r
         {\r
-#if false\r
-            Slider source = sender as Slider;\r
-            if (source != null)\r
-            {\r
-                if (source == slider_style[0] || source == slider_style[1] || source == slider_style[2] || source == slider_style[3])\r
-                {\r
-                    inforText[1].Text = "Finished currentValue = " + args.CurrentValue;\r
-                }\r
-                else\r
-                {\r
-                    inforText[0].Text = "Finished currentValue = " + args.CurrentValue;\r
-                }\r
-            }\r
-#endif\r
         }\r
 \r
         protected string mTitle;\r
index 41c0fd0f6dac6837bdb472be86373b8126aa71f0..6abb60b82498609a49b416ab47ad1d871c59b426 100644 (file)
@@ -36,19 +36,122 @@ namespace SettingMain
 \r
             DefaultLinearItem item = null;\r
 \r
-            item = base.CreateItemWithCheck(Resources.IDS_ST_MBODY_AUTO_UPDATE, Resources.IDS_ST_HEADER_UNAVAILABLE, false, true);\r
-            content.Add(item);\r
+            bool bAutoupdate = Vconf.GetBool("db/setting/automatic_time_update");\r
+\r
+            item = base.CreateItemWithCheck(Resources.IDS_ST_MBODY_AUTO_UPDATE, null, false, true);\r
+            if (item)\r
+            {\r
+                var toggle = item.Extra as Switch;\r
+                toggle.IsSelected = bAutoupdate;\r
+\r
+\r
+                toggle.SelectedChanged += (o, e) =>\r
+                {\r
+                    if (e.IsSelected)\r
+                    {\r
+                        Vconf.SetBool("db/setting/automatic_time_update", true);\r
+                        Tizen.Log.Debug("NUI", "Auto Update is ON!\n");\r
+                    }\r
+                    else\r
+                    {\r
+                        Vconf.SetBool("db/setting/automatic_time_update", false);\r
+                        Tizen.Log.Debug("NUI", "Auto Update is OFF!\n");\r
+                    }\r
+                };\r
+\r
+                content.Add(item);\r
+            }\r
+\r
+\r
+            item = CreateItemWithCheck(Resources.IDS_ST_BODY_SET_DATE, DateTime.Now.ToShortDateString());\r
+            if (item)\r
+            {\r
+                item.Clicked += (o, e) =>\r
+                {\r
+                    // Update Widget Content by sending message to add the third page in advance.\r
+                    Bundle nextBundle = new Bundle();\r
+                    nextBundle.AddItem("WIDGET_ID", "setdate@org.tizen.cssettings");\r
+                    nextBundle.AddItem("WIDGET_WIDTH", window.Size.Width.ToString());\r
+                    nextBundle.AddItem("WIDGET_HEIGHT", window.Size.Height.ToString());\r
+                    nextBundle.AddItem("WIDGET_PAGE", "CONTENT_PAGE");\r
+                    nextBundle.AddItem("WIDGET_ACTION", "PUSH");\r
+                    String encodedBundle = nextBundle.Encode();\r
+                    SetContentInfo(encodedBundle);\r
+\r
+                };\r
+                content.Add(item);\r
+            }\r
+                    \r
+\r
+\r
 \r
-            item = CreateItemWithCheck(Resources.IDS_ST_BODY_SET_DATE, Resources.IDS_ST_HEADER_UNAVAILABLE);\r
-            content.Add(item);\r
-            item = CreateItemWithCheck(Resources.IDS_ST_BODY_SET_TIME, Resources.IDS_ST_HEADER_UNAVAILABLE);\r
-            content.Add(item);\r
 \r
-            item = CreateItemWithCheck(Resources.IDS_ST_BODY_TIME_ZONE, Resources.IDS_ST_HEADER_UNAVAILABLE);\r
-            content.Add(item);\r
 \r
+            item = CreateItemWithCheck(Resources.IDS_ST_BODY_SET_TIME, DateTime.Now.ToShortTimeString());\r
+            if (item)\r
+            {\r
+                item.Clicked += (o, e) =>\r
+                {\r
+                    // Update Widget Content by sending message to add the third page in advance.\r
+                    Bundle nextBundle = new Bundle();\r
+                    nextBundle.AddItem("WIDGET_ID", "settime@org.tizen.cssettings");\r
+                    nextBundle.AddItem("WIDGET_WIDTH", window.Size.Width.ToString());\r
+                    nextBundle.AddItem("WIDGET_HEIGHT", window.Size.Height.ToString());\r
+                    nextBundle.AddItem("WIDGET_PAGE", "CONTENT_PAGE");\r
+                    nextBundle.AddItem("WIDGET_ACTION", "PUSH");\r
+                    String encodedBundle = nextBundle.Encode();\r
+                    SetContentInfo(encodedBundle);\r
+\r
+                };\r
+                content.Add(item);\r
+            }\r
+\r
+            string strTimezone = SystemSettings.LocaleTimeZone;\r
+            item = CreateItemWithCheck(Resources.IDS_ST_BODY_TIME_ZONE, strTimezone);\r
+            if (item)\r
+            {\r
+#if false\r
+                item.Clicked += (o, e) =>\r
+                {\r
+                    // Update Widget Content by sending message to add the third page in advance.\r
+                    Bundle nextBundle = new Bundle();\r
+                    nextBundle.AddItem("WIDGET_ID", "settimezone@org.tizen.cssettings");\r
+                    nextBundle.AddItem("WIDGET_WIDTH", window.Size.Width.ToString());\r
+                    nextBundle.AddItem("WIDGET_HEIGHT", window.Size.Height.ToString());\r
+                    nextBundle.AddItem("WIDGET_PAGE", "CONTENT_PAGE");\r
+                    nextBundle.AddItem("WIDGET_ACTION", "PUSH");\r
+                    String encodedBundle = nextBundle.Encode();\r
+                    SetContentInfo(encodedBundle);\r
+                };\r
+#endif\r
+                content.Add(item);\r
+            }\r
+\r
+            bool bTime24 = (Vconf.GetInt("db/menu_widget/regionformat_time1224") == 2)? true : false;\r
             item = CreateItemWithCheck(Resources.IDS_ST_MBODY_24_HOUR_CLOCK, Resources.IDS_ST_SBODY_SHOW_THE_TIME_IN_24_HOUR_FORMAT_INSTEAD_OF_12_HOUR_HAM_PM_FORMAT, false, true);\r
-            content.Add(item);\r
+            if (item)\r
+            {\r
+                var toggle = item.Extra as Switch;\r
+                toggle.IsSelected = bTime24;\r
+\r
+\r
+                toggle.SelectedChanged += (o, e) =>\r
+                {\r
+                    if (e.IsSelected)\r
+                    {\r
+                        Vconf.SetInt("db/menu_widget/regionformat_time1224", 2);\r
+                        Tizen.Log.Debug("NUI", "Auto Update is ON!\n");\r
+                    }\r
+                    else\r
+                    {\r
+                        Vconf.SetInt("db/menu_widget/regionformat_time1224", 1);\r
+                        Tizen.Log.Debug("NUI", "Auto Update is OFF!\n");\r
+                    }\r
+                };\r
+\r
+                content.Add(item);\r
+            }\r
+\r
 \r
             return content;\r
         }\r
index 586d6b8824941259ff685e60759c9584a19eec3f..c9764529e6e34f20a8e912e552100c8c6a1836f0 100644 (file)
@@ -8,6 +8,8 @@ using Tizen.Applications;
 using Tizen.System;\r
 \r
 using SettingAppTextResopurces.TextResources;\r
+using Tizen.Telephony;\r
+using Tizen.Network;\r
 \r
 namespace SettingMain\r
 {\r
@@ -50,29 +52,17 @@ namespace SettingMain
 \r
                 Tizen.Telephony.Manager.Deinit();\r
             }\r
-#else\r
-            item = CreateItemWithCheck(Resources.IDS_ST_BODY_PHONE_NUMBER, Resources.IDS_ST_HEADER_UNAVAILABLE);\r
-            content.Add(item);\r
-            item = CreateItemWithCheck(Resources.IDS_ST_BODY_IMEI, Resources.IDS_ST_HEADER_UNAVAILABLE);\r
-            content.Add(item);\r
-\r
 #endif\r
 \r
 \r
 #if false\r
             item = CreateItemWithCheck(Resources.IDS_ST_MBODY_BLUETOOTH_ADDRESS, Tizen.Network.Bluetooth.BluetoothAdapter.Address);\r
             content.Add(item);\r
-#else\r
-            item = CreateItemWithCheck(Resources.IDS_ST_MBODY_BLUETOOTH_ADDRESS, Resources.IDS_ST_HEADER_UNAVAILABLE);\r
-            content.Add(item);\r
 #endif\r
 \r
 #if false\r
             item = CreateItemWithCheck(Resources.IDS_ST_BODY_WI_FI_MAC_ADDRESS, Tizen.Network.WiFi.WiFiManager.MacAddress);\r
             content.Add(item);\r
-#else\r
-            item = CreateItemWithCheck(Resources.IDS_ST_BODY_WI_FI_MAC_ADDRESS, Resources.IDS_ST_HEADER_UNAVAILABLE);\r
-            content.Add(item);\r
 #endif\r
             IEnumerator<Storage> storages = StorageManager.Storages.GetEnumerator();\r
             ulong total = 0, available = 0;\r
@@ -83,7 +73,7 @@ namespace SettingMain
                 available += storage.AvailableSpace;\r
             }\r
             item = CreateItemWithCheck(Resources.IDS_ST_BODY_STORAGE,\r
-                String.Format("{0:0.0}GB available (Total {1:0.0}GB)", (double)(available / 1000000000.0), (double)(total / 1000000000.0)));\r
+            String.Format("{0:0.0}GB available (Total {1:0.0}GB)", (double)(available / 1000000000.0), (double)(total / 1000000000.0)));\r
             content.Add(item);\r
 \r
 \r
index 204703bc2a1b9e312bfcb0109a9635eb8f854b0e..1d96593c5989135f709d06d5a6e5d756eb9eb134 100644 (file)
@@ -77,18 +77,70 @@ namespace SettingMain
 \r
             item = CreateItemWithCheck(Resources.IDS_ST_BODY_BRIGHTNESS_M_POWER_SAVING);\r
             content.Add(item);\r
-            var slideritem = CreateSliderItem("BRIGHTNESS", iconpath);\r
+            var slideritem = CreateSliderItem("BRIGHTNESS", iconpath, 100);\r
             content.Add(slideritem);\r
 \r
 \r
-            item = CreateItemWithCheck(Resources.IDS_ST_BODY_FONT, Resources.IDS_ST_HEADER_UNAVAILABLE);\r
-            content.Add(item);\r
 \r
-            item = CreateItemWithCheck(Resources.IDS_ST_BODY_SCREEN_TIMEOUT_ABB2, Resources.IDS_ST_HEADER_UNAVAILABLE);\r
-            content.Add(item);\r
+            SystemSettingsFontSize fontSize = SystemSettings.FontSize;\r
+            string fontType = SystemSettings.FontType;\r
 \r
-            item = CreateItemWithCheck(Resources.IDS_ST_BODY_THEME, Resources.IDS_ST_HEADER_UNAVAILABLE);\r
-            content.Add(item);\r
+            item = CreateItemWithCheck(Resources.IDS_ST_BODY_FONT, fontSize.ToString() + ", " + fontType);\r
+            if (item)\r
+            {\r
+                item.Clicked += (o, e) =>\r
+                {\r
+                    // Update Widget Content by sending message to add the third page in advance.\r
+                    Bundle nextBundle = new Bundle();\r
+                    nextBundle.AddItem("WIDGET_ID", "font@org.tizen.cssettings");\r
+                    nextBundle.AddItem("WIDGET_WIDTH", window.Size.Width.ToString());\r
+                    nextBundle.AddItem("WIDGET_HEIGHT", window.Size.Height.ToString());\r
+                    nextBundle.AddItem("WIDGET_PAGE", "CONTENT_PAGE");\r
+                    nextBundle.AddItem("WIDGET_ACTION", "PUSH");\r
+                    String encodedBundle = nextBundle.Encode();\r
+                    SetContentInfo(encodedBundle);\r
+\r
+                };\r
+                content.Add(item);\r
+            }\r
+\r
+\r
+            item = CreateItemWithCheck(Resources.IDS_ST_BODY_SCREEN_TIMEOUT_ABB2, SettingContent_ScreenTimeout.GetScreenTimeoutName());\r
+            if (item != null)\r
+            {\r
+                item.Clicked += (o, e) =>\r
+                {\r
+                    // Update Widget Content by sending message to add the third page in advance.\r
+                    Bundle nextBundle = new Bundle();\r
+                    nextBundle.AddItem("WIDGET_ID", "timeout@org.tizen.cssettings");\r
+                    nextBundle.AddItem("WIDGET_WIDTH", window.Size.Width.ToString());\r
+                    nextBundle.AddItem("WIDGET_HEIGHT", window.Size.Height.ToString());\r
+                    nextBundle.AddItem("WIDGET_PAGE", "CONTENT_PAGE");\r
+                    nextBundle.AddItem("WIDGET_ACTION", "PUSH");\r
+                    String encodedBundle = nextBundle.Encode();\r
+                    SetContentInfo(encodedBundle);\r
+                };\r
+                content.Add(item);\r
+            }\r
+\r
+\r
+            item = CreateItemWithCheck(Resources.IDS_ST_BODY_THEME, SettingContent_Theme.GetThemeName());\r
+            if (item != null)\r
+            {\r
+                item.Clicked += (o, e) =>\r
+                {\r
+                    // Update Widget Content by sending message to add the third page in advance.\r
+                    Bundle nextBundle = new Bundle();\r
+                    nextBundle.AddItem("WIDGET_ID", "theme@org.tizen.cssettings");\r
+                    nextBundle.AddItem("WIDGET_WIDTH", window.Size.Width.ToString());\r
+                    nextBundle.AddItem("WIDGET_HEIGHT", window.Size.Height.ToString());\r
+                    nextBundle.AddItem("WIDGET_PAGE", "CONTENT_PAGE");\r
+                    nextBundle.AddItem("WIDGET_ACTION", "PUSH");\r
+                    String encodedBundle = nextBundle.Encode();\r
+                    SetContentInfo(encodedBundle);\r
+                };\r
+                content.Add(item);\r
+            }\r
 \r
             return content;\r
         }\r
index d4fe91c538fc18c05a52647a88ab83e9d2752207..da63ff1443016e11bd3df56fbcaed23f1b6a2af1 100644 (file)
@@ -4,7 +4,7 @@ using Tizen.NUI;
 using Tizen.NUI.BaseComponents;\r
 using Tizen.NUI.Components;\r
 using Tizen.Applications;\r
-\r
+using System.Collections.ObjectModel;\r
 using Tizen.System;\r
 \r
 using SettingAppTextResopurces.TextResources;\r
@@ -50,44 +50,228 @@ namespace SettingMain
 \r
     class SettingContent_DisplayLanguage : SettingContent_Base\r
     {\r
-        private static readonly DisplayLanguageInfo[] LanguageList = \r
+        private static readonly DisplayLanguageInfo[] LanguageList =\r
         {\r
             new DisplayLanguageInfo("en_US", "English (United States)", "English(US)", "310,311,313,316"),\r
             new DisplayLanguageInfo("ko_KR", "한국어", "Korean", "450")\r
         };\r
 \r
+        private string[] PickerItems;\r
         public SettingContent_DisplayLanguage()\r
             : base()\r
         {\r
-            mTitle = Resources.IDS_ST_HEADER_DISPLAY_LANGUAGE;\r
+\r
+\r
+            mTitle = Resources.IDS_ST_BUTTON_BACK;\r
+\r
+            PickerItems = new string[LanguageList.Length];\r
+            for (int i = 0; i < LanguageList.Length; i++)\r
+            {\r
+                PickerItems[i] = LanguageList[i].GetName();\r
+            }\r
         }\r
 \r
         protected override View CreateContent(Window window)\r
         {\r
-            // Content of the page which scrolls items vertically.\r
-            var content = new ScrollableBase()\r
+            var picker = new Picker()\r
             {\r
+                //WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                //HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                //                Size = new Size(100, 200),\r
+            };\r
+\r
+            ReadOnlyCollection<string> rc = new ReadOnlyCollection<string>(PickerItems);\r
+            picker.DisplayedValues = rc;\r
+            picker.MinValue = 0;\r
+            picker.MaxValue = PickerItems.Length - 1;\r
+            Tizen.Log.Debug("NUI", "DisplayedValues : " + picker.DisplayedValues);\r
+\r
+            var button = new Button()\r
+            {\r
+                // WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                // HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Text = Resources.IDS_ST_BUTTON_OK\r
+            };\r
+            button.Clicked += (bo, be) =>\r
+            {\r
+\r
+                Tizen.Log.Debug("NUI", String.Format("current : {0}", PickerItems[picker.CurrentValue]));\r
+\r
+                SetDisplayLanguage(picker.CurrentValue);\r
+\r
+                // Update Widget Content by sending message to pop the fourth page.\r
+                Bundle nextBundle2 = new Bundle();\r
+                nextBundle2.AddItem("WIDGET_ACTION", "POP");\r
+                String encodedBundle2 = nextBundle2.Encode();\r
+                SetContentInfo(encodedBundle2);\r
+            };\r
+\r
+\r
+            var content = new View()\r
+            {\r
+\r
                 WidthSpecification = LayoutParamPolicies.MatchParent,\r
                 HeightSpecification = LayoutParamPolicies.MatchParent,\r
-                ScrollingDirection = ScrollableBase.Direction.Vertical,\r
-                HideScrollbar = false,\r
                 Layout = new LinearLayout()\r
                 {\r
+                    HorizontalAlignment = HorizontalAlignment.Center,\r
                     LinearOrientation = LinearLayout.Orientation.Vertical,\r
                 },\r
             };\r
+            content.Add(new TextLabel(Resources.IDS_ST_HEADER_DISPLAY_LANGUAGE));\r
+            content.Add(picker);\r
+            content.Add(button);\r
+\r
+            return content;\r
+        }\r
+\r
+        void SetDisplayLanguage(int index)\r
+        {\r
+            /* [control] set automatic - TRUE */\r
+            Vconf.SetBool("db/setting/lang_automatic", false);\r
 \r
-            DefaultLinearItem item = null;\r
+            string locale = LanguageList[index].GetLocale();\r
+            \r
 \r
-            foreach (var lang in LanguageList) \r
+            /* [control] set vconf language */\r
+            // system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, pnode->locale);\r
+            //system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, pnode->locale);\r
+            SystemSettings.LocaleLanguage = locale;\r
+            //elm_language_set(temp);\r
+            string temp = locale + ".UTF-8";\r
+            // To-do : NUI setting corresponding to elm_language_set(temp);\r
+\r
+            bool region_automatic = Vconf.GetBool("db/setting/region_automatic");\r
+            if (region_automatic)\r
             {\r
-                item = CreateItemWithCheck(lang.GetName());\r
-                content.Add(item);\r
+                /* [control] region format set - if 'automatic region' */\r
+                SystemSettings.LocaleCountry = locale;\r
 \r
+                SetDateFormat(locale);\r
             }\r
 \r
-            return content;\r
+\r
+            /* 2. GET SELECTED LANG */\r
+            String paLanguage = Vconf.GetString("db/menu_widget/language");\r
+            String[] qStrings = paLanguage.Split('.');\r
+            string qString = qStrings[0];\r
+            Tizen.Log.Debug("NUI", String.Format("{0} -> {1}", paLanguage, qString));\r
+\r
+\r
+            /* 3. SET DEFAULT */\r
+            /* default UI language */\r
+            // i18n_ulocale_set_default(qString);\r
+            // To-do : NUI setting corresponding to i18n_ulocale_set_default();\r
+\r
+            SetDateFormat(qString);\r
+\r
+\r
+            paLanguage = Vconf.GetString("db/menu_widget/language");\r
+            SystemSettings.LocaleCountry = paLanguage;\r
+\r
         }\r
 \r
+\r
+\r
+        private static void SetDateFormat(string region)\r
+        {\r
+#if false\r
+            SettingLaIData *ad = (SettingLaIData *)data;\r
+            char *ret_str = NULL;\r
+            i18n_uchar *uret = NULL;\r
+            i18n_uchar customSkeleton[SETTING_STR_SLP_LEN] = { 0, };\r
+            i18n_uchar bestPattern[SETTING_STR_SLP_LEN] = { 0, };\r
+            char bestPatternString[SETTING_STR_SLP_LEN] = { 0, };\r
+            char *skeleton = DATA_FORMAT_SKELETON;\r
+            int i = 0;\r
+            int j = 0;\r
+            int32_t bestPatternCapacity;\r
+            int len;\r
+            char region_format[4] = { 0, };\r
+            int ymd[3] = { 0, };\r
+            char *date_format_str[DATA_FORMAT_CATEGORY_NUM] = {"dMy","Mdy","yMd","ydM" };\r
+            int err = SETTING_RETURN_SUCCESS;\r
+\r
+            uret = i18n_ustring_copy_ua_n(customSkeleton, skeleton, safeStrLen(skeleton));\r
+            setting_retvm_if(!uret, SETTING_RETURN_FAIL, "i18n_ustring_copy_ua_n is fail");\r
+\r
+            if (ad->pattern_generator == NULL || safeStrCmp(region, ad->prev_locale) != 0) {\r
+                if (ad->pattern_generator != NULL) {\r
+                    i18n_udatepg_destroy(ad->pattern_generator);\r
+                    ad->pattern_generator = NULL;\r
+                }\r
+\r
+                i18n_udatepg_create(region, ad->pattern_generator);\r
+            }\r
+\r
+            bestPatternCapacity = (int32_t) (sizeof(bestPattern) / sizeof((bestPattern)[0]));\r
+            int32_t best_pattern_len;\r
+            (void)i18n_udatepg_get_best_pattern(ad->pattern_generator, customSkeleton, i18n_ustring_get_length(customSkeleton), bestPattern, bestPatternCapacity, &best_pattern_len);\r
+\r
+            ret_str = i18n_ustring_copy_au(bestPatternString, bestPattern);\r
+            setting_retvm_if(!ret_str, SETTING_RETURN_FAIL, "i18n_ustring_copy_au is fail");\r
+\r
+            len = safeStrLen(bestPatternString);\r
+            /* only save 'y', 'M', 'd' charactor */\r
+            for (; i < len; i++) {\r
+                if (bestPatternString[i] == 'y' && ymd[0] == 0) {\r
+                    region_format[j++] = bestPatternString[i];\r
+                    ymd[0] = 1;\r
+                } else if (bestPatternString[i] == 'M' && ymd[1] == 0) {\r
+                    region_format[j++] = bestPatternString[i];\r
+                    ymd[1] = 1;\r
+                } else if (bestPatternString[i] == 'd' && ymd[2] == 0) {\r
+                    region_format[j++] = bestPatternString[i];\r
+                    ymd[2] = 1;\r
+                }\r
+            }\r
+\r
+            region_format[3] = '\0';\r
+\r
+            /* default is "Mdy" */\r
+            int date_format_vconf_value = DATA_FORMAT_DEFAULT;\r
+            for (i = 0; i < DATA_FORMAT_CATEGORY_NUM; i++) {\r
+                if (!safeStrCmp(region_format, date_format_str[i]))\r
+                    date_format_vconf_value = i;\r
+            }\r
+\r
+            /* if region_format is null, should be set as default */\r
+            if (isEmptyStr(region_format) || isSpaceStr(region_format))\r
+                date_format_vconf_value = 1;\r
+\r
+            SETTING_TRACE("bestPatternString : %s, format: %s, index: %d", bestPatternString, region_format, date_format_vconf_value);\r
+\r
+            setting_set_int_slp_key(INT_SLP_SETTING_DATE_FORMAT, date_format_vconf_value, &err);\r
+            retv_if(err == SETTING_RETURN_FAIL, SETTING_RETURN_FAIL);\r
+\r
+            G_FREE(ad->prev_locale);\r
+            ad->prev_locale = (char *)g_strdup(region);\r
+#endif\r
+        }\r
+\r
+        public static string GetDisplayLanguageName()\r
+        {\r
+            string title = "N/A";\r
+\r
+\r
+            bool lang_automatic = Vconf.GetBool("db/setting/lang_automatic");\r
+            if (lang_automatic)\r
+            {\r
+                return Resources.IDS_ST_BODY_ANSWERINGMODE_AUTOMATIC;\r
+            }\r
+\r
+            string locale = Vconf.GetString("db/menu_widget/language");\r
+            String[] qStrings = locale.Split('.');\r
+            locale = qStrings[0];\r
+\r
+            foreach (DisplayLanguageInfo item in LanguageList)\r
+            {\r
+                if (locale == item.GetLocale())\r
+                    return item.GetName();\r
+            }\r
+\r
+            return title;\r
+        }\r
     }\r
 }\r
+\r
diff --git a/SettingMain/SettingContent_Font.cs b/SettingMain/SettingContent_Font.cs
new file mode 100644 (file)
index 0000000..31b4dd0
--- /dev/null
@@ -0,0 +1,79 @@
+using System;\r
+using System.Collections.Generic; // for Dictionary\r
+using Tizen.NUI;\r
+using Tizen.NUI.BaseComponents;\r
+using Tizen.NUI.Components;\r
+using Tizen.Applications;\r
+\r
+using Tizen.System;\r
+\r
+using SettingAppTextResopurces.TextResources;\r
+\r
+namespace SettingMain\r
+{\r
+    class SettingContent_Font : SettingContent_Base\r
+    {\r
+        public SettingContent_Font()\r
+            : base()\r
+        {\r
+            mTitle = Resources.IDS_ST_BODY_FONT;\r
+        }\r
+\r
+        protected override View CreateContent(Window window)\r
+        {\r
+            // Content of the page which scrolls items vertically.\r
+            var content = new ScrollableBase()\r
+            {\r
+                WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                ScrollingDirection = ScrollableBase.Direction.Vertical,\r
+\r
+                HideScrollbar = false,\r
+                Layout = new LinearLayout()\r
+                {\r
+                    LinearOrientation = LinearLayout.Orientation.Vertical,\r
+                },\r
+            };\r
+\r
+\r
+            SystemSettingsFontSize fontSize = SystemSettings.FontSize;\r
+            Tizen.Log.Debug("NUI", "font size : " + fontSize.ToString());\r
+                \r
+            string fontType = SystemSettings.FontType;\r
+            Tizen.Log.Debug("NUI", "font type : " + fontType);\r
+\r
+\r
+            DefaultLinearItem item = null;\r
+\r
+            item = CreateItemStatic(Resources.IDS_ST_BODY_SIZE);\r
+            content.Add(item);\r
+            var slideritem = CreateSliderItem("BRIGHTNESS", null, 5);\r
+\r
+            content.Add(slideritem);\r
+\r
+\r
+            item = CreateItemStatic(Resources.IDS_ST_BODY_TYPE);\r
+            content.Add(item);\r
+\r
+\r
+            RadioButtonGroup radiogroup = new RadioButtonGroup();\r
+            RadioButtonGroup.SetIsGroupHolder(content, true);\r
+\r
+            RadioButton radioButton = null;\r
+            \r
+            radioButton = new RadioButton()\r
+            {\r
+                WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                Text = fontType,\r
+                IsSelected = true,\r
+            };\r
+            radiogroup.Add(radioButton);\r
+            content.Add(radioButton);\r
+\r
+\r
+            return content;\r
+        }\r
+\r
+\r
+    }\r
+}\r
index 35a5fd03c81280daff9e3a99ca891ba7e1ad008e..ae6f26ffd80231d7432159331516a082c317c1f7 100644 (file)
@@ -36,7 +36,7 @@ namespace SettingMain
 \r
             DefaultLinearItem item = null;\r
 \r
-            item = CreateItemWithCheck(Resources.IDS_ST_HEADER_DISPLAY_LANGUAGE, Resources.IDS_ST_HEADER_UNAVAILABLE);\r
+            item = CreateItemWithCheck(Resources.IDS_ST_HEADER_DISPLAY_LANGUAGE, SettingContent_DisplayLanguage.GetDisplayLanguageName());\r
             if (item != null)\r
             {\r
                 item.Clicked += (o, e) =>\r
diff --git a/SettingMain/SettingContent_NotificationSound.cs b/SettingMain/SettingContent_NotificationSound.cs
new file mode 100644 (file)
index 0000000..39b6803
--- /dev/null
@@ -0,0 +1,182 @@
+using System;\r
+using System.IO;\r
+using System.Collections;\r
+using Tizen.NUI;\r
+using Tizen.NUI.BaseComponents;\r
+using Tizen.NUI.Components;\r
+using Tizen.Applications;\r
+using System.Collections.ObjectModel;\r
+using Tizen.System;\r
+\r
+using SettingAppTextResopurces.TextResources;\r
+\r
+namespace SettingMain\r
+{\r
+\r
+    \r
+\r
+    class SettingContent_NotificationSound : SettingContent_Base\r
+    {\r
+\r
+        static public string GetFileName(string value)\r
+        {\r
+            String[] folders = value.Split('/');\r
+            int foldercount = folders.Length;\r
+            if (foldercount > 0) return folders[foldercount - 1];\r
+            return value;\r
+        }\r
+\r
+\r
+        private static ArrayList SoundList = null;\r
+\r
+\r
+\r
+        private static void MakeSoundList() \r
+        {\r
+            SoundList = new ArrayList();\r
+\r
+\r
+            string sharedData = "/opt/usr/data";\r
+            string path = sharedData + "/settings/Alerts";\r
+\r
+            Tizen.Log.Debug("NUI", String.Format("sound path : {0}", path));\r
+\r
+            System.IO.DirectoryInfo d = new System.IO.DirectoryInfo(path);\r
+\r
+            int i = 0;\r
+\r
+            FileInfo[] wavFiles = d.GetFiles("*.wav");\r
+            foreach (FileInfo file in wavFiles)\r
+            {\r
+                Tizen.Log.Debug("NUI", String.Format("[{0}] {1}", i, file.Name));\r
+                SoundList.Add(path +"/"+ file.Name);\r
+                i++;\r
+            }\r
+\r
+            FileInfo[] mp3Files = d.GetFiles("*.mp3");\r
+            foreach (FileInfo file in mp3Files)\r
+            {\r
+                Tizen.Log.Debug("NUI", String.Format("[{0}] {1}", i, file.Name));\r
+                SoundList.Add(path + "/" + file.Name);\r
+                i++;\r
+            }\r
+\r
+            \r
+        }\r
+\r
+\r
+        private string[] PickerItems;\r
+        public SettingContent_NotificationSound()\r
+            : base()\r
+        {\r
+            mTitle = Resources.IDS_ST_BUTTON_BACK;\r
+\r
+            // Init data list\r
+            MakeSoundList();\r
+            // Make menu list\r
+            PickerItems = new string[SoundList.Count];\r
+            for (int i = 0; i < SoundList.Count; i++)\r
+            {\r
+                string path = SoundList[i] as string;\r
+                PickerItems[i] = GetFileName(path);\r
+            }\r
+        }\r
+\r
+        protected override View CreateContent(Window window)\r
+        {\r
+            var picker = new Picker()\r
+            {\r
+                // WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                // HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                // Size = new Size(100, 200),\r
+            };\r
+\r
+            ReadOnlyCollection<string> rc = new ReadOnlyCollection<string>(PickerItems);\r
+            picker.DisplayedValues = rc;\r
+            picker.MinValue = 0;\r
+            picker.MaxValue = PickerItems.Length - 1;\r
+            picker.CurrentValue = GetNotificationSoundIndex();\r
+            Tizen.Log.Debug("NUI", "DisplayedValues : " + picker.DisplayedValues);\r
+\r
+            var button = new Button()\r
+            {\r
+                // WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                // HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Text = Resources.IDS_ST_BUTTON_OK\r
+            };\r
+            button.Clicked += (bo, be) =>\r
+            {\r
+\r
+                Tizen.Log.Debug("NUI", String.Format("current : {0}", PickerItems[picker.CurrentValue]));\r
+\r
+                SetNotificationSoundIndex(picker.CurrentValue);\r
+\r
+                // Update Widget Content by sending message to pop the fourth page.\r
+                Bundle nextBundle2 = new Bundle();\r
+                nextBundle2.AddItem("WIDGET_ACTION", "POP");\r
+                String encodedBundle2 = nextBundle2.Encode();\r
+                SetContentInfo(encodedBundle2);\r
+            };\r
+\r
+\r
+            var content = new View()\r
+            {\r
+\r
+                WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Layout = new LinearLayout()\r
+                {\r
+                    HorizontalAlignment = HorizontalAlignment.Center,\r
+                    LinearOrientation = LinearLayout.Orientation.Vertical,\r
+                },\r
+            };\r
+            content.Add(new TextLabel(Resources.IDS_ST_BODY_NOTIFICATION));\r
+            content.Add(picker);\r
+            content.Add(button);\r
+\r
+            return content;\r
+        }\r
+\r
+\r
+        public static int GetNotificationSoundIndex()\r
+        {\r
+            string sound = GetNotificationSound();\r
+\r
+\r
+            for(int i = 0; i < SoundList.Count; i++) {\r
+                if (sound.Equals(SoundList[i])) {\r
+                    return i;\r
+                }\r
+\r
+            }\r
+\r
+            return -1;\r
+        }\r
+\r
+        private static void SetNotificationSoundIndex(int index)\r
+        {\r
+            string path = SoundList[index] as string;\r
+            SetNotificationSound(path);\r
+        }\r
+\r
+\r
+        private static void SetNotificationSound(string notificationsound)\r
+        {\r
+            Vconf.SetString("db/setting/sound/noti/msg_ringtone_path", notificationsound);\r
+        }\r
+\r
+        public static string GetNotificationSound()\r
+        {\r
+            return Vconf.GetString("db/setting/sound/noti/msg_ringtone_path");\r
+        }\r
+        public static string GetNotificationSoundName()\r
+        {\r
+            string path = GetNotificationSound();\r
+            String[] folders = path.Split('/');\r
+            int foldercount = folders.Length;\r
+            if (foldercount > 0) return folders[foldercount - 1];\r
+            return path;\r
+        }\r
+    }\r
+}\r
+\r
diff --git a/SettingMain/SettingContent_ScreenTimeout.cs b/SettingMain/SettingContent_ScreenTimeout.cs
new file mode 100644 (file)
index 0000000..4a8da68
--- /dev/null
@@ -0,0 +1,186 @@
+using System;\r
+using System.Collections.Generic; // for Dictionary\r
+using Tizen.NUI;\r
+using Tizen.NUI.BaseComponents;\r
+using Tizen.NUI.Components;\r
+using Tizen.Applications;\r
+using System.Collections.ObjectModel;\r
+using Tizen.System;\r
+\r
+using SettingAppTextResopurces.TextResources;\r
+\r
+namespace SettingMain\r
+{\r
+    public class ScreenTimeoutInfo\r
+    {\r
+        private readonly string Name = null;\r
+        private readonly int Value;\r
+\r
+\r
+        public ScreenTimeoutInfo(string name, int value)\r
+        {\r
+            Name = name;\r
+            Value = value;\r
+        }\r
+\r
+\r
+        public string GetName()\r
+        {\r
+            return Name;\r
+        }\r
+\r
+        public int GetValue()\r
+        {\r
+            return Value;\r
+        }\r
+    };\r
+\r
+\r
+    class SettingContent_ScreenTimeout : SettingContent_Base\r
+    {\r
+\r
+        private static readonly ScreenTimeoutInfo[] TimeoutList =\r
+        {\r
+            new ScreenTimeoutInfo(Resources.IDS_ST_BODY_ALWAYS_ON, 0),\r
+            new ScreenTimeoutInfo(Resources.IDS_ST_BODY_15SEC, 15),\r
+            new ScreenTimeoutInfo(Resources.IDS_ST_BODY_30SEC, 30),\r
+            new ScreenTimeoutInfo(Resources.IDS_ST_BODY_1_MINUTE, 60),\r
+            new ScreenTimeoutInfo(Resources.IDS_ST_BODY_2_MINUTES, 120),\r
+            new ScreenTimeoutInfo(Resources.IDS_ST_BODY_5_MINUTES, 300),\r
+            new ScreenTimeoutInfo(Resources.IDS_ST_BODY_10_MINUTES, 600)\r
+        };\r
+\r
+\r
+\r
+        private string[] PickerItems;\r
+        public SettingContent_ScreenTimeout()\r
+            : base()\r
+        {\r
+\r
+\r
+            mTitle = Resources.IDS_ST_BODY_SCREEN_TIMEOUT_ABB2;\r
+\r
+            PickerItems = new string[TimeoutList.Length];\r
+            for (int i = 0; i < TimeoutList.Length; i++)\r
+            {\r
+                PickerItems[i] = TimeoutList[i].GetName();\r
+            }\r
+        }\r
+\r
+        protected override View CreateContent(Window window)\r
+        {\r
+            var picker = new Picker()\r
+            {\r
+                // WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                // HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                // Size = new Size(100, 200),\r
+            };\r
+\r
+            ReadOnlyCollection<string> rc = new ReadOnlyCollection<string>(PickerItems);\r
+            picker.DisplayedValues = rc;\r
+            picker.MinValue = 0;\r
+            picker.MaxValue = PickerItems.Length - 1;\r
+            picker.CurrentValue = GetScreenTimeoutIndex();\r
+            Tizen.Log.Debug("NUI", "DisplayedValues : " + picker.DisplayedValues);\r
+\r
+            var button = new Button()\r
+            {\r
+                // WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                // HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Text = Resources.IDS_ST_BUTTON_OK\r
+            };\r
+            button.Clicked += (bo, be) =>\r
+            {\r
+\r
+                Tizen.Log.Debug("NUI", String.Format("current : {0}", PickerItems[picker.CurrentValue]));\r
+\r
+                SetScreenTimeout(picker.CurrentValue);\r
+\r
+                // Update Widget Content by sending message to pop the fourth page.\r
+                Bundle nextBundle2 = new Bundle();\r
+                nextBundle2.AddItem("WIDGET_ACTION", "POP");\r
+                String encodedBundle2 = nextBundle2.Encode();\r
+                SetContentInfo(encodedBundle2);\r
+            };\r
+\r
+\r
+            var content = new View()\r
+            {\r
+\r
+                WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Layout = new LinearLayout()\r
+                {\r
+                    HorizontalAlignment = HorizontalAlignment.Center,\r
+                    LinearOrientation = LinearLayout.Orientation.Vertical,\r
+                },\r
+            };\r
+            content.Add(new TextLabel(Resources.IDS_ST_BODY_SCREEN_TIMEOUT_ABB2));\r
+            content.Add(picker);\r
+            content.Add(button);\r
+\r
+            return content;\r
+        }\r
+\r
+        void SetScreenTimeout(int index)\r
+        {\r
+            SystemSettings.ScreenBacklightTime = TimeoutList[index].GetValue();\r
+        }\r
+\r
+        public static int GetScreenTimeoutIndex()\r
+        {\r
+            //int value = SystemSettings.ScreenBacklightTime;\r
+            int value = Vconf.GetInt("db/setting/lcd_backlight_normal");\r
+\r
+            Tizen.Log.Debug("NUI", "ScreenTimeout : " + value.ToString());\r
+\r
+            int index = 0;\r
+            if (value < 15)\r
+            {\r
+                value = 0;\r
+                index = 0;\r
+            }\r
+            else if (value >= 15 && value < 30)\r
+            {\r
+                value = 15;\r
+                index = 1;\r
+            }\r
+            else if (value >= 30 && value < 60)\r
+            {\r
+                value = 30;\r
+                index = 2;\r
+            }\r
+            else if (value >= 60 && value < 120)\r
+            {\r
+                value = 60;\r
+                index = 3;\r
+            }\r
+            else if (value >= 120 && value < 300)\r
+            {\r
+                value = 120;\r
+                index = 4;\r
+            }\r
+            else if (value >= 300 && value < 600)\r
+            {\r
+                value = 300;\r
+                index = 5;\r
+            }\r
+            else\r
+            {\r
+                value = 600;\r
+                index = 6;\r
+            }\r
+\r
+            //SystemSettings.ScreenBacklightTime = value;\r
+            Vconf.SetInt("db/setting/lcd_backlight_normal", value);\r
+\r
+            return index;\r
+        }\r
+        public static string GetScreenTimeoutName()\r
+        {\r
+            return TimeoutList[GetScreenTimeoutIndex()].GetName();\r
+\r
+        }\r
+    }\r
+}\r
+\r
diff --git a/SettingMain/SettingContent_SetDate.cs b/SettingMain/SettingContent_SetDate.cs
new file mode 100644 (file)
index 0000000..43d0fe5
--- /dev/null
@@ -0,0 +1,118 @@
+using System;\r
+using System.Collections.Generic; // for Dictionary\r
+using Tizen.NUI;\r
+using Tizen.NUI.BaseComponents;\r
+using Tizen.NUI.Components;\r
+using Tizen.Applications;\r
+\r
+using Tizen.System;\r
+\r
+using SettingAppTextResopurces.TextResources;\r
+\r
+using System.Runtime.InteropServices;\r
+\r
+\r
+\r
+namespace SettingMain\r
+{\r
+    class SettingContent_SetDate : SettingContent_Base\r
+    {\r
+\r
+        public SettingContent_SetDate()\r
+            : base()\r
+        {\r
+            mTitle = Resources.IDS_ST_BUTTON_BACK;\r
+        }\r
+\r
+        protected override View CreateContent(Window window)\r
+        {\r
+            var datepicker = new DatePicker()\r
+            {\r
+                //WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                //HeightSpecification = LayoutParamPolicies.MatchParent,\r
+\r
+                Date = DateTime.Now,\r
+            };\r
+\r
+            var button = new Button()\r
+            {\r
+                // WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                // HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Text = Resources.IDS_ST_BUTTON_OK\r
+            };\r
+            button.Clicked += (bo, be) =>\r
+            {\r
+                DateTime date = datepicker.Date;\r
+                Tizen.Log.Debug("NUI", String.Format("local time : {0}.{1}.{2}", date.Year, date.Month, date.Day));\r
+                DateTime utime = date.ToUniversalTime();\r
+                Tizen.Log.Debug("NUI", String.Format("universal time : {0}.{1}.{2}", utime.Year, utime.Month, utime.Day));\r
+\r
+                var dialog = new AlertDialog()\r
+                {\r
+                    Title = Resources.IDS_ST_BODY_SET_DATE,\r
+                    Message = Resources.IDS_ST_BODY_DO_YOU_WANT_CHANGE_THE_DATE,\r
+                };\r
+\r
+                var buttonCancel = new Button()\r
+                {\r
+                    Text = Resources.IDS_ST_BUTTON_CANCEL,\r
+                };\r
+                buttonCancel.Clicked += (abo, abe) =>\r
+                {\r
+                    // Update Widget Content by sending message to pop the fourth page.\r
+                    Bundle nextBundle2 = new Bundle();\r
+                    nextBundle2.AddItem("WIDGET_ACTION", "POP");\r
+                    String encodedBundle2 = nextBundle2.Encode();\r
+                    SetContentInfo(encodedBundle2);\r
+                };\r
+                var buttonOK = new Button()\r
+                {\r
+                    Text = Resources.IDS_ST_BUTTON_OK,\r
+                };\r
+                buttonOK.Clicked += (abo, abe) =>\r
+                {\r
+                    DateTime setTime = datepicker.Date;\r
+                    DateTime curTime = DateTime.Now;\r
+\r
+                    DateTime ltime = new DateTime(setTime.Year, setTime.Month, setTime.Day, curTime.Hour, curTime.Minute, curTime.Second, curTime.Millisecond);\r
+                    DateTime utime2 = ltime.ToUniversalTime();\r
+\r
+                    \r
+                    DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);\r
+                    TimeSpan delta = utime2 - epoch;\r
+                    \r
+                    Int64 timetick = Convert.ToInt64(delta.TotalSeconds);\r
+\r
+                    Interop.Alarm.Alarmmgr_SetSystime(timetick);\r
+\r
+                    // Update Widget Content by sending message to pop the fourth page.\r
+                    Bundle nextBundle2 = new Bundle();\r
+                    nextBundle2.AddItem("WIDGET_ACTION", "POP");\r
+                    String encodedBundle2 = nextBundle2.Encode();\r
+                    SetContentInfo(encodedBundle2);\r
+                };\r
+\r
+                dialog.Actions = new View[] { buttonCancel, buttonOK };\r
+                window.Add(dialog);\r
+            };\r
+\r
+\r
+            var content = new View()\r
+            {\r
+\r
+                WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Layout = new LinearLayout()\r
+                {\r
+                    HorizontalAlignment = HorizontalAlignment.Center,\r
+                    LinearOrientation = LinearLayout.Orientation.Vertical,\r
+                },\r
+            };\r
+            content.Add(new TextLabel(Resources.IDS_ST_BODY_SET_DATE));\r
+            content.Add(datepicker);\r
+            content.Add(button);\r
+\r
+            return content;\r
+        }\r
+    }\r
+}\r
diff --git a/SettingMain/SettingContent_SetTime.cs b/SettingMain/SettingContent_SetTime.cs
new file mode 100644 (file)
index 0000000..32b471f
--- /dev/null
@@ -0,0 +1,137 @@
+using System;\r
+using System.Collections.Generic; // for Dictionary\r
+using Tizen.NUI;\r
+using Tizen.NUI.BaseComponents;\r
+using Tizen.NUI.Components;\r
+using Tizen.Applications;\r
+\r
+using Tizen.System;\r
+\r
+using SettingAppTextResopurces.TextResources;\r
+\r
+\r
+\r
+using System.Runtime.InteropServices;\r
+\r
+namespace SettingMain\r
+{\r
+    class SettingContent_SetTime : SettingContent_Base\r
+    {\r
+        [StructLayout(LayoutKind.Sequential)]\r
+        public struct SYSTEMTIME\r
+        {\r
+            public short wYear;\r
+            public short wMonth;\r
+            public short wDayOfWeek;\r
+            public short wDay;\r
+            public short wHour;\r
+            public short wMinute;\r
+            public short wSecond;\r
+            public short wMilliseconds;\r
+        }\r
+\r
+        [DllImport("kernel32.dll", SetLastError = true)]\r
+        public static extern bool SetSystemTime(ref SYSTEMTIME st);\r
+\r
+        [DllImport("kernel32.dll", SetLastError = true)]\r
+        public static extern bool SetLocalTime(ref SYSTEMTIME st);\r
+\r
+\r
+        public SettingContent_SetTime()\r
+            : base()\r
+        {\r
+            mTitle = Resources.IDS_ST_BUTTON_BACK;\r
+        }\r
+\r
+        protected override View CreateContent(Window window)\r
+        {\r
+            var timepicker = new TimePicker()\r
+            {\r
+                //WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                //HeightSpecification = LayoutParamPolicies.MatchParent,\r
+\r
+                Time = DateTime.Now,\r
+            };\r
+\r
+            var button = new Button()\r
+            {\r
+                // WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                // HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Text = Resources.IDS_ST_BUTTON_OK\r
+            };\r
+            button.Clicked += (bo, be) =>\r
+            {\r
+                DateTime time = timepicker.Time;\r
+                Tizen.Log.Debug("NUI", String.Format("local time - {0}:{1}:{2}", time.Hour, time.Minute, time.Second));\r
+                DateTime utime = time.ToUniversalTime();\r
+                Tizen.Log.Debug("NUI", String.Format("universal time - {0}:{1}:{2}", utime.Hour, utime.Minute, utime.Second));\r
+\r
+                var dialog = new AlertDialog()\r
+                {\r
+                    Title = Resources.IDS_ST_BODY_SET_TIME,\r
+                    Message = Resources.IDS_ST_BODY_DO_YOU_WANT_CHANGE_THE_TIME,\r
+                };\r
+\r
+                var buttonCancel = new Button()\r
+                {\r
+                    Text = Resources.IDS_ST_BUTTON_CANCEL,\r
+                };\r
+                buttonCancel.Clicked += (abo, abe) =>\r
+                {\r
+                    // Update Widget Content by sending message to pop the fourth page.\r
+                    Bundle nextBundle2 = new Bundle();\r
+                    nextBundle2.AddItem("WIDGET_ACTION", "POP");\r
+                    String encodedBundle2 = nextBundle2.Encode();\r
+                    SetContentInfo(encodedBundle2);\r
+                };\r
+                var buttonOK = new Button()\r
+                {\r
+                    Text = Resources.IDS_ST_BUTTON_OK,\r
+                };\r
+                buttonOK.Clicked += (abo, abe) =>\r
+                {\r
+                    DateTime setTime = timepicker.Time;\r
+                    DateTime curTime = DateTime.Now;\r
+\r
+                    DateTime ltime = new DateTime(curTime.Year, curTime.Month, curTime.Day, setTime.Hour, setTime.Minute, setTime.Second, setTime.Millisecond);\r
+                    DateTime utime2 = ltime.ToUniversalTime();\r
+\r
+\r
+                    DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);\r
+                    TimeSpan delta = utime2 - epoch;\r
+\r
+                    Int64 timetick = Convert.ToInt64(delta.TotalSeconds);\r
+\r
+                    Interop.Alarm.Alarmmgr_SetSystime(timetick);\r
+\r
+                    // Update Widget Content by sending message to pop the fourth page.\r
+                    Bundle nextBundle2 = new Bundle();\r
+                    nextBundle2.AddItem("WIDGET_ACTION", "POP");\r
+                    String encodedBundle2 = nextBundle2.Encode();\r
+                    SetContentInfo(encodedBundle2);\r
+                };\r
+\r
+                dialog.Actions = new View[] { buttonCancel, buttonOK };\r
+                window.Add(dialog);\r
+            };\r
+\r
+\r
+            var content = new View()\r
+            {\r
+\r
+                WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Layout = new LinearLayout()\r
+                {\r
+                    HorizontalAlignment = HorizontalAlignment.Center,\r
+                    LinearOrientation = LinearLayout.Orientation.Vertical,\r
+                },\r
+            };\r
+            content.Add(new TextLabel(Resources.IDS_ST_BODY_SET_TIME));\r
+            content.Add(timepicker);\r
+            content.Add(button);\r
+\r
+            return content;\r
+        }\r
+    }\r
+}\r
diff --git a/SettingMain/SettingContent_SetTimezone.cs b/SettingMain/SettingContent_SetTimezone.cs
new file mode 100644 (file)
index 0000000..14f9ca3
--- /dev/null
@@ -0,0 +1,91 @@
+using System;\r
+using System.Collections.Generic; // for Dictionary\r
+using Tizen.NUI;\r
+using Tizen.NUI.BaseComponents;\r
+using Tizen.NUI.Components;\r
+using Tizen.Applications;\r
+using System.Collections.ObjectModel;\r
+using Tizen.System;\r
+\r
+using SettingAppTextResopurces.TextResources;\r
+\r
+\r
+namespace SettingMain\r
+{\r
+    class SettingContent_SetTimezone : SettingContent_Base\r
+    {\r
+        private string[] PickerItems;\r
+        public SettingContent_SetTimezone()\r
+            : base()\r
+        {\r
+            mTitle = Resources.IDS_ST_BUTTON_BACK;\r
+\r
+            PickerItems = new string[10];\r
+            PickerItems[0] = "Time zone 1";\r
+            PickerItems[1] = "Time zone 2";\r
+            PickerItems[2] = "Time zone 3";\r
+            PickerItems[3] = "Time zone 4";\r
+            PickerItems[4] = "Time zone 5";\r
+            PickerItems[5] = "Time zone 6";\r
+            PickerItems[6] = "Time zone 7";\r
+            PickerItems[7] = "Time zone 8";\r
+            PickerItems[8] = "Time zone 9";\r
+            PickerItems[9] = "Time zone 10";\r
+        }\r
+\r
+        protected override View CreateContent(Window window)\r
+        {\r
+            var picker = new Picker()\r
+            {\r
+                // WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                // HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                // Size = new Size(100, 200),\r
+            };\r
+\r
+            ReadOnlyCollection<string> rc = new ReadOnlyCollection<string>(PickerItems);\r
+            picker.DisplayedValues = rc;\r
+            picker.MinValue = 0;\r
+            picker.MaxValue = PickerItems.Length - 1;\r
+            Tizen.Log.Debug("NUI", "DisplayedValues : " + picker.DisplayedValues);\r
+\r
+            var button = new Button()\r
+            {\r
+                // WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                // HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Text = Resources.IDS_ST_BUTTON_OK\r
+            };\r
+            button.Clicked += (bo, be) =>\r
+            {\r
+                \r
+                Tizen.Log.Debug("NUI", String.Format("current : {0}", PickerItems[picker.CurrentValue]));\r
+\r
+\r
+#if false\r
+                // Update Widget Content by sending message to pop the fourth page.\r
+                Bundle nextBundle2 = new Bundle();\r
+                nextBundle2.AddItem("WIDGET_ACTION", "POP");\r
+                String encodedBundle2 = nextBundle2.Encode();\r
+                SetContentInfo(encodedBundle2);\r
+#endif\r
+            };\r
+\r
+\r
+            var content = new View()\r
+            {\r
+\r
+                WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Layout = new LinearLayout()\r
+                {\r
+                    HorizontalAlignment = HorizontalAlignment.Center,\r
+                    LinearOrientation = LinearLayout.Orientation.Vertical,\r
+                },\r
+            };\r
+            content.Add(new TextLabel(Resources.IDS_ST_BODY_TIME_ZONE));\r
+            content.Add(picker);\r
+            content.Add(button);\r
+\r
+            return content;\r
+        }\r
+    }\r
+}\r
index 53b37464b5aa5e134730ef3a8ce1b28c4183e8ad..1af22da1ff129d42389ef3ac92a7a78614604e6b 100644 (file)
@@ -39,30 +39,62 @@ namespace SettingMain
 \r
 \r
 \r
-            item = CreateItemWithCheck(Resources.IDS_ST_HEADER_SOUND_MODE, Resources.IDS_ST_HEADER_UNAVAILABLE);\r
-            content.Add(item);\r
+            item = CreateItemWithCheck(Resources.IDS_ST_HEADER_SOUND_MODE, SettingContent_Soundmode.GetSoundmodeName());\r
+            if (item != null)\r
+            {\r
+                item.Clicked += (o, e) =>\r
+                {\r
+                    // Update Widget Content by sending message to add the third page in advance.\r
+                    Bundle nextBundle = new Bundle();\r
+                    nextBundle.AddItem("WIDGET_ID", "soundmode@org.tizen.cssettings");\r
+                    nextBundle.AddItem("WIDGET_WIDTH", window.Size.Width.ToString());\r
+                    nextBundle.AddItem("WIDGET_HEIGHT", window.Size.Height.ToString());\r
+                    nextBundle.AddItem("WIDGET_PAGE", "CONTENT_PAGE");\r
+                    nextBundle.AddItem("WIDGET_ACTION", "PUSH");\r
+                    String encodedBundle = nextBundle.Encode();\r
+                    SetContentInfo(encodedBundle);\r
+                };\r
+                content.Add(item);\r
+            }\r
+\r
+\r
+            item = CreateItemWithCheck(Resources.IDS_ST_BODY_NOTIFICATIONS, SettingContent_NotificationSound.GetNotificationSoundName());\r
+            if (item != null)\r
+            {\r
+                item.Clicked += (o, e) =>\r
+                {\r
+                    // Update Widget Content by sending message to add the third page in advance.\r
+                    Bundle nextBundle = new Bundle();\r
+                    nextBundle.AddItem("WIDGET_ID", "notificationsound@org.tizen.cssettings");\r
+                    nextBundle.AddItem("WIDGET_WIDTH", window.Size.Width.ToString());\r
+                    nextBundle.AddItem("WIDGET_HEIGHT", window.Size.Height.ToString());\r
+                    nextBundle.AddItem("WIDGET_PAGE", "CONTENT_PAGE");\r
+                    nextBundle.AddItem("WIDGET_ACTION", "PUSH");\r
+                    String encodedBundle = nextBundle.Encode();\r
+                    SetContentInfo(encodedBundle);\r
+                };\r
+                content.Add(item);\r
+            }\r
+\r
+\r
+            //item = CreateItemWithCheck(Resources.IDS_ST_MBODY_OTHER_SOUNDS);\r
+            //content.Add(item);\r
 \r
-            item = CreateItemWithCheck(Resources.IDS_ST_BODY_NOTIFICATIONS, Resources.IDS_ST_HEADER_UNAVAILABLE);\r
-            content.Add(item);\r
 \r
-            item = CreateItemWithCheck(Resources.IDS_ST_MBODY_OTHER_SOUNDS);\r
-            content.Add(item);\r
 \r
-            \r
-            \r
             item = CreateItemWithCheck(Resources.IDS_ST_BODY_MEDIA);\r
             content.Add(item);\r
-            var slideritem = CreateSliderItem("MEDIA", resPath + SETTING_ICON_PATH_CFG + "sound_slider_icon_default.png");\r
+            var slideritem = CreateSliderItem("MEDIA", resPath + SETTING_ICON_PATH_CFG + "sound_slider_icon_default.png", 100);\r
             content.Add(slideritem);\r
 \r
             item = CreateItemWithCheck(Resources.IDS_ST_BODY_NOTIFICATIONS);\r
             content.Add(item);\r
-            slideritem = CreateSliderItem("MEDIA", resPath + SETTING_ICON_PATH_CFG + "sound_slider_icon_default.png");\r
+            slideritem = CreateSliderItem("MEDIA", resPath + SETTING_ICON_PATH_CFG + "sound_slider_icon_default.png", 100);\r
             content.Add(slideritem);\r
 \r
             item = CreateItemWithCheck(Resources.IDS_ST_BODY_SYSTEM);\r
             content.Add(item);\r
-            slideritem = CreateSliderItem("MEDIA", resPath + SETTING_ICON_PATH_CFG + "sound_slider_icon_default.png");\r
+            slideritem = CreateSliderItem("MEDIA", resPath + SETTING_ICON_PATH_CFG + "sound_slider_icon_default.png", 100);\r
             content.Add(slideritem);\r
 \r
             return content;\r
diff --git a/SettingMain/SettingContent_Soundmode.cs b/SettingMain/SettingContent_Soundmode.cs
new file mode 100644 (file)
index 0000000..d59398b
--- /dev/null
@@ -0,0 +1,207 @@
+using System;\r
+using System.Collections.Generic; // for Dictionary\r
+using Tizen.NUI;\r
+using Tizen.NUI.BaseComponents;\r
+using Tizen.NUI.Components;\r
+using Tizen.Applications;\r
+using System.Collections.ObjectModel;\r
+using Tizen.System;\r
+\r
+using SettingAppTextResopurces.TextResources;\r
+\r
+namespace SettingMain\r
+{\r
+\r
+    \r
+\r
+    class SettingContent_Soundmode : SettingContent_Base\r
+    {\r
+        public enum enumSoundmode\r
+        {\r
+            SOUND_MODE_SOUND,\r
+            SOUND_MODE_VIBRATE,\r
+            SOUND_MODE_MUTE\r
+        };\r
+\r
+        public class SoundmodeInfo\r
+        {\r
+            private readonly string Name = null;\r
+            private readonly enumSoundmode Value;\r
+\r
+\r
+            public SoundmodeInfo(string name, enumSoundmode value)\r
+            {\r
+                Name = name;\r
+                Value = value;\r
+            }\r
+\r
+\r
+            public string GetName()\r
+            {\r
+                return Name;\r
+            }\r
+\r
+            public enumSoundmode GetValue()\r
+            {\r
+                return Value;\r
+            }\r
+        };\r
+\r
+\r
+        private static readonly SoundmodeInfo[] SoundmodeList =\r
+        {\r
+            new SoundmodeInfo(SoundmodeToString(enumSoundmode.SOUND_MODE_SOUND), enumSoundmode.SOUND_MODE_SOUND),\r
+            new SoundmodeInfo(SoundmodeToString(enumSoundmode.SOUND_MODE_MUTE), enumSoundmode.SOUND_MODE_MUTE),\r
+        };\r
+\r
+\r
+\r
+        private string[] PickerItems;\r
+        public SettingContent_Soundmode()\r
+            : base()\r
+        {\r
+\r
+\r
+            mTitle = Resources.IDS_ST_BUTTON_BACK;\r
+\r
+            PickerItems = new string[SoundmodeList.Length];\r
+            for (int i = 0; i < SoundmodeList.Length; i++)\r
+            {\r
+                PickerItems[i] = SoundmodeList[i].GetName();\r
+            }\r
+        }\r
+\r
+        protected override View CreateContent(Window window)\r
+        {\r
+            var picker = new Picker()\r
+            {\r
+                // WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                // HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                // Size = new Size(100, 200),\r
+            };\r
+\r
+            ReadOnlyCollection<string> rc = new ReadOnlyCollection<string>(PickerItems);\r
+            picker.DisplayedValues = rc;\r
+            picker.MinValue = 0;\r
+            picker.MaxValue = PickerItems.Length - 1;\r
+            picker.CurrentValue = GetSoundmodeIndex();\r
+            Tizen.Log.Debug("NUI", "DisplayedValues : " + picker.DisplayedValues);\r
+\r
+            var button = new Button()\r
+            {\r
+                // WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                // HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Text = Resources.IDS_ST_BUTTON_OK\r
+            };\r
+            button.Clicked += (bo, be) =>\r
+            {\r
+\r
+                Tizen.Log.Debug("NUI", String.Format("current : {0}", PickerItems[picker.CurrentValue]));\r
+\r
+                SetSoundmodeIndex(picker.CurrentValue);\r
+\r
+                // Update Widget Content by sending message to pop the fourth page.\r
+                Bundle nextBundle2 = new Bundle();\r
+                nextBundle2.AddItem("WIDGET_ACTION", "POP");\r
+                String encodedBundle2 = nextBundle2.Encode();\r
+                SetContentInfo(encodedBundle2);\r
+            };\r
+\r
+\r
+            var content = new View()\r
+            {\r
+\r
+                WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Layout = new LinearLayout()\r
+                {\r
+                    HorizontalAlignment = HorizontalAlignment.Center,\r
+                    LinearOrientation = LinearLayout.Orientation.Vertical,\r
+                },\r
+            };\r
+            content.Add(new TextLabel(Resources.IDS_ST_HEADER_SOUND_MODE));\r
+            content.Add(picker);\r
+            content.Add(button);\r
+\r
+            return content;\r
+        }\r
+\r
+\r
+        public static int GetSoundmodeIndex()\r
+        {\r
+            enumSoundmode mode = GetSoundmode();\r
+\r
+            if (mode == enumSoundmode.SOUND_MODE_SOUND) \r
+                return 0;\r
+            return 1;\r
+        }\r
+\r
+        private static void SetSoundmodeIndex(int index)\r
+        {\r
+            SetSoundmode(SoundmodeList[index].GetValue());\r
+        }\r
+\r
+\r
+        private static void SetSoundmode(enumSoundmode soundmode)\r
+        {\r
+            bool have_sound = false, have_vibrations = false;\r
+\r
+            switch (soundmode)\r
+            {\r
+                case enumSoundmode.SOUND_MODE_SOUND:\r
+                    have_sound = true;\r
+                    have_vibrations = false;\r
+                    break;\r
+                case enumSoundmode.SOUND_MODE_VIBRATE:\r
+                    have_sound = false;\r
+                    have_vibrations = true;\r
+                    break;\r
+                case enumSoundmode.SOUND_MODE_MUTE:\r
+                    have_sound = false;\r
+                    have_vibrations = false;\r
+                    break;\r
+            };\r
+\r
+            Vconf.SetBool("db/setting/sound/sound_on", have_sound);\r
+            Vconf.SetBool("db/setting/sound/vibration_on", have_vibrations);\r
+        }\r
+\r
+        public static enumSoundmode GetSoundmode()\r
+        {\r
+            bool have_sound = Vconf.GetBool("db/setting/sound/sound_on");\r
+                \r
+                \r
+            bool have_vibrations = Vconf.GetBool("db/setting/sound/vibration_on");\r
+\r
+            if (have_sound)\r
+                return enumSoundmode.SOUND_MODE_SOUND;\r
+            else if (have_vibrations)\r
+                return enumSoundmode.SOUND_MODE_VIBRATE;\r
+            \r
+            return enumSoundmode.SOUND_MODE_MUTE;\r
+        }\r
+        public static string GetSoundmodeName()\r
+        {\r
+            return SoundmodeToString(GetSoundmode());\r
+\r
+        }\r
+\r
+\r
+        public static string SoundmodeToString(enumSoundmode mode)\r
+        {\r
+               switch (mode)\r
+               {\r
+                       case enumSoundmode.SOUND_MODE_SOUND:\r
+                               return Resources.IDS_ST_HEADER_SOUND;\r
+                       case enumSoundmode.SOUND_MODE_VIBRATE:\r
+                               return Resources.IDS_ST_HEADER_VIBRATE;\r
+                       case enumSoundmode.SOUND_MODE_MUTE:\r
+                               return Resources.IDS_ST_HEADER_MUTE;\r
+                       default:\r
+                               return null;\r
+               }\r
+        }\r
+\r
+    }\r
+}\r
+\r
diff --git a/SettingMain/SettingContent_Theme.cs b/SettingMain/SettingContent_Theme.cs
new file mode 100644 (file)
index 0000000..c2744c3
--- /dev/null
@@ -0,0 +1,391 @@
+using System;\r
+using System.Collections.Generic; // for Dictionary\r
+using Tizen.NUI;\r
+using Tizen.NUI.BaseComponents;\r
+using Tizen.NUI.Components;\r
+using Tizen.Applications;\r
+using System.Collections.ObjectModel;\r
+using Tizen.System;\r
+\r
+using SettingAppTextResopurces.TextResources;\r
+\r
+namespace SettingMain\r
+{\r
+    public class ThemeInfo\r
+    {\r
+        private readonly string Name = null;\r
+        private readonly int Value;\r
+\r
+\r
+        public ThemeInfo(string name, int value)\r
+        {\r
+            Name = name;\r
+            Value = value;\r
+        }\r
+\r
+\r
+        public string GetName()\r
+        {\r
+            return Name;\r
+        }\r
+\r
+        public int GetValue()\r
+        {\r
+            return Value;\r
+        }\r
+    };\r
+\r
+\r
+    class SettingContent_Theme : SettingContent_Base\r
+    {\r
+\r
+        private static readonly ThemeInfo[] ThemeList =\r
+        {\r
+            new ThemeInfo("Light theme", 0),\r
+            new ThemeInfo("Dark theme", 1),\r
+        };\r
+\r
+        private string[] PickerItems;\r
+        public SettingContent_Theme()\r
+            : base()\r
+        {\r
+            mTitle = Resources.IDS_ST_BUTTON_BACK;\r
+\r
+            PickerItems = new string[ThemeList.Length];\r
+            for (int i = 0; i < ThemeList.Length; i++)\r
+            {\r
+                PickerItems[i] = ThemeList[i].GetName();\r
+            }\r
+        }\r
+\r
+        protected override View CreateContent(Window window)\r
+        {\r
+            var picker = new Picker()\r
+            {\r
+                // WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                // HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                // Size = new Size(100, 200),\r
+            };\r
+\r
+            ReadOnlyCollection<string> rc = new ReadOnlyCollection<string>(PickerItems);\r
+            picker.DisplayedValues = rc;\r
+            picker.MinValue = 0;\r
+            picker.MaxValue = PickerItems.Length - 1;\r
+            picker.CurrentValue = GetThemeIndex();\r
+            Tizen.Log.Debug("NUI", "DisplayedValues : " + picker.DisplayedValues);\r
+\r
+            var button = new Button()\r
+            {\r
+                // WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                // HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Text = Resources.IDS_ST_BUTTON_OK\r
+            };\r
+            button.Clicked += (bo, be) =>\r
+            {\r
+\r
+                Tizen.Log.Debug("NUI", String.Format("current : {0}", PickerItems[picker.CurrentValue]));\r
+\r
+                SetTheme(picker.CurrentValue);\r
+\r
+                // Update Widget Content by sending message to pop the fourth page.\r
+                Bundle nextBundle2 = new Bundle();\r
+                nextBundle2.AddItem("WIDGET_ACTION", "POP");\r
+                String encodedBundle2 = nextBundle2.Encode();\r
+                SetContentInfo(encodedBundle2);\r
+            };\r
+\r
+\r
+            var content = new View()\r
+            {\r
+\r
+                WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                HeightSpecification = LayoutParamPolicies.MatchParent,\r
+                Layout = new LinearLayout()\r
+                {\r
+                    HorizontalAlignment = HorizontalAlignment.Center,\r
+                    LinearOrientation = LinearLayout.Orientation.Vertical,\r
+                },\r
+            };\r
+            content.Add(new TextLabel(Resources.IDS_ST_BODY_THEME));\r
+            content.Add(picker);\r
+            content.Add(button);\r
+\r
+            return content;\r
+        }\r
+\r
+        void SetTheme(int index)\r
+        {\r
+            SystemSettings.ScreenBacklightTime = ThemeList[index].GetValue();\r
+        }\r
+\r
+        public static int GetThemeIndex()\r
+        {\r
+\r
+//            Tizen.Log.Debug("NUI", "Theme : " + value.ToString());\r
+\r
+            int index = 0;\r
+            return index;\r
+        }\r
+        public static string GetThemeName()\r
+        {\r
+            return ThemeList[GetThemeIndex()].GetName();\r
+\r
+        }\r
+\r
+\r
+\r
+#if false\r
+        static char* get_current_theme_str()\r
+        {\r
+            SETTING_TRACE_BEGIN;\r
+\r
+            if (!setting_display_theme_change_is_supported())\r
+                return (char*)g_strdup(_("IDS_ST_HEADER_UNAVAILABLE"));\r
+\r
+            theme_loader_h tl_handle;\r
+            int result = theme_loader_create(&tl_handle);\r
+            if (result != THEME_MANAGER_ERROR_NONE)\r
+            {\r
+                SETTING_TRACE_ERROR("error %x: theme_loader_create()", result);\r
+                return (char*)g_strdup(_("IDS_ST_HEADER_UNAVAILABLE"));\r
+            }\r
+\r
+            char** ids;\r
+            int count;\r
+            result = theme_loader_query_id(tl_handle, &ids, &count);\r
+            if (result == THEME_MANAGER_ERROR_NONE)\r
+            {\r
+                SETTING_TRACE_DEBUG("ids : %d", count);\r
+                for (int i = 0; i < count; i++)\r
+                {\r
+                    SETTING_TRACE_DEBUG("%d : %s", i, ids[i]);\r
+\r
+                    theme_h t_handle;\r
+                    result = theme_loader_load(tl_handle, ids[i], &t_handle);\r
+                    if (result == THEME_MANAGER_ERROR_NONE)\r
+                    {\r
+                        char* theme_title;\r
+                        result = theme_get_title(t_handle, &theme_title);\r
+                        if (result == THEME_MANAGER_ERROR_NONE)\r
+                        {\r
+                            SETTING_TRACE_DEBUG("%d's title : %s", i, theme_title);\r
+                            free(theme_title);\r
+                        }\r
+                        theme_destroy(t_handle);\r
+                    }\r
+\r
+                    free(ids[i]);\r
+                }\r
+                free(ids);\r
+            }\r
+\r
+            theme_h t_handle;\r
+            result = theme_loader_load_current(tl_handle, &t_handle);\r
+            if (result != THEME_MANAGER_ERROR_NONE)\r
+            {\r
+                if (result == THEME_MANAGER_ERROR_NO_SUCH_THEME)\r
+                {\r
+                    SETTING_TRACE_ERROR("error NO_SUCH_THEME: theme_loader_load_current()");\r
+                    theme_loader_destroy(tl_handle);\r
+                    return (char*)g_strdup("No Such Theme");\r
+                }\r
+\r
+                SETTING_TRACE_ERROR("error : theme_loader_load_current()");\r
+                theme_loader_destroy(tl_handle);\r
+                return (char*)g_strdup(_("IDS_ST_HEADER_UNAVAILABLE"));\r
+            }\r
+\r
+            char* theme_title;\r
+            result = theme_get_title(t_handle, &theme_title);\r
+            if (result != THEME_MANAGER_ERROR_NONE)\r
+            {\r
+                if (result == THEME_MANAGER_ERROR_INVALID_PARAMETER)\r
+                    SETTING_TRACE_ERROR("error INVALID_PARAMETER: theme_get_title()");\r
+                else if (result == THEME_MANAGER_ERROR_OUT_OF_MEMORY)\r
+                    SETTING_TRACE_ERROR("error OUT_OF_MEMORY: theme_get_title()");\r
+                else\r
+                    SETTING_TRACE_ERROR("error : theme_get_title()");\r
+\r
+                theme_destroy(t_handle);\r
+                theme_loader_destroy(tl_handle);\r
+                return (char*)g_strdup(_("IDS_ST_HEADER_UNAVAILABLE"));\r
+            }\r
+\r
+            theme_destroy(t_handle);\r
+            theme_loader_destroy(tl_handle);\r
+\r
+            return theme_title;\r
+        }\r
+#endif\r
+\r
+\r
+\r
+\r
+#if false\r
+\r
+static void __theme_cb(void *data, Evas_Object *obj, void *event_info)\r
+{\r
+       SETTING_TRACE_BEGIN;\r
+\r
+       Elm_Object_Item *item = (Elm_Object_Item *)event_info;\r
+       SettingDisplay *ad = data;\r
+\r
+       ret_if(data == NULL);\r
+       retm_if(event_info == NULL, "Invalid argument: event info is NULL");\r
+\r
+       elm_genlist_item_selected_set(item, 0);\r
+       Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);\r
+\r
+       SETTING_TRACE("clicking item[%s, %s]", _(list_item->keyStr), list_item->sub_desc);\r
+\r
+       theme_loader_h tl_handle;\r
+       int result = theme_loader_create(&tl_handle);\r
+       if(result == THEME_MANAGER_ERROR_NONE) {\r
+\r
+               SETTING_TRACE_DEBUG("call theme_loader_set_current(): %s", list_item->sub_desc);\r
+               result = theme_loader_set_current(tl_handle, list_item->sub_desc);\r
+               if(result != THEME_MANAGER_ERROR_NONE) {\r
+                       SETTING_TRACE_ERROR("error : theme_loader_set_current()");\r
+               }\r
+               theme_loader_destroy(tl_handle);\r
+       }\r
+       else{\r
+               SETTING_TRACE_ERROR("error : theme_loader_create()");\r
+       }\r
+\r
+       if (ad->theme_popup) {\r
+               evas_object_del(ad->theme_popup);\r
+               ad->theme_popup = NULL;\r
+       }\r
+\r
+}\r
+\r
+#endif\r
+\r
+        private static void GetThemeList()\r
+        {\r
+\r
+            //ThemeManager 1;\r
+            \r
+\r
+#if false\r
+            Evas_Object* menu_glist = NULL;\r
+            Evas_Object* rdg = NULL;\r
+\r
+\r
+\r
+            theme_loader_h tl_handle;\r
+            int result = theme_loader_create(&tl_handle);\r
+            if (result != THEME_MANAGER_ERROR_NONE)\r
+            {\r
+                SETTING_TRACE_ERROR("error %x: theme_loader_create()", result);\r
+                return;\r
+            }\r
+\r
+\r
+\r
+            theme_h t_handle;\r
+            char* curtheme_title = 0;\r
+            result = theme_loader_load_current(tl_handle, &t_handle);\r
+            if (result == THEME_MANAGER_ERROR_NONE)\r
+            {\r
+                char* theme_title;\r
+                result = theme_get_title(t_handle, &theme_title);\r
+                if (result == THEME_MANAGER_ERROR_NONE)\r
+                {\r
+                    curtheme_title = theme_title;\r
+                    SETTING_TRACE_DEBUG("curtheme_title : %s", curtheme_title);\r
+                }\r
+\r
+                theme_destroy(t_handle);\r
+            }\r
+            else\r
+            {\r
+                if (result == THEME_MANAGER_ERROR_NO_SUCH_THEME)\r
+                {\r
+                    SETTING_TRACE_ERROR("error NO_SUCH_THEME: theme_loader_load_current()");\r
+                }\r
+                else\r
+                    SETTING_TRACE_ERROR("error : theme_loader_load_current()");\r
+            }\r
+\r
+            int cur_radio_num = -1;\r
+\r
+            char** ids;\r
+            int count;\r
+            result = theme_loader_query_id(tl_handle, &ids, &count);\r
+            if (result == THEME_MANAGER_ERROR_NONE)\r
+            {\r
+                int radio_num = 0;\r
+                SETTING_TRACE_DEBUG("ids : %d", count);\r
+                for (int i = 0; i < count; i++)\r
+                {\r
+                    SETTING_TRACE_DEBUG("%d : %s", i, ids[i]);\r
+\r
+                    result = theme_loader_load(tl_handle, ids[i], &t_handle);\r
+                    if (result == THEME_MANAGER_ERROR_NONE)\r
+                    {\r
+                        char* theme_title;\r
+                        result = theme_get_title(t_handle, &theme_title);\r
+                        if (result == THEME_MANAGER_ERROR_NONE)\r
+                        {\r
+                            SETTING_TRACE_DEBUG("%d's title : %s", i, theme_title);\r
+\r
+                            {\r
+\r
+                                Setting_GenGroupItem_Data* data_theme = setting_create_Gendial_field_1radio(\r
+                                        menu_glist,\r
+                                        &(ad->itc_1line),\r
+                                        __theme_cb,\r
+                                        ad,\r
+                                        SWALLOW_Type_1RADIO_RIGHT,\r
+                                        rdg,\r
+                                        radio_num,          /* Always ON */\r
+                                        theme_title,\r
+                                        NULL);\r
+\r
+                                if (data_theme)\r
+                                {\r
+                                    data_theme->sub_desc = (char*)g_strdup(ids[i]);\r
+                                    data_theme->userdata = ad;\r
+                                    __BACK_POINTER_SET(data_theme);\r
+\r
+                                }\r
+                                else\r
+                                {\r
+                                    SETTING_TRACE_ERROR("data_theme is NULL");\r
+                                }\r
+\r
+                                if (!isEmptyStr(curtheme_title) && !safeStrCmp(theme_title, curtheme_title))\r
+                                {\r
+                                    cur_radio_num = radio_num;\r
+                                    SETTING_TRACE_DEBUG("cur_radio_num : %d", cur_radio_num);\r
+                                }\r
+\r
+                                radio_num++;\r
+                            }\r
+\r
+                            free(theme_title);\r
+                        }\r
+                        theme_destroy(t_handle);\r
+                    }\r
+\r
+                    free(ids[i]);\r
+                }\r
+                free(ids);\r
+            }\r
+\r
+            if (curtheme_title) free(curtheme_title);\r
+\r
+\r
+            theme_loader_destroy(tl_handle);\r
+\r
+            /* update radio */\r
+            if (cur_radio_num >= 0)\r
+                elm_radio_value_set(rdg, cur_radio_num);\r
+#endif\r
+        }\r
+\r
+\r
+    }\r
+}
\ No newline at end of file
index c565c1533df2bd9dfc0c5513f66ae33591a28644..b91540933d590797c3826206308c15d46d5dca2b 100644 (file)
@@ -38,17 +38,25 @@ namespace SettingMain
         {\r
             Dictionary<System.Type, string> widgetSet = new Dictionary<Type, string>();\r
             widgetSet.Add(typeof(SettingContent_Sound), "sound@org.tizen.cssettings");\r
+                widgetSet.Add(typeof(SettingContent_Soundmode), "soundmode@org.tizen.cssettings");\r
+                widgetSet.Add(typeof(SettingContent_NotificationSound), "notificationsound@org.tizen.cssettings");\r
             widgetSet.Add(typeof(SettingContent_Display), "display@org.tizen.cssettings");\r
+                widgetSet.Add(typeof(SettingContent_Font), "font@org.tizen.cssettings");\r
+                widgetSet.Add(typeof(SettingContent_ScreenTimeout), "timeout@org.tizen.cssettings");\r
+                widgetSet.Add(typeof(SettingContent_Theme), "theme@org.tizen.cssettings");\r
             widgetSet.Add(typeof(SettingContent_Applications), "apps@org.tizen.cssettings");\r
             widgetSet.Add(typeof(SettingContent_Storage), "storage@org.tizen.cssettings");\r
             widgetSet.Add(typeof(SettingContent_LanguageInput), "languageinput@org.tizen.cssettings");\r
             widgetSet.Add(typeof(SettingContent_DisplayLanguage), "displaylanguage@org.tizen.cssettings");\r
             widgetSet.Add(typeof(SettingContent_DateTime), "datetime@org.tizen.cssettings");\r
+                widgetSet.Add(typeof(SettingContent_SetDate), "setdate@org.tizen.cssettings");\r
+                widgetSet.Add(typeof(SettingContent_SetTime), "settime@org.tizen.cssettings");\r
+                widgetSet.Add(typeof(SettingContent_SetTimezone), "settimezone@org.tizen.cssettings");\r
             widgetSet.Add(typeof(SettingContent_AboutDevice), "aboutdevice@org.tizen.cssettings");\r
             \r
-            widgetSet.Add(typeof(SettingContent_LegalInfo), "content_legalinfo@org.tizen.cssettings");\r
+            widgetSet.Add(typeof(SettingContent_LegalInfo), "legalinfo@org.tizen.cssettings");\r
             widgetSet.Add(typeof(SettingDialog_Rename), "dlg_rename@org.tizen.cssettings");\r
-            widgetSet.Add(typeof(SettingContent_DeviceStatus), "content_devicestatus@org.tizen.cssettings");\r
+            widgetSet.Add(typeof(SettingContent_DeviceStatus), "devicestatus@org.tizen.cssettings");\r
 \r
 \r
             var app = new Program(widgetSet);\r
index ddac78c04dc9319143eb952e54690f288451a6ea..5d32996a82219a8df1dcc0391c8262f84f04730a 100644 (file)
Binary files a/SettingMain/res/icons/brightness_icon/settings_ic_brightness_00.png and b/SettingMain/res/icons/brightness_icon/settings_ic_brightness_00.png differ
index df97974780f8b011e966811e8d6e32a70263c148..5d32996a82219a8df1dcc0391c8262f84f04730a 100644 (file)
Binary files a/SettingMain/res/icons/brightness_icon/settings_ic_brightness_01.png and b/SettingMain/res/icons/brightness_icon/settings_ic_brightness_01.png differ
index 452926ae467e92a11b5d292f2cd4ed09a8199a3a..5d32996a82219a8df1dcc0391c8262f84f04730a 100644 (file)
Binary files a/SettingMain/res/icons/brightness_icon/settings_ic_brightness_02.png and b/SettingMain/res/icons/brightness_icon/settings_ic_brightness_02.png differ
index ea2bcbbbdb6f827cbc20e644ff9c2ed307a2e742..5d32996a82219a8df1dcc0391c8262f84f04730a 100644 (file)
Binary files a/SettingMain/res/icons/brightness_icon/settings_ic_brightness_03.png and b/SettingMain/res/icons/brightness_icon/settings_ic_brightness_03.png differ
index 5c41fddc41a74de6381d5af4c97ac6188e404e5b..5d32996a82219a8df1dcc0391c8262f84f04730a 100644 (file)
Binary files a/SettingMain/res/icons/brightness_icon/settings_ic_brightness_04.png and b/SettingMain/res/icons/brightness_icon/settings_ic_brightness_04.png differ
index aefa68738267e04fb46f564113a722ef2e555c25..5d32996a82219a8df1dcc0391c8262f84f04730a 100644 (file)
Binary files a/SettingMain/res/icons/brightness_icon/settings_ic_brightness_05.png and b/SettingMain/res/icons/brightness_icon/settings_ic_brightness_05.png differ
index 62b2b06ec44863810cffbcf2abf887468a1cecf2..5d32996a82219a8df1dcc0391c8262f84f04730a 100644 (file)
Binary files a/SettingMain/res/icons/brightness_icon/settings_ic_brightness_06.png and b/SettingMain/res/icons/brightness_icon/settings_ic_brightness_06.png differ
index 7595939c1d3e762f176cce057dae34cb40f5b11e..5d32996a82219a8df1dcc0391c8262f84f04730a 100644 (file)
Binary files a/SettingMain/res/icons/brightness_icon/settings_ic_brightness_07.png and b/SettingMain/res/icons/brightness_icon/settings_ic_brightness_07.png differ
index d4629331ffbcfd868ca03a5f33c130799bf992a2..5d32996a82219a8df1dcc0391c8262f84f04730a 100644 (file)
Binary files a/SettingMain/res/icons/brightness_icon/settings_ic_brightness_08.png and b/SettingMain/res/icons/brightness_icon/settings_ic_brightness_08.png differ
index c3b877136c07117d6bdae3fa5be192ac5da5ded8..5d32996a82219a8df1dcc0391c8262f84f04730a 100644 (file)
Binary files a/SettingMain/res/icons/brightness_icon/settings_ic_brightness_09.png and b/SettingMain/res/icons/brightness_icon/settings_ic_brightness_09.png differ
index 6e0aad33ae8b4998d319d76723f340628084dd65..5d32996a82219a8df1dcc0391c8262f84f04730a 100644 (file)
Binary files a/SettingMain/res/icons/brightness_icon/settings_ic_brightness_10.png and b/SettingMain/res/icons/brightness_icon/settings_ic_brightness_10.png differ
index e187938af5bce6315ed66db73d5ba678a8eea405..5d32996a82219a8df1dcc0391c8262f84f04730a 100644 (file)
Binary files a/SettingMain/res/icons/brightness_icon/settings_ic_brightness_11.png and b/SettingMain/res/icons/brightness_icon/settings_ic_brightness_11.png differ
index 94f54571d1e80c0c5ea0db2adebff55809235307..d93a506eafb5d00dc9ee49a66f77c16e5eca31b9 100644 (file)
     <widget-class classid="sound" update-period="0">\r
       <support-size preview="SettingMain.png">4x4</support-size>\r
     </widget-class>\r
+    <widget-class classid="soundmode" update-period="0">\r
+      <support-size preview="SettingMain.png">4x4</support-size>\r
+    </widget-class>\r
+    <widget-class classid="notificationsound" update-period="0">\r
+      <support-size preview="SettingMain.png">4x4</support-size>\r
+    </widget-class>\r
     <widget-class classid="display" update-period="0">\r
       <support-size preview="SettingMain.png">4x4</support-size>\r
     </widget-class>\r
+    <widget-class classid="font" update-period="0">\r
+      <support-size preview="SettingMain.png">4x4</support-size>\r
+    </widget-class>\r
+    <widget-class classid="timeout" update-period="0">\r
+      <support-size preview="SettingMain.png">4x4</support-size>\r
+    </widget-class>\r
+    <widget-class classid="theme" update-period="0">\r
+      <support-size preview="SettingMain.png">4x4</support-size>\r
+    </widget-class>\r
     <widget-class classid="apps" update-period="0">\r
       <support-size preview="SettingMain.png">4x4</support-size>\r
     </widget-class>\r
     <widget-class classid="datetime" update-period="0">\r
       <support-size preview="SettingMain.png">4x4</support-size>\r
     </widget-class>\r
+    <widget-class classid="setdate" update-period="0">\r
+      <support-size preview="SettingMain.png">4x4</support-size>\r
+    </widget-class>\r
+    <widget-class classid="settime" update-period="0">\r
+      <support-size preview="SettingMain.png">4x4</support-size>\r
+    </widget-class>\r
+    <widget-class classid="settimezone" update-period="0">\r
+      <support-size preview="SettingMain.png">4x4</support-size>\r
+    </widget-class>\r
     <widget-class classid="aboutdevice" update-period="0">\r
       <support-size preview="SettingMain.png">4x4</support-size>\r
     </widget-class>\r
-    <widget-class classid="content_legalinfo" update-period="0">\r
+    <widget-class classid="legalinfo" update-period="0">\r
       <support-size preview="SettingMain.png">4x4</support-size>\r
     </widget-class>\r
     <widget-class classid="dlg_rename" update-period="0">\r
       <support-size preview="SettingMain.png">4x4</support-size>\r
     </widget-class>\r
-    <widget-class classid="content_devicestatus" update-period="0">\r
+    <widget-class classid="devicestatus" update-period="0">\r
       <support-size preview="SettingMain.png">4x4</support-size>\r
     </widget-class>\r
     <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />\r
-      <privileges>\r
-        <privilege>http://tizen.org/privilege/telephony</privilege>\r
-        <privilege>http://tizen.org/privilege/bluetooth</privilege>\r
-        <privilege>http://tizen.org/privilege/network.set</privilege>\r
-        <privilege>http://tizen.org/privilege/systemmonitor</privilege>\r
-      </privileges>\r
   </widget-application>\r
+  <privileges>\r
+    <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>\r
+    <privilege>http://tizen.org/privilege/telephony</privilege>\r
+    <privilege>http://tizen.org/privilege/bluetooth</privilege>\r
+    <privilege>http://tizen.org/privilege/network.set</privilege>\r
+    <privilege>http://tizen.org/privilege/systemmonitor</privilege>\r
+  </privileges>\r
 \r
 </manifest>\r
 \r
index 33b415a3360d42ff2b20077adaea1576c849e815..8381b5b896f30d1d67c4d7d5dfd4c1ba16bc6321 100644 (file)
@@ -27,7 +27,7 @@ namespace SettingView
         {\r
 \r
             Window window = GetDefaultWindow();\r
-            window.BackgroundColor = Color.Blue;\r
+\r
             window.KeyEvent += OnKeyEvent;\r
             window.TouchEvent += OnTouchEvent;\r
 \r
@@ -36,34 +36,6 @@ namespace SettingView
             String encodedBundle = bundle.Encode();\r
 \r
             Tizen.Log.Error("SettingWidget", "REQUEST \n");\r
-#if false\r
-            // Add Widget in advance to avoid loading pending.\r
-            mWidgetView = WidgetViewManager.Instance.AddWidget("main@org.tizen.cssettings", encodedBundle, window.Size.Width, window.Size.Height, 0.0f);\r
-            mWidgetView.Position = new Position(0, 0);\r
-            mWidgetView.WidgetContentUpdated += OnWidgetContentUpdatedCB;\r
-\r
-            //window.GetDefaultLayer().Add(mWidgetView);\r
-\r
-\r
-\r
-\r
-\r
-            var button = new Button()\r
-            {\r
-                Text = "Click to Second Page",\r
-                WidthSpecification = LayoutParamPolicies.MatchParent,\r
-                HeightSpecification = LayoutParamPolicies.MatchParent,\r
-            };\r
-            button.Clicked += (o, e) =>\r
-            {\r
-                //  var page = new ContentPage();\r
-                //  page.Content = secondPageWidgetView;\r
-                //navigator.Push(page);\r
-            };\r
-\r
-            // Push the first page.\r
-            //PushContentPage("First Page", button);\r
-#endif\r
 \r
             CreateSettingsMainMenu();\r
 \r
@@ -226,103 +198,92 @@ namespace SettingView
 \r
         // Create an list item with checkbox.\r
         private DefaultLinearItem CreateItemWithCheck(string text, string subText = null, bool icon = false, bool extra = false)\r
-    {\r
-        var item = new DefaultLinearItem()\r
         {\r
-            WidthSpecification = LayoutParamPolicies.MatchParent,\r
-            Text = text,\r
-            IsSelectable = false, // Item should not be remained as selected state.\r
-        };\r
+            var item = new DefaultLinearItem()\r
+            {\r
+                WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                Text = text,\r
+                IsSelectable = false, // Item should not be remained as selected state.\r
+            };\r
 \r
-        if (subText != null)\r
-        {\r
-            item.SubText = subText;\r
-        }\r
+            if (subText != null)\r
+            {\r
+                item.SubText = subText;\r
+            }\r
 \r
-        CheckBox check = null;\r
-        if (icon)\r
-        {\r
-            check = new CheckBox();\r
-            check.SelectedChanged += (o, e) =>\r
+            CheckBox check = null;\r
+            if (icon)\r
             {\r
-                if (e.IsSelected)\r
-                {\r
-                    Tizen.Log.Debug("NUI", "check is selected!\n");\r
-                }\r
-                else\r
+                check = new CheckBox();\r
+                check.SelectedChanged += (o, e) =>\r
                 {\r
-                    Tizen.Log.Debug("NUI", "check is unselected!\n");\r
-                }\r
-            };\r
-            // Icon is placed at the beginning(left end) of the item.\r
-            item.Icon = check;\r
+                    if (e.IsSelected)\r
+                    {\r
+                        Tizen.Log.Debug("NUI", "check is selected!\n");\r
+                    }\r
+                    else\r
+                    {\r
+                        Tizen.Log.Debug("NUI", "check is unselected!\n");\r
+                    }\r
+                };\r
+                // Icon is placed at the beginning(left end) of the item.\r
+                item.Icon = check;\r
 \r
-            // Do not propagate Pressed/Selected states from item to item.Icon.\r
-            // When item is pressed/clicked/selected, item.Icon is not pressed/clicked/selected.\r
-            item.Icon.PropagatableControlStates = ControlState.Disabled;\r
-        }\r
+                // Do not propagate Pressed/Selected states from item to item.Icon.\r
+                // When item is pressed/clicked/selected, item.Icon is not pressed/clicked/selected.\r
+                item.Icon.PropagatableControlStates = ControlState.Disabled;\r
+            }\r
 \r
-        Switch toggle = null;\r
-        if (extra)\r
-        {\r
-            toggle = new Switch();\r
-            toggle.SelectedChanged += (o, e) =>\r
+            Switch toggle = null;\r
+            if (extra)\r
             {\r
-                if (e.IsSelected)\r
+                toggle = new Switch();\r
+                // Extra is placed at the end(right end) of the item.\r
+                item.Extra = toggle;\r
+\r
+                // Do not propagate Pressed/Selected states from item to item.Extra.\r
+                // When item is pressed/clicked/selected, item.Extra is not pressed/clicked/selected.\r
+                item.Extra.PropagatableControlStates = ControlState.Disabled;\r
+            }\r
+\r
+            item.Clicked += (o, e) =>\r
+            {\r
+                if (check != null)\r
                 {\r
-                    Tizen.Log.Debug("NUI", "toggle is selected!\n");\r
+                    check.IsSelected = !check.IsSelected;\r
                 }\r
-                else\r
+\r
+                if (toggle != null)\r
                 {\r
-                    Tizen.Log.Debug("NUI", "toggle is unselected!\n");\r
+                    toggle.IsSelected = !toggle.IsSelected;\r
                 }\r
+\r
+                Tizen.Log.Debug("NUI", "item is clicked!\n");\r
             };\r
-            // Extra is placed at the end(right end) of the item.\r
-            item.Extra = toggle;\r
 \r
-            // Do not propagate Pressed/Selected states from item to item.Extra.\r
-            // When item is pressed/clicked/selected, item.Extra is not pressed/clicked/selected.\r
-            item.Extra.PropagatableControlStates = ControlState.Disabled;\r
+\r
+\r
+            return item;\r
         }\r
 \r
-        item.Clicked += (o, e) =>\r
+        // Create an list item  with icon\r
+        private DefaultLinearItem CreateItemWithIcon(string text, string iconpath, string subText = null, bool extra = false)\r
         {\r
-            if (check != null)\r
+            var item = new DefaultLinearItem()\r
             {\r
-                check.IsSelected = !check.IsSelected;\r
-            }\r
+                WidthSpecification = LayoutParamPolicies.MatchParent,\r
+                Text = text,\r
+                IsSelectable = false, // Item should not be remained as selected state.\r
+            };\r
 \r
-            if (toggle != null)\r
+            if (subText != null)\r
             {\r
-                toggle.IsSelected = !toggle.IsSelected;\r
+                item.SubText = subText;\r
             }\r
 \r
-            Tizen.Log.Debug("NUI", "item is clicked!\n");\r
-        };\r
-\r
-\r
-\r
-        return item;\r
-    }\r
-\r
-    // Create an list item  with icon\r
-    private DefaultLinearItem CreateItemWithIcon(string text, string iconpath, string subText = null, bool extra = false)\r
-    {\r
-        var item = new DefaultLinearItem()\r
-        {\r
-            WidthSpecification = LayoutParamPolicies.MatchParent,\r
-            Text = text,\r
-            IsSelectable = false, // Item should not be remained as selected state.\r
-        };\r
+            ImageView icon = null;\r
 \r
-        if (subText != null)\r
-        {\r
-            item.SubText = subText;\r
-        }\r
-\r
-        ImageView icon = null;\r
-\r
-        if (iconpath.Length > 0)\r
+            if (iconpath.Length > 0)\r
         {\r
             icon = new ImageView(iconpath)\r
             {\r
@@ -394,8 +355,12 @@ namespace SettingView
             {\r
                 item.Clicked += (o, e) =>\r
                 {\r
+#if false\r
                     Window window = GetDefaultWindow();\r
                     LaunchWidget(window, "wifi@org.tizen.cssetting-wifi");\r
+#else\r
+                    LaunchApplication("wifi-efl-ug");\r
+#endif\r
                 };\r
                 content.Add(item);\r
             }\r
@@ -404,8 +369,12 @@ namespace SettingView
             {\r
                 item.Clicked += (o, e) =>\r
                 {\r
+#if false\r
                     Window window = GetDefaultWindow();\r
                     LaunchWidget(window, "bluetooth@org.tizen.cssetting-bluetooth");\r
+#else\r
+                    LaunchApplication("ug-bluetooth-efl");\r
+#endif\r
                 };\r
                 content.Add(item);\r
             }\r
@@ -595,6 +564,16 @@ namespace SettingView
         }\r
     }\r
 \r
+    void LaunchApplication(string appid)\r
+    {\r
+        AppControl appcontrol = new AppControl() {\r
+            Operation = AppControlOperations.Default,\r
+            ApplicationId = appid,\r
+            LaunchMode = AppControlLaunchMode.Group,\r
+        };\r
+        AppControl.SendLaunchRequest(appcontrol);\r
+    }\r
+\r
     static void Main(string[] args)\r
         {\r
             var appCustomBorder = new SettingViewBorder();\r
index 082d1660e4e0f65b863e484a2c68df0b6a3ba4eb..0258e8a608bbbbd2faa009c2da187fc3bd5054bb 100644 (file)
@@ -36,7 +36,7 @@ namespace SettingView
         {\r
             //BorderHeight = 50;\r
             BorderLineThickness = 0;\r
-            ResizePolicy = Window.BorderResizePolicyType.Fixed;\r
+            ResizePolicy = Window.BorderResizePolicyType.Free;\r
         }\r
 \r
 \r
@@ -199,7 +199,7 @@ namespace SettingView
             this.borderView = borderView;\r
             borderView.CornerRadius = new Vector4(0.03f, 0.03f, 0.03f, 0.03f);\r
             borderView.CornerRadiusPolicy = VisualTransformPolicyType.Relative;\r
-            borderView.BackgroundColor = new Color(1, 1, 1, 0.3f);\r
+            borderView.BackgroundColor = new Color(1, 1, 1, 0.2f);\r
         }\r
 \r
         public override void OnCreated(View borderView)\r