class Ui_Form(object): def setupUi(self, Form): Form.setObjectName("Form") Form.resize(508, 94) self.verticalLayout = QtGui.QVBoxLayout(Form) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.dictionaryCombo = QtGui.QComboBox(Form) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.dictionaryCombo.sizePolicy().hasHeightForWidth()) self.dictionaryCombo.setSizePolicy(sizePolicy) self.dictionaryCombo.setObjectName("dictionaryCombo") self.horizontalLayout.addWidget(self.dictionaryCombo) self.checkVersionButton = KPushButton(Form) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.checkVersionButton.sizePolicy().hasHeightForWidth()) self.checkVersionButton.setSizePolicy(sizePolicy) self.checkVersionButton.setObjectName("checkVersionButton") self.horizontalLayout.addWidget(self.checkVersionButton) self.removeButton = KPushButton(Form) self.removeButton.setObjectName("removeButton") self.horizontalLayout.addWidget(self.removeButton) self.installButton = KPushButton(Form) self.installButton.setEnabled(False) self.installButton.setObjectName("installButton") self.horizontalLayout.addWidget(self.installButton) self.verticalLayout.addLayout(self.horizontalLayout) self.statusLabel = KSqueezedTextLabel(Form) self.statusLabel.setObjectName("statusLabel") self.verticalLayout.addWidget(self.statusLabel) self.progressBar = QtGui.QProgressBar(Form) self.progressBar.setProperty("value", QtCore.QVariant(24)) self.progressBar.setInvertedAppearance(False) self.progressBar.setObjectName("progressBar") self.verticalLayout.addWidget(self.progressBar) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form) def retranslateUi(self, Form): Form.setWindowTitle(kdecore.i18n("Form")) self.checkVersionButton.setToolTip(kdecore.i18n("Check the online resource for a newer version.")) self.checkVersionButton.setWhatsThis(kdecore.i18n("Check the online resource for a newer version.")) self.checkVersionButton.setText(kdecore.i18n("&Check for newer")) self.removeButton.setText(kdecore.i18n("&Remove")) self.installButton.setToolTip(kdecore.i18n("Download and install the selected dictionary.")) self.installButton.setWhatsThis(kdecore.i18n("Download and install the selected dictionary.")) self.installButton.setText(kdecore.i18n("&Install"))
class PointAndClick(SettingsGroup): def __init__(self, page): super(PointAndClick, self).__init__(i18n("Point and Click"), page) layout = QHBoxLayout(self) self.button = KPushButton(i18n("Enable Point and Click")) self.button.setFixedSize(self.button.sizeHint()) l = QLabel( i18n( "Click this button if Point and Click does not work. " "See Shift+F1 (What's This) for more information." ) ) l.setWordWrap(True) l.setWhatsThis( i18n( "On its first run, Frescobaldi tries to auto-configure Okular " "(which provides the PDF preview) to call Frescobaldi when a " "clickable object is clicked." "\n\n" "But this setting can get lost when you move Frescobaldi to a " "different location or when other applications reconfigure Okular." "\n\n" "Click this button to configure Frescobaldi as 'custom editor' " "inside Okular. This works best when all instances of Okular are " "closed and the PDF preview has not yet been opened." ) ) self.button.setWhatsThis(l.whatsThis()) self.button.clicked.connect(self.installOkularPartRC) layout.addWidget(self.button) layout.addWidget(l) def installOkularPartRC(self): import frescobaldi_app.install frescobaldi_app.install.installOkularPartRC() config("").writeEntry("configure okularpart", True) KMessageBox.information( self, i18n( "The Okular PDF preview has been reconfigured.\n\n" "If you already opened the PDF preview, " "restart Frescobaldi for the new settings to take effect." ), )