Commit e5214474 authored by guinux's avatar guinux

improve error display

parent 9750a32d
......@@ -161,10 +161,7 @@ namespace Pamac {
void print_error (string message, string[] details) {
display_current_line ();
if (downloading) {
// when downloading errors have no details
stdout.printf ("%s\n", message);
} else if (details.length > 0) {
if (details.length > 0) {
if (details.length == 1) {
stdout.printf ("%s: %s: %s\n", dgettext (null, "Error"), message, details[0]);
} else {
......
......@@ -75,6 +75,7 @@ namespace Pamac {
emit_hook_progress.connect (display_hook_progress);
emit_script_output.connect (show_in_term);
emit_warning.connect ((msg) => {
show_in_term (msg);
warning_textbuffer.append (msg + "\n");
});
emit_error.connect (display_error);
......@@ -455,10 +456,6 @@ namespace Pamac {
box.add (scrolledwindow);
dialog.default_width = 600;
dialog.default_height = 300;
dialog.show ();
dialog.response.connect (() => {
dialog.destroy ();
});
Timeout.add (1000, () => {
try {
var notification = new Notify.Notification (dgettext (null, "Package Manager"),
......@@ -470,6 +467,8 @@ namespace Pamac {
}
return false;
});
dialog.run ();
dialog.destroy ();
}
void on_refresh_finished (bool success) {
......
......@@ -690,7 +690,7 @@ namespace Pamac {
line = dgettext (null, "Error") + ": " + msg;
}
important_details_outpout (false);
emit_error (line.replace ("\n", ""), {});
emit_warning (line.replace ("\n", ""));
} else if (level == (1 << 1)) { //Alpm.LogLevel.WARNING
// warnings when no_confirm_commit should already have been sent
if (no_confirm_commit) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment