Skip to content

Commit

Permalink
Gui - Loading cursor added
Browse files Browse the repository at this point in the history
  • Loading branch information
regeciovad committed Nov 10, 2015
1 parent f1fbe04 commit a176bf3
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion rpg/gui/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from PyQt5.QtWidgets import (QLabel, QVBoxLayout, QLineEdit, QCheckBox,
QGroupBox, QPushButton, QGridLayout,
QPlainTextEdit, QFileDialog, QDialog,
QComboBox, QWizard, QFrame)
QComboBox, QWizard, QFrame, QApplication)
from rpg.gui.dialogs import DialogImport
from pathlib import Path
from rpg.command import Command
Expand Down Expand Up @@ -479,6 +479,7 @@ def validatePage(self):
else:
self.base.spec.description = self.descriptionEdit.toPlainText()
self.base.spec.Summary = self.summaryEdit.text()
QApplication.setOverrideCursor(QtCore.Qt.WaitCursor)
self.base.run_patched_source_analysis()
return True

Expand All @@ -495,6 +496,7 @@ def initializePage(self):
self.prepareEdit.insertPlainText(str(self.base.spec.prep))
self.buildEdit.insertPlainText(str(self.base.spec.build))
self.checkEdit.insertPlainText(str(self.base.spec.check))
QApplication.restoreOverrideCursor()

def __init__(self, Wizard, parent=None):
super(ScriptsPage, self).__init__(parent)
Expand Down Expand Up @@ -590,6 +592,7 @@ def validatePage(self):
self.base.spec.check = Command(self.checkEdit.toPlainText())
if self.buildArchCheckbox.isChecked():
self.base.spec.BuildArch = "noarch"
QApplication.setOverrideCursor(QtCore.Qt.WaitCursor)
self.base.build_project()
self.base.run_compiled_source_analysis()
return True
Expand All @@ -605,6 +608,7 @@ def initializePage(self):
self.pretransEdit.insertPlainText(str(self.base.spec.pretrans))
self.preEdit.insertPlainText(str(self.base.spec.pre))
self.postEdit.insertPlainText(str(self.base.spec.post))
QApplication.restoreOverrideCursor()

def __init__(self, Wizard, parent=None):
super(InstallPage, self).__init__(parent)
Expand Down Expand Up @@ -697,6 +701,7 @@ def validatePage(self):
self.base.spec.pretrans = Command(self.pretransEdit.toPlainText())
self.base.spec.pre = Command(self.preEdit.toPlainText())
self.base.spec.post = Command(self.postEdit.toPlainText())
QApplication.setOverrideCursor(QtCore.Qt.WaitCursor)
self.base.install_project()
self.base.run_installed_source_analysis()
return True
Expand All @@ -712,6 +717,7 @@ def initializePage(self):
'\n'.join(self.base.spec.BuildRequires))
self.requiresEdit.insertPlainText('\n'.join(self.base.spec.Requires))
self.providesEdit.insertPlainText('\n'.join(self.base.spec.Provides))
QApplication.restoreOverrideCursor()

def __init__(self, Wizard, parent=None):
super(RequiresPage, self).__init__(parent)
Expand Down Expand Up @@ -878,6 +884,7 @@ def validatePage(self):
self.base.spec.postun = Command(self.postunEdit.toPlainText())
self.base.spec.preun = Command(self.preunEdit.toPlainText())
self.base.spec.posttrans = Command(self.posttransEdit.toPlainText())
QApplication.setOverrideCursor(QtCore.Qt.WaitCursor)
self.base.write_spec()
return True

Expand All @@ -888,6 +895,7 @@ def nextId(self):
class BuildPage(QtWidgets.QWizardPage):

def initializePage(self):
QApplication.restoreOverrideCursor()
self.buildLocationEdit.setText(expanduser("~"))
self.distro = self.base.target_distro
self.arch = self.base.target_arch
Expand Down Expand Up @@ -1262,6 +1270,7 @@ def validatePage(self):
self.base.coprpackageUrl = self.packageUrlEdit.text()
self.base.coprlogin = self.loginEdit.text()
self.base.coprtoken = self.tokenEdit.text()
QApplication.setOverrideCursor(QtCore.Qt.WaitCursor)
self.base.copr_set_config(self.base.coprusername,
self.base.coprlogin, self.base.coprtoken)
return True
Expand All @@ -1272,6 +1281,9 @@ def nextId(self):

class CoprDistroPage(QtWidgets.QWizardPage):

def initializePage(self):
QApplication.restoreOverrideCursor()

def __init__(self, Wizard, parent=None):
super(CoprDistroPage, self).__init__(parent)

Expand Down Expand Up @@ -1414,6 +1426,7 @@ def __init__(self, Wizard, parent=None):
self.setLayout(mainLayout)

def validatePage(self):
QApplication.setOverrideCursor(QtCore.Qt.WaitCursor)
self.textBuildLabel.setText(
"<html><head/><body><p align=\"left\"><span" +
"style=\" font-size:24pt;\">" +
Expand Down Expand Up @@ -1463,6 +1476,7 @@ def nextId(self):
class CoprFinalPage(QtWidgets.QWizardPage):

def initializePage(self):
QApplication.restoreOverrideCursor()
self.newproject = self.base.coprusername + \
"/" + self.base.coprpackageName
self.webpage = "https://copr.fedoraproject.org/api/coprs/" + \
Expand Down

0 comments on commit a176bf3

Please sign in to comment.