summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjinwoo.shin <jw0227.shin@samsung.com>2015-07-31 13:58:33 +0900
committerjinwoo.shin <jw0227.shin@samsung.com>2015-07-31 13:58:33 +0900
commitc34ed4684b91fc2bcea4c64227fe2efffbb8e893 (patch)
treefcebd47714f66314d559be3da71603083fe691bb
parent358b9e182c4d15260883f734062e28630af16129 (diff)
downloadair_infosquare-c34ed4684b91fc2bcea4c64227fe2efffbb8e893.tar.gz
air_infosquare-c34ed4684b91fc2bcea4c64227fe2efffbb8e893.tar.bz2
air_infosquare-c34ed4684b91fc2bcea4c64227fe2efffbb8e893.zip
Update user message
Change-Id: I14f596546f5687e340003f901fa0e691a3174119 Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>
-rw-r--r--include/strings.h2
-rw-r--r--src/square_view.c14
2 files changed, 13 insertions, 3 deletions
diff --git a/include/strings.h b/include/strings.h
index 964dc7a..fb210e0 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -31,7 +31,7 @@
#define STR_SQUARE_TITLE STR_NOTIFICATION_TITLE
#define STR_NOTIFICATION_LIST_TITLE "Recent Notification"
-#define STR_DEFAULT_USER_MESSAGE "Good morning !"
+#define STR_DEFAULT_USER_MESSAGE "Welcome, %s"
#define STR_DEFAULT_TIME_AM_PM ""
#define STR_DEFAULT_TIME_HOUR "12"
#define STR_DEFAULT_TIME_MINUTE "30"
diff --git a/src/square_view.c b/src/square_view.c
index 16db8a1..9dbcbf2 100644
--- a/src/square_view.c
+++ b/src/square_view.c
@@ -69,10 +69,20 @@ static input_handler scroller_handler = {
static void _print_user_message(struct _priv *priv)
{
char *message;
+ uid_t uid;
+ struct passwd *passwd;
+ char buf[128];
message = vconf_get_str(KEY_USER_MESSAGE);
- if (!message)
- message = strdup(STR_DEFAULT_USER_MESSAGE);
+ if (!message) {
+ uid = getuid();
+ passwd = getpwuid(uid);
+ if (passwd) {
+ snprintf(buf, sizeof(buf),
+ STR_DEFAULT_USER_MESSAGE, passwd->pw_name);
+ message = buf;
+ }
+ }
elm_object_part_text_set(priv->base, PART_INFO_USER_MESSAGE, message);
}