summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Houston <stephen@localhost.localdomain>2017-09-27 17:19:47 -0500
committerStephen Houston <stephen@localhost.localdomain>2017-09-27 17:19:47 -0500
commitfdbf49af1b6507463459aa59f098dc49304e7230 (patch)
tree49fbdcc35fe4ba7e1aa209a4be081b1d668b8927 /src
parentbb4d69519f84dbdd0c6b7267d4afee4f2d9a9ce5 (diff)
Sysinfo: Cpuclock, Netstatus, and Thermal now use progressbars in the popups to unify and match all sysinfo gadgets.
Diffstat (limited to 'src')
-rw-r--r--src/modules/sysinfo/cpuclock/cpuclock.c95
-rw-r--r--src/modules/sysinfo/memusage/memusage.c31
-rw-r--r--src/modules/sysinfo/netstatus/netstatus.c101
-rw-r--r--src/modules/sysinfo/sysinfo.h13
-rw-r--r--src/modules/sysinfo/thermal/thermal.c71
5 files changed, 233 insertions, 78 deletions
diff --git a/src/modules/sysinfo/cpuclock/cpuclock.c b/src/modules/sysinfo/cpuclock/cpuclock.c
index e786fe6..83890bf 100644
--- a/src/modules/sysinfo/cpuclock/cpuclock.c
+++ b/src/modules/sysinfo/cpuclock/cpuclock.c
@@ -272,7 +272,7 @@ _cpuclock_popup_dismissed(void *data, Evas_Object *obj, void *event_info EINA_UN
272 E_FREE_FUNC(obj, evas_object_del); 272 E_FREE_FUNC(obj, evas_object_del);
273 273
274 inst->cfg->cpuclock.popup = NULL; 274 inst->cfg->cpuclock.popup = NULL;
275 inst->cfg->cpuclock.popup_label = NULL; 275 inst->cfg->cpuclock.popup_pbar = NULL;
276} 276}
277 277
278static void 278static void
@@ -285,9 +285,9 @@ _cpuclock_popup_deleted(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U
285static Evas_Object * 285static Evas_Object *
286_cpuclock_popup_create(Instance *inst) 286_cpuclock_popup_create(Instance *inst)
287{ 287{
288 Evas_Object *popup, *box, *label; 288 Evas_Object *popup, *table, *label, *pbar;
289 double f = inst->cfg->cpuclock.status->cur_frequency; 289 double f = inst->cfg->cpuclock.status->cur_frequency;
290 char buf[100], *u; 290 char buf[4096], text[4096], *u;
291 291
292 if (f < 1000000) 292 if (f < 1000000)
293 { 293 {
@@ -309,19 +309,33 @@ _cpuclock_popup_create(Instance *inst)
309 evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, 309 evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL,
310 _cpuclock_popup_deleted, inst); 310 _cpuclock_popup_deleted, inst);
311 311
312 box = elm_box_add(popup); 312 table = elm_table_add(popup);
313 elm_box_horizontal_set(box, EINA_FALSE); 313 E_EXPAND(table);
314 E_EXPAND(box); E_FILL(box); 314 E_FILL(table);
315 elm_object_content_set(popup, box); 315 elm_object_content_set(popup, table);
316 evas_object_show(box); 316 evas_object_show(table);
317 317
318 label = elm_label_add(box); 318 snprintf(text, sizeof(text), "<big><b>%s</b></big>", _("Frequency"));
319 elm_object_style_set(label, "marker"); 319
320 snprintf(buf, 100, "%s: %1.1f %s", _("Frequency"), f, u); 320 label = elm_label_add(table);
321 elm_object_text_set(label, buf); 321 E_EXPAND(label);
322 elm_box_pack_end(box, label); 322 E_ALIGN(label, 0.5, 0.5);
323 evas_object_show(label); 323 elm_object_text_set(label, text);
324 inst->cfg->cpuclock.popup_label = label; 324 elm_table_pack(table, label, 0, 0, 2, 1);
325 evas_object_show(label);
326
327 snprintf(buf, sizeof(buf), "%1.1f %s (%d %%)", f, u,
328 inst->cfg->cpuclock.percent);
329
330 pbar = elm_progressbar_add(table);
331 E_EXPAND(pbar);
332 E_FILL(pbar);
333 elm_progressbar_span_size_set(pbar, 200 * e_scale);
334 elm_progressbar_value_set(pbar, (float)inst->cfg->cpuclock.percent / 100);
335 elm_progressbar_unit_format_set(pbar, buf);
336 elm_table_pack(table, pbar, 0, 1, 2, 1);
337 evas_object_show(pbar);
338 inst->cfg->cpuclock.popup_pbar = pbar;
325 339
326 e_gadget_util_ctxpopup_place(inst->o_main, popup, 340 e_gadget_util_ctxpopup_place(inst->o_main, popup,
327 inst->cfg->cpuclock.o_gadget); 341 inst->cfg->cpuclock.o_gadget);
@@ -416,7 +430,31 @@ _cpuclock_face_update_current(Instance *inst)
416 edje_object_message_send(elm_layout_edje_get(inst->cfg->cpuclock.o_gadget), EDJE_MESSAGE_INT_SET, 3, 430 edje_object_message_send(elm_layout_edje_get(inst->cfg->cpuclock.o_gadget), EDJE_MESSAGE_INT_SET, 3,
417 frequency_msg); 431 frequency_msg);
418 E_FREE(frequency_msg); 432 E_FREE(frequency_msg);
419 433 if (inst->cfg->cpuclock.tot_min_frequency == 0)
434 inst->cfg->cpuclock.tot_min_frequency = inst->cfg->cpuclock.status->cur_frequency;
435 if (inst->cfg->cpuclock.status->cur_frequency >
436 inst->cfg->cpuclock.tot_max_frequency)
437 {
438 inst->cfg->cpuclock.tot_max_frequency = inst->cfg->cpuclock.status->cur_frequency;
439 inst->cfg->cpuclock.percent = 100;
440 }
441 if (inst->cfg->cpuclock.status->cur_frequency <
442 inst->cfg->cpuclock.tot_min_frequency)
443 {
444 inst->cfg->cpuclock.tot_min_frequency = inst->cfg->cpuclock.status->cur_frequency;
445 inst->cfg->cpuclock.percent = 0;
446 }
447 if ((inst->cfg->cpuclock.tot_min_frequency > 0) &&
448 (inst->cfg->cpuclock.tot_max_frequency >=
449 inst->cfg->cpuclock.tot_min_frequency))
450 {
451 inst->cfg->cpuclock.percent = ((double)(inst->cfg->cpuclock.status->cur_frequency -
452 inst->cfg->cpuclock.tot_min_frequency) /
453 (double)(inst->cfg->cpuclock.tot_max_frequency -
454 inst->cfg->cpuclock.tot_min_frequency)) * 100;
455 }
456 else
457 inst->cfg->cpuclock.percent = 0;
420 /* BSD crashes here without the if-condition 458 /* BSD crashes here without the if-condition
421 * since it has no governors (yet) */ 459 * since it has no governors (yet) */
422 if (inst->cfg->cpuclock.status->cur_governor) 460 if (inst->cfg->cpuclock.status->cur_governor)
@@ -429,7 +467,7 @@ _cpuclock_face_update_current(Instance *inst)
429 if (inst->cfg->cpuclock.popup) 467 if (inst->cfg->cpuclock.popup)
430 { 468 {
431 double f = inst->cfg->cpuclock.status->cur_frequency; 469 double f = inst->cfg->cpuclock.status->cur_frequency;
432 char buf[100], *u; 470 char buf[4096], *u;
433 471
434 if (f < 1000000) 472 if (f < 1000000)
435 { 473 {
@@ -443,8 +481,11 @@ _cpuclock_face_update_current(Instance *inst)
443 f /= 1000000; 481 f /= 1000000;
444 u = _("GHz"); 482 u = _("GHz");
445 } 483 }
446 snprintf(buf, 100, "%s: %1.1f %s", _("Frequency"), f, u); 484 snprintf(buf, sizeof(buf), "%1.1f %s (%d %%)", f, u,
447 elm_object_text_set(inst->cfg->cpuclock.popup_label, buf); 485 inst->cfg->cpuclock.percent);
486 elm_progressbar_unit_format_set(inst->cfg->cpuclock.popup_pbar, buf);
487 elm_progressbar_value_set(inst->cfg->cpuclock.popup_pbar,
488 (float)inst->cfg->cpuclock.percent / 100);
448 } 489 }
449} 490}
450 491
@@ -954,8 +995,8 @@ _cpuclock_removed_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_data)
954 995
955 if (inst->o_main != event_data) return; 996 if (inst->o_main != event_data) return;
956 997
957 if (inst->cfg->cpuclock.popup_label) 998 if (inst->cfg->cpuclock.popup_pbar)
958 E_FREE_FUNC(inst->cfg->cpuclock.popup, evas_object_del); 999 E_FREE_FUNC(inst->cfg->cpuclock.popup_pbar, evas_object_del);
959 if (inst->cfg->cpuclock.popup) 1000 if (inst->cfg->cpuclock.popup)
960 E_FREE_FUNC(inst->cfg->cpuclock.popup, evas_object_del); 1001 E_FREE_FUNC(inst->cfg->cpuclock.popup, evas_object_del);
961 if (inst->cfg->cpuclock.configure) 1002 if (inst->cfg->cpuclock.configure)
@@ -988,8 +1029,8 @@ sysinfo_cpuclock_remove(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U
988 Instance *inst = data; 1029 Instance *inst = data;
989 Ecore_Event_Handler *handler; 1030 Ecore_Event_Handler *handler;
990 1031
991 if (inst->cfg->cpuclock.popup_label) 1032 if (inst->cfg->cpuclock.popup_pbar)
992 E_FREE_FUNC(inst->cfg->cpuclock.popup, evas_object_del); 1033 E_FREE_FUNC(inst->cfg->cpuclock.popup_pbar, evas_object_del);
993 if (inst->cfg->cpuclock.popup) 1034 if (inst->cfg->cpuclock.popup)
994 E_FREE_FUNC(inst->cfg->cpuclock.popup, evas_object_del); 1035 E_FREE_FUNC(inst->cfg->cpuclock.popup, evas_object_del);
995 if (inst->cfg->cpuclock.configure) 1036 if (inst->cfg->cpuclock.configure)
@@ -1017,6 +1058,9 @@ _cpuclock_created_cb(void *data, Evas_Object *obj, void *event_data EINA_UNUSED)
1017 1058
1018 if (inst->cfg->cpuclock.pstate_min == 0) inst->cfg->cpuclock.pstate_min = 1; 1059 if (inst->cfg->cpuclock.pstate_min == 0) inst->cfg->cpuclock.pstate_min = 1;
1019 if (inst->cfg->cpuclock.pstate_max == 0) inst->cfg->cpuclock.pstate_max = 101; 1060 if (inst->cfg->cpuclock.pstate_max == 0) inst->cfg->cpuclock.pstate_max = 101;
1061 inst->cfg->cpuclock.percent = 0;
1062 inst->cfg->cpuclock.tot_min_frequency = 0;
1063 inst->cfg->cpuclock.tot_max_frequency = 0;
1020 1064
1021 inst->cfg->cpuclock.o_gadget = elm_layout_add(inst->o_main); 1065 inst->cfg->cpuclock.o_gadget = elm_layout_add(inst->o_main);
1022 if (orient == E_GADGET_SITE_ORIENT_VERTICAL) 1066 if (orient == E_GADGET_SITE_ORIENT_VERTICAL)
@@ -1070,6 +1114,9 @@ sysinfo_cpuclock_create(Evas_Object *parent, Instance *inst)
1070 1114
1071 if (inst->cfg->cpuclock.pstate_min == 0) inst->cfg->cpuclock.pstate_min = 1; 1115 if (inst->cfg->cpuclock.pstate_min == 0) inst->cfg->cpuclock.pstate_min = 1;
1072 if (inst->cfg->cpuclock.pstate_max == 0) inst->cfg->cpuclock.pstate_max = 101; 1116 if (inst->cfg->cpuclock.pstate_max == 0) inst->cfg->cpuclock.pstate_max = 101;
1117 inst->cfg->cpuclock.percent = 0;
1118 inst->cfg->cpuclock.tot_min_frequency = 0;
1119 inst->cfg->cpuclock.tot_max_frequency = 0;
1073 1120
1074 inst->cfg->cpuclock.o_gadget = elm_layout_add(parent); 1121 inst->cfg->cpuclock.o_gadget = elm_layout_add(parent);
1075 e_theme_edje_object_set(inst->cfg->cpuclock.o_gadget, "base/theme/gadget/cpuclock", 1122 e_theme_edje_object_set(inst->cfg->cpuclock.o_gadget, "base/theme/gadget/cpuclock",
diff --git a/src/modules/sysinfo/memusage/memusage.c b/src/modules/sysinfo/memusage/memusage.c
index acb8545..0b6e726 100644
--- a/src/modules/sysinfo/memusage/memusage.c
+++ b/src/modules/sysinfo/memusage/memusage.c
@@ -139,13 +139,15 @@ _memusage_popup_create(Instance *inst)
139 _memusage_popup_deleted, inst); 139 _memusage_popup_deleted, inst);
140 140
141 table = elm_table_add(popup); 141 table = elm_table_add(popup);
142 E_EXPAND(table); E_FILL(table); 142 E_EXPAND(table);
143 E_FILL(table);
143 elm_object_content_set(popup, table); 144 elm_object_content_set(popup, table);
144 evas_object_show(table); 145 evas_object_show(table);
145 146
146 snprintf(buf, sizeof(buf), _("Memory usage (available %ld MB)"), 147 snprintf(buf, sizeof(buf), _("Memory Usage (Available %ld MB)"),
147 inst->cfg->memusage.mem_total / 1024); 148 inst->cfg->memusage.mem_total / 1024);
148 snprintf(buf2, sizeof(buf2), "<big><b>%s</b></big>", buf); 149 snprintf(buf2, sizeof(buf2), "<big><b>%s</b></big>", buf);
150
149 label = elm_label_add(table); 151 label = elm_label_add(table);
150 E_EXPAND(label); E_ALIGN(label, 0.5, 0.5); 152 E_EXPAND(label); E_ALIGN(label, 0.5, 0.5);
151 elm_object_text_set(label, buf2); 153 elm_object_text_set(label, buf2);
@@ -157,8 +159,10 @@ _memusage_popup_create(Instance *inst)
157 elm_object_text_set(label, _("Used")); 159 elm_object_text_set(label, _("Used"));
158 elm_table_pack(table, label, 0, 1, 1, 1); 160 elm_table_pack(table, label, 0, 1, 1, 1);
159 evas_object_show(label); 161 evas_object_show(label);
162
160 pbar = elm_progressbar_add(table); 163 pbar = elm_progressbar_add(table);
161 E_EXPAND(pbar); E_FILL(pbar); 164 E_EXPAND(pbar);
165 E_FILL(pbar);
162 elm_progressbar_span_size_set(pbar, 200 * e_scale); 166 elm_progressbar_span_size_set(pbar, 200 * e_scale);
163 elm_table_pack(table, pbar, 1, 1, 1, 1); 167 elm_table_pack(table, pbar, 1, 1, 1, 1);
164 evas_object_show(pbar); 168 evas_object_show(pbar);
@@ -169,8 +173,10 @@ _memusage_popup_create(Instance *inst)
169 elm_object_text_set(label, _("Buffers")); 173 elm_object_text_set(label, _("Buffers"));
170 elm_table_pack(table, label, 0, 2, 1, 1); 174 elm_table_pack(table, label, 0, 2, 1, 1);
171 evas_object_show(label); 175 evas_object_show(label);
176
172 pbar = elm_progressbar_add(table); 177 pbar = elm_progressbar_add(table);
173 E_EXPAND(pbar); E_FILL(pbar); 178 E_EXPAND(pbar);
179 E_FILL(pbar);
174 elm_progressbar_span_size_set(pbar, 200 * e_scale); 180 elm_progressbar_span_size_set(pbar, 200 * e_scale);
175 elm_table_pack(table, pbar, 1, 2, 1, 1); 181 elm_table_pack(table, pbar, 1, 2, 1, 1);
176 evas_object_show(pbar); 182 evas_object_show(pbar);
@@ -181,8 +187,10 @@ _memusage_popup_create(Instance *inst)
181 elm_object_text_set(label, _("Cached")); 187 elm_object_text_set(label, _("Cached"));
182 elm_table_pack(table, label, 0, 3, 1, 1); 188 elm_table_pack(table, label, 0, 3, 1, 1);
183 evas_object_show(label); 189 evas_object_show(label);
190
184 pbar = elm_progressbar_add(table); 191 pbar = elm_progressbar_add(table);
185 E_EXPAND(pbar); E_FILL(pbar); 192 E_EXPAND(pbar);
193 E_FILL(pbar);
186 elm_progressbar_span_size_set(pbar, 200 * e_scale); 194 elm_progressbar_span_size_set(pbar, 200 * e_scale);
187 elm_table_pack(table, pbar, 1, 3, 1, 1); 195 elm_table_pack(table, pbar, 1, 3, 1, 1);
188 evas_object_show(pbar); 196 evas_object_show(pbar);
@@ -193,24 +201,29 @@ _memusage_popup_create(Instance *inst)
193 elm_object_text_set(label, _("Shared")); 201 elm_object_text_set(label, _("Shared"));
194 elm_table_pack(table, label, 0, 4, 1, 1); 202 elm_table_pack(table, label, 0, 4, 1, 1);
195 evas_object_show(label); 203 evas_object_show(label);
204
196 pbar = elm_progressbar_add(table); 205 pbar = elm_progressbar_add(table);
197 E_EXPAND(pbar); E_FILL(pbar); 206 E_EXPAND(pbar);
207 E_FILL(pbar);
198 elm_progressbar_span_size_set(pbar, 200 * e_scale); 208 elm_progressbar_span_size_set(pbar, 200 * e_scale);
199 elm_table_pack(table, pbar, 1, 4, 1, 1); 209 elm_table_pack(table, pbar, 1, 4, 1, 1);
200 evas_object_show(pbar); 210 evas_object_show(pbar);
201 evas_object_data_set(popup, "mem_shared_pbar", pbar); 211 evas_object_data_set(popup, "mem_shared_pbar", pbar);
202 212
203 snprintf(buf, sizeof(buf), _("Swap usage (available %ld MB)"), 213 snprintf(buf, sizeof(buf), _("Swap Usage (Available %ld MB)"),
204 inst->cfg->memusage.swp_total / 1024); 214 inst->cfg->memusage.swp_total / 1024);
205 snprintf(buf2, sizeof(buf2), "<big><b>%s</b></big>", buf); 215 snprintf(buf2, sizeof(buf2), "<big><b>%s</b></big>", buf);
216
206 label = elm_label_add(table); 217 label = elm_label_add(table);
207 E_EXPAND(label); E_ALIGN(label, 0.5, 0.5); 218 E_EXPAND(label);
219 E_ALIGN(label, 0.5, 0.5);
208 elm_object_text_set(label, buf2); 220 elm_object_text_set(label, buf2);
209 elm_table_pack(table, label, 0, 5, 2, 1); 221 elm_table_pack(table, label, 0, 5, 2, 1);
210 evas_object_show(label); 222 evas_object_show(label);
211 223
212 pbar = elm_progressbar_add(table); 224 pbar = elm_progressbar_add(table);
213 E_EXPAND(pbar); E_FILL(pbar); 225 E_EXPAND(pbar);
226 E_FILL(pbar);
214 elm_table_pack(table, pbar, 0, 6, 2, 1); 227 elm_table_pack(table, pbar, 0, 6, 2, 1);
215 evas_object_show(pbar); 228 evas_object_show(pbar);
216 evas_object_data_set(popup, "swap_pbar", pbar); 229 evas_object_data_set(popup, "swap_pbar", pbar);
diff --git a/src/modules/sysinfo/netstatus/netstatus.c b/src/modules/sysinfo/netstatus/netstatus.c
index 87ea74c..5d29f94 100644
--- a/src/modules/sysinfo/netstatus/netstatus.c
+++ b/src/modules/sysinfo/netstatus/netstatus.c
@@ -41,9 +41,20 @@ _netstatus_face_update(Thread_Config *thc)
41 41
42 if (thc->inst->cfg->netstatus.popup) 42 if (thc->inst->cfg->netstatus.popup)
43 { 43 {
44 char text[4096]; 44 char buf[4096];
45 snprintf(text, sizeof(text), "%s<ps/>%s", thc->instring, thc->outstring); 45 snprintf(buf, sizeof(buf), "%s (%d %%)",
46 elm_object_text_set(thc->inst->cfg->netstatus.popup_label, text); 46 thc->inst->cfg->netstatus.instring,
47 thc->inst->cfg->netstatus.inpercent);
48 elm_progressbar_value_set(thc->inst->cfg->netstatus.popup_inpbar,
49 (float)thc->inst->cfg->netstatus.inpercent / 100);
50 elm_progressbar_unit_format_set(thc->inst->cfg->netstatus.popup_inpbar, buf);
51 memset(buf, 0x00, sizeof(buf));
52 snprintf(buf, sizeof(buf), "%s (%d %%)",
53 thc->inst->cfg->netstatus.outstring,
54 thc->inst->cfg->netstatus.outpercent);
55 elm_progressbar_value_set(thc->inst->cfg->netstatus.popup_outpbar,
56 (float)thc->inst->cfg->netstatus.outpercent / 100);
57 elm_progressbar_unit_format_set(thc->inst->cfg->netstatus.popup_outpbar, buf);
47 } 58 }
48} 59}
49 60
@@ -75,10 +86,10 @@ _netstatus_popup_deleted(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
75static void 86static void
76_netstatus_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_data) 87_netstatus_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_data)
77{ 88{
78 Evas_Object *label, *popup; 89 Evas_Object *label, *popup, *table, *pbar;
79 Evas_Event_Mouse_Down *ev = event_data; 90 Evas_Event_Mouse_Down *ev = event_data;
80 Instance *inst = data; 91 Instance *inst = data;
81 char text[4096]; 92 char text[4096], buf[4096];
82 93
83 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; 94 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
84 if (ev->button != 3) 95 if (ev->button != 3)
@@ -93,13 +104,59 @@ _netstatus_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
93 evas_object_smart_callback_add(popup, "dismissed", _netstatus_popup_dismissed, inst); 104 evas_object_smart_callback_add(popup, "dismissed", _netstatus_popup_dismissed, inst);
94 evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, _netstatus_popup_deleted, inst); 105 evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, _netstatus_popup_deleted, inst);
95 106
96 snprintf(text, sizeof(text), "%s<ps/>%s", inst->cfg->netstatus.instring, inst->cfg->netstatus.outstring); 107 table = elm_table_add(popup);
97 label = elm_label_add(popup); 108 E_EXPAND(table);
98 elm_object_style_set(label, "marker"); 109 E_FILL(table);
110 elm_object_content_set(popup, table);
111 evas_object_show(table);
112
113 snprintf(text, sizeof(text), "<big><b>%s</b></big>", _("Network Throughput"));
114
115 label = elm_label_add(table);
116 E_EXPAND(label); E_ALIGN(label, 0.5, 0.5);
99 elm_object_text_set(label, text); 117 elm_object_text_set(label, text);
100 elm_object_content_set(popup, label); 118 elm_table_pack(table, label, 0, 0, 2, 1);
101 evas_object_show(label); 119 evas_object_show(label);
102 inst->cfg->netstatus.popup_label = label; 120
121 label = elm_label_add(table);
122 E_ALIGN(label, 0.0, 0.5);
123 elm_object_text_set(label, _("Receiving"));
124 elm_table_pack(table, label, 0, 1, 1, 1);
125 evas_object_show(label);
126
127 snprintf(buf, sizeof(buf), "%s (%d %%)",
128 inst->cfg->netstatus.instring,
129 inst->cfg->netstatus.inpercent);
130
131 pbar = elm_progressbar_add(table);
132 E_EXPAND(pbar);
133 E_FILL(pbar);
134 elm_progressbar_span_size_set(pbar, 200 * e_scale);
135 elm_progressbar_value_set(pbar, (float)inst->cfg->netstatus.inpercent / 100);
136 elm_table_pack(table, pbar, 1, 1, 1, 1);
137 evas_object_show(pbar);
138 inst->cfg->netstatus.popup_inpbar = pbar;
139
140 label = elm_label_add(table);
141 E_ALIGN(label, 0.0, 0.5);
142 elm_object_text_set(label, _("Sending"));
143 elm_table_pack(table, label, 0, 2, 1, 1);
144 evas_object_show(label);
145
146 memset(buf, 0x00, sizeof(buf));
147 snprintf(buf, sizeof(buf), "%s (%d %%)",
148 inst->cfg->netstatus.outstring,
149 inst->cfg->netstatus.outpercent);
150
151 pbar = elm_progressbar_add(table);
152 E_EXPAND(pbar);
153 E_FILL(pbar);
154 elm_progressbar_span_size_set(pbar, 200 * e_scale);
155 elm_progressbar_value_set(pbar, (float)inst->cfg->netstatus.outpercent / 100);
156 elm_progressbar_unit_format_set(pbar, buf);
157 elm_table_pack(table, pbar, 1, 2, 1, 1);
158 evas_object_show(pbar);
159 inst->cfg->netstatus.popup_outpbar = pbar;
103 160
104 e_gadget_util_ctxpopup_place(inst->o_main, popup, 161 e_gadget_util_ctxpopup_place(inst->o_main, popup,
105 inst->cfg->netstatus.o_gadget); 162 inst->cfg->netstatus.o_gadget);
@@ -154,30 +211,30 @@ _netstatus_cb_usage_check_main(void *data, Ecore_Thread *th)
154#endif 211#endif
155 if (!thc->incurrent) 212 if (!thc->incurrent)
156 { 213 {
157 snprintf(rin, sizeof(rin), "%s: 0 B/s", _("Receiving")); 214 snprintf(rin, sizeof(rin), "0 B/s");
158 } 215 }
159 else 216 else
160 { 217 {
161 if (thc->incurrent > 1048576) 218 if (thc->incurrent > 1048576)
162 snprintf(rin, sizeof(rin), "%s: %.2f MB/s", _("Receiving"), ((float)thc->incurrent / 1048576)); 219 snprintf(rin, sizeof(rin), "%.2f MB/s", ((float)thc->incurrent / 1048576));
163 else if ((thc->incurrent > 1024) && (thc->incurrent < 1048576)) 220 else if ((thc->incurrent > 1024) && (thc->incurrent < 1048576))
164 snprintf(rin, sizeof(rin), "%s: %lu KB/s", _("Receiving"), (thc->incurrent / 1024)); 221 snprintf(rin, sizeof(rin), "%lu KB/s", (thc->incurrent / 1024));
165 else 222 else
166 snprintf(rin, sizeof(rin), "%s: %lu B/s", _("Receiving"), thc->incurrent); 223 snprintf(rin, sizeof(rin), "%lu B/s", thc->incurrent);
167 } 224 }
168 eina_stringshare_replace(&thc->instring, rin); 225 eina_stringshare_replace(&thc->instring, rin);
169 if (!thc->outcurrent) 226 if (!thc->outcurrent)
170 { 227 {
171 snprintf(rout, sizeof(rout), "%s: 0 B/s", _("Sending")); 228 snprintf(rout, sizeof(rout), "0 B/s");
172 } 229 }
173 else 230 else
174 { 231 {
175 if (thc->outcurrent > 1048576) 232 if (thc->outcurrent > 1048576)
176 snprintf(rout, sizeof(rout), "%s: %.2f MB/s", _("Sending"), ((float)thc->outcurrent / 1048576)); 233 snprintf(rout, sizeof(rout), "%.2f MB/s", ((float)thc->outcurrent / 1048576));
177 else if ((thc->outcurrent > 1024) && (thc->outcurrent < 1048576)) 234 else if ((thc->outcurrent > 1024) && (thc->outcurrent < 1048576))
178 snprintf(rout, sizeof(rout), "%s: %lu KB/s", _("Sending"), (thc->outcurrent / 1024)); 235 snprintf(rout, sizeof(rout), "%lu KB/s", (thc->outcurrent / 1024));
179 else 236 else
180 snprintf(rout, sizeof(rout), "%s: %lu B/s", _("Sending"), thc->outcurrent); 237 snprintf(rout, sizeof(rout), "%lu B/s", thc->outcurrent);
181 } 238 }
182 eina_stringshare_replace(&thc->outstring, rout); 239 eina_stringshare_replace(&thc->outstring, rout);
183 ecore_thread_feedback(th, NULL); 240 ecore_thread_feedback(th, NULL);
@@ -199,6 +256,8 @@ _netstatus_cb_usage_check_notify(void *data,
199 256
200 eina_stringshare_replace(&thc->inst->cfg->netstatus.instring, thc->instring); 257 eina_stringshare_replace(&thc->inst->cfg->netstatus.instring, thc->instring);
201 eina_stringshare_replace(&thc->inst->cfg->netstatus.outstring, thc->outstring); 258 eina_stringshare_replace(&thc->inst->cfg->netstatus.outstring, thc->outstring);
259 thc->inst->cfg->netstatus.inpercent = thc->inpercent;
260 thc->inst->cfg->netstatus.outpercent = thc->outpercent;
202 _netstatus_face_update(thc); 261 _netstatus_face_update(thc);
203} 262}
204 263
@@ -346,8 +405,11 @@ _netstatus_created_cb(void *data, Evas_Object *obj, void *event_data EINA_UNUSED
346 405
347 e_gadget_configure_cb_set(inst->o_main, _netstatus_configure_cb); 406 e_gadget_configure_cb_set(inst->o_main, _netstatus_configure_cb);
348 407
408 inst->cfg->netstatus.popup = NULL;
349 inst->cfg->netstatus.instring = NULL; 409 inst->cfg->netstatus.instring = NULL;
350 inst->cfg->netstatus.outstring = NULL; 410 inst->cfg->netstatus.outstring = NULL;
411 inst->cfg->netstatus.inpercent = 0;
412 inst->cfg->netstatus.outpercent = 0;
351 413
352 inst->cfg->netstatus.o_gadget = elm_layout_add(inst->o_main); 414 inst->cfg->netstatus.o_gadget = elm_layout_add(inst->o_main);
353 if (orient == E_GADGET_SITE_ORIENT_VERTICAL) 415 if (orient == E_GADGET_SITE_ORIENT_VERTICAL)
@@ -377,6 +439,9 @@ sysinfo_netstatus_create(Evas_Object *parent, Instance *inst)
377 inst->cfg->netstatus.popup = NULL; 439 inst->cfg->netstatus.popup = NULL;
378 inst->cfg->netstatus.instring = NULL; 440 inst->cfg->netstatus.instring = NULL;
379 inst->cfg->netstatus.outstring = NULL; 441 inst->cfg->netstatus.outstring = NULL;
442 inst->cfg->netstatus.inpercent = 0;
443 inst->cfg->netstatus.outpercent = 0;
444
380 inst->cfg->netstatus.o_gadget = elm_layout_add(parent); 445 inst->cfg->netstatus.o_gadget = elm_layout_add(parent);
381 e_theme_edje_object_set(inst->cfg->netstatus.o_gadget, "base/theme/gadget/netstatus", 446 e_theme_edje_object_set(inst->cfg->netstatus.o_gadget, "base/theme/gadget/netstatus",
382 "e/gadget/netstatus/main"); 447 "e/gadget/netstatus/main");
diff --git a/src/modules/sysinfo/sysinfo.h b/src/modules/sysinfo/sysinfo.h
index 98b4c5a..387e4eb 100644
--- a/src/modules/sysinfo/sysinfo.h
+++ b/src/modules/sysinfo/sysinfo.h
@@ -160,11 +160,12 @@ struct _Config_Item
160 Evas_Object *o_gadget; 160 Evas_Object *o_gadget;
161 Evas_Object *configure; 161 Evas_Object *configure;
162 Evas_Object *popup; 162 Evas_Object *popup;
163 Evas_Object *popup_label; 163 Evas_Object *popup_pbar;
164 int poll_interval; 164 int poll_interval;
165 int low, high; 165 int low, high;
166 int sensor_type; 166 int sensor_type;
167 int temp; 167 int temp;
168 int percent;
168 const char *sensor_name; 169 const char *sensor_name;
169 Unit units; 170 Unit units;
170#if defined(HAVE_EEZE) 171#if defined(HAVE_EEZE)
@@ -182,11 +183,14 @@ struct _Config_Item
182 { 183 {
183 Evas_Object *o_gadget; 184 Evas_Object *o_gadget;
184 Evas_Object *popup; 185 Evas_Object *popup;
185 Evas_Object *popup_label; 186 Evas_Object *popup_pbar;
186 Evas_Object *configure; 187 Evas_Object *configure;
187 int poll_interval; 188 int poll_interval;
188 int restore_governor; 189 int restore_governor;
189 int auto_powersave; 190 int auto_powersave;
191 int percent;
192 int tot_min_frequency;
193 int tot_max_frequency;
190 const char *powersave_governor; 194 const char *powersave_governor;
191 const char *governor; 195 const char *governor;
192 int pstate_min; 196 int pstate_min;
@@ -232,12 +236,15 @@ struct _Config_Item
232 { 236 {
233 Evas_Object *o_gadget; 237 Evas_Object *o_gadget;
234 Evas_Object *popup; 238 Evas_Object *popup;
235 Evas_Object *popup_label; 239 Evas_Object *popup_inpbar;
240 Evas_Object *popup_outpbar;
236 Evas_Object *configure; 241 Evas_Object *configure;
237 Eina_Bool automax; 242 Eina_Bool automax;
238 Netstatus_Unit receive_units; 243 Netstatus_Unit receive_units;
239 Netstatus_Unit send_units; 244 Netstatus_Unit send_units;
240 int poll_interval; 245 int poll_interval;
246 int inpercent;
247 int outpercent;
241 unsigned long inmax; 248 unsigned long inmax;
242 unsigned long outmax; 249 unsigned long outmax;
243 Ecore_Thread *usage_check_thread; 250 Ecore_Thread *usage_check_thread;
diff --git a/src/modules/sysinfo/thermal/thermal.c b/src/modules/sysinfo/thermal/thermal.c
index f09d053..a423d67 100644
--- a/src/modules/sysinfo/thermal/thermal.c
+++ b/src/modules/sysinfo/thermal/thermal.c
@@ -27,6 +27,7 @@ _thermal_face_level_set(Instance *inst, double level)
27 if (level < 0.0) level = 0.0; 27 if (level < 0.0) level = 0.0;
28 else if (level > 1.0) 28 else if (level > 1.0)
29 level = 1.0; 29 level = 1.0;
30 inst->cfg->thermal.percent = level * 100;
30 msg.val = level; 31 msg.val = level;
31 edje_object_message_send(elm_layout_edje_get(inst->cfg->thermal.o_gadget), EDJE_MESSAGE_FLOAT, 1, &msg); 32 edje_object_message_send(elm_layout_edje_get(inst->cfg->thermal.o_gadget), EDJE_MESSAGE_FLOAT, 1, &msg);
32} 33}
@@ -63,13 +64,18 @@ _thermal_apply(Instance *inst, int temp)
63 } 64 }
64 if (inst->cfg->thermal.popup) 65 if (inst->cfg->thermal.popup)
65 { 66 {
66 char buf[100]; 67 char buf[4096];
67 68
68 if (inst->cfg->thermal.units == FAHRENHEIT) 69 if (inst->cfg->thermal.units == FAHRENHEIT)
69 snprintf(buf, 100, "%s: %d F", _("Temperature"), (int)((inst->cfg->thermal.temp * 9.0 / 5.0) + 32)); 70 snprintf(buf, sizeof(buf), "%d F (%d %%)",
71 (int)((inst->cfg->thermal.temp * 9.0 / 5.0) + 32),
72 inst->cfg->thermal.percent);
70 else 73 else
71 snprintf(buf, 100, "%s: %d C", _("Temperature"), inst->cfg->thermal.temp); 74 snprintf(buf, sizeof(buf), "%d C (%d %%)",
72 elm_object_text_set(inst->cfg->thermal.popup_label, buf); 75 (int)inst->cfg->thermal.temp,
76 inst->cfg->thermal.percent);
77 elm_progressbar_value_set(inst->cfg->thermal.popup_pbar,
78 (float)inst->cfg->thermal.percent / 100);
73 } 79 }
74} 80}
75 81
@@ -161,7 +167,7 @@ _thermal_popup_dismissed(void *data, Evas_Object *obj, void *event_info EINA_UNU
161 E_FREE_FUNC(obj, evas_object_del); 167 E_FREE_FUNC(obj, evas_object_del);
162 168
163 inst->cfg->thermal.popup = NULL; 169 inst->cfg->thermal.popup = NULL;
164 inst->cfg->thermal.popup_label = NULL; 170 inst->cfg->thermal.popup_pbar = NULL;
165} 171}
166 172
167static void 173static void
@@ -174,8 +180,8 @@ _thermal_popup_deleted(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UN
174static Evas_Object * 180static Evas_Object *
175_thermal_popup_create(Instance *inst) 181_thermal_popup_create(Instance *inst)
176{ 182{
177 Evas_Object *popup, *box, *label; 183 Evas_Object *popup, *table, *label, *pbar;
178 char buf[100]; 184 char text[4096], buf[100];
179 185
180 popup = elm_ctxpopup_add(e_comp->elm); 186 popup = elm_ctxpopup_add(e_comp->elm);
181 elm_object_style_set(popup, "noblock"); 187 elm_object_style_set(popup, "noblock");
@@ -184,22 +190,37 @@ _thermal_popup_create(Instance *inst)
184 evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, 190 evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL,
185 _thermal_popup_deleted, inst); 191 _thermal_popup_deleted, inst);
186 192
187 box = elm_box_add(popup); 193 table = elm_table_add(popup);
188 elm_box_horizontal_set(box, EINA_FALSE); 194 E_EXPAND(table);
189 E_EXPAND(box); E_FILL(box); 195 E_FILL(table);
190 elm_object_content_set(popup, box); 196 elm_object_content_set(popup, table);
191 evas_object_show(box); 197 evas_object_show(table);
198
199 snprintf(text, sizeof(text), "<big><b>%s</b></big>", _("Temperature"));
200
201 label = elm_label_add(table);
202 E_EXPAND(label); E_ALIGN(label, 0.5, 0.5);
203 elm_object_text_set(label, text);
204 elm_table_pack(table, label, 0, 0, 2, 1);
205 evas_object_show(label);
192 206
193 label = elm_label_add(box);
194 elm_object_style_set(label, "marker");
195 if (inst->cfg->thermal.units == FAHRENHEIT) 207 if (inst->cfg->thermal.units == FAHRENHEIT)
196 snprintf(buf, 100, "%s: %d F", _("Temperature"), (int)((inst->cfg->thermal.temp * 9.0 / 5.0) + 32)); 208 snprintf(buf, sizeof(buf), "%d F (%d %%)",
209 (int)((inst->cfg->thermal.temp * 9.0 / 5.0) + 32),
210 inst->cfg->thermal.percent);
197 else 211 else
198 snprintf(buf, 100, "%s: %d C", _("Temperature"), inst->cfg->thermal.temp); 212 snprintf(buf, sizeof(buf), "%d C (%d %%)",
199 elm_object_text_set(label, buf); 213 (int)inst->cfg->thermal.temp,
200 elm_box_pack_end(box, label); 214 inst->cfg->thermal.percent);
201 evas_object_show(label); 215
202 inst->cfg->thermal.popup_label = label; 216 pbar = elm_progressbar_add(table);
217 E_EXPAND(pbar); E_FILL(pbar);
218 elm_progressbar_span_size_set(pbar, 200 * e_scale);
219 elm_progressbar_value_set(pbar, (float)inst->cfg->thermal.percent / 100);
220 elm_progressbar_unit_format_set(pbar, buf);
221 elm_table_pack(table, pbar, 0, 1, 2, 1);
222 evas_object_show(pbar);
223 inst->cfg->thermal.popup_pbar = pbar;
203 224
204 e_gadget_util_ctxpopup_place(inst->o_main, popup, 225 e_gadget_util_ctxpopup_place(inst->o_main, popup,
205 inst->cfg->thermal.o_gadget); 226 inst->cfg->thermal.o_gadget);
@@ -334,8 +355,8 @@ _thermal_removed_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_data)
334 355
335 if (inst->o_main != event_data) return; 356 if (inst->o_main != event_data) return;
336 357
337 if (inst->cfg->thermal.popup_label) 358 if (inst->cfg->thermal.popup_pbar)
338 E_FREE_FUNC(inst->cfg->thermal.popup_label, evas_object_del); 359 E_FREE_FUNC(inst->cfg->thermal.popup_pbar, evas_object_del);
339 if (inst->cfg->thermal.popup) 360 if (inst->cfg->thermal.popup)
340 E_FREE_FUNC(inst->cfg->thermal.popup, evas_object_del); 361 E_FREE_FUNC(inst->cfg->thermal.popup, evas_object_del);
341 if (inst->cfg->thermal.configure) 362 if (inst->cfg->thermal.configure)
@@ -364,8 +385,8 @@ sysinfo_thermal_remove(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UN
364 Instance *inst = data; 385 Instance *inst = data;
365 Ecore_Event_Handler *handler; 386 Ecore_Event_Handler *handler;
366 387
367 if (inst->cfg->thermal.popup_label) 388 if (inst->cfg->thermal.popup_pbar)
368 E_FREE_FUNC(inst->cfg->thermal.popup_label, evas_object_del); 389 E_FREE_FUNC(inst->cfg->thermal.popup_pbar, evas_object_del);
369 if (inst->cfg->thermal.popup) 390 if (inst->cfg->thermal.popup)
370 E_FREE_FUNC(inst->cfg->thermal.popup, evas_object_del); 391 E_FREE_FUNC(inst->cfg->thermal.popup, evas_object_del);
371 if (inst->cfg->thermal.configure) 392 if (inst->cfg->thermal.configure)
@@ -389,6 +410,7 @@ _thermal_created_cb(void *data, Evas_Object *obj, void *event_data EINA_UNUSED)
389 e_gadget_configure_cb_set(inst->o_main, _thermal_configure_cb); 410 e_gadget_configure_cb_set(inst->o_main, _thermal_configure_cb);
390 411
391 inst->cfg->thermal.temp = 900; 412 inst->cfg->thermal.temp = 900;
413 inst->cfg->thermal.percent = 0;
392 inst->cfg->thermal.have_temp = EINA_FALSE; 414 inst->cfg->thermal.have_temp = EINA_FALSE;
393 415
394 inst->cfg->thermal.o_gadget = elm_layout_add(inst->o_main); 416 inst->cfg->thermal.o_gadget = elm_layout_add(inst->o_main);
@@ -419,6 +441,7 @@ Evas_Object *
419sysinfo_thermal_create(Evas_Object *parent, Instance *inst) 441sysinfo_thermal_create(Evas_Object *parent, Instance *inst)
420{ 442{
421 inst->cfg->thermal.temp = 900; 443 inst->cfg->thermal.temp = 900;
444 inst->cfg->thermal.percent = 0;
422 inst->cfg->thermal.have_temp = EINA_FALSE; 445 inst->cfg->thermal.have_temp = EINA_FALSE;
423 446
424 inst->cfg->thermal.o_gadget = elm_layout_add(parent); 447 inst->cfg->thermal.o_gadget = elm_layout_add(parent);