def generateVersionInfo(linesep = '\n'): """ Module function to generate a string with various version infos. @param linesep string to be used to separate lines (string) @return string with version infos (string) """ try: import sipconfig sip_version_str = sipconfig.Configuration().sip_version_str except ImportError: sip_version_str = "sip version not available" info = "Version Numbers:%s Python %s%s" % \ (linesep, sys.version.split()[0], linesep) if KdeQt.isKDEAvailable(): info += " KDE %s%s PyKDE %s%s" % \ (str(KdeQt.kdeVersionString()), linesep, str(KdeQt.pyKdeVersionString()), linesep) info += " Qt %s%s PyQt4 %s%s" % \ (str(qVersion()), linesep, str(PYQT_VERSION_STR), linesep) info += " sip %s%s QScintilla %s%s" % \ (str(sip_version_str), linesep, str(QSCINTILLA_VERSION_STR), linesep) info += " %s %s%s" % \ (Program, Version, linesep * 2) info += "Platform: %s%s%s%s" % \ (sys.platform, linesep, sys.version, linesep) return info
def __printPreviewImage(self): """ Private slot to handle the Print Preview menu action. """ from PyQt4.QtGui import QPrintPreviewDialog if self.mainWidget is None: KQMessageBox.critical(None, self.trUtf8("Print Preview"), self.trUtf8("""There is no UI file loaded.""")) return settings = Preferences.Prefs.settings printer = KdeQt.KQPrinter.KQPrinter(mode = QPrinter.HighResolution) printer.setFullPage(True) if not KdeQt.isKDE(): printer.setPrinterName(settings.value("UIPreviewer/printername").toString()) printer.setPageSize( QPrinter.PageSize(settings.value("UIPreviewer/pagesize").toInt()[0])) printer.setPageOrder( QPrinter.PageOrder(settings.value("UIPreviewer/pageorder").toInt()[0])) printer.setOrientation( QPrinter.Orientation(settings.value("UIPreviewer/orientation").toInt()[0])) printer.setColorMode( QPrinter.ColorMode(settings.value("UIPreviewer/colormode").toInt()[0])) preview = QPrintPreviewDialog(printer, self) self.connect(preview, SIGNAL("paintRequested(QPrinter*)"), self.__print) preview.exec_()
def __init__(self): """ Constructor """ ConfigurationPageBase.__init__(self) self.setupUi(self) self.setObjectName("HelpDocumentationPage") self.pythonDocDirCompleter = E4FileCompleter(self.pythonDocDirEdit) self.qt4DocDirCompleter = E4FileCompleter(self.qt4DocDirEdit) self.pyqt4DocDirCompleter = E4FileCompleter(self.pyqt4DocDirEdit) self.pykde4DocDirCompleter = E4FileCompleter(self.pykde4DocDirEdit) self.pysideDocDirCompleter = E4FileCompleter(self.pysideDocDirEdit) self.pykde4Group.setEnabled(KdeQt.isKDEAvailable()) try: import PySide self.pysideGroup.setEnabled(True) del PySide except ImportError: self.pysideGroup.setEnabled(False) # set initial values self.pythonDocDirEdit.setText(\ Preferences.getHelp("PythonDocDir")) self.qt4DocDirEdit.setText(\ Preferences.getHelp("Qt4DocDir")) self.pyqt4DocDirEdit.setText(\ Preferences.getHelp("PyQt4DocDir")) self.pykde4DocDirEdit.setText(\ Preferences.getHelp("PyKDE4DocDir")) self.pysideDocDirEdit.setText(\ Preferences.getHelp("PySideDocDir"))
def __printImage(self): """ Private slot to handle the Print Image menu action. """ if self.mainWidget is None: KQMessageBox.critical(None, self.trUtf8("Print Image"), self.trUtf8("""There is no UI file loaded.""")) return settings = Preferences.Prefs.settings printer = KdeQt.KQPrinter.KQPrinter(mode = QPrinter.HighResolution) printer.setFullPage(True) if not KdeQt.isKDE(): printer.setPrinterName(settings.value("UIPreviewer/printername").toString()) printer.setPageSize( QPrinter.PageSize(settings.value("UIPreviewer/pagesize").toInt()[0])) printer.setPageOrder( QPrinter.PageOrder(settings.value("UIPreviewer/pageorder").toInt()[0])) printer.setOrientation( QPrinter.Orientation(settings.value("UIPreviewer/orientation").toInt()[0])) printer.setColorMode( QPrinter.ColorMode(settings.value("UIPreviewer/colormode").toInt()[0])) printDialog = KQPrintDialog(printer, self) if printDialog.exec_() == QDialog.Accepted: self.statusBar().showMessage(self.trUtf8("Printing the image...")) self.__print(printer) if not KdeQt.isKDE(): settings.setValue("UIPreviewer/printername", QVariant(printer.printerName())) settings.setValue("UIPreviewer/pagesize", QVariant(printer.pageSize())) settings.setValue("UIPreviewer/pageorder", QVariant(printer.pageOrder())) settings.setValue("UIPreviewer/orientation", QVariant(printer.orientation())) settings.setValue("UIPreviewer/colormode", QVariant(printer.colorMode())) self.statusBar().showMessage(self.trUtf8("Image sent to printer..."), 2000)
def __initActions(self): """ Private method to initialize the actions. """ acts = [] self.aboutAct = E4Action(self.trUtf8('About %1').arg(Program), UI.PixmapCache.getIcon("helpAbout.png"), self.trUtf8('&About %1').arg(Program), 0, 0, self, 'about_eric') self.aboutAct.setStatusTip(self.trUtf8('Display information about this software')) self.aboutAct.setWhatsThis(self.trUtf8( """<b>About %1</b>""" """<p>Display some information about this software.</p>""" ).arg(Program)) self.connect(self.aboutAct, SIGNAL('triggered()'), self.__about) self.aboutAct.setMenuRole(QAction.AboutRole) acts.append(self.aboutAct) self.aboutQtAct = E4Action(self.trUtf8('About Qt'), UI.PixmapCache.getIcon("helpAboutQt.png"), self.trUtf8('About &Qt'), 0, 0, self, 'about_qt') self.aboutQtAct.setStatusTip(\ self.trUtf8('Display information about the Qt toolkit')) self.aboutQtAct.setWhatsThis(self.trUtf8( """<b>About Qt</b>""" """<p>Display some information about the Qt toolkit.</p>""" )) self.connect(self.aboutQtAct, SIGNAL('triggered()'), self.__aboutQt) self.aboutQtAct.setMenuRole(QAction.AboutQtRole) acts.append(self.aboutQtAct) if KdeQt.isKDE(): self.aboutKdeAct = E4Action(self.trUtf8('About KDE'), UI.PixmapCache.getIcon("helpAboutKde.png"), self.trUtf8('About &KDE'), 0, 0, self, 'about_kde') self.aboutKdeAct.setStatusTip(self.trUtf8('Display information about KDE')) self.aboutKdeAct.setWhatsThis(self.trUtf8( """<b>About KDE</b>""" """<p>Display some information about KDE.</p>""" )) self.connect(self.aboutKdeAct, SIGNAL('triggered()'), self.__aboutKde) acts.append(self.aboutKdeAct) else: self.aboutKdeAct = None self.__ui.addE4Actions(acts, 'ui')