Skip to content

Commit

Permalink
OWMap: show progress bar indicator while updating markers
Browse files Browse the repository at this point in the history
  • Loading branch information
kernc committed Nov 9, 2016
1 parent 7d6081c commit d8c8146
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Orange/widgets/visualize/owmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ def redraw_markers_overlay_image(self, *args, new_image=False):

self._image_token = image_token = np.random.random()

n_iters = np.ceil(len(visible) / N_POINTS_PER_ITER)

def add_points():
nonlocal cur, image_token
if image_token != self._image_token:
Expand Down Expand Up @@ -418,7 +420,12 @@ def add_points():
cur += N_POINTS_PER_ITER
if cur < len(visible):
QTimer.singleShot(10, add_points)
self._owwidget.progressBarAdvance(100 / n_iters, None)
else:
self._owwidget.progressBarFinished(None)

self._owwidget.progressBarFinished(None)
self._owwidget.progressBarInit(None)
QTimer.singleShot(10, add_points)


Expand Down

0 comments on commit d8c8146

Please sign in to comment.