Skip to content
Permalink
Browse files

Prevent same recursion error as before in the Add Songs dialog

  • Loading branch information...
Kurocon committed Apr 26, 2016
1 parent c9aa94a commit 6741e3cfd31a221b29a15914a9a2b6f6f51540e6
Showing with 12 additions and 8 deletions.
  1. +8 −4 gui_controller/addsongs.py
  2. +2 −2 gui_controller/loading.py
  3. +2 −2 gui_controller/loading_addsong.py
@@ -46,6 +46,7 @@ def __init__(self, collectionname, songs):
# Progress bar
progress = 0
total_progress = len(self.songs.songs)
bar_progress = 0

# Create backup list of top level items
self.allsongs_toplevel_items = []
@@ -54,10 +55,13 @@ def __init__(self, collectionname, songs):
# Add songs to left tree
for song in self.songs.songs:
if len(song.difficulties) > 0:
loading_dialog.progress.emit(int((progress / total_progress) * 100))
loading_dialog.current.emit(
"{} - {} ({}) ({} maps)".format(song.difficulties[0].artist, song.difficulties[0].name,
song.difficulties[0].mapper, len(song.difficulties)))
if bar_progress < int((progress / total_progress) * 100):
bar_progress = int((progress / total_progress) * 100)
loading_dialog.progress.emit(int((progress / total_progress) * 100))
loading_dialog.current.emit(
"({}/{}) {} - {} ({}) ({} maps)".format(progress, total_progress, song.difficulties[0].artist,
song.difficulties[0].name, song.difficulties[0].mapper,
len(song.difficulties)))
progress += 1

tli = QtWidgets.QTreeWidgetItem()
@@ -52,12 +52,12 @@ def update_precentage(self, percentage):

def update_text(self, text):
if len(text) > 33:
text = text[:30] + "..."
text = text[:40] + "..."
self.ui.loading_label.setText(text)

def update_current(self, text):
if len(text) > 33:
text = text[:30] + "..."
text = text[:40] + "..."
self.ui.loading_current_label.setText(text)

def exec_(self):
@@ -40,12 +40,12 @@ def update_precentage(self, percentage):

def update_text(self, text):
if len(text) > 33:
text = text[:30] + "..."
text = text[:40] + "..."
self.ui.loading_label.setText(text)

def update_current(self, text):
if len(text) > 33:
text = text[:30] + "..."
text = text[:40] + "..."
self.ui.loading_current_label.setText(text)

def open(self):

0 comments on commit 6741e3c

Please sign in to comment.
You can’t perform that action at this time.