def __init__(self, orient=Qt.Horizontal, obj=None, factor=5, val_=1, parent=None): Plasma.Dialog.__init__(self, parent) self.prnt = obj self.orient = orient self.factor = factor self.slider = QSlider() self.slider.setOrientation(self.orient) self.slider.setValue(val_) self.slider.setToolTip('Simple Spacer') self.slider.valueChanged.connect(self.resizeSpacer) self.multiplier = KIntSpinBox(1, 20, 1, self.factor, self) self.multiplier.setToolTip('Multiplier') self.multiplier.setMaximumWidth(40) self.multiplier.valueChanged.connect(self.multiplierValue) self.layout = QGridLayout() self.layout.setSpacing(0) self.layout.addWidget(self.slider, 0, 0) if self.prnt.formFactor() == Plasma.Horizontal: self.layout.addWidget(self.multiplier, 0, 1) else: self.layout.addWidget(self.multiplier, 1, 0) self.setLayout(self.layout)
class Ui_GeneralPage(object): def setupUi(self, GeneralPage): GeneralPage.setObjectName("GeneralPage") GeneralPage.resize(199, 60) self.formLayout = QtGui.QFormLayout(GeneralPage) self.formLayout.setObjectName("formLayout") self.label = QtGui.QLabel(GeneralPage) self.label.setObjectName("label") self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label) self.kcfg_serverName = KLineEdit(GeneralPage) self.kcfg_serverName.setObjectName("kcfg_serverName") self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.kcfg_serverName) self.label_2 = QtGui.QLabel(GeneralPage) self.label_2.setObjectName("label_2") self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_2) self.kcfg_portNumber = KIntSpinBox(GeneralPage) self.kcfg_portNumber.setMaximum(65536) self.kcfg_portNumber.setObjectName("kcfg_portNumber") self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.kcfg_portNumber) self.retranslateUi(GeneralPage) QtCore.QMetaObject.connectSlotsByName(GeneralPage) def retranslateUi(self, GeneralPage): self.label.setText(kdecore.i18n("Server name:")) self.label_2.setText(kdecore.i18n("Port number:"))
def setupUi(self, Form): Form.setObjectName(_fromUtf8("Form")) Form.resize(400, 300) self.verticalLayout = QtGui.QVBoxLayout(Form) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.label = QtGui.QLabel(Form) self.label.setObjectName(_fromUtf8("label")) self.verticalLayout.addWidget(self.label) self.recKeyboardButton = QtGui.QCheckBox(Form) self.recKeyboardButton.setObjectName(_fromUtf8("recKeyboardButton")) self.verticalLayout.addWidget(self.recKeyboardButton) self.recMouseButton = QtGui.QCheckBox(Form) self.recMouseButton.setObjectName(_fromUtf8("recMouseButton")) self.verticalLayout.addWidget(self.recMouseButton) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.label_2 = QtGui.QLabel(Form) self.label_2.setObjectName(_fromUtf8("label_2")) self.horizontalLayout.addWidget(self.label_2) self.secondsSpinBox = KIntSpinBox(Form) self.secondsSpinBox.setProperty("value", 5) self.secondsSpinBox.setObjectName(_fromUtf8("secondsSpinBox")) self.horizontalLayout.addWidget(self.secondsSpinBox) self.label_3 = QtGui.QLabel(Form) self.label_3.setObjectName(_fromUtf8("label_3")) self.horizontalLayout.addWidget(self.label_3) self.verticalLayout.addLayout(self.horizontalLayout) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def setupUi(self, GeneralPage): GeneralPage.setObjectName("GeneralPage") GeneralPage.resize(299, 92) self.formLayout = QtGui.QFormLayout(GeneralPage) self.formLayout.setObjectName("formLayout") self.thumbnalLabel = QtGui.QLabel(GeneralPage) self.thumbnalLabel.setObjectName("thumbnalLabel") self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.thumbnalLabel) self.kcfg_thumbnailMaxRetrieve = KIntSpinBox(GeneralPage) self.kcfg_thumbnailMaxRetrieve.setMinimum(1) self.kcfg_thumbnailMaxRetrieve.setMaximum(100) self.kcfg_thumbnailMaxRetrieve.setProperty("value", 3) self.kcfg_thumbnailMaxRetrieve.setObjectName("kcfg_thumbnailMaxRetrieve") self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.kcfg_thumbnailMaxRetrieve) self.columnLabel = QtGui.QLabel(GeneralPage) self.columnLabel.setObjectName("columnLabel") self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.columnLabel) self.kcfg_displayColumns = KIntSpinBox(GeneralPage) self.kcfg_displayColumns.setMinimum(1) self.kcfg_displayColumns.setMaximum(100) self.kcfg_displayColumns.setObjectName("kcfg_displayColumns") self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.kcfg_displayColumns) self.kcfg_maxAllowedRating = KComboBox(GeneralPage) self.kcfg_maxAllowedRating.setObjectName("kcfg_maxAllowedRating") self.kcfg_maxAllowedRating.addItem("") self.kcfg_maxAllowedRating.addItem("") self.kcfg_maxAllowedRating.addItem("") self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.kcfg_maxAllowedRating) self.ratingLabel = QtGui.QLabel(GeneralPage) self.ratingLabel.setObjectName("ratingLabel") self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.ratingLabel) self.retranslateUi(GeneralPage) QtCore.QMetaObject.connectSlotsByName(GeneralPage)
class ControlWidget(Plasma.Dialog): def __init__(self, orient=Qt.Horizontal, obj=None, factor=5, val_=1, parent=None): Plasma.Dialog.__init__(self, parent) self.prnt = obj self.orient = orient self.factor = factor self.slider = QSlider() self.slider.setOrientation(self.orient) self.slider.setValue(val_) self.slider.setToolTip('Simple Spacer') self.slider.valueChanged.connect(self.resizeSpacer) self.multiplier = KIntSpinBox(1, 20, 1, self.factor, self) self.multiplier.setToolTip('Multiplier') self.multiplier.setMaximumWidth(40) self.multiplier.valueChanged.connect(self.multiplierValue) self.layout = QGridLayout() self.layout.setSpacing(0) self.layout.addWidget(self.slider, 0, 0) if self.prnt.formFactor() == Plasma.Horizontal: self.layout.addWidget(self.multiplier, 0, 1) else: self.layout.addWidget(self.multiplier, 1, 0) self.setLayout(self.layout) def multiplierValue(self, val): self.prnt.config().writeEntry('Multiplier', val) self.factor = val def resizeSpacer(self, vol): if self.prnt.formFactor() == Plasma.Horizontal: self.prnt.size_ = 20 + vol * self.factor, 20 else: self.prnt.size_ = 20, 20 + vol * self.factor self.prnt.setMinimumSize(self.prnt.size_[0], self.prnt.size_[1]) self.prnt.resize(self.prnt.size_[0], self.prnt.size_[1]) self.prnt.config().writeEntry('Width', self.prnt.size_[0]) self.prnt.config().writeEntry('Height', self.prnt.size_[1]) self.prnt.setLayout(self.prnt.layout)
class Ui_Form(object): def setupUi(self, Form): Form.setObjectName(_fromUtf8("Form")) Form.resize(400, 300) self.verticalLayout = QtGui.QVBoxLayout(Form) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.label = QtGui.QLabel(Form) self.label.setObjectName(_fromUtf8("label")) self.verticalLayout.addWidget(self.label) self.recKeyboardButton = QtGui.QCheckBox(Form) self.recKeyboardButton.setObjectName(_fromUtf8("recKeyboardButton")) self.verticalLayout.addWidget(self.recKeyboardButton) self.recMouseButton = QtGui.QCheckBox(Form) self.recMouseButton.setObjectName(_fromUtf8("recMouseButton")) self.verticalLayout.addWidget(self.recMouseButton) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.label_2 = QtGui.QLabel(Form) self.label_2.setObjectName(_fromUtf8("label_2")) self.horizontalLayout.addWidget(self.label_2) self.secondsSpinBox = KIntSpinBox(Form) self.secondsSpinBox.setProperty("value", 5) self.secondsSpinBox.setObjectName(_fromUtf8("secondsSpinBox")) self.horizontalLayout.addWidget(self.secondsSpinBox) self.label_3 = QtGui.QLabel(Form) self.label_3.setObjectName(_fromUtf8("label_3")) self.horizontalLayout.addWidget(self.label_3) self.verticalLayout.addLayout(self.horizontalLayout) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form) def retranslateUi(self, Form): Form.setWindowTitle(kdecore.i18n(_fromUtf8("Form"))) self.label.setText( kdecore.i18n(_fromUtf8("Record a keyboard/mouse macro"))) self.recKeyboardButton.setText( kdecore.i18n(_fromUtf8("Record keyboard events"))) self.recMouseButton.setText( kdecore.i18n(_fromUtf8("Record mouse events (experimental)"))) self.label_2.setText(kdecore.i18n(_fromUtf8("Start recording after"))) self.label_3.setText(kdecore.i18n(_fromUtf8("seconds")))
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(362, 205) self.gridLayoutWidget = QtGui.QWidget(Dialog) self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 50, 341, 135)) self.gridLayoutWidget.setObjectName("gridLayoutWidget") self.gridLayout_2 = QtGui.QGridLayout(self.gridLayoutWidget) self.gridLayout_2.setSizeConstraint(QtGui.QLayout.SetMinimumSize) self.gridLayout_2.setObjectName("gridLayout_2") self.textColor_button = KColorButton(self.gridLayoutWidget) self.textColor_button.setObjectName("textColor_button") self.gridLayout_2.addWidget(self.textColor_button, 0, 1, 1, 1) self.Dropshadow_label = QtGui.QLabel(self.gridLayoutWidget) self.Dropshadow_label.setLayoutDirection(QtCore.Qt.RightToLeft) self.Dropshadow_label.setObjectName("Dropshadow_label") self.gridLayout_2.addWidget(self.Dropshadow_label, 1, 0, 1, 1) self.shadowColor_button = KColorButton(self.gridLayoutWidget) self.shadowColor_button.setObjectName("shadowColor_button") self.gridLayout_2.addWidget(self.shadowColor_button, 1, 1, 1, 1) self.TextColor_label = QtGui.QLabel(self.gridLayoutWidget) self.TextColor_label.setLayoutDirection(QtCore.Qt.RightToLeft) self.TextColor_label.setTextFormat(QtCore.Qt.AutoText) self.TextColor_label.setObjectName("TextColor_label") self.gridLayout_2.addWidget(self.TextColor_label, 0, 0, 1, 1) self.Logo_checkbox = QtGui.QCheckBox(self.gridLayoutWidget) self.Logo_checkbox.setObjectName("Logo_checkbox") self.gridLayout_2.addWidget(self.Logo_checkbox, 2, 1, 1, 1) self.Background_checkbox = QtGui.QCheckBox(self.gridLayoutWidget) self.Background_checkbox.setObjectName("Background_checkbox") self.gridLayout_2.addWidget(self.Background_checkbox, 3, 1, 1, 1) self.Interval_label = QtGui.QLabel(self.gridLayoutWidget) self.Interval_label.setLayoutDirection(QtCore.Qt.RightToLeft) self.Interval_label.setObjectName("Interval_label") self.gridLayout_2.addWidget(self.Interval_label, 4, 0, 1, 1) self.update_SpinBox = KIntSpinBox(self.gridLayoutWidget) self.update_SpinBox.setMaximum(120) self.update_SpinBox.setProperty("value", 5) self.update_SpinBox.setObjectName("update_SpinBox") self.gridLayout_2.addWidget(self.update_SpinBox, 4, 1, 1, 1) self.Font_combo = QtGui.QFontComboBox(Dialog) self.Font_combo.setGeometry(QtCore.QRect(7, 20, 208, 25)) self.Font_combo.setObjectName("Font_combo") self.Italic_button = QtGui.QPushButton(Dialog) self.Italic_button.setGeometry(QtCore.QRect(330, 20, 25, 25)) self.Italic_button.setObjectName("Italic_button") self.fontSize_combo = QtGui.QComboBox(Dialog) self.fontSize_combo.setGeometry(QtCore.QRect(215, 20, 91, 25)) self.fontSize_combo.setObjectName("fontSize_combo") self.Bold_button = QtGui.QPushButton(Dialog) self.Bold_button.setGeometry(QtCore.QRect(305, 20, 25, 25)) self.Bold_button.setObjectName("Bold_button") self.retranslateUi(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
class Ui_Form(object): def setupUi(self, Form): Form.setObjectName(_fromUtf8("Form")) Form.resize(400, 300) self.verticalLayout = QtGui.QVBoxLayout(Form) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.label = QtGui.QLabel(Form) self.label.setObjectName(_fromUtf8("label")) self.verticalLayout.addWidget(self.label) self.recKeyboardButton = QtGui.QCheckBox(Form) self.recKeyboardButton.setObjectName(_fromUtf8("recKeyboardButton")) self.verticalLayout.addWidget(self.recKeyboardButton) self.recMouseButton = QtGui.QCheckBox(Form) self.recMouseButton.setObjectName(_fromUtf8("recMouseButton")) self.verticalLayout.addWidget(self.recMouseButton) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.label_2 = QtGui.QLabel(Form) self.label_2.setObjectName(_fromUtf8("label_2")) self.horizontalLayout.addWidget(self.label_2) self.secondsSpinBox = KIntSpinBox(Form) self.secondsSpinBox.setProperty("value", 5) self.secondsSpinBox.setObjectName(_fromUtf8("secondsSpinBox")) self.horizontalLayout.addWidget(self.secondsSpinBox) self.label_3 = QtGui.QLabel(Form) self.label_3.setObjectName(_fromUtf8("label_3")) self.horizontalLayout.addWidget(self.label_3) self.verticalLayout.addLayout(self.horizontalLayout) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form) def retranslateUi(self, Form): Form.setWindowTitle(kdecore.i18n(_fromUtf8("Form"))) self.label.setText(kdecore.i18n(_fromUtf8("Record a keyboard/mouse macro"))) self.recKeyboardButton.setText(kdecore.i18n(_fromUtf8("Record keyboard events"))) self.recMouseButton.setText(kdecore.i18n(_fromUtf8("Record mouse events (experimental)"))) self.label_2.setText(kdecore.i18n(_fromUtf8("Start recording after"))) self.label_3.setText(kdecore.i18n(_fromUtf8("seconds")))
class ControlWidget(Plasma.Dialog): def __init__(self, orient = Qt.Horizontal, obj = None, factor = 5, val_ = 1, parent = None): Plasma.Dialog.__init__(self, parent) self.prnt = obj self.orient = orient self.factor = factor self.slider = QSlider() self.slider.setOrientation(self.orient) self.slider.setValue(val_) self.slider.setToolTip('Simple Spacer') self.slider.valueChanged.connect(self.resizeSpacer) self.multiplier = KIntSpinBox(1, 20, 1, self.factor, self) self.multiplier.setToolTip('Multiplier') self.multiplier.setMaximumWidth(40) self.multiplier.valueChanged.connect(self.multiplierValue) self.layout = QGridLayout() self.layout.setSpacing(0) self.layout.addWidget(self.slider, 0, 0) if self.prnt.formFactor() == Plasma.Horizontal : self.layout.addWidget(self.multiplier, 0, 1) else : self.layout.addWidget(self.multiplier, 1, 0) self.setLayout(self.layout) def multiplierValue(self, val): self.prnt.config().writeEntry('Multiplier', val) self.factor = val def resizeSpacer(self, vol): if self.prnt.formFactor() == Plasma.Horizontal : self.prnt.size_ = 20 + vol * self.factor, 20 else : self.prnt.size_ = 20, 20 + vol * self.factor self.prnt.setMinimumSize(self.prnt.size_[0], self.prnt.size_[1]) self.prnt.resize(self.prnt.size_[0], self.prnt.size_[1]) self.prnt.config().writeEntry('Width', self.prnt.size_[0]) self.prnt.config().writeEntry('Height', self.prnt.size_[1]) self.prnt.setLayout(self.prnt.layout)
def __init__(self, orient = Qt.Horizontal, obj = None, factor = 5, val_ = 1, parent = None): Plasma.Dialog.__init__(self, parent) self.prnt = obj self.orient = orient self.factor = factor self.slider = QSlider() self.slider.setOrientation(self.orient) self.slider.setValue(val_) self.slider.setToolTip('Simple Spacer') self.slider.valueChanged.connect(self.resizeSpacer) self.multiplier = KIntSpinBox(1, 20, 1, self.factor, self) self.multiplier.setToolTip('Multiplier') self.multiplier.setMaximumWidth(40) self.multiplier.valueChanged.connect(self.multiplierValue) self.layout = QGridLayout() self.layout.setSpacing(0) self.layout.addWidget(self.slider, 0, 0) if self.prnt.formFactor() == Plasma.Horizontal : self.layout.addWidget(self.multiplier, 0, 1) else : self.layout.addWidget(self.multiplier, 1, 0) self.setLayout(self.layout)
def __init__(self, obj=None, parent=None): QWidget.__init__(self, parent) self.prnt = parent self.Settings = obj.Settings colorNames = QColor().colorNames() timeOut = self.Settings.value("TimeOut", 300).toInt()[0] autoClose = self.Settings.value("AutoClose", 3).toInt()[0] popup = self.Settings.value("PopUp", 1).toInt()[0] iconText = self.Settings.value("IconText", 1).toInt()[0] popupColor = self.Settings.value("PopUpColor", "red").toString() iconTextColor = self.Settings.value("IconTextColor", "blue").toString() self.layout = QGridLayout() self.timeOutLabel = QLabel("Timeout checking (sec.):") self.layout.addWidget(self.timeOutLabel, 0, 0) self.timeOutBox = KIntSpinBox(10, 7200, 1, timeOut, self) self.timeOutBox.setMaximumWidth(75) self.layout.addWidget(self.timeOutBox, 0, 5) self.autoCloseLabel = QLabel("Advice auto close (sec.):") self.layout.addWidget(self.autoCloseLabel, 1, 0) self.autoCloseBox = KIntSpinBox(1, 7200, 1, autoClose, self) self.autoCloseBox.setMaximumWidth(75) self.layout.addWidget(self.autoCloseBox, 1, 5) self.popupLabel = QLabel("Show pop-up advice:") self.layout.addWidget(self.popupLabel, 2, 0) self.popupBox = QCheckBox() if popup == 0: self.popupBox.setCheckState(Qt.Unchecked) else: self.popupBox.setCheckState(Qt.Checked) self.popupBox.setMaximumWidth(75) self.layout.addWidget(self.popupBox, 2, 5) self.popupColorLabel = QLabel("Pop-up color:") self.layout.addWidget(self.popupColorLabel, 3, 0) self.popupColorBox = QComboBox() self.popupColorBox.setMaximumWidth(150) self.popupColorBox.addItems(colorNames) self.popupColorBox.setCurrentIndex(self.popupColorBox.findText(popupColor)) self.layout.addWidget(self.popupColorBox, 3, 5) self.iconTextLabel = QLabel("Show advice in Icon:") self.layout.addWidget(self.iconTextLabel, 4, 0) self.iconTextBox = QCheckBox() if iconText == 0: self.iconTextBox.setCheckState(Qt.Unchecked) else: self.iconTextBox.setCheckState(Qt.Checked) self.iconTextBox.setMaximumWidth(75) self.layout.addWidget(self.iconTextBox, 4, 5) self.iconTextColorLabel = QLabel("IconText color:") self.layout.addWidget(self.iconTextColorLabel, 5, 0) self.iconTextColorBox = QComboBox() self.iconTextColorBox.setMaximumWidth(150) self.iconTextColorBox.addItems(colorNames) self.iconTextColorBox.setCurrentIndex(self.iconTextColorBox.findText(iconTextColor)) self.layout.addWidget(self.iconTextColorBox, 5, 5) self.setLayout(self.layout)
def setupUi(self, FetchDialog): FetchDialog.setObjectName(_fromUtf8("FetchDialog")) FetchDialog.resize(662, 31) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(FetchDialog.sizePolicy().hasHeightForWidth()) FetchDialog.setSizePolicy(sizePolicy) FetchDialog.setWindowTitle(_fromUtf8("")) self.horizontalLayout = QtGui.QHBoxLayout(FetchDialog) self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.closeButton = KPushButton(FetchDialog) self.closeButton.setFlat(True) self.closeButton.setObjectName(_fromUtf8("closeButton")) self.horizontalLayout.addWidget(self.closeButton) self.ratingLabel = QtGui.QLabel(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.ratingLabel.sizePolicy().hasHeightForWidth()) self.ratingLabel.setSizePolicy(sizePolicy) self.ratingLabel.setObjectName(_fromUtf8("ratingLabel")) self.horizontalLayout.addWidget(self.ratingLabel) self.ratingComboBox = KComboBox(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.ratingComboBox.sizePolicy().hasHeightForWidth()) self.ratingComboBox.setSizePolicy(sizePolicy) self.ratingComboBox.setObjectName(_fromUtf8("ratingComboBox")) self.ratingComboBox.addItem(_fromUtf8("")) self.ratingComboBox.addItem(_fromUtf8("")) self.ratingComboBox.addItem(_fromUtf8("")) self.horizontalLayout.addWidget(self.ratingComboBox) self.postLabel = QtGui.QLabel(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.postLabel.sizePolicy().hasHeightForWidth()) self.postLabel.setSizePolicy(sizePolicy) self.postLabel.setObjectName(_fromUtf8("postLabel")) self.horizontalLayout.addWidget(self.postLabel) self.postSpinBox = KIntSpinBox(FetchDialog) self.postSpinBox.setMinimum(1) self.postSpinBox.setMaximum(100) self.postSpinBox.setObjectName(_fromUtf8("postSpinBox")) self.horizontalLayout.addWidget(self.postSpinBox) self.tagLabel = QtGui.QLabel(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.tagLabel.sizePolicy().hasHeightForWidth()) self.tagLabel.setSizePolicy(sizePolicy) self.tagLabel.setObjectName(_fromUtf8("tagLabel")) self.horizontalLayout.addWidget(self.tagLabel) self.tagLineEdit = KLineEdit(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.tagLineEdit.sizePolicy().hasHeightForWidth()) self.tagLineEdit.setSizePolicy(sizePolicy) self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) self.horizontalLayout.addWidget(self.tagLineEdit) self.downloadButton = KPushButton(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.downloadButton.sizePolicy().hasHeightForWidth()) self.downloadButton.setSizePolicy(sizePolicy) self.downloadButton.setObjectName(_fromUtf8("downloadButton")) self.horizontalLayout.addWidget(self.downloadButton) self.retranslateUi(FetchDialog) QtCore.QMetaObject.connectSlotsByName(FetchDialog)
class Ui_FetchDialog(object): def setupUi(self, FetchDialog): FetchDialog.setObjectName(_fromUtf8("FetchDialog")) FetchDialog.resize(662, 31) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(FetchDialog.sizePolicy().hasHeightForWidth()) FetchDialog.setSizePolicy(sizePolicy) FetchDialog.setWindowTitle(_fromUtf8("")) self.horizontalLayout = QtGui.QHBoxLayout(FetchDialog) self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.closeButton = KPushButton(FetchDialog) self.closeButton.setFlat(True) self.closeButton.setObjectName(_fromUtf8("closeButton")) self.horizontalLayout.addWidget(self.closeButton) self.ratingLabel = QtGui.QLabel(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.ratingLabel.sizePolicy().hasHeightForWidth()) self.ratingLabel.setSizePolicy(sizePolicy) self.ratingLabel.setObjectName(_fromUtf8("ratingLabel")) self.horizontalLayout.addWidget(self.ratingLabel) self.ratingComboBox = KComboBox(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.ratingComboBox.sizePolicy().hasHeightForWidth()) self.ratingComboBox.setSizePolicy(sizePolicy) self.ratingComboBox.setObjectName(_fromUtf8("ratingComboBox")) self.ratingComboBox.addItem(_fromUtf8("")) self.ratingComboBox.addItem(_fromUtf8("")) self.ratingComboBox.addItem(_fromUtf8("")) self.horizontalLayout.addWidget(self.ratingComboBox) self.postLabel = QtGui.QLabel(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.postLabel.sizePolicy().hasHeightForWidth()) self.postLabel.setSizePolicy(sizePolicy) self.postLabel.setObjectName(_fromUtf8("postLabel")) self.horizontalLayout.addWidget(self.postLabel) self.postSpinBox = KIntSpinBox(FetchDialog) self.postSpinBox.setMinimum(1) self.postSpinBox.setMaximum(100) self.postSpinBox.setObjectName(_fromUtf8("postSpinBox")) self.horizontalLayout.addWidget(self.postSpinBox) self.tagLabel = QtGui.QLabel(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.tagLabel.sizePolicy().hasHeightForWidth()) self.tagLabel.setSizePolicy(sizePolicy) self.tagLabel.setObjectName(_fromUtf8("tagLabel")) self.horizontalLayout.addWidget(self.tagLabel) self.tagLineEdit = KLineEdit(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.tagLineEdit.sizePolicy().hasHeightForWidth()) self.tagLineEdit.setSizePolicy(sizePolicy) self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) self.horizontalLayout.addWidget(self.tagLineEdit) self.downloadButton = KPushButton(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.downloadButton.sizePolicy().hasHeightForWidth()) self.downloadButton.setSizePolicy(sizePolicy) self.downloadButton.setObjectName(_fromUtf8("downloadButton")) self.horizontalLayout.addWidget(self.downloadButton) self.retranslateUi(FetchDialog) QtCore.QMetaObject.connectSlotsByName(FetchDialog) def retranslateUi(self, FetchDialog): self.ratingLabel.setText(kdecore.i18n(_fromUtf8("Maximum rating: "))) self.ratingComboBox.setItemText(0, kdecore.i18n(_fromUtf8("Safe"))) self.ratingComboBox.setItemText(1, kdecore.i18n(_fromUtf8("Questionable"))) self.ratingComboBox.setItemText(2, kdecore.i18n(_fromUtf8("Explicit"))) self.postLabel.setText(kdecore.i18n(_fromUtf8("Posts to retrieve:"))) self.postSpinBox.setToolTip(kdecore.i18n(_fromUtf8("Number of posts to retrieve (max 100)"))) self.postSpinBox.setWhatsThis( kdecore.i18n( _fromUtf8( "The number of posts to retrieve. Notice that Danbooru limits the maximum number of posts to 100." ) ) ) self.tagLabel.setText(kdecore.i18n(_fromUtf8("Tags:"))) self.tagLineEdit.setToolTip(kdecore.i18n(_fromUtf8("Tags to include in search (optional)"))) self.tagLineEdit.setWhatsThis( kdecore.i18n( _fromUtf8( "Input here the tags that should be used when looking for posts. Separate them with commas, without spaces." ) ) ) self.tagLineEdit.setClickMessage(kdecore.i18n(_fromUtf8("Tags, comma separated"))) self.downloadButton.setText(kdecore.i18n(_fromUtf8("Download")))
def __init__(self, obj = None, parent= None): QWidget.__init__(self, parent) self.Parent = obj self.prnt = parent self.tr = Translator('AppletSettings') self.Settings = self.Parent.Settings self.checkAccess = self.Parent.checkAccess timeOut = self.initValue('TimeOut', '600') AutoRun = self.initValue('AutoRun', '0') countProbe = self.initValue('CountProbe', '3') showError = self.initValue('ShowError', '1') waitThread = self.initValue('WaitThread', '120') stayDebLog = self.initValue('stayDebLog', '5') showVersion = self.initValue('ShowVersion', '1') timeOutGroup = self.initValue('TimeOutGroup', '3') maxShowedMail = self.initValue('MaxShowedMail', '1024') mailsInGroup = self.initValue('MailsInGroup', '5') self.layout = QGridLayout() self.timeOutLabel = QLabel(self.tr._translate("Timeout checking (sec.):")) self.layout.addWidget(self.timeOutLabel,0,0) self.timeOutBox = KIntSpinBox(10, 7200, 1, int(timeOut), self) self.timeOutBox.setMaximumWidth(75) self.layout.addWidget(self.timeOutBox, 0, 5) self.autoRunLabel = QLabel(self.tr._translate("Autorun mail checking :")) self.layout.addWidget(self.autoRunLabel,1,0) self.AutoRunBox = QCheckBox() if int(AutoRun) > 0 : self.AutoRunBox.setCheckState(Qt.Checked) self.layout.addWidget(self.AutoRunBox,1,5) self.countProbe = QLabel(self.tr._translate("Count of connect probe\nto mail server:")) self.layout.addWidget(self.countProbe,2,0) self.countProbeBox = KIntSpinBox(1, 10, 1, int(countProbe), self) self.layout.addWidget(self.countProbeBox, 2, 5) self.showError = QLabel(self.tr._translate("Show error messages :")) self.layout.addWidget(self.showError,3,0) self.showErrorBox = QCheckBox() if int(showError) > 0 : self.showErrorBox.setCheckState(Qt.Checked) self.layout.addWidget(self.showErrorBox,3,5) self.waitThreadLabel = QLabel(self.tr._translate("Autoexit of connect (sec.):")) self.layout.addWidget(self.waitThreadLabel,4,0) self.waitThreadBox = KIntSpinBox(3, 7200, 1, int(waitThread), self) self.layout.addWidget(self.waitThreadBox, 4, 5) self.stayDebLogLabel = QLabel(self.tr._translate("Stay Debug output Log :")) self.layout.addWidget(self.stayDebLogLabel,5,0) self.stayDebLogBox = KIntSpinBox(1, 50, 1, int(stayDebLog), self) self.stayDebLogBox.setMaximumWidth(75) self.layout.addWidget(self.stayDebLogBox, 5, 5) self.showVersion = QLabel(self.tr._translate("Show Version :")) self.layout.addWidget(self.showVersion,6,0) self.showVersionBox = QCheckBox() if int(showVersion) > 0 : self.showVersionBox.setCheckState(Qt.Checked) self.layout.addWidget(self.showVersionBox,6,5) self.timeOutGroupLabel = QLabel(self.tr._translate("Group Akonadi events timeout (sec.):")) self.timeOutGroupLabel.setEnabled(AkonadiModuleExist) self.layout.addWidget(self.timeOutGroupLabel, 7, 0) self.timeOutGroupBox = KIntSpinBox(1, 200, 1, int(timeOutGroup), self) self.timeOutGroupBox.setMaximumWidth(75) self.timeOutGroupBox.setEnabled(AkonadiModuleExist) self.layout.addWidget(self.timeOutGroupBox, 7, 5) self.maxMailLabel = QLabel(self.tr._translate("Max Count of Showed Mail :")) self.layout.addWidget(self.maxMailLabel, 8, 0) self.maxMailBox = KIntSpinBox(1, 1024, 1, int(maxShowedMail), self) self.maxMailBox.setMaximumWidth(75) self.maxMailBox.valueChanged[int].connect(self.showMailGroupping) self.layout.addWidget(self.maxMailBox, 8, 5) self.mailInGroupLabel = QLabel('\t' + self.tr._translate("Count of Mail in Group for account:")) self.mailInGroupLabel.setEnabled(False) self.layout.addWidget(self.mailInGroupLabel, 9, 0) self.mailInGroupBox = KIntSpinBox(1, 10, 1, int(mailsInGroup), self) self.mailInGroupBox.setMaximumWidth(75) self.mailInGroupBox.setEnabled(False) self.layout.addWidget(self.mailInGroupBox, 9, 5) self.setLayout(self.layout) self.maxMailBox.valueChanged.emit(int(maxShowedMail))
class Ui_FetchDialog(object): def setupUi(self, FetchDialog): FetchDialog.setObjectName(_fromUtf8("FetchDialog")) FetchDialog.resize(662, 31) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( FetchDialog.sizePolicy().hasHeightForWidth()) FetchDialog.setSizePolicy(sizePolicy) FetchDialog.setWindowTitle(_fromUtf8("")) self.horizontalLayout = QtGui.QHBoxLayout(FetchDialog) self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.closeButton = KPushButton(FetchDialog) self.closeButton.setFlat(True) self.closeButton.setObjectName(_fromUtf8("closeButton")) self.horizontalLayout.addWidget(self.closeButton) self.ratingLabel = QtGui.QLabel(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.ratingLabel.sizePolicy().hasHeightForWidth()) self.ratingLabel.setSizePolicy(sizePolicy) self.ratingLabel.setObjectName(_fromUtf8("ratingLabel")) self.horizontalLayout.addWidget(self.ratingLabel) self.ratingComboBox = KComboBox(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.ratingComboBox.sizePolicy().hasHeightForWidth()) self.ratingComboBox.setSizePolicy(sizePolicy) self.ratingComboBox.setObjectName(_fromUtf8("ratingComboBox")) self.ratingComboBox.addItem(_fromUtf8("")) self.ratingComboBox.addItem(_fromUtf8("")) self.ratingComboBox.addItem(_fromUtf8("")) self.horizontalLayout.addWidget(self.ratingComboBox) self.postLabel = QtGui.QLabel(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.postLabel.sizePolicy().hasHeightForWidth()) self.postLabel.setSizePolicy(sizePolicy) self.postLabel.setObjectName(_fromUtf8("postLabel")) self.horizontalLayout.addWidget(self.postLabel) self.postSpinBox = KIntSpinBox(FetchDialog) self.postSpinBox.setMinimum(1) self.postSpinBox.setMaximum(100) self.postSpinBox.setObjectName(_fromUtf8("postSpinBox")) self.horizontalLayout.addWidget(self.postSpinBox) self.tagLabel = QtGui.QLabel(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.tagLabel.sizePolicy().hasHeightForWidth()) self.tagLabel.setSizePolicy(sizePolicy) self.tagLabel.setObjectName(_fromUtf8("tagLabel")) self.horizontalLayout.addWidget(self.tagLabel) self.tagLineEdit = KLineEdit(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.tagLineEdit.sizePolicy().hasHeightForWidth()) self.tagLineEdit.setSizePolicy(sizePolicy) self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) self.horizontalLayout.addWidget(self.tagLineEdit) self.downloadButton = KPushButton(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.downloadButton.sizePolicy().hasHeightForWidth()) self.downloadButton.setSizePolicy(sizePolicy) self.downloadButton.setObjectName(_fromUtf8("downloadButton")) self.horizontalLayout.addWidget(self.downloadButton) self.retranslateUi(FetchDialog) QtCore.QMetaObject.connectSlotsByName(FetchDialog) def retranslateUi(self, FetchDialog): self.ratingLabel.setText(kdecore.i18n(_fromUtf8("Maximum rating: "))) self.ratingComboBox.setItemText(0, kdecore.i18n(_fromUtf8("Safe"))) self.ratingComboBox.setItemText( 1, kdecore.i18n(_fromUtf8("Questionable"))) self.ratingComboBox.setItemText(2, kdecore.i18n(_fromUtf8("Explicit"))) self.postLabel.setText(kdecore.i18n(_fromUtf8("Posts to retrieve:"))) self.postSpinBox.setToolTip( kdecore.i18n(_fromUtf8("Number of posts to retrieve (max 100)"))) self.postSpinBox.setWhatsThis( kdecore.i18n( _fromUtf8( "The number of posts to retrieve. Notice that Danbooru limits the maximum number of posts to 100." ))) self.tagLabel.setText(kdecore.i18n(_fromUtf8("Tags:"))) self.tagLineEdit.setToolTip( kdecore.i18n(_fromUtf8("Tags to include in search (optional)"))) self.tagLineEdit.setWhatsThis( kdecore.i18n( _fromUtf8( "Input here the tags that should be used when looking for posts. Separate them with commas, without spaces." ))) self.tagLineEdit.setClickMessage( kdecore.i18n(_fromUtf8("Tags, comma separated"))) self.downloadButton.setText(kdecore.i18n(_fromUtf8("Download")))
class Ui_GeneralPage(object): def setupUi(self, GeneralPage): GeneralPage.setObjectName("GeneralPage") GeneralPage.resize(299, 92) self.formLayout = QtGui.QFormLayout(GeneralPage) self.formLayout.setObjectName("formLayout") self.thumbnalLabel = QtGui.QLabel(GeneralPage) self.thumbnalLabel.setObjectName("thumbnalLabel") self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.thumbnalLabel) self.kcfg_thumbnailMaxRetrieve = KIntSpinBox(GeneralPage) self.kcfg_thumbnailMaxRetrieve.setMinimum(1) self.kcfg_thumbnailMaxRetrieve.setMaximum(100) self.kcfg_thumbnailMaxRetrieve.setProperty("value", 3) self.kcfg_thumbnailMaxRetrieve.setObjectName("kcfg_thumbnailMaxRetrieve") self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.kcfg_thumbnailMaxRetrieve) self.columnLabel = QtGui.QLabel(GeneralPage) self.columnLabel.setObjectName("columnLabel") self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.columnLabel) self.kcfg_displayColumns = KIntSpinBox(GeneralPage) self.kcfg_displayColumns.setMinimum(1) self.kcfg_displayColumns.setMaximum(100) self.kcfg_displayColumns.setObjectName("kcfg_displayColumns") self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.kcfg_displayColumns) self.kcfg_maxAllowedRating = KComboBox(GeneralPage) self.kcfg_maxAllowedRating.setObjectName("kcfg_maxAllowedRating") self.kcfg_maxAllowedRating.addItem("") self.kcfg_maxAllowedRating.addItem("") self.kcfg_maxAllowedRating.addItem("") self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.kcfg_maxAllowedRating) self.ratingLabel = QtGui.QLabel(GeneralPage) self.ratingLabel.setObjectName("ratingLabel") self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.ratingLabel) self.retranslateUi(GeneralPage) QtCore.QMetaObject.connectSlotsByName(GeneralPage) def retranslateUi(self, GeneralPage): self.thumbnalLabel.setText(kdecore.i18n("Default number of thumbnails to retrieve")) self.columnLabel.setText(kdecore.i18n("Number of columns to display")) self.kcfg_maxAllowedRating.setItemText(0, kdecore.i18n("Safe")) self.kcfg_maxAllowedRating.setItemText(1, kdecore.i18n("Questionable")) self.kcfg_maxAllowedRating.setItemText(2, kdecore.i18n("Explicit")) self.ratingLabel.setText(kdecore.i18n("Maximum allowed rating"))
def setupUi(self, FetchDialog): FetchDialog.setObjectName(_fromUtf8("FetchDialog")) FetchDialog.resize(662, 31) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( FetchDialog.sizePolicy().hasHeightForWidth()) FetchDialog.setSizePolicy(sizePolicy) FetchDialog.setWindowTitle(_fromUtf8("")) self.horizontalLayout = QtGui.QHBoxLayout(FetchDialog) self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.closeButton = KPushButton(FetchDialog) self.closeButton.setFlat(True) self.closeButton.setObjectName(_fromUtf8("closeButton")) self.horizontalLayout.addWidget(self.closeButton) self.ratingLabel = QtGui.QLabel(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.ratingLabel.sizePolicy().hasHeightForWidth()) self.ratingLabel.setSizePolicy(sizePolicy) self.ratingLabel.setObjectName(_fromUtf8("ratingLabel")) self.horizontalLayout.addWidget(self.ratingLabel) self.ratingComboBox = KComboBox(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.ratingComboBox.sizePolicy().hasHeightForWidth()) self.ratingComboBox.setSizePolicy(sizePolicy) self.ratingComboBox.setObjectName(_fromUtf8("ratingComboBox")) self.ratingComboBox.addItem(_fromUtf8("")) self.ratingComboBox.addItem(_fromUtf8("")) self.ratingComboBox.addItem(_fromUtf8("")) self.horizontalLayout.addWidget(self.ratingComboBox) self.postLabel = QtGui.QLabel(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.postLabel.sizePolicy().hasHeightForWidth()) self.postLabel.setSizePolicy(sizePolicy) self.postLabel.setObjectName(_fromUtf8("postLabel")) self.horizontalLayout.addWidget(self.postLabel) self.postSpinBox = KIntSpinBox(FetchDialog) self.postSpinBox.setMinimum(1) self.postSpinBox.setMaximum(100) self.postSpinBox.setObjectName(_fromUtf8("postSpinBox")) self.horizontalLayout.addWidget(self.postSpinBox) self.tagLabel = QtGui.QLabel(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.tagLabel.sizePolicy().hasHeightForWidth()) self.tagLabel.setSizePolicy(sizePolicy) self.tagLabel.setObjectName(_fromUtf8("tagLabel")) self.horizontalLayout.addWidget(self.tagLabel) self.tagLineEdit = KLineEdit(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.tagLineEdit.sizePolicy().hasHeightForWidth()) self.tagLineEdit.setSizePolicy(sizePolicy) self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) self.horizontalLayout.addWidget(self.tagLineEdit) self.downloadButton = KPushButton(FetchDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.downloadButton.sizePolicy().hasHeightForWidth()) self.downloadButton.setSizePolicy(sizePolicy) self.downloadButton.setObjectName(_fromUtf8("downloadButton")) self.horizontalLayout.addWidget(self.downloadButton) self.retranslateUi(FetchDialog) QtCore.QMetaObject.connectSlotsByName(FetchDialog)
class AppletSettings(QWidget): def __init__(self, obj = None, parent= None): QWidget.__init__(self, parent) self.Parent = obj self.prnt = parent self.tr = Translator('AppletSettings') self.Settings = self.Parent.Settings self.checkAccess = self.Parent.checkAccess timeOut = self.initValue('TimeOut', '600') AutoRun = self.initValue('AutoRun', '0') countProbe = self.initValue('CountProbe', '3') showError = self.initValue('ShowError', '1') waitThread = self.initValue('WaitThread', '120') stayDebLog = self.initValue('stayDebLog', '5') showVersion = self.initValue('ShowVersion', '1') timeOutGroup = self.initValue('TimeOutGroup', '3') maxShowedMail = self.initValue('MaxShowedMail', '1024') mailsInGroup = self.initValue('MailsInGroup', '5') self.layout = QGridLayout() self.timeOutLabel = QLabel(self.tr._translate("Timeout checking (sec.):")) self.layout.addWidget(self.timeOutLabel,0,0) self.timeOutBox = KIntSpinBox(10, 7200, 1, int(timeOut), self) self.timeOutBox.setMaximumWidth(75) self.layout.addWidget(self.timeOutBox, 0, 5) self.autoRunLabel = QLabel(self.tr._translate("Autorun mail checking :")) self.layout.addWidget(self.autoRunLabel,1,0) self.AutoRunBox = QCheckBox() if int(AutoRun) > 0 : self.AutoRunBox.setCheckState(Qt.Checked) self.layout.addWidget(self.AutoRunBox,1,5) self.countProbe = QLabel(self.tr._translate("Count of connect probe\nto mail server:")) self.layout.addWidget(self.countProbe,2,0) self.countProbeBox = KIntSpinBox(1, 10, 1, int(countProbe), self) self.layout.addWidget(self.countProbeBox, 2, 5) self.showError = QLabel(self.tr._translate("Show error messages :")) self.layout.addWidget(self.showError,3,0) self.showErrorBox = QCheckBox() if int(showError) > 0 : self.showErrorBox.setCheckState(Qt.Checked) self.layout.addWidget(self.showErrorBox,3,5) self.waitThreadLabel = QLabel(self.tr._translate("Autoexit of connect (sec.):")) self.layout.addWidget(self.waitThreadLabel,4,0) self.waitThreadBox = KIntSpinBox(3, 7200, 1, int(waitThread), self) self.layout.addWidget(self.waitThreadBox, 4, 5) self.stayDebLogLabel = QLabel(self.tr._translate("Stay Debug output Log :")) self.layout.addWidget(self.stayDebLogLabel,5,0) self.stayDebLogBox = KIntSpinBox(1, 50, 1, int(stayDebLog), self) self.stayDebLogBox.setMaximumWidth(75) self.layout.addWidget(self.stayDebLogBox, 5, 5) self.showVersion = QLabel(self.tr._translate("Show Version :")) self.layout.addWidget(self.showVersion,6,0) self.showVersionBox = QCheckBox() if int(showVersion) > 0 : self.showVersionBox.setCheckState(Qt.Checked) self.layout.addWidget(self.showVersionBox,6,5) self.timeOutGroupLabel = QLabel(self.tr._translate("Group Akonadi events timeout (sec.):")) self.timeOutGroupLabel.setEnabled(AkonadiModuleExist) self.layout.addWidget(self.timeOutGroupLabel, 7, 0) self.timeOutGroupBox = KIntSpinBox(1, 200, 1, int(timeOutGroup), self) self.timeOutGroupBox.setMaximumWidth(75) self.timeOutGroupBox.setEnabled(AkonadiModuleExist) self.layout.addWidget(self.timeOutGroupBox, 7, 5) self.maxMailLabel = QLabel(self.tr._translate("Max Count of Showed Mail :")) self.layout.addWidget(self.maxMailLabel, 8, 0) self.maxMailBox = KIntSpinBox(1, 1024, 1, int(maxShowedMail), self) self.maxMailBox.setMaximumWidth(75) self.maxMailBox.valueChanged[int].connect(self.showMailGroupping) self.layout.addWidget(self.maxMailBox, 8, 5) self.mailInGroupLabel = QLabel('\t' + self.tr._translate("Count of Mail in Group for account:")) self.mailInGroupLabel.setEnabled(False) self.layout.addWidget(self.mailInGroupLabel, 9, 0) self.mailInGroupBox = KIntSpinBox(1, 10, 1, int(mailsInGroup), self) self.mailInGroupBox.setMaximumWidth(75) self.mailInGroupBox.setEnabled(False) self.layout.addWidget(self.mailInGroupBox, 9, 5) self.setLayout(self.layout) self.maxMailBox.valueChanged.emit(int(maxShowedMail)) def initValue(self, key_, default = '0'): if self.Settings.contains(key_) : #print dateStamp() , key_, self.Settings.value(key_).toString() return self.Settings.value(key_).toString() else : self.Settings.setValue(key_, QVariant(default)) #print dateStamp() , key_, self.Settings.value(key_).toString() return default def stateChanged(self, state): self.mailInGroupLabel.setEnabled(state) self.mailInGroupBox.setEnabled(state) def showMailGroupping(self, i): if i > self.mailInGroupBox.value() : self.stateChanged(True) else : self.stateChanged(False) def refreshSettings(self): if not self.checkAccess() : return None self.Settings.setValue('TimeOut', str(self.timeOutBox.value())) self.Settings.setValue('CountProbe', str(self.countProbeBox.value())) self.Settings.setValue('WaitThread', str(self.waitThreadBox.value())) self.Settings.setValue('stayDebLog', str(self.stayDebLogBox.value())) self.Settings.setValue('TimeOutGroup', str(self.timeOutGroupBox.value())) self.Settings.setValue('MaxShowedMail', str(self.maxMailBox.value())) self.Settings.setValue('MailsInGroup', str(self.mailInGroupBox.value())) if self.AutoRunBox.isChecked() : self.Settings.setValue('AutoRun', '1') else: self.Settings.setValue('AutoRun', '0') if self.showErrorBox.isChecked() : self.Settings.setValue('ShowError', '1') else: self.Settings.setValue('ShowError', '0') if self.showVersionBox.isChecked() : self.Settings.setValue('ShowVersion', '1') else: self.Settings.setValue('ShowVersion', '0') self.Settings.sync() def eventClose(self, event): self.prnt.done(0)