PKit gadget: more accurate progress bar

when opening a popup with an in-progress transaction the progressbar need to be created with the last received Progress value. Otherwise it will stay at zero until the next Progress change
This commit is contained in:
Davide Andreoli 2017-08-27 20:45:12 +02:00
parent 2ab2fe18ea
commit 27e8ce95b4
2 changed files with 4 additions and 0 deletions

View File

@ -253,6 +253,8 @@ packagekit_popup_update(E_PackageKit_Instance *inst, Eina_Bool rebuild_list)
if (ctxt->transaction)
{
elm_genlist_clear(inst->popup_genlist);
elm_progressbar_value_set(inst->popup_progressbar,
ctxt->transaction_progress);
evas_object_show(inst->popup_progressbar);
}
else
@ -316,6 +318,7 @@ packagekit_progress_percentage_update(E_PackageKit_Module_Context *ctxt,
Eina_List *l;
double val = (double)percent / 100.0;
ctxt->transaction_progress = val;
EINA_LIST_FOREACH(ctxt->instances, l, inst)
if (inst->popup_progressbar)
elm_progressbar_value_set(inst->popup_progressbar, val);

View File

@ -66,6 +66,7 @@ typedef struct _E_PackageKit_Module_Context
Eldbus_Connection *conn;
Eldbus_Proxy *packagekit;
Eldbus_Proxy *transaction;
double transaction_progress;
E_Config_DD *conf_edd;
PackageKit_Config *config;