Remove vconf set in spec file. Add vconf set flow to main.cpp 41/36641/2 accepted/tizen/tv/20150312.010920 submit/tizen_tv/20150311.080819
authorJuWan Kim <juwan.kim@samsung.com>
Wed, 11 Mar 2015 07:41:10 +0000 (16:41 +0900)
committerJuWan Kim <juwan.kim@samsung.com>
Wed, 11 Mar 2015 07:48:49 +0000 (16:48 +0900)
 * Vconftool set command in spec has a root user label
 * To use the vconf value in program, vconf value shoud be set in running
 * time.

Change-Id: Ia2fa3d983eaa8dbe241e299c7344e5ddb46199b4
Signed-off-by: JuWan Kim <juwan.kim@samsung.com>
include/def.h
packaging/org.tizen.settings-tv-ref.spec
src/main.cpp

index b10affc..7b1b383 100644 (file)
 #define KEY_8 "8"
 #define KEY_9 "9"
 
+/* VCONF KEYS */
+
+/* Proxy */
+#define VCONF_NETWORK_TYPE "db/menu/network/network_type"
+#define VCONF_PROXY_METHOD "db/menu/proxy/method"
+#define VCONF_PROXY_IP     "db/menu/proxy/ip"
+#define VCONF_PROXY_URL    "db/menu/proxy/url"
+
+/* Network */
+#define WIRED_DNS_KEY       "db/menu/network/wired_dns"
+#define WIRED_GATEWAY_KEY   "db/menu/network/wired_gateway"
+#define WIRED_IP_LAST_MODE  "db/menu/network/wired_ip_mode"
+#define WIRED_DNS_LAST_MODE "db/menu/network/wired_dns_mode"
+#define WIRED_IP_KEY        "db/menu/network/wired_ip"
+#define WIRED_SUBMASK_KEY   "db/menu/network/wired_subnet"
+
+#define WIRELESS_DNS_KEY       "db/menu/network/wireless_dns"
+#define WIRELESS_GATEWAY_KEY   "db/menu/network/wireless_gateway"
+#define WIRELESS_IP_LAST_MODE  "db/menu/network/wireless_ip_mode"
+#define WIRELESS_DNS_LAST_MODE "db/menu/network/wireless_dns_mode"
+#define WIRELESS_IP_KEY        "db/menu/network/wireless_ip"
+#define WIRELESS_SUBMASK_KEY   "db/menu/network/wireless_subnet"
+
+/* Time */
+#define KEY_SYSTEM_CLOCK_MODE  "db/menu/system/time/clock/clock_mode"
+#define KEY_SLEEPTIMER         "db/menu/system/time/sleeptimer/value"
+#define KEY_SLEEPTIMER_TIMERID "db/menu/system/time/sleeptimer/timer_id"
+#define KEY_WAKEUP_TIMER_SETUP "db/menu/system/time/ontimer1/setup"
+
+#define VCONF_KEY_24HOUR_MODE   "db/menu/system/clock/24hour_mode"
+#define KEY_CHANGE_PASSCODE     "db/menu/system/change_pin"
+#define KEY_SUBTITLE_LANGUAGE   "db/menu/subtitle/subtitlelanguage"
+
+/* Broadcasting */
+#define KEY_CHANNEL_LOCK "db/menu/broadcasting/channel_lock"
+
+/* Lang and Region */
+#define KEY_SYSTEM_LANGUAGE "db/menu_widget/language"
+#define KEY_SYSTEM_COUNTRY "db/menu_widget/regionformat"
+
 #endif /* __DEF_H__ */
index 803bd3a..1fccda1 100644 (file)
@@ -80,71 +80,6 @@ rm -rf %{buildroot}
 %make_install
 
 %post
-# Set vconf values with -g/-u options
-GOPTION="-g 6514"
-
-# Network
-vconftool $GOPTION set -t string db/menu/network/wired_dns "0.0.0.0"
-vconftool $GOPTION set -t string db/menu/network/wired_gateway "0.0.0.0"
-vconftool $GOPTION set -t string db/menu/network/wired_ip_mode "Obtain automatically"
-vconftool $GOPTION set -t string db/menu/network/wired_dns_mode "Obtain automatically"
-vconftool $GOPTION set -t string db/menu/network/wired_ip "0.0.0.0"
-vconftool $GOPTION set -t string db/menu/network/wired_subnet "0.0.0.0"
-
-vconftool $GOPTION set -t string db/menu/network/wireless_dns "0.0.0.0"
-vconftool $GOPTION set -t string db/menu/network/wireless_gateway "0.0.0.0"
-vconftool $GOPTION set -t string db/menu/network/wireless_ip_mode "Obtain automatically"
-vconftool $GOPTION set -t string db/menu/network/wireless_dns_mode "Obtain automatically"
-vconftool $GOPTION set -t string db/menu/network/wireless_ip "0.0.0.0"
-vconftool $GOPTION set -t string db/menu/network/wireless_subnet "0.0.0.0"
-
-# Proxy
-vconftool $GOPTION set -t int db/menu/proxy/method 0
-vconftool $GOPTION set -t string db/menu/proxy/ip "0.0.0.0"
-vconftool $GOPTION set -t string db/menu/proxy/url ""
-
-# Broadcasting
-vconftool $GOPTION set -t bool db/menu/broadcasting/channel_lock 0
-
-# Time
-vconftool $GOPTION set -t int db/menu/system/time/clock/clock_mode 0
-vconftool $GOPTION set -t int db/menu/system/time/sleeptimer/value 0
-vconftool $GOPTION set -t int db/menu/system/time/sleeptimer/timer_id 0
-vconftool $GOPTION set -t string db/menu/system/time/ontimer1/setup "OFF"
-vconftool $GOPTION set -t string db/menu/system/time/ontimer1/time "12:00"
-vconftool $GOPTION set -t int db/menu/system/time/ontimer1/volume 20
-vconftool $GOPTION set -t string db/menu/system/time/ontimer1/external "TV"
-vconftool $GOPTION set -t string db/menu/system/time/ontimer1/channel "30-01"
-vconftool $GOPTION set -t string db/menu/system/ontimer1/channel_svcid "00"
-vconftool $GOPTION set -t int db/menu/system/time/ontimer1/timer_id 0
-vconftool $GOPTION set -t int db/menu/system/clock/24hour_mode 0
-
-vconftool $GOPTION set -t string db/menu/system/change_pin "0000"
-vconftool $GOPTION set -t int db/menu/subtitle/subtitlelanguage 0
-
-# FIXME: need to check below
-
-# Font
-vconftool $GOPTION set -t int db/setting/font_size "1"
-vconftool $GOPTION set -t int db/setting/font_type "0"
-
-# TimeAndData
-vconftool $GOPTION set -t bool db/setting/automatic_time_update "1"
-vconftool $GOPTION set -t int db/menu_widget/regionformat_time1224 "1"
-vconftool $GOPTION set -t int db/setting/date_format "0"
-vconftool $GOPTION set -t int db/setting/weekofday_format  "0"
-vconftool $GOPTION set -t string db/setting/timezone "+9"
-
-# LanguageAndRegion
-vconftool $GOPTION set -t int db/setting/lang "9"
-vconftool $GOPTION set -t string db/menu_widget/language "en_US.UTF-8"
-vconftool $GOPTION set -t string db/menu_widget/regionformat "en_US.UTF-8"
-
-# Devoptions
-vconftool $GOPTION -i set -t int db/setting/devoption/bgprocess "0"
-
-
-#chmod -R 777 /var/kdb/db/menu/
 
 %postun -p /sbin/ldconfig
 
