primitivus: fixed progress panel
This commit is contained in:
parent
2494387bf5
commit
4ffbce51c3
1 changed files with 41 additions and 17 deletions
|
|
@ -563,11 +563,13 @@ class PrimitivusApp(QuickApp, InputHistory):
|
|||
self.center_part.focus_position = 0
|
||||
self.redraw()
|
||||
|
||||
def addProgress (self, id, message):
|
||||
"""Follow a SàT progress bar
|
||||
@param id: SàT id of the progression
|
||||
@param message: message to show to identify the progression"""
|
||||
self.progress_wid.addProgress(id, message)
|
||||
def addProgress(self, pid, message, profile):
|
||||
"""Follow a SàT progression
|
||||
|
||||
@param pid: progression id
|
||||
@param message: message to show to identify the progression
|
||||
"""
|
||||
self.progress_wid.add(pid, message, profile)
|
||||
|
||||
def setProgress(self, percentage):
|
||||
"""Set the progression shown in notification bar"""
|
||||
|
|
@ -631,6 +633,7 @@ class PrimitivusApp(QuickApp, InputHistory):
|
|||
self.main_widget.hide('notif_bar')
|
||||
else:
|
||||
self.main_widget.show('notif_bar')
|
||||
self.redraw() # FIXME: invalidate cache in a more efficient way
|
||||
|
||||
def _actionManagerUnknownError(self):
|
||||
self.alert(_("Error"), _(u"Unmanaged action"))
|
||||
|
|
@ -707,11 +710,21 @@ class PrimitivusApp(QuickApp, InputHistory):
|
|||
log.error (_("FIXME FIXME FIXME: type [%s] not implemented") % type_)
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
def roomJoinedHandler(self, room_jid_s, room_nicks, user_nick, profile):
|
||||
super(PrimitivusApp, self).roomJoinedHandler(room_jid_s, room_nicks, user_nick, profile)
|
||||
self.contact_lists[profile].setFocus(jid.JID(room_jid_s), True)
|
||||
|
||||
def progressStartedHandler(self, pid, metadata, profile):
|
||||
super(PrimitivusApp, self).progressStartedHandler(pid, metadata, profile)
|
||||
self.addProgress(pid, metadata.get('name', _(u'unkown')), profile)
|
||||
|
||||
def progressFinishedHandler(self, pid, metadata, profile):
|
||||
log.info(u"Progress {} finished".format(pid))
|
||||
super(PrimitivusApp, self).progressFinishedHandler(pid, metadata, profile)
|
||||
|
||||
def progressErrorHandler(self, pid, err_msg, profile):
|
||||
log.warning(u"Progress {pid} error: {err_msg}".format(pid=pid, err_msg=err_msg))
|
||||
super(PrimitivusApp, self).progressErrorHandler(pid, err_msg, profile)
|
||||
|
||||
|
||||
##DIALOGS CALLBACKS##
|
||||
|
|
|
|||
Loading…
Reference in a new issue