def __init__(self, parent): QtGui.QWizard.__init__(self, parent) # Set some appearance stuff self.setMinimumSize(600, 500) self.setWindowTitle(translate('wizard', 'Getting started with Pyzo')) self.setWizardStyle(self.ModernStyle) self.setButtonText(self.CancelButton, 'Stop') # Set logo pm = QtGui.QPixmap() pm.load( os.path.join(pyzo.pyzoDir, 'resources', 'appicons', 'pyzologo48.png')) self.setPixmap(self.LogoPixmap, pm) # Define pages klasses = [ IntroWizardPage, TwocomponentsWizardPage, EditorWizardPage, ShellWizardPage1, ShellWizardPage2, RuncodeWizardPage1, RuncodeWizardPage2, ToolsWizardPage1, ToolsWizardPage2, FinalPage ] # Create pages self._n = len(klasses) for i, klass in enumerate(klasses): self.addPage(klass(self, i))
def __init__(self, parent, i): QtGui.QWizardPage.__init__(self, parent) self._i = i # Create label for description self._text_label = QtGui.QLabel(self) self._text_label.setTextFormat(QtCore.Qt.RichText) self._text_label.setWordWrap(True) # Create label for image self._comicLabel = QtGui.QLabel(self) pm = QtGui.QPixmap() if 'logo' in self._image_filename: pm.load( os.path.join(pyzo.pyzoDir, 'resources', 'appicons', self._image_filename)) elif self._image_filename: pm.load( os.path.join(pyzo.pyzoDir, 'resources', 'images', self._image_filename)) self._comicLabel.setPixmap(pm) self._comicLabel.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) # Layout theLayout = QtGui.QVBoxLayout(self) self.setLayout(theLayout) # theLayout.addWidget(self._text_label) theLayout.addStretch() theLayout.addWidget(self._comicLabel) theLayout.addStretch()
def _getPixmap(self, icon): # Get icon if given by name if isinstance(icon, str): icon = pyzo.icons[icon] # Create pixmap if icon is None: pm = QtGui.QPixmap(16, 16) pm.fill(QtGui.QColor(0, 0, 0, 0)) return pm elif isinstance(icon, tuple): pm = QtGui.QPixmap(icon[0], icon[1]) pm.fill(QtGui.QColor(0, 0, 0, 0)) return pm elif isinstance(icon, QtGui.QPixmap): return icon elif isinstance(icon, QtGui.QIcon): return icon.pixmap(16, 16) else: raise ValueError( 'Icon for IconArtis should be icon, pixmap or name.')
def __init__(self, parent): QtGui.QDialog.__init__(self, parent) self.setWindowTitle(pyzo.translate("menu dialog", "About Pyzo")) self.resize(600, 500) # Layout layout = QtGui.QVBoxLayout(self) self.setLayout(layout) # Create image and title im = QtGui.QPixmap( os.path.join(pyzo.pyzoDir, 'resources', 'appicons', 'pyzologo64.png')) imlabel = QtGui.QLabel(self) imlabel.setPixmap(im) textlabel = QtGui.QLabel(self) textlabel.setText('<h3>Pyzo: the Interactive Editor for Python</h3>') # titleLayout = QtGui.QHBoxLayout() titleLayout.addWidget(imlabel, 0) titleLayout.addWidget(textlabel, 1) # layout.addLayout(titleLayout, 0) # Create tab bar self._tabs = QtGui.QTabWidget(self) self._tabs.setDocumentMode(True) layout.addWidget(self._tabs, 1) # Create button box self._butBox = QtGui.QDialogButtonBox(self) self._butBox.setOrientation(QtCore.Qt.Horizontal) self._butBox.setStandardButtons(self._butBox.Close) layout.addWidget(self._butBox, 0) # Signals self._butBox.rejected.connect(self.close) # Create tabs self.createGeneralTab() self.createContributorsTab() self.createLicenseTab()