\r
protected string mTitle;\r
protected ContentPage mPage;\r
+ Bundle mBundle;\r
\r
public SettingContent_Base()\r
: base()\r
{\r
mWindow = null;\r
mPage = null;\r
+ mBundle = null;\r
}\r
\r
protected override void OnCreate(string contentInfo, Window window)\r
{\r
- Bundle bundle = Bundle.Decode(contentInfo);\r
-\r
- window.BackgroundColor = Color.Transparent;\r
+ mBundle = Bundle.Decode(contentInfo);\r
\r
mWindow = window;\r
+ mWindow.BackgroundColor = Color.Transparent;\r
\r
mPage = new ContentPage()\r
{\r
\r
\r
#if true\r
- item = SettingItemCreator.CreateItemWithCheck(Resources.IDS_ST_MBODY_BLUETOOTH_ADDRESS, Tizen.Network.Bluetooth.BluetoothAdapter.Address);\r
+ string addressBT = Resources.IDS_ST_HEADER_UNAVAILABLE;\r
+ try\r
+ {\r
+ if (Tizen.Network.Bluetooth.BluetoothAdapter.IsBluetoothEnabled)\r
+ addressBT = Tizen.Network.Bluetooth.BluetoothAdapter.Address;\r
+ else\r
+ addressBT = Resources.IDS_ST_SBODY_DISABLED;\r
+ }\r
+ catch (Exception e) {\r
+ }\r
+\r
+ item = SettingItemCreator.CreateItemWithCheck(Resources.IDS_ST_MBODY_BLUETOOTH_ADDRESS, addressBT);\r
content.Add(item);\r
#endif\r
\r
#if true\r
- item = SettingItemCreator.CreateItemWithCheck(Resources.IDS_ST_BODY_WI_FI_MAC_ADDRESS, Tizen.Network.WiFi.WiFiManager.MacAddress);\r
+ string addressMac = Resources.IDS_ST_HEADER_UNAVAILABLE;\r
+ if (Tizen.Network.WiFi.WiFiManager.IsActive)\r
+ addressMac = Tizen.Network.WiFi.WiFiManager.MacAddress;\r
+ else\r
+ addressMac = Resources.IDS_ST_SBODY_DISABLED;\r
+\r
+ item = SettingItemCreator.CreateItemWithCheck(Resources.IDS_ST_BODY_WI_FI_MAC_ADDRESS, addressMac);\r
content.Add(item);\r
#endif\r
IEnumerator<Storage> storages = StorageManager.Storages.GetEnumerator();\r
content.Add(item);\r
\r
\r
-\r
+#if false\r
// To do : Caluacate CPU Usage\r
// Tizen.System.ProcessCpuUsage\r
item = SettingItemCreator.CreateItemWithCheck(Resources.IDS_ST_BODY_CPU_USAGE, Resources.IDS_ST_HEADER_UNAVAILABLE);\r
content.Add(item);\r
-\r
+#endif\r
return content;\r
}\r
}\r
\r
if (Display.NumberOfDisplays > 0)\r
{\r
+ int brightness = 0;\r
+ try\r
+ {\r
+ brightness = Display.Displays[0].Brightness;\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Tizen.Log.Debug("NUI", string.Format("error :({0}) {1} ", e.GetType().ToString(), e.Message));\r
+ }\r
\r
- int brightness = Display.Displays[0].Brightness;\r
int maxbrightness = Display.Displays[0].MaxBrightness;\r
\r
GetBrightnessSliderIcon(brightness, out string iconpath);\r
mBrightnessItem.mIcon.SetImage(iconpath);\r
}\r
\r
- Display.Displays[0].Brightness = brightness;\r
+ try\r
+ {\r
+ Display.Displays[0].Brightness = brightness;\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Tizen.Log.Debug("NUI", string.Format("error :({0}) {1} ", e.GetType().ToString(), e.Message));\r
+ }\r
}\r
\r
}\r
content.Add(item);\r
}\r
\r
+ content.Add(SettingItemCreator.CreateItemStatic(""));\r
+ content.Add(SettingItemCreator.CreateItemStatic(Resources.IDS_ST_BODY_KEYBOARD));\r
\r
item = SettingItemCreator.CreateItemWithCheck(Resources.IDS_ST_BODY_KEYBOARD);\r
if (item != null)\r
content.Add(item);\r
}\r
\r
+ content.Add(SettingItemCreator.CreateItemStatic(""));\r
+ content.Add(SettingItemCreator.CreateItemStatic(Resources.IDS_ST_BODY_INPUT_ASSISTANCE));\r
\r
item = SettingItemCreator.CreateItemWithCheck(Resources.IDS_ST_BODY_AUTOFILL_SERVICE);\r
if (item != null)\r
content.Add(item);\r
}\r
\r
-\r
-\r
+ content.Add(SettingItemCreator.CreateItemStatic(""));\r
+ content.Add(SettingItemCreator.CreateItemStatic(Resources.IDS_ST_BODY_SPEECH));\r
+ \r
item = SettingItemCreator.CreateItemWithCheck(Resources.IDS_VOICE_BODY_VOICE_CONTROL_ABB2);\r
if (item != null)\r
{\r
using Tizen.Applications;\r
using System.Collections.ObjectModel;\r
using Tizen.System;\r
+using Tizen.Multimedia;\r
\r
using SettingAppTextResopurces.TextResources;\r
\r
namespace SettingMain\r
{\r
\r
- \r
-\r
class SettingContent_NotificationSound : SettingContent_Base\r
{\r
+ public const string keyNotificationSound = "db/setting/sound/noti/msg_ringtone_path";\r
\r
- static public string GetFileName(string value)\r
+ public static string SettingMediaBasename(string path)\r
{\r
- String[] folders = value.Split('/');\r
+ if (string.IsNullOrEmpty(path))\r
+ return Resources.IDS_ST_BODY_PHONEPROFILES_SILENT;\r
+\r
+ string title = "";\r
+ try\r
+ {\r
+ var extractor = new Tizen.Multimedia.MetadataExtractor(path);\r
+ Metadata metadata = extractor.GetMetadata();\r
+ title = metadata.Title;\r
+ }\r
+ catch (Exception e){\r
+ Tizen.Log.Debug("NUI", string.Format("error :({0}) {1} ", e.GetType().ToString(), e.Message));\r
+ }\r
+\r
+ if (!string.IsNullOrEmpty(title))\r
+ return title;\r
+\r
+ return GetFileName(path);\r
+ }\r
+\r
+\r
+ private static string GetFileName(string path)\r
+ {\r
+ String[] folders = path.Split('/');\r
int foldercount = folders.Length;\r
if (foldercount > 0) return folders[foldercount - 1];\r
- return value;\r
+ return path;\r
}\r
\r
\r
{\r
SoundList = new ArrayList();\r
\r
+ SoundList.Add(""); // Silent\r
\r
string sharedData = "/opt/usr/data";\r
string path = sharedData + "/settings/Alerts";\r
for (int i = 0; i < SoundList.Count; i++)\r
{\r
string path = SoundList[i] as string;\r
- PickerItems[i] = GetFileName(path);\r
+ PickerItems[i] = SettingMediaBasename(path);\r
}\r
}\r
\r
Layout = new LinearLayout()\r
{\r
HorizontalAlignment = HorizontalAlignment.Center,\r
+ VerticalAlignment = VerticalAlignment.Center,\r
LinearOrientation = LinearLayout.Orientation.Vertical,\r
+ \r
},\r
};\r
content.Add(new TextLabel(Resources.IDS_ST_BODY_NOTIFICATION));\r
\r
private static void SetNotificationSound(string notificationsound)\r
{\r
- Vconf.SetString("db/setting/sound/noti/msg_ringtone_path", notificationsound);\r
+ Vconf.SetString(keyNotificationSound, notificationsound);\r
}\r
\r
public static string GetNotificationSound()\r
{\r
- return Vconf.GetString("db/setting/sound/noti/msg_ringtone_path");\r
+ return Vconf.GetString(keyNotificationSound);\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
+ return SettingMediaBasename(path);\r
}\r
}\r
}\r
class SettingContent_Sound : SettingContent_Base\r
{\r
\r
- private DefaultLinearItem mSoundModeItem;\r
- private DefaultLinearItem mNotificationSoundItem;\r
+ private static DefaultLinearItem mSoundModeItem;\r
+ private static DefaultLinearItem mNotificationSoundItem;\r
\r
public SettingContent_Sound()\r
: base()\r
\r
#if false\r
Tizen.System.SystemSettings.SoundNotificationChanged += SystemSettings_NotificationSoundChanged;\r
+#else\r
+ Vconf.NotifyKeyChanged(SettingContent_NotificationSound.keyNotificationSound, VconfChanged_NotificationSound);\r
#endif\r
}\r
\r
\r
#if false\r
Tizen.System.SystemSettings.SoundNotificationChanged -= SystemSettings_NotificationSoundChanged;\r
+#else\r
+ Vconf.IgnoreKeyChanged(SettingContent_NotificationSound.keyNotificationSound, VconfChanged_NotificationSound);\r
#endif\r
base.OnTerminate(contentInfo, type);\r
}\r
\r
- private void SystemSettings_SoundSilentModeSettingChanged(object sender, SoundSilentModeSettingChangedEventArgs e)\r
+ private static void SystemSettings_SoundSilentModeSettingChanged(object sender, SoundSilentModeSettingChangedEventArgs e)\r
{\r
if (mSoundModeItem != null)\r
mSoundModeItem.SubText = SettingContent_Soundmode.GetSoundmodeName();\r
}\r
- private void SystemSettings_VibrationChanged(object sender, VibrationChangedEventArgs e)\r
+ private static void SystemSettings_VibrationChanged(object sender, VibrationChangedEventArgs e)\r
{\r
if (mSoundModeItem != null)\r
mSoundModeItem.SubText = SettingContent_Soundmode.GetSoundmodeName();\r
}\r
\r
- private void SystemSettings_NotificationSoundChanged(object sender, SoundNotificationChangedEventArgs e)\r
+#if false\r
+ private static void SystemSettings_NotificationSoundChanged(object sender, SoundNotificationChangedEventArgs e)\r
{\r
if (mNotificationSoundItem != null)\r
mNotificationSoundItem.SubText = SettingContent_NotificationSound.GetNotificationSoundName();\r
}\r
-\r
-\r
+#else\r
+ public static void VconfChanged_NotificationSound(IntPtr node, IntPtr userData)\r
+ {\r
+ if (mNotificationSoundItem != null)\r
+ mNotificationSoundItem.SubText = SettingContent_NotificationSound.GetNotificationSoundName();\r
+ }\r
+#endif\r
\r
/// ///////////////////////////\r
\r
{\r
LinearOrientation = LinearLayout.Orientation.Horizontal,\r
VerticalAlignment = VerticalAlignment.Center,\r
- CellPadding = new Size2D(10, 10)\r
-\r
},\r
+ WidthSpecification = LayoutParamPolicies.MatchParent,\r
Padding = new Extents(8, 0, 5, 5),\r
};\r
\r
+\r
TextLabel label = new TextLabel(text)\r
{\r
TextColor = Color.DarkGray\r
\r
public static void PopWidget(Window window)\r
{\r
- window.GetDefaultNavigator().Pop();\r
+ var page = window.GetDefaultNavigator().Pop();\r
+\r
+ ContentPage contentpage = page as ContentPage;\r
+ if (contentpage != null) {\r
+ var view = contentpage.Content;\r
+ WidgetView widgetview = view as WidgetView;\r
+ if (widgetview != null)\r
+ WidgetViewManager.Instance.RemoveWidget(widgetview);\r
+ else\r
+ Tizen.Log.Debug("NUI", "This View is Not a WidgetView");\r
+ }\r
+ else\r
+ {\r
+ DialogPage dialogpage = page as DialogPage;\r
+ if (dialogpage != null)\r
+ {\r
+ var view = dialogpage.Content;\r
+ WidgetView widgetview = view as WidgetView;\r
+ if (widgetview != null)\r
+ WidgetViewManager.Instance.RemoveWidget(widgetview);\r
+ else\r
+ Tizen.Log.Debug("NUI", "This View is Not a WidgetView");\r
+ }\r
+ else\r
+ Tizen.Log.Debug("NUI", "This Page is Not a ContentPage or a DialogPage");\r
+ }\r
\r
LastestPushWidgetId = "";\r
}\r
{\r
if (widgetAction.Equals("PUSH"))\r
{\r
- Tizen.Log.Debug("NUI", "WIDGET_ACTION : PUSH!\n");\r
- PushWidget(NUIApplication.GetDefaultWindow(), widgetID);\r
+ if (widgetID.Equals("renamedevice@org.tizen.cssettings"))\r
+ {\r
+ Tizen.Log.Debug("NUI", "WIDGET_ACTION : RENAMEDEVICE!\n");\r
+ PushRenameContents(NUIApplication.GetDefaultWindow());\r
+ }\r
+ else\r
+ {\r
+ Tizen.Log.Debug("NUI", "WIDGET_ACTION : PUSH!\n");\r
+ PushWidget(NUIApplication.GetDefaultWindow(), widgetID);\r
+ }\r
}\r
else if (widgetAction.Equals("POP"))\r
{\r
}\r
\r
\r
-#if true\r
-\r
public static SettingMenuInfo[] ReadMenuList(string folderpath, string name)\r
{\r
string locale = Vconf.GetString("db/menu_widget/language");\r
\r
return menulist;\r
}\r
-#endif\r
+\r
+ private static void PushRenameContents(Window window)\r
+ {\r
+ Navigator navigator = window.GetDefaultNavigator();\r
+\r
+ ContentPage renamepage = new SettingRenameDevicePage(window) {\r
+ WidthSpecification = LayoutParamPolicies.MatchParent,\r
+ HeightSpecification = LayoutParamPolicies.MatchParent,\r
+\r
+ Position = new Position(0, 0),\r
+ };\r
+\r
+ Tizen.Log.Debug("NUI", String.Format($"RenameContent Push"));\r
+\r
+\r
+ navigator.Push(renamepage);\r
+\r
+ }\r
\r
}\r
}\r
--- /dev/null
+/*\r
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved\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 Tizen.NUI;\r
+using Tizen.NUI.BaseComponents;\r
+using Tizen.NUI.Components;\r
+using Tizen.Applications;\r
+\r
+using SettingAppTextResopurces.TextResources;\r
+\r
+namespace SettingView\r
+{\r
+ class SettingRenameDevicePage : ContentPage\r
+ {\r
+\r
+ protected Window mWindow;\r
+ protected string mTitle;\r
+\r
+ private const int MAX_DEVICE_NAME_LEN = 32;\r
+ TextField mTextField;\r
+ public SettingRenameDevicePage(Window window)\r
+ : base()\r
+ {\r
+ mWindow = window;\r
+\r
+ mTitle = Resources.IDS_ST_BUTTON_BACK;\r
+\r
+ mTextField = null;\r
+\r
+ Content = CreateContent(window);\r
+ AppBar = CreateAppBar(mTitle);\r
+ }\r
+\r
+ protected AppBar CreateAppBar(string title)\r
+ {\r
+ var appBar = new AppBar()\r
+ {\r
+ Title = title,\r
+ AutoNavigationContent = false,\r
+ };\r
+\r
+ var appBarStyle = ThemeManager.GetStyle("Tizen.NUI.Components.AppBar");\r
+\r
+ var navigationContent = new Button(((AppBarStyle)appBarStyle).BackButton);\r
+ navigationContent.Clicked += (o, e) =>\r
+ {\r
+ if (mWindow != null)\r
+ {\r
+ Navigator navigator = mWindow.GetDefaultNavigator();\r
+ navigator.Pop();\r
+ }\r
+ };\r
+ appBar.NavigationContent = navigationContent;\r
+ //appBarStyle.Dispose();\r
+\r
+ return appBar;\r
+ }\r
+\r
+ protected View CreateContent(Window window)\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
+\r
+ var textTitle = SettingItemCreator.CreateItemTitle(Resources.IDS_ST_HEADER_RENAME_DEVICE);\r
+ content.Add(textTitle);\r
+\r
+ var textSubTitle = new TextLabel(Resources.IDS_ST_BODY_DEVICE_NAMES_ARE_DISPLAYED)\r
+ {\r
+ MultiLine = true,\r
+ LineWrapMode = LineWrapMode.Character,\r
+ Size2D = new Size2D(window.WindowSize.Width-20*2, 100),\r
+ };\r
+ content.Add(textSubTitle);\r
+\r
+ String name = Vconf.GetString("db/setting/device_name");\r
+\r
+ PropertyMap placeholder = new PropertyMap();\r
+ placeholder.Add("color", new PropertyValue(Color.CadetBlue));\r
+ placeholder.Add("fontFamily", new PropertyValue("Serif"));\r
+ placeholder.Add("pointSize", new PropertyValue(25.0f));\r
+\r
+ mTextField = new TextField\r
+ {\r
+ BackgroundColor = Color.White,\r
+\r
+ Placeholder = placeholder,\r
+\r
+ MaxLength = MAX_DEVICE_NAME_LEN,\r
+ EnableCursorBlink = true,\r
+ Text = name,\r
+ };\r
+ content.Add(mTextField);\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 += (o, e) =>\r
+ {\r
+ // Change Device Name\r
+ Vconf.SetString("db/setting/device_name", mTextField.Text);\r
+\r
+ Navigator navigator = mWindow.GetDefaultNavigator();\r
+ navigator.Pop();\r
+ //RequestWidgetPop();\r
+ };\r
+ content.Add(button);\r
+\r
+ return content;\r
+ }\r
+ }\r
+}\r
</ui-application>\r
<shortcut-list />\r
<privileges>\r
+ <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>\r
+\r
<privilege>http://tizen.org/privilege/appmanager.launch</privilege>\r
<privilege>http://tizen.org/privilege/datasharing</privilege>\r
<privilege>http://tizen.org/privilege/widget.viewer</privilege>\r