index 031bea0..fda34a6 100644 (file)
@@ -25,6 +25,7 @@
 #include "settings_provider.h"
 
 #include <BaseApp.h>
+#include <vconf.h>
 
 #define PARAM_SETTINGS_ITEM "settings-item"
 #define MAIN_CATALOG "maincatalog"
@@ -90,6 +91,45 @@ protected:
                ad.item = NULL;
                ad.app_control = 0;
 
+               /* Set Default value by vconf */
+
+               /* Proxy */
+               if(vconf_set_int(VCONF_PROXY_METHOD, 0)) _DBG("Fail to set vconf");
+               if(vconf_set_str(VCONF_PROXY_IP, "0.0.0.0")) _DBG("Fail to set vconf");
+               if(vconf_set_str(VCONF_PROXY_URL, "")) _DBG("Fail to set vconf");
+
+               /* Network */
+               if(vconf_set_str(WIRED_DNS_KEY, "0.0.0.0")) _DBG("Fail to set vconf");
+               if(vconf_set_str(WIRED_GATEWAY_KEY, "0.0.0.0")) _DBG("Fail to set vconf");
+               if(vconf_set_str(WIRED_IP_LAST_MODE, "Obtain automatically")) _DBG("Fail to set vconf");
+               if(vconf_set_str(WIRED_DNS_LAST_MODE, "Obtain automatically")) _DBG("Fail to set vconf");
+               if(vconf_set_str(WIRED_IP_KEY, "0.0.0.0")) _DBG("Fail to set vconf");
+               if(vconf_set_str(WIRED_SUBMASK_KEY, "0.0.0.0")) _DBG("Fail to set vconf");
+
+               if(vconf_set_str(WIRELESS_DNS_KEY, "0.0.0.0")) _DBG("Fail to set vconf");
+               if(vconf_set_str(WIRELESS_GATEWAY_KEY, "0.0.0.0")) _DBG("Fail to set vconf");
+               if(vconf_set_str(WIRELESS_IP_LAST_MODE, "Obtain automatically")) _DBG("Fail to set vconf");
+               if(vconf_set_str(WIRELESS_DNS_LAST_MODE, "Obtain automatically")) _DBG("Fail to set vconf");
+               if(vconf_set_str(WIRELESS_IP_KEY, "0.0.0.0")) _DBG("Fail to set vconf");
+               if(vconf_set_str(WIRELESS_SUBMASK_KEY, "0.0.0.0")) _DBG("Fail to set vconf");
+
+               /* Time */
+               if(vconf_set_int(KEY_SYSTEM_CLOCK_MODE, 0)) _DBG("Fail to set vconf");
+               if(vconf_set_int(KEY_SLEEPTIMER, 0)) _DBG("Fail to set vconf");
+               if(vconf_set_int(KEY_SLEEPTIMER_TIMERID, 0)) _DBG("Fail to set vconf");
+               if(vconf_set_str(KEY_WAKEUP_TIMER_SETUP, "OFF")) _DBG("Fail to set vconf");
+
+               if(vconf_set_int(VCONF_KEY_24HOUR_MODE, 0)) _DBG("Fail to set vconf");
+               if(vconf_set_str(KEY_CHANGE_PASSCODE, "0000")) _DBG("Fail to set vconf");
+               if(vconf_set_int(KEY_SUBTITLE_LANGUAGE, 0)) _DBG("Fail to set vconf");
+
+               /* Broadcasting */
+               if(vconf_set_bool(KEY_CHANNEL_LOCK, false)) _DBG("Fail to set vconf");
+
+               /* Lang and Region */
+               if(vconf_set_str(KEY_SYSTEM_LANGUAGE, "en_US.UTF-8")) _DBG("Fail to set vconf");
+               if(vconf_set_str(KEY_SYSTEM_COUNTRY, "en_US.UTF-8")) _DBG("Fail to set vconf");
+
                return true;
        }