def buildInterface(self): frame = QFrame() layout = QVBoxLayout(frame) self.setWidget(frame) self.setWidgetResizable(True) title = u'<h1>%s</h1>' % self.tr('EdenWall activation keys') layout.addWidget(QLabel(title)) sn = "<strong>%s</strong>" % self.ID self.IDLabel = QLabel(tr('This appliance serial number is %s.') % sn) self.IDLabel.setTextInteractionFlags( Qt.TextSelectableByKeyboard | Qt.TextSelectableByMouse) sendLicenseButton = NuConfPageKit.createButton( tr('Upload an activation key'), frame, self.mainwindow, self.chooseAndSendFile, QIcon(":/icons/up")) self.mainwindow.writeAccessNeeded(sendLicenseButton) self.table = QTableWidget(0, 4, frame) self.table.setEditTriggers(QAbstractItemView.NoEditTriggers) self.table.setSelectionMode(QAbstractItemView.NoSelection) self.table.horizontalHeader().setStretchLastSection(True) self.table.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents) self.table.setHorizontalHeaderLabels([ unicode(translate('MainWindow', 'Activation key owner')), unicode(translate('MainWindow', 'Valid until')), unicode(translate('MainWindow', 'Days left')), unicode(translate('MainWindow', 'Type'))]) for widget in (self.IDLabel, sendLicenseButton, self.table): layout.addWidget(widget) layout.addStretch(100)
def pleaseRestartEASDialog(self, need_ufwi_rpcd_restart=False): dialog = QDialog(self) dialog.setModal(False) if need_ufwi_rpcd_restart: title = tr("Please restart the configuration service and EAS") msg = tr("Please restart the configuration service, then " "EAS to use unlocked functionalities.") else: title = tr("Please restart EAS") msg = tr("Please restart EAS to use unlocked functionalities.") dialog.setWindowTitle(title) label = NuConfPageKit.createLabel(msg, dialog) layout = QVBoxLayout(dialog) dialog.setLayout(layout) button = NuConfPageKit.createButton(translate('MainWindow', 'Close'), dialog, dialog, dialog.close) for widget in (label, button): layout.addWidget(widget) widget.show() dialog.show()