Skip to content

Commit

Permalink
Gui - cleanupPage in ImportPage
Browse files Browse the repository at this point in the history
  • Loading branch information
regeciovad committed Oct 26, 2015
1 parent acc1335 commit dfd987f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions rpg/gui/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, base, parent=None):
self.setPage(self.PageCoprDistro, CoprDistroPage(self))
self.setPage(self.PageCoprBuild, CoprBuildPage(self))
self.setPage(self.PageCoprFinal, CoprFinalPage(self))
self.setStartId(self.PageImport)
self.setStartId(self.PageIntro)


class IntroPage(QtWidgets.QWizardPage):
Expand Down Expand Up @@ -235,16 +235,24 @@ def validatePage(self):
self.base.target_distro = self.DistroEdit.currentText()
self.base.load_project_from_url(self.importEdit.text().strip())
self.base.run_extracted_source_analysis()
new_thread = Thread(
self.new_thread = Thread(
target=self.base.fetch_repos, args=(self.base.target_distro,
self.base.target_arch))
new_thread.start()
self.new_thread.start()
self.importEdit.setStyleSheet("")
return True
else:
self.importEdit.setStyleSheet(self.redQLineEdit)
return False

def cleanupPage(self):
""" Stops the thread (there are no official way to stop thread.
This will unlocked thread and it will be stopped
with GUI - without error). """
self.new_thread._tstate_lock = None
self.new_thread._stop()
self.new_thread.join()

def nextId(self):
''' [int] Function that determines the next page after the current one
- returns integer value and then checks, which value is page"
Expand Down

0 comments on commit dfd987f

Please sign in to comment.