From 828328201c4a0f12d36ca7cca131259ee83c7cb8 Mon Sep 17 00:00:00 2001 From: cskim Date: Tue, 15 Mar 2016 09:25:47 +0900 Subject: [PATCH] Add focus to the text entry of the country selection page. Change-Id: I5b6948774a54966effb215d9d7db0bddc23d4db3 --- TelegramTizen/src/tg_country_selection_view.c | 2 ++ tg-engine-service/mtprotocol/tgl-inner.h | 29 ++++++++++++++++---- tg-engine-service/mtprotocol/tools.c | 38 +-------------------------- 3 files changed, 27 insertions(+), 42 deletions(-) diff --git a/TelegramTizen/src/tg_country_selection_view.c b/TelegramTizen/src/tg_country_selection_view.c index 0a14b7a..d24543f 100644 --- a/TelegramTizen/src/tg_country_selection_view.c +++ b/TelegramTizen/src/tg_country_selection_view.c @@ -260,4 +260,6 @@ void launch_country_selection_view(appdata_s *ad) Elm_Object_Item *it = NULL; it = elm_naviframe_item_push(ad->nf, "MIDS_SPAY_BODY_SELECT_A_COUNTRY", NULL, NULL, layout, NULL); elm_object_item_domain_text_translatable_set(it, NULL, EINA_TRUE); + + elm_object_focus_set(searchbar_layout, EINA_TRUE); } diff --git a/tg-engine-service/mtprotocol/tgl-inner.h b/tg-engine-service/mtprotocol/tgl-inner.h index 19df19e..0086f38 100644 --- a/tg-engine-service/mtprotocol/tgl-inner.h +++ b/tg-engine-service/mtprotocol/tgl-inner.h @@ -21,11 +21,30 @@ #ifndef __TGL_INNER_H__ #define __TGL_INNER_H__ +#include "logger.h" + #define vlogprintf(verbosity_level,...) \ - do { \ - if (TLS->verbosity >= verbosity_level) { \ - logprintf_x(verbosity_level, __VA_ARGS__); \ - } \ - } while (0) + do { \ + if (TLS->verbosity >= (verbosity_level)) { \ + switch(verbosity_level) \ + { \ + case E_ERROR :\ + LOGE(__VA_ARGS__);\ + break;\ + case E_WARNING : \ + WARN(__VA_ARGS__); \ + break;\ + case E_NOTICE : \ + LOGI(__VA_ARGS__); \ + break;\ + case E_SOCKET : \ + LOGV(__VA_ARGS__); \ + break;\ + case E_DEBUG : \ + default: \ + LOGD(__VA_ARGS__); \ + } \ + } \ + } while (0) #endif diff --git a/tg-engine-service/mtprotocol/tools.c b/tg-engine-service/mtprotocol/tools.c index e935833..d78530a 100644 --- a/tg-engine-service/mtprotocol/tools.c +++ b/tg-engine-service/mtprotocol/tools.c @@ -57,42 +57,6 @@ static long long total_allocated_bytes; void logprintf(const char *format, ...) __attribute__((format(printf, 1, 2), weak)); -void _printf(int level, char* buffer) -{ - switch(level) - { - case E_ERROR : - LOGE("%s", buffer); - return; - case E_WARNING : - WARN("%s", buffer); - return; - case E_NOTICE : - LOGI("%s", buffer); - return; - case E_DEBUG : - LOGD("%s", buffer); - return; - case E_SOCKET : - LOGV("%s", buffer); - return; - default: - LOGD("%s", buffer); - } -} - -void logprintf_x(int level, const char *format, ...) -{ - char buffer[2048]; - va_list ap; - - va_start(ap, format); - vsnprintf(buffer, sizeof(buffer), format, ap); - va_end(ap); - - _printf(level, buffer); -} - void logprintf(const char *format, ...) { char buffer[2048]; @@ -102,7 +66,7 @@ void logprintf(const char *format, ...) vsnprintf(buffer, sizeof(buffer), format, ap); va_end(ap); - _printf(E_DEBUG, buffer); + LOGD("%s", buffer); } int tgl_snprintf(char *buf, int len, const char *format, ...) -- 2.7.4