From c50d0e8c7f2a891104ae112bbfa58f73afecf467 Mon Sep 17 00:00:00 2001 From: guinux Date: Sun, 19 May 2013 11:20:23 +0200 Subject: [PATCH] try to display warnings at a smarter time --- pamac-daemon.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/pamac-daemon.py b/pamac-daemon.py index 8a8a649..492e2de 100755 --- a/pamac-daemon.py +++ b/pamac-daemon.py @@ -67,12 +67,20 @@ class PamacDBusService(dbus.service.Object): if ID is 1: self.action = _('Checking dependencies')+'...' self.icon = '/usr/share/pamac/icons/24x24/status/package-search.png' + elif ID is 2: + if self.warning: + self.EmitLogWarning(self.warning) + self.warning = '' elif ID is 3: self.action = _('Checking file conflicts')+'...' self.icon = '/usr/share/pamac/icons/24x24/status/package-search.png' elif ID is 5: self.action = _('Resolving dependencies')+'...' self.icon = '/usr/share/pamac/icons/24x24/status/setup.png' + elif ID is 6: + if self.warning: + self.EmitLogWarning(self.warning) + self.warning = '' elif ID is 7: self.action = _('Checking inter conflicts')+'...' self.icon = '/usr/share/pamac/icons/24x24/status/package-search.png' @@ -152,13 +160,13 @@ class PamacDBusService(dbus.service.Object): if not (level & _logmask): return if level & pyalpm.LOG_ERROR: - #self.error += "ERROR: "+line - self.EmitLogError(line) - #print(self.error) + self.error += "ERROR: "+line + #self.EmitLogError(line) + print(self.error) #self.t.release() elif level & pyalpm.LOG_WARNING: - #self.warning += "WARNING: "+line - self.EmitLogWarning(line) + self.warning += "WARNING: "+line + #self.EmitLogWarning(line) elif level & pyalpm.LOG_DEBUG: line = "DEBUG: " + line print(line) @@ -424,6 +432,9 @@ class PamacDBusService(dbus.service.Object): #pass finally: self.CheckUpdates() + if self.warning: + self.EmitLogWarning(self.warning) + self.warning = '' if self.error: self.EmitTransactionError(self.error) else: