applied capi-system-system-settings into Settings- use font-type related enumeration .
authorJing Yigang <yigang.jing@samsung.com>
Tue, 28 Aug 2012 04:03:12 +0000 (12:03 +0800)
committerJing Yigang <yigang.jing@samsung.com>
Tue, 28 Aug 2012 04:03:12 +0000 (12:03 +0800)
Change-Id: I99df11778fa62cbc01e9190a39825e425c45e15c

packaging/settings.spec
setting-common/CMakeLists.txt
setting-common/include/setting-common-data-type.h
setting-common/src/setting-common-draw-genlist.c
setting-common/src/setting-common-general-func.c
setting-font/CMakeLists.txt
setting-font/include/setting-font-font-size.h
setting-font/src/setting-font-main.c
setting-time/src/setting-time-main.c
src/CMakeLists.txt
src/conf_util/setting_confutil.c

index bf8752e..e62c770 100755 (executable)
Binary files a/packaging/settings.spec and b/packaging/settings.spec differ
index 5dd6df7..4c3684f 100755 (executable)
@@ -19,7 +19,7 @@ PROJECT(${LIB_SETTING_COMMON})
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs_common_data REQUIRED appcore-efl elementary vconf openssl evas ecore ecore-imf json-glib-1.0 edje iniparser glib-2.0 libxml-2.0 ui-gadget-1 capi-appfw-application capi-system-info)
+pkg_check_modules(pkgs_common_data REQUIRED appcore-efl elementary vconf openssl evas ecore ecore-imf json-glib-1.0 edje iniparser glib-2.0 libxml-2.0 ui-gadget-1 capi-appfw-application capi-system-info capi-system-system-settings)
 
 FOREACH(flag ${pkgs_common_data_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 0cf3d2a..a8b1093 100755 (executable)
@@ -154,14 +154,6 @@ typedef void (*setting_call_back_func) (void *data, Evas_Object *obj, void *even
 #define SYSTEM_SERVICE_LIST_PATH "/opt/osp/system/configuration/system-services.list"
 #define MAX_PKG_NAME_LEN                       128
 
-typedef enum
-{
-       SYSTEM_SETTINGS_FONT_SIZE_SMALL = 0, /**< A small size */
-       SYSTEM_SETTINGS_FONT_SIZE_NORMAL, /**< A normal size */
-       SYSTEM_SETTINGS_FONT_SIZE_LARGE, /**< A large size */
-       SYSTEM_SETTINGS_FONT_SIZE_HUGE, /**< A huge size */
-       SYSTEM_SETTINGS_FONT_SIZE_GIANT /**< A giant size */
-} settings_font_size_e;
 
 typedef struct
 {
index b9353c2..2034658 100755 (executable)
@@ -22,6 +22,7 @@
 #include <glib.h>
 #include <utilX.h>
 #include <Ecore_X.h>
+#include <system_settings.h>
 
 #define EXCEED_LIMITATION_STR          "Name is too long."
 
index 5ea6249..da74fdf 100755 (executable)
@@ -29,6 +29,8 @@
 #include <libxml/parser.h>
 #include <system_info.h>
 
+#include <system_settings.h>
+
 char *setting_file_basename(char *path)
 {
        if (NULL == path || '\0' == path[0]) {
index bde6b2b..ba9a002 100755 (executable)
@@ -4,7 +4,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${SETTING_COMMON}/include)
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs_font REQUIRED ecore ecore-file evas elementary appcore-common appcore-efl ui-gadget-1 capi-appfw-application 
-sysman fontconfig libxml-2.0)
+sysman fontconfig libxml-2.0 capi-system-system-settings)
 
 FOREACH(flag ${pkgs_font_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 775796f..24b0f38 100644 (file)
@@ -22,6 +22,7 @@
 #define __SETTING_FONT_FONT_SIZE_H__
 
 #include <setting-font.h>
+#include <system_settings.h>
 
 static void setting_font_font_size_list_mouse_up_cb(void *data, Evas_Object *obj, void *event_info);
 #endif                         /* __SETTING_FONT_FONT_SIZE_H__ */
index ef47941..e0a18e1 100755 (executable)
@@ -25,6 +25,7 @@
 #include <libxml/xmlmemory.h>
 #include <libxml/parser.h>
 #include <Ecore_X.h>
+#include <system_settings.h>
 
 static int setting_font_main_create(void *cb);
 static int setting_font_main_destroy(void *cb);
index 5e5eb72..9551035 100755 (executable)
@@ -1379,6 +1379,7 @@ static void setting_time_main_controlbar_lbtn_label_set(
  */
 static void get_gmt_offset(char *str_buf, int size)
 {
+       SETTING_TRACE(" before GMT processing : %s", str_buf);
        // timezone string +/-<n> ex. +9, -1
        time_t t = time(0);     // get unix time. sec.
 
index e471c2b..e29563b 100755 (executable)
@@ -12,6 +12,7 @@ pkg_check_modules(pkgs_main REQUIRED
                                          ecore ecore-file ecore-input
                                          sysman icu-i18n icu-io icu-le icu-lx icu-uc
                                          appsvc libxml-2.0
+                                         capi-system-system-settings
                                          ##setting-service
                                  )
 
index 1563860..59d5c1e 100755 (executable)
 #include <setting-common-general-func.h>
 #include <setting-common-data-slp-setting.h>
 #include <unistd.h>
+#include <system_settings.h>
 
 static char* get_timezone();
 
+static void get_gmt_offset(char *str_buf, int size)
+{
+       // timezone string +/-<n> ex. +9, -1
+       time_t t = time(0);     // get unix time. sec.
+
+       struct tm* data;
+       data = localtime(&t);           // save time as structure.
+       setting_retm_if(!data, "data is NULL");
+       data->tm_isdst = 0;                     // summer time, not applied.
+       time_t a = mktime(data);
+
+       data = gmtime(&a);
+       data->tm_isdst = 0;                     // summer time, not applied.
+       time_t b = mktime(data);
+
+       int gmtoffset_hour = (a-b)/3600;        // result : hour.
+       int gmtoffset_min = ((a-b)%3600)/60;    // result : min.
+       if(gmtoffset_min != 0) {
+               gmtoffset_min = 30;
+       }
+
+       snprintf(str_buf, size, "%+d:%02u", gmtoffset_hour, gmtoffset_min);
+       SETTING_TRACE("szTimezone is of a valid format: GMT: %s", str_buf);
+}
+
+
+void timezone_init()
+{
+       char* tzpath = get_timezone();
+       //printf(">>> time zone : %s \n", tzpath+20);
+       int ret = vconf_set_str(VCONFKEY_SETAPPL_TIMEZONE_INT, tzpath+20);
+
+       char str_buf[256] = {0, };
+       get_gmt_offset(str_buf, 256);
+       printf(">>> time zone GMT string : %s \n", str_buf);
+}
+
+void get_current_font()
+{
+       char *value = NULL;
+       int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, &value);
+       printf(">>> get current font type : %s \n", value);
+}
+
 /**
 sh-4.1# /opt/apps/com.samsung.setting/bin/setting_conf_util timezone_check
 debug level init 1(1)
@@ -30,14 +75,12 @@ int main(int argc, char* argv[])
        int ret;
        // exporting - current status
        if ( (argc == 2) && (0 == strcmp(argv[1], "export"))) {
-                       setting_export();
-       }
-       else if ( (argc == 2) && (0 == strcmp(argv[1], "timezone_init"))) {
-               char* tzpath = get_timezone();
-               //printf(">>> time zone : %s \n", tzpath+20);
-               ret = vconf_set_str(VCONFKEY_SETAPPL_TIMEZONE_INT, tzpath+20);
-       }
-       else {
+               setting_export();
+       } else if ( (argc == 2) && (0 == strcmp(argv[1], "timezone_init"))) {
+               timezone_init();
+       } else if ( (argc == 2) && (0 == strcmp(argv[1], "get_current_font"))) {
+               get_current_font();
+       } else {
                // cfg create
                // TRUE or FALSE
                ret = setting_cfg_create();