[chirp_devel] [PATCH] Only update import progress bar on non-empty and mod 50. Fixes #119

Tom Hayward
Fri Apr 13 14:07:58 PDT 2012


# HG changeset patch
# User Tom Hayward <tom at tomh.us>
# Date 1334351262 21600
# Node ID d52446e9dfb828287b381224d349621b356cc01d
# Parent  f1eee956f6af4e303bd88dd9ff85d954d1bd6ecd
Only update import progress bar on non-empty and mod 50. Fixes #119.

diff -r f1eee956f6af -r d52446e9dfb8 chirpui/importdialog.py
--- a/chirpui/importdialog.py	Thu Apr 12 15:52:46 2012 -0700
+++ b/chirpui/importdialog.py	Fri Apr 13 15:07:42 2012 -0600
@@ -507,7 +507,8 @@
     def populate_list(self):
         start, end = self.src_radio.get_features().memory_bounds
         for i in range(start, end+1):
-            self.ww.set(float(i) / end)
+            if i % (end/50) == 0:
+                self.ww.set(float(i) / end)
             try:
                 mem = self.src_radio.get_memory(i)
             except errors.InvalidMemoryLocation, e:
@@ -515,6 +516,7 @@
             if mem.empty:
                 continue
 
+            self.ww.set(float(i) / end)
             msgs = self.dst_radio.validate_memory(mem)
             errs = [x for x in msgs if isinstance(x, chirp_common.ValidationError)]
             if errs:



More information about the chirp_devel mailing list