Change overheat string format 37/78937/6 accepted/tizen/common/20160708.140817 accepted/tizen/mobile/20160708.091907 accepted/tizen/tv/20160708.091957 accepted/tizen/wearable/20160708.091848 submit/tizen/20160708.060309
authorchangjoo.lee <changjoo.lee@samsung.com>
Thu, 7 Jul 2016 11:03:43 +0000 (20:03 +0900)
committerchangjoo.lee <changjoo.lee@samsung.com>
Fri, 8 Jul 2016 05:51:21 +0000 (14:51 +0900)
Change-Id: I4d82f0a10af68800350238b626a93fa7010ae4a8
Signed-off-by: changjoo.lee <changjoo.lee@samsung.com>
src/overheat/overheat-popup.edc
src/overheat/overheat.c

index 6252790..cbf3c23 100755 (executable)
@@ -35,8 +35,10 @@ collections {
 
        #define POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC 15 27
        #define POPUP_PROGRESSBAR_VIEW_LAYOUT_TEXT_FONT_SIZE_INC 0 38
+       #define POPUP_PROGRESSBAR_VIEW_LAYOUT_TEXT_FONT_OVERHEAT_SIZE_INC 20 20
        #define POPUP_PROGRESSBAR_VIEW_LAYOUT_BG_INC 0 69
        #define POPUP_PROGRESSBAR_VIEW_LAYOUT_BG_MIN_INC 0 161
+       #define POPUP_PROGRESSBAR_VIEW_LAYOUT_BG_OVERHEAT_MIN_INC 0 300
 
        #define POPUP_PROGRESSBAR_2TEXT_VIEW_LAYOUT_BG_MIN_INC 0 193
        #define POPUP_PROGRESSBAR_VIEW_LAYOUT_SUBTEXT_FONT_SIZE_INC 0 32
@@ -388,8 +390,8 @@ collections {
 
        group { name: "overheat_view_layout";
           styles {
-             style { name: "overheat_progress_style";
-                base: "font=Tizen:style=Regular align=left font_size="POPUP_TEXT_FONT_SIZE0" color=#000000 wrap=mixed text_class=tizen";
+              style { name: "overheat_processing_style";
+                base: "font=Tizen:style=Regular align=left linegap=20 font_size="POPUP_TEXT_FONT_SIZE0" color=#000000 wrap=mixed text_class=tizen";
                 tag:  "br" "\n";
                 tag:  "tab" "\t";
              }
@@ -399,98 +401,98 @@ collections {
                 type: SPACER;
                 scale: 1;
                 description { state: "default" 0.0;
-                   min: OVERHEAT_POPUP_PROCESSING_VIEW_LAYOUT_BG_MIN_INC;
+                    min: POPUP_PROGRESSBAR_VIEW_LAYOUT_BG_OVERHEAT_MIN_INC;
+                    fixed: 1 0;
                 }
              }
-             part { name: "pad_l";
+             part { name: "pad_l_t";
                 type: SPACER;
                 scale: 1;
                 description { state: "default" 0.0;
-                   min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0;
-                   fixed: 1 0;
-                   rel1 {
-                      relative: 0.0 0.0;
-                      to: "bg";
-                   }
-                               rel2 {
-                      relative: 0.0 1.0;
-                      to: "bg";
-                   }
-                   align: 0.0 0.5;
+                    min: POPUP_PROGRESSBAR_VIEW_LAYOUT_TEXT_FONT_OVERHEAT_SIZE_INC;
+                    max: POPUP_PROGRESSBAR_VIEW_LAYOUT_TEXT_FONT_OVERHEAT_SIZE_INC;
+                    fixed: 1 1;
+                    rel1.relative: 0.0 0.0;
+                    rel2.relative: 0.0 1.0;
+                    align: 0.0 0.0;
                 }
              }
-             part { name: "pad_r";
+             part { name: "pad_r_t";
                 type: SPACER;
                 scale: 1;
                 description { state: "default" 0.0;
-                   min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0;
-                   fixed: 1 0;
-                   rel1 {
-                      relative: 1.0 0.0;
-                      to: "bg";
-                   }
-                               rel2 {
-                      relative: 1.0 1.0;
-                      to: "bg";
-                   }
-                   align: 1.0 0.5;
-                }
+                    min: POPUP_PROGRESSBAR_VIEW_LAYOUT_TEXT_FONT_OVERHEAT_SIZE_INC;
+                    max: POPUP_PROGRESSBAR_VIEW_LAYOUT_TEXT_FONT_OVERHEAT_SIZE_INC;
+                    fixed: 1 1;
+                    rel1.relative: 1.0 0.0;
+                    rel2.relative: 1.0 1.0;
+                    align: 1.0 1.0;
+                }
+             }
+             part { name: "elm.text.contents1";
+                 type: TEXTBLOCK;
+                 scale: 1;
+                 multiline: 1;
+                 description { state: "default" 0.0;
+                    fixed: 0 1;
+                    min: 0 130;
+                    rel1 {
+                       relative: 1.0 0.0;
+                       to: "pad_l_t";
+                    }
+                    rel2 {
+                       relative: 0.0 1.0;
+                       to_x: "pad_r_t";
+                       to_y: "pad_l_t";
+                    }
+                    text {
+                       style: "overheat_processing_style";
+                       min: 0 1;
+                    }
+                    align: 0.5 0.0;
+                 }
              }
              part { name: "processing";
                 type: SWALLOW;
                 scale: 1;
                 description { state: "default" 0.0;
-                   min: POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_MIN_INC;
-                   max: POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_MAX_INC;
-                   rel1 {
-                      relative: 1.0 0.0;
-                      to_x: "pad_l";
-                   }
-                   rel2 {
-                      relative: 1.0 0.0;
-                      to: "pad_after_processing";
-                   }
-                   align: 0.5 0.5;
-                   fixed: 1 1;
-                }
-             }
-             part { name: "pad_after_processing";
-                type: SPACER;
-                scale: 1;
-                description { state: "default" 0.0;
-                   min: 0 10;
-                   rel1 {
-                      to: "elm.text";
-                      relative: 0.0 0.0;
-                   }
-                   rel2 {
-                      to: "elm.text";
-                      relative: 1.0 0.0;
-                   }
-                   align: 0.5 1.0;
-                   fixed: 0 1;
+                    min: POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_MIN_INC;
+                    max: POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_MAX_INC;
+                    rel1 {
+                       relative: 0.0 1.1;
+                       to: "elm.text.contents1";
+                    }
+                    rel2 {
+                       relative: 1.0 0.0;
+                       to_x: "pad_l_t";
+                       to_y: "pad_r_t";
+                    }
+                    align: 0.0 0.0;
+                    fixed: 1 1;
                 }
              }
-             part { name: "elm.text";
+             part { name: "elm.text.contents2";
                 type: TEXTBLOCK;
                 scale: 1;
                 multiline: 1;
                 description { state: "default" 0.0;
-                   min: POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_TEXT_MIN_INC;
-                   rel1 {
-                      relative: 1.0 1.0;
-                      to_x: "pad_l";
-                   }
-                   rel2 {
-                      relative: 0.0 1.0;
-                      to_x: "pad_r";
-                   }
-                   align: 0.5 1.0;
-                   fixed: 0 1;
-                   text {
-                      style: "overheat_progress_style";
-                      min: 0 1;
-                   }
+                    fixed: 0 1;
+                    min: 0 130;
+                    rel1 {
+                       relative: 1.0 1.0;
+                       to_x: "processing";
+                       to_y: "elm.text.contents1";
+                    }
+                    rel2 {
+                       relative: 0.0 0.0;
+                       to: "pad_r_t";
+                    }
+                    text {
+                       style: "overheat_processing_style";
+                       min: 0 1;
+                    }
+                    align: 0.0 0.0;
+                    fixed: 1 1;
                 }
              }
           }
index af442c7..33de226 100755 (executable)
@@ -19,6 +19,7 @@
 
 #include "popup-common.h"
 
+#define BUF_MAX 512
 #define SYSTEMD_STOP_POWER_OFF 4
 
 #define POWER_BUS_NAME        "org.tizen.system.deviced"
@@ -40,12 +41,20 @@ static __attribute__ ((constructor)) void overheat_register_popup(void);
 static char *items[] = {
        "IDS_IDLE_HEADER_PHONE_OVERHEATING_ABB",
        "IDS_QP_POP_YOUR_DEVICE_IS_OVERHEATING_IT_WILL_NOW_POWER_OFF_TO_COOL_DOWN",
+       "IDS_IDLE_POP_PD_SECONDS_ARE_LEFT_BEFORE_YOUR_DEVICE_POWERS_OFF",
        "IDS_ST_BUTTON_TURN_OFF_NOW",
 };
 
 char* gl_text_get(int index)
 {
-       return strdup(_(items[index]));
+       char *text = NULL, buffer[BUF_MAX] = {NULL};
+
+       if (index == 2) {
+               text = _(items[2]);
+               snprintf(buffer, sizeof(buffer), text, 30);
+
+               return strdup(buffer);
+       } else return strdup(_(items[index]));
 }
 
 static void
@@ -204,7 +213,7 @@ int overheat_popup(bundle *b, const struct popup_ops *ops)
        /* turn off button */
        btn = elm_button_add(popup);
        elm_object_style_set(btn, "bottom");
-       elm_object_text_set(btn, gl_text_get(2));
+       elm_object_text_set(btn, gl_text_get(3));
        elm_object_part_content_set(popup, "button2", btn);
        evas_object_smart_callback_add(btn, "clicked", _popup_turnoff_btn_clicked_cb, ops);
 
@@ -215,11 +224,13 @@ int overheat_popup(bundle *b, const struct popup_ops *ops)
        layout = elm_layout_add(popup);
        _D("ELM_OVERHEAT_EDC = %s", ELM_OVERHEAT_EDC);
        elm_layout_file_set(layout, ELM_OVERHEAT_EDC, "overheat_view_layout");
+       elm_object_part_text_set(layout, "elm.text.contents1", gl_text_get(1));
+       elm_object_part_text_set(layout, "elm.text.contents2", gl_text_get(2));
        evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       elm_object_part_text_set(layout, "elm.text", gl_text_get(1));
 
+       /* progressbar */
        progressbar = elm_progressbar_add(layout);
-       elm_object_style_set(progressbar, "process_medium");
+       elm_object_style_set(progressbar, "process_large");
        evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5);
        evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        elm_progressbar_pulse(progressbar, EINA_TRUE);