summaryrefslogtreecommitdiff
path: root/src/bin/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/ui.c')
-rw-r--r--src/bin/ui.c37
1 files changed, 15 insertions, 22 deletions
diff --git a/src/bin/ui.c b/src/bin/ui.c
index 3688da8..aa3b249 100644
--- a/src/bin/ui.c
+++ b/src/bin/ui.c
@@ -91,13 +91,6 @@ _mem_adjust(Data_Unit unit, unsigned long value)
91 return value; 91 return value;
92} 92}
93 93
94static void
95_progressbar_value_force_set(Evas_Object *progressbar, double val)
96{
97 elm_progressbar_value_set(progressbar, 0.00001);
98 elm_progressbar_value_set(progressbar, val);
99}
100
101static char * 94static char *
102_network_transfer_format(double rate) 95_network_transfer_format(double rate)
103{ 96{
@@ -154,7 +147,7 @@ _tab_misc_update(Ui *ui, results_t *results)
154 evas_object_size_hint_weight_set(progress, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 147 evas_object_size_hint_weight_set(progress, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
155 elm_progressbar_span_size_set(progress, 1.0); 148 elm_progressbar_span_size_set(progress, 1.0);
156 elm_progressbar_unit_format_set(progress, "%1.2f%%"); 149 elm_progressbar_unit_format_set(progress, "%1.2f%%");
157 _progressbar_value_force_set(progress, (double)results->power.batteries[i]->percent / 100); 150 elm_progressbar_value_set(progress, (double)results->power.batteries[i]->percent / 100);
158 evas_object_show(progress); 151 evas_object_show(progress);
159 elm_object_content_set(frame, progress); 152 elm_object_content_set(frame, progress);
160 elm_box_pack_end(box, frame); 153 elm_box_pack_end(box, frame);
@@ -182,9 +175,9 @@ _tab_misc_update(Ui *ui, results_t *results)
182 free(tmp); 175 free(tmp);
183 176
184 if (results->incoming == 0) 177 if (results->incoming == 0)
185 _progressbar_value_force_set(progress, 0.0); 178 elm_progressbar_value_set(progress, 0.0);
186 else 179 else
187 _progressbar_value_force_set(progress, 1.0); 180 elm_progressbar_value_set(progress, 1.0);
188 181
189 evas_object_show(progress); 182 evas_object_show(progress);
190 183
@@ -206,9 +199,9 @@ _tab_misc_update(Ui *ui, results_t *results)
206 free(tmp); 199 free(tmp);
207 200
208 if (results->outgoing == 0) 201 if (results->outgoing == 0)
209 _progressbar_value_force_set(progress, 0.0); 202 elm_progressbar_value_set(progress, 0.0);
210 else 203 else
211 _progressbar_value_force_set(progress, 1.0); 204 elm_progressbar_value_set(progress, 1.0);
212 205
213 evas_object_show(progress); 206 evas_object_show(progress);
214 207
@@ -266,9 +259,9 @@ _ui_disk_add(Ui *ui, const char *path, const char *mount, unsigned long total, u
266 value = used / ratio; 259 value = used / ratio;
267 260
268 if (used == 0 && total == 0) 261 if (used == 0 && total == 0)
269 _progressbar_value_force_set(progress, 1.0); 262 elm_progressbar_value_set(progress, 1.0);
270 else 263 else
271 _progressbar_value_force_set(progress, value / 100.0); 264 elm_progressbar_value_set(progress, value / 100.0);
272 265
273 evas_object_show(progress); 266 evas_object_show(progress);
274 267
@@ -323,7 +316,7 @@ _tab_memory_update(Ui *ui, results_t *results)
323 _mem_adjust(ui->data_unit, results->memory.total), ui->data_unit)); 316 _mem_adjust(ui->data_unit, results->memory.total), ui->data_unit));
324 ratio = results->memory.total / 100.0; 317 ratio = results->memory.total / 100.0;
325 value = results->memory.used / ratio; 318 value = results->memory.used / ratio;
326 _progressbar_value_force_set(progress, value / 100); 319 elm_progressbar_value_set(progress, value / 100);
327 320
328 progress = ui->progress_mem_cached; 321 progress = ui->progress_mem_cached;
329 elm_progressbar_unit_format_set(progress, eina_slstr_printf( 322 elm_progressbar_unit_format_set(progress, eina_slstr_printf(
@@ -332,7 +325,7 @@ _tab_memory_update(Ui *ui, results_t *results)
332 _mem_adjust(ui->data_unit, results->memory.total), ui->data_unit)); 325 _mem_adjust(ui->data_unit, results->memory.total), ui->data_unit));
333 ratio = results->memory.total / 100.0; 326 ratio = results->memory.total / 100.0;
334 value = results->memory.cached / ratio; 327 value = results->memory.cached / ratio;
335 _progressbar_value_force_set(progress, value / 100); 328 elm_progressbar_value_set(progress, value / 100);
336 329
337 progress = ui->progress_mem_buffered; 330 progress = ui->progress_mem_buffered;
338 elm_progressbar_unit_format_set(progress, 331 elm_progressbar_unit_format_set(progress,
@@ -342,7 +335,7 @@ _tab_memory_update(Ui *ui, results_t *results)
342 _mem_adjust(ui->data_unit, results->memory.total), ui->data_unit)); 335 _mem_adjust(ui->data_unit, results->memory.total), ui->data_unit));
343 ratio = results->memory.total / 100.0; 336 ratio = results->memory.total / 100.0;
344 value = results->memory.buffered / ratio; 337 value = results->memory.buffered / ratio;
345 _progressbar_value_force_set(progress, value / 100); 338 elm_progressbar_value_set(progress, value / 100);
346 339
347 progress = ui->progress_mem_shared; 340 progress = ui->progress_mem_shared;
348 elm_progressbar_unit_format_set(progress, 341 elm_progressbar_unit_format_set(progress,
@@ -352,7 +345,7 @@ _tab_memory_update(Ui *ui, results_t *results)
352 _mem_adjust(ui->data_unit, results->memory.total), ui->data_unit)); 345 _mem_adjust(ui->data_unit, results->memory.total), ui->data_unit));
353 ratio = results->memory.total / 100.0; 346 ratio = results->memory.total / 100.0;
354 value = results->memory.shared / ratio; 347 value = results->memory.shared / ratio;
355 _progressbar_value_force_set(progress, value / 100); 348 elm_progressbar_value_set(progress, value / 100);
356 349
357 progress = ui->progress_mem_swap; 350 progress = ui->progress_mem_swap;
358 elm_progressbar_unit_format_set(progress, 351 elm_progressbar_unit_format_set(progress,
@@ -362,7 +355,7 @@ _tab_memory_update(Ui *ui, results_t *results)
362 _mem_adjust(ui->data_unit, results->memory.swap_total), ui->data_unit)); 355 _mem_adjust(ui->data_unit, results->memory.swap_total), ui->data_unit));
363 ratio = results->memory.swap_total / 100.0; 356 ratio = results->memory.swap_total / 100.0;
364 value = results->memory.swap_used / ratio; 357 value = results->memory.swap_used / ratio;
365 _progressbar_value_force_set(progress, value / 100); 358 elm_progressbar_value_set(progress, value / 100);
366} 359}
367 360
368static void 361static void
@@ -400,7 +393,7 @@ _tab_cpu_update(Ui *ui, results_t *results)
400 elm_progressbar_span_size_set(progress, 1.0); 393 elm_progressbar_span_size_set(progress, 1.0);
401 elm_progressbar_unit_format_set(progress, "%1.2f%%"); 394 elm_progressbar_unit_format_set(progress, "%1.2f%%");
402 395
403 _progressbar_value_force_set(progress, results->cores[i]->percent / 100); 396 elm_progressbar_value_set(progress, results->cores[i]->percent / 100);
404 evas_object_show(progress); 397 evas_object_show(progress);
405 elm_object_content_set(frame, progress); 398 elm_object_content_set(frame, progress);
406 elm_box_pack_end(box, frame); 399 elm_box_pack_end(box, frame);
@@ -437,7 +430,7 @@ _system_stats_feedback_cb(void *data, Ecore_Thread *thread, void *msg)
437 430
438 cpu_usage = cpu_usage / system_cpu_online_count_get(); 431 cpu_usage = cpu_usage / system_cpu_online_count_get();
439 432
440 _progressbar_value_force_set(ui->progress_cpu, (double)cpu_usage / 100); 433 elm_progressbar_value_set(ui->progress_cpu, (double)cpu_usage / 100);
441 434
442 progress = ui->progress_mem; 435 progress = ui->progress_mem;
443 elm_progressbar_unit_format_set(progress, 436 elm_progressbar_unit_format_set(progress,
@@ -449,7 +442,7 @@ _system_stats_feedback_cb(void *data, Ecore_Thread *thread, void *msg)
449 ratio = results->memory.total / 100.0; 442 ratio = results->memory.total / 100.0;
450 value = results->memory.used / ratio; 443 value = results->memory.used / ratio;
451 444
452 _progressbar_value_force_set(progress, value / 100); 445 elm_progressbar_value_set(progress, value / 100);
453 446
454out: 447out:
455 free(results->cores); 448 free(results->cores);