def __init__(self, parent, settings): QtGui.QDialog.__init__(self, parent) self._settings = settings ui.loadUi(self, 'preferences.ui') win_remove_context_help(self) styles = QtGui.QStyleFactory.keys() style = QtGui.QApplication.style().objectName() self._comboStyles.addItems(styles) index = ([name.lower() for name in styles]).index(style) self._comboStyles.setCurrentIndex(index) units = ['Metric', 'Imperial', 'Nautical'] self._comboUnits.addItems(units) index = ([unit.lower() for unit in units]).index(self._settings.units.lower()) self._comboUnits.setCurrentIndex(index) self._font = QtGui.QFont() self._font.fromString(settings.fontList) self._buttonFont.setText(self.__font_name()) if NATGRID: interp = ['Linear', 'Nearest neighbour'] self._comboInterp.addItems(interp) self._comboInterp.setCurrentIndex(1 if self._settings.interpolation == 'nn' else 0) else: self._labelInterp.hide() self._comboInterp.hide()
def __init__(self, parent, settings): QtGui.QDialog.__init__(self, parent) self._settings = settings ui.loadUi(self, 'preferences.ui') win_remove_context_help(self) styles = QtGui.QStyleFactory.keys() style = QtGui.QApplication.style().objectName() self._comboStyles.addItems(styles) index = ([name.lower() for name in styles]).index(style) self._comboStyles.setCurrentIndex(index) units = ['Metric', 'Imperial', 'Nautical'] self._comboUnits.addItems(units) index = ([unit.lower() for unit in units]).index(self._settings.units.lower()) self._comboUnits.setCurrentIndex(index) self._font = QtGui.QFont() self._font.fromString(settings.fontList) self._buttonFont.setText(self.__font_name()) if NATGRID: interp = ['Linear', 'Nearest neighbour'] self._comboInterp.addItems(interp) self._comboInterp.setCurrentIndex( 1 if self._settings.interpolation == 'nn' else 0) else: self._labelInterp.hide() self._comboInterp.hide()
def __init__(self, parent, remote): QtGui.QDialog.__init__(self, parent) self._remote = remote settings = remote.get_settings() ports = remote.get_ports() ui.loadUi(self, 'remote_settings.ui') win_remove_context_help(self) if settings[0] is not None: self._comboPort.addItems(ports) if settings[0] in ports: index = ports.index(settings[0]) self._comboPort.setCurrentIndex(index) self._editFreq.setValidator(QtGui.QDoubleValidator(1, 9999, 1)) self._editFreq.setText(str(settings[2])) self._editDelay.setValidator(QtGui.QDoubleValidator(0, 9999, 1)) if settings[1] is not None: self._checkAuto.setChecked(True) self._editDelay.setEnabled(True) self._editDelay.setText(str(settings[1])) else: self._editDelay.setText('4')
def __init__(self, parent): QtGui.QDialog.__init__(self, parent) ui.loadUi(self, 'about.ui') win_remove_context_help(self) pixmap = QtGui.QPixmap(get_ui_path('logo.png')) self._labelLogo.setPixmap(pixmap)
def on_actionPrint_triggered(self): self._printer.setDocName(self.windowTitle()) dialog = QtGui.QPrintPreviewDialog(self._printer, self) win_remove_context_help(dialog) dialog.paintRequested.connect(self.__on__print) if dialog.exec_(): self._status.show_message(Status.PRINTING) self._printer = dialog.printer() self._status.show_message(Status.READY)
def __init__(self, parent): QtGui.QDialog.__init__(self, parent) ui.loadUi(self, 'about.ui') win_remove_context_help(self) pixmap = QtGui.QPixmap(get_resource_ui('logo.png')) self._labelLogo.setPixmap(pixmap) self._version.setText('v' + '.'.join([str(x) for x in VERSION]))
def on_actionExportPdf_triggered(self): printer = QtGui.QPrinter() self._printer.setDocName(self.windowTitle()) printer.setOutputFormat(QtGui.QPrinter.PdfFormat) dialog = QtGui.QPrintPreviewDialog(printer, self) win_remove_context_help(dialog) dialog.paintRequested.connect(self.__on__print) if dialog.exec_(): self._status.show_message(Status.EXPORTING) self._printer = dialog.printer() self._status.show_message(Status.READY)
def __init__(self, parent, settings): QtGui.QDialog.__init__(self, parent) self._settings = settings ui.loadUi(self, 'remote_connect.ui') win_remove_context_help(self) completer = QtGui.QCompleter(settings.remoteHistory, self) completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive) self._editAddr.setCompleter(completer) self._editAddr.setText(settings.remoteAddr)
def __init__(self, parent, logs): QtGui.QDialog.__init__(self, parent) ui.loadUi(self, 'log.ui') win_remove_context_help(self) self._model = ModelLog(logs) self._tableLog.setModel(self._model) self._tableLog.resizeColumnsToContents() header = self._tableLog.horizontalHeader() header.setResizeMode(QtGui.QHeaderView.Fixed)
def __init__(self, parent, timeStamps): QtGui.QDialog.__init__(self, parent) self._timeStamps = timeStamps ui.loadUi(self, 'scans_range.ui') win_remove_context_help(self) timeMin, timeMax = self.__get_range() self._timeFrom = timeMin.toTime_t() self._timeTo = timeMax.toTime_t() self._dateFrom.setDateTimeRange(timeMin, timeMax) self._dateFrom.setDateTime(timeMin) self._dateTo.setDateTimeRange(timeMin, timeMax) self._dateTo.setDateTime(timeMax) cal_set_colours(self._dateFrom) cal_set_colours(self._dateTo)
def __init__(self, parent, settings): QtGui.QDialog.__init__(self, parent) self._settings = settings ui.loadUi(self, 'preferences.ui') win_remove_context_help(self) styles = QtGui.QStyleFactory.keys() style = QtGui.QApplication.style().objectName() self._comboStyles.addItems(styles) index = ([name.lower() for name in styles]).index(style) self._comboStyles.setCurrentIndex(index) units = ['Metric', 'Imperial', 'Nautical'] self._comboUnits.addItems(units) index = ([unit.lower() for unit in units]).index(self._settings.units.lower()) self._comboUnits.setCurrentIndex(index) self._font = QtGui.QFont() self._font.fromString(settings.fontList) self._buttonFont.setText(self.__font_name())