def __showVersions(self): """ Private slot to handle the Versions dialog. """ from PyQt5.QtCore import qVersion, PYQT_VERSION_STR from PyQt5.Qsci import QSCINTILLA_VERSION_STR try: try: from PyQt5 import sip except ImportError: import sip sip_version_str = sip.SIP_VERSION_STR except (ImportError, AttributeError): sip_version_str = "sip version not available" versionText = self.tr( """<h3>Version Numbers</h3>""" """<table>""") versionText += ( """<tr><td><b>Python</b></td><td>{0}</td></tr>""" .format(sys.version.split()[0]) ) versionText += ( """<tr><td><b>Qt</b></td><td>{0}</td></tr>""" .format(qVersion()) ) versionText += ( """<tr><td><b>PyQt</b></td><td>{0}</td></tr>""" .format(PYQT_VERSION_STR) ) versionText += ( """<tr><td><b>sip</b></td><td>{0}</td></tr>""" .format(sip_version_str) ) versionText += ( """<tr><td><b>QScintilla</b></td><td>{0}</td></tr>""" .format(QSCINTILLA_VERSION_STR) ) try: from WebBrowser.Tools import WebBrowserTools chromeVersion = WebBrowserTools.getWebEngineVersions()[0] versionText += ( """<tr><td><b>WebEngine</b></td><td>{0}</td></tr>""" .format(chromeVersion) ) except ImportError: pass versionText += ( """<tr><td><b>{0}</b></td><td>{1}</td></tr>""" .format(Program, Version) ) versionText += self.tr("""</table>""") E5MessageBox.about(None, Program, versionText)
def __about(self): """ Private slot to show the about information. """ E5MessageBox.about( self, self.tr("SQL Browser"), self.tr( """<h3>About SQL Browser</h3>""" """<p>The SQL browser window is a little tool to examine """ """the data and the schema of a database and to execute """ """queries on a database.</p>"""))
def __about(self): """ Private slot to show the about information. """ E5MessageBox.about( self, self.tr("UI Previewer"), self.tr( """<h3> About UI Previewer </h3>""" """<p>The UI Previewer loads and displays Qt User-Interface""" """ files with various styles, which are selectable via a""" """ selection list.</p>"""))
def __about(self): """ Private slot to show the about information. """ E5MessageBox.about( self, self.tr("TR Previewer"), self.tr( """<h3> About TR Previewer </h3>""" """<p>The TR Previewer loads and displays Qt User-Interface""" """ files and translation files and shows dialogs for a""" """ selected language.</p>"""))
def __about(self): """ Private slot to show the about information. """ E5MessageBox.about( self, self.tr("TR Previewer"), self.tr( """<h3> About TR Previewer </h3>""" """<p>The TR Previewer loads and displays Qt User-Interface""" """ files and translation files and shows dialogs for a""" """ selected language.</p>""" ) )
def __about(self): """ Private slot to show the about information. """ E5MessageBox.about( self, self.tr("SQL Browser"), self.tr( """<h3>About SQL Browser</h3>""" """<p>The SQL browser window is a little tool to examine """ """the data and the schema of a database and to execute """ """queries on a database.</p>""" ) )
def __about(self): """ Private slot to show the about information. """ E5MessageBox.about( self, self.tr("UI Previewer"), self.tr( """<h3> About UI Previewer </h3>""" """<p>The UI Previewer loads and displays Qt User-Interface""" """ files with various styles, which are selectable via a""" """ selection list.</p>""" ) )
def on_bTest_clicked(self): """ Private method to test the selected options. """ if self.rAbout.isChecked(): E5MessageBox.about( None, self.eCaption.text(), self.eMessage.toPlainText() ) elif self.rAboutQt.isChecked(): E5MessageBox.aboutQt( None, self.eCaption.text() ) elif self.rInformation.isChecked() or \ self.rQuestion.isChecked() or \ self.rWarning.isChecked() or \ self.rCritical.isChecked(): buttons = E5MessageBox.NoButton if self.abortCheck.isChecked(): buttons |= E5MessageBox.Abort if self.applyCheck.isChecked(): buttons |= E5MessageBox.Apply if self.cancelCheck.isChecked(): buttons |= E5MessageBox.Cancel if self.closeCheck.isChecked(): buttons |= E5MessageBox.Close if self.discardCheck.isChecked(): buttons |= E5MessageBox.Discard if self.helpCheck.isChecked(): buttons |= E5MessageBox.Help if self.ignoreCheck.isChecked(): buttons |= E5MessageBox.Ignore if self.noCheck.isChecked(): buttons |= E5MessageBox.No if self.notoallCheck.isChecked(): buttons |= E5MessageBox.NoToAll if self.okCheck.isChecked(): buttons |= E5MessageBox.Ok if self.openCheck.isChecked(): buttons |= E5MessageBox.Open if self.resetCheck.isChecked(): buttons |= E5MessageBox.Reset if self.restoreCheck.isChecked(): buttons |= E5MessageBox.RestoreDefaults if self.retryCheck.isChecked(): buttons |= E5MessageBox.Retry if self.saveCheck.isChecked(): buttons |= E5MessageBox.Save if self.saveallCheck.isChecked(): buttons |= E5MessageBox.SaveAll if self.yesCheck.isChecked(): buttons |= E5MessageBox.Yes if self.yestoallCheck.isChecked(): buttons |= E5MessageBox.YesToAll if buttons == E5MessageBox.NoButton: buttons = E5MessageBox.Ok defaultButton = self.buttonsCodeListBinary[ self.defaultCombo.currentIndex()] if self.rInformation.isChecked(): E5MessageBox.information( self, self.eCaption.text(), self.eMessage.toPlainText(), E5MessageBox.StandardButtons(buttons), defaultButton ) elif self.rQuestion.isChecked(): E5MessageBox.question( self, self.eCaption.text(), self.eMessage.toPlainText(), E5MessageBox.StandardButtons(buttons), defaultButton ) elif self.rWarning.isChecked(): E5MessageBox.warning( self, self.eCaption.text(), self.eMessage.toPlainText(), E5MessageBox.StandardButtons(buttons), defaultButton ) elif self.rCritical.isChecked(): E5MessageBox.critical( self, self.eCaption.text(), self.eMessage.toPlainText(), E5MessageBox.StandardButtons(buttons), defaultButton ) elif self.rYesNo.isChecked() or \ self.rRetryAbort.isChecked(): if self.iconInformation.isChecked(): icon = E5MessageBox.Information elif self.iconQuestion.isChecked(): icon = E5MessageBox.Question elif self.iconWarning.isChecked(): icon = E5MessageBox.Warning elif self.iconCritical.isChecked(): icon = E5MessageBox.Critical if self.rYesNo.isChecked(): E5MessageBox.yesNo( self, self.eCaption.text(), self.eMessage.toPlainText(), icon=icon, yesDefault=self.yesDefaultCheck.isChecked() ) elif self.rRetryAbort.isChecked(): E5MessageBox.retryAbort( self, self.eCaption.text(), self.eMessage.toPlainText(), icon=icon ) elif self.rOkToClearData.isChecked(): E5MessageBox.okToClearData( self, self.eCaption.text(), self.eMessage.toPlainText(), lambda: True )
def on_bTest_clicked(self): """ Private method to test the selected options. """ if self.rAbout.isChecked(): E5MessageBox.about(None, self.eCaption.text(), self.eMessage.toPlainText()) elif self.rAboutQt.isChecked(): E5MessageBox.aboutQt(None, self.eCaption.text()) elif self.rInformation.isChecked() or \ self.rQuestion.isChecked() or \ self.rWarning.isChecked() or \ self.rCritical.isChecked(): buttons = E5MessageBox.NoButton if self.abortCheck.isChecked(): buttons |= E5MessageBox.Abort if self.applyCheck.isChecked(): buttons |= E5MessageBox.Apply if self.cancelCheck.isChecked(): buttons |= E5MessageBox.Cancel if self.closeCheck.isChecked(): buttons |= E5MessageBox.Close if self.discardCheck.isChecked(): buttons |= E5MessageBox.Discard if self.helpCheck.isChecked(): buttons |= E5MessageBox.Help if self.ignoreCheck.isChecked(): buttons |= E5MessageBox.Ignore if self.noCheck.isChecked(): buttons |= E5MessageBox.No if self.notoallCheck.isChecked(): buttons |= E5MessageBox.NoToAll if self.okCheck.isChecked(): buttons |= E5MessageBox.Ok if self.openCheck.isChecked(): buttons |= E5MessageBox.Open if self.resetCheck.isChecked(): buttons |= E5MessageBox.Reset if self.restoreCheck.isChecked(): buttons |= E5MessageBox.RestoreDefaults if self.retryCheck.isChecked(): buttons |= E5MessageBox.Retry if self.saveCheck.isChecked(): buttons |= E5MessageBox.Save if self.saveallCheck.isChecked(): buttons |= E5MessageBox.SaveAll if self.yesCheck.isChecked(): buttons |= E5MessageBox.Yes if self.yestoallCheck.isChecked(): buttons |= E5MessageBox.YesToAll if buttons == E5MessageBox.NoButton: buttons = E5MessageBox.Ok defaultButton = self.buttonsCodeListBinary[ self.defaultCombo.currentIndex()] if self.rInformation.isChecked(): E5MessageBox.information(self, self.eCaption.text(), self.eMessage.toPlainText(), E5MessageBox.StandardButtons(buttons), defaultButton) elif self.rQuestion.isChecked(): E5MessageBox.question(self, self.eCaption.text(), self.eMessage.toPlainText(), E5MessageBox.StandardButtons(buttons), defaultButton) elif self.rWarning.isChecked(): E5MessageBox.warning(self, self.eCaption.text(), self.eMessage.toPlainText(), E5MessageBox.StandardButtons(buttons), defaultButton) elif self.rCritical.isChecked(): E5MessageBox.critical(self, self.eCaption.text(), self.eMessage.toPlainText(), E5MessageBox.StandardButtons(buttons), defaultButton) elif self.rYesNo.isChecked() or \ self.rRetryAbort.isChecked(): if self.iconInformation.isChecked(): icon = E5MessageBox.Information elif self.iconQuestion.isChecked(): icon = E5MessageBox.Question elif self.iconWarning.isChecked(): icon = E5MessageBox.Warning elif self.iconCritical.isChecked(): icon = E5MessageBox.Critical if self.rYesNo.isChecked(): E5MessageBox.yesNo(self, self.eCaption.text(), self.eMessage.toPlainText(), icon=icon, yesDefault=self.yesDefaultCheck.isChecked()) elif self.rRetryAbort.isChecked(): E5MessageBox.retryAbort(self, self.eCaption.text(), self.eMessage.toPlainText(), icon=icon) elif self.rOkToClearData.isChecked(): E5MessageBox.okToClearData(self, self.eCaption.text(), self.eMessage.toPlainText(), lambda: True)