Guest User

Untitled

a guest
Jul 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. class AreaOptionsDialog(QtGui.QDialog):
  2. """Dialog which lets you choose among various from tabs"""
  3. def __init__(self):
  4. """Creates and initialises the tab dialog"""
  5. QtGui.QDialog.__init__(self)
  6. self.setWindowTitle('Area Options')
  7.  
  8. self.tabWidget = QtGui.QTabWidget()
  9. self.LoadingTab = LoadingTab()
  10. self.tabWidget.addTab(self.LoadingTab, "On Load")
  11.  
  12. buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel)
  13.  
  14. buttonBox.accepted.connect(self.accept)
  15. buttonBox.rejected.connect(self.reject)
  16.  
  17.  
  18.  
  19. class LoadingTab(QtGui.QWidget):
  20. def __init__(self):
  21. QtGui.QWidget.__init__(self)
  22.  
  23. self.timer = QtGui.QSpinBox()
  24. self.timer.setRange(0, 999)
  25. self.timer.setToolTip("Sets the countdown timer on load from the world map. It's possible to set different times for the midpoint area.")
  26. self.timer.setValue(Level.options[2] + 200)
  27.  
  28. Layout.addWidget(self.timer)
  29. self.setLayout(Layout)
  30.  
  31.  
  32.  
  33.  
  34. def HandleAreaOptions(self):
  35. """Pops up the options for Area Dialogue"""
  36. dlg = AreaOptionsDialog()
  37. if dlg.exec_() == QtGui.QDialog.Accepted:
  38. print(dir(dlg))
  39. Level.options[2] = int(dlg.LoadingTab.timer.value()) - 200
Add Comment
Please, Sign In to add comment