From 58c084e68b7ce38ecf2501e9442632a899843fa2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 5 Mar 2014 08:07:18 +0530 Subject: [PATCH] Do not show system tray notification popups while analyzing books on device, as they can be slow on systems that display multiple messages serially instead of replacing the last message --- src/calibre/gui2/device.py | 2 +- src/calibre/gui2/init.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/device.py b/src/calibre/gui2/device.py index 3f3f8daf9c..530540e07c 100644 --- a/src/calibre/gui2/device.py +++ b/src/calibre/gui2/device.py @@ -1805,7 +1805,7 @@ class DeviceMixin(object): # {{{ if current_book_count % 100 == 0: self.status_bar.show_message( _('Analyzing books on the device: %d%% finished')%( - int((float(current_book_count)/total_book_count)*100.0))) + int((float(current_book_count)/total_book_count)*100.0)), show_notification=False) # I am assuming that this sort-of multi-threading won't break # anything. Reasons: excluding UI events prevents the user diff --git a/src/calibre/gui2/init.py b/src/calibre/gui2/init.py index 69a375f0da..7c952ebaf3 100644 --- a/src/calibre/gui2/init.py +++ b/src/calibre/gui2/init.py @@ -227,9 +227,9 @@ class StatusBar(QStatusBar): # {{{ self.device_string = '' self.set_label() - def show_message(self, msg, timeout=0): + def show_message(self, msg, timeout=0, show_notification=True): self.showMessage(msg, timeout) - if self.notifier is not None and not config['disable_tray_notification']: + if self.notifier is not None and not config['disable_tray_notification'] and show_notification: if isosx and isinstance(msg, unicode): try: msg = msg.encode(preferred_encoding)