Notifications should not appear if Phatch is the active application
Bug #383664 reported by
Stani
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Phatch |
Fix Released
|
Low
|
Stani |
Bug Description
It should only make sense to notify on lengthy actions (> 5s?) otherwise the person still has the program open. Notifications should however appear if problems have been logged.
Changed in phatch: | |
assignee: | nobody → stani (stani) |
importance: | Undecided → Low |
status: | New → Confirmed |
Changed in phatch: | |
status: | Confirmed → In Progress |
summary: |
- Notifications should not appear after a short duration + Notifications should not appear if Phatch is the active application |
Changed in phatch: | |
status: | In Progress → Fix Committed |
Changed in phatch: | |
milestone: | none → 0.2.1 |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
$ bzr commit -m "fix notifications" sync/python/ phatch/ trunk/ core/message. py
Committing to: /home/stani/
modified phatch/core/api.py
modified phatch/
modified phatch/pyWx/gui.py
Committed revision 656.
$ bzr diff core/api. py'
=== modified file 'phatch/
--- phatch/core/api.py 2009-06-05 18:01:30 +0000
+++ phatch/core/api.py 2009-06-05 19:09:48 +0000
@@ -19,8 +19,14 @@
#---import modules
#standard library
-import codecs, cPickle, os, pprint, time, traceback
+import codecs
+import cPickle
+import os
+import pprint
+import time
+import traceback
from cStringIO import StringIO
+from datetime import timedelta
#gui-independent to_unicode, ENCODING
from core import ct, pil
@@ -30,6 +36,9 @@
from unicoding import ensure_unicode, exception_
from formField import ensure_path
+#---constants
+SEE_LOG = _('See Tools>Show Log for more details.')
+
#---classes
class PathError( Exception) :
@@ -348,6 +357,7 @@
}
#Execute action list
+ image_amount = len(image_files)
actions_amount = len(actions) + 1 #open image is extra action
cache = {}
is_done = actions[-1].is_done #checking method for resuming
@@ -355,11 +365,11 @@
#Start progress dialog frame_show_ progress( title = _("Executing action list"),
child_ max = actions_amount,
message = '',
) image_files) :
progress_ result = {}
flush_ log(photo, image_file, action) progress_ close() seconds= int(delta) +48) amount, duration) show_notificati on(message) show_info( message) show_message( '%s\n\n% s'%(message, SEE_LOG) )
send.
- parent_max = len(image_files),
+ parent_max = image_amount,
-
+ start = time.time()
for image_index, (folder,image_file) in enumerate(
#update image file & progress dialog box
@@ -400,6 +410,25 @@
del photo, progress_result, action_index, action
send.
+ #mention amount of photos and duration
+ delta = time.time()-start
+ duration = timedelta(
+ if image_amount == 1:
+ message = _('One photo done in %s')%duration
+ else:
+ message = _('%d photos done in %s')\
+ %(image_
+ #add error status
+ if ERROR_LOG_COUNTER == 1:
+ message += '\n'+_('One issue was logged')
+ elif ERROR_LOG_COUNTER:
+ message += '\n'+_('%d issues were logged')\
+ %ERROR_LOG_COUNTER
+ send.frame_
+ if ERROR_LOG_COUNTER == 0:
+ send.frame_
+ else:
+ send.frame_
#---common
import glob
=== modified file 'phatch/ core/message. py' core/message. py 2008-04-05 19:23:49 +0000 core/message. py 2009-06-05 19:08:14 +0000
self. subscribe( 'show_execute_ dialog' )
self. subscribe( 'show_error' )
self. subscribe( 'show_files_ message' ) 'show_info' )
--- phatch/
+++ phatch/
@@ -33,6 +33,9 @@
+ self.subscribe(
+ ...