Browse Source

better hooks support

tags/v5.1.2
guinux 4 years ago
parent
commit
e53a71fc3a
2 changed files with 16 additions and 2 deletions
  1. +1
    -1
      src/daemon.vala
  2. +15
    -1
      src/transaction.vala

+ 1
- 1
src/daemon.vala View File

@@ -834,7 +834,7 @@ private void cb_event (Alpm.Event.Data data) {
break;
case Alpm.Event.Type.HOOK_RUN_START:
details += data.hook_run_name;
details += data.hook_run_desc;
details += data.hook_run_desc ?? "";
details += data.hook_run_position.to_string ();
details += data.hook_run_total.to_string ();
break;


+ 15
- 1
src/transaction.vala View File

@@ -685,7 +685,21 @@ namespace Pamac {
}
break;
case Alpm.Event.Type.HOOK_RUN_START:
msg = "%s:%s %s/%s".printf (details[0], details[1], details[2], details[3]);
string textbar = "%s/%s".printf (details[2], details[3]);
if (textbar != previous_textbar) {
previous_textbar = textbar;
progress_dialog.progressbar.set_text (textbar);
}
float fraction = (float) int.parse (details[2]) / int.parse (details[3]);
if (fraction != previous_percent) {
previous_percent = fraction;
progress_dialog.progressbar.set_fraction (fraction);
}
if (details[1] != "") {
msg = details[1] + ":";
} else {
msg = details[0] + ":";
}
progress_dialog.spawn_in_term ({"echo", msg});
break;
case Alpm.Event.Type.CHECKDEPS_START:


Loading…
Cancel
Save