Exemple #1
0
    def mTypeBoxCrrentIndexChanged(self, index):
        # FIXME: sync with providers/ogr/qgsogrprovider.cpp
        if isinstance(index, str) or isinstance(index, QString):
            return
        for case in switch(index):
            if case(0):  # Text data
                if (int(self.ui.mWidth.text()) < 1
                        or int(self.ui.mWidth.text()) > 255):
                    self.ui.mWidth.setText("80")
                self.ui.mPrecision.setEnabled(False)
                self.ui.mWidth.setValidator(QIntValidator(1, 255, self))
                break

            elif case(1):  # Whole number
                if (int(self.ui.mWidth.text()) < 1
                        or int(self.ui.mWidth.text()) > 10):
                    self.ui.mWidth.setText("10")
                self.ui.mPrecision.setEnabled(False)
                self.ui.mWidth.setValidator(QIntValidator(1, 10, self))
                break

            elif case(2):  # Decimal number
                if (int(self.ui.mWidth.text()) < 1
                        or int(self.ui.mWidth.text()) > 20):
                    self.ui.mWidth.setText("20")
                self.ui.mPrecision.setEnabled(True)
                self.ui.mWidth.setValidator(QIntValidator(1, 20, self))
                break

            else:
                QMessageBox.warning(self, "Warning", "unexpected index")
                break
    def createWidgetEndXY(self):
        """
        Create widget 
        """
        self.endXyAndroidGroup = QGroupBox(self.tr(""))
        endXyAndroidlayout = QGridLayout()

        self.endxAndroidLine = QLineEdit(self)
        validatorEndXAndroid = QIntValidator(self)
        self.endxAndroidLine.setValidator(validatorEndXAndroid)
        self.endxAndroidLine.installEventFilter(self)

        self.endyAndroidLine = QLineEdit(self)
        validatorEndYAndroid = QIntValidator(self)
        self.endyAndroidLine.setValidator(validatorEndYAndroid)
        self.endyAndroidLine.installEventFilter(self)

        endXyAndroidlayout.addWidget(
            QLabel(self.tr("Destination Coordinate X:")), 0, 0)
        endXyAndroidlayout.addWidget(self.endxAndroidLine, 0, 1)
        endXyAndroidlayout.addWidget(
            QLabel(self.tr("Destination Coordinate Y:")), 1, 0)
        endXyAndroidlayout.addWidget(self.endyAndroidLine, 1, 1)

        self.endXyAndroidGroup.setLayout(endXyAndroidlayout)
        self.endXyAndroidGroup.hide()
    def __init__(self, parent):
        QDialog.__init__(self, parent)

        self.prm = self.parent().prm
        self.currLocale = self.parent().prm['currentLocale']
        self.currLocale.setNumberOptions(
            self.currLocale.OmitGroupSeparator
            | self.currLocale.RejectGroupSeparator)

        grid = QGridLayout()
        n = 0

        blockALabel = QLabel(self.tr('Block A: '))
        grid.addWidget(blockALabel, n, 0)
        self.blockAWidget = QLineEdit(str(self.prm['currentBlock']))
        self.blockAWidget.setValidator(QIntValidator(self))
        grid.addWidget(self.blockAWidget, n, 1)

        blockBLabel = QLabel(self.tr('Block B: '))
        grid.addWidget(blockBLabel, n, 2)
        self.blockBWidget = QLineEdit('')
        self.blockBWidget.setValidator(QIntValidator(self))
        grid.addWidget(self.blockBWidget, n, 3)

        n = n + 1
        buttonBox = QDialogButtonBox(QDialogButtonBox.Ok
                                     | QDialogButtonBox.Cancel)
        buttonBox.accepted.connect(self.accept)
        buttonBox.rejected.connect(self.reject)
        grid.addWidget(buttonBox, n, 3)
        self.setLayout(grid)
        self.setWindowTitle(self.tr("Swap Blocks"))
    def __init__(self, parent=None):
        super(EditorWidgetTms, self).__init__(parent)
        self.setupUi(self)
        self.tms_validator = LineEditColorValidator(
            self.txtUrl,
            'http[s]?://.+',
            error_tooltip='http{s}://any_text/{z}/{x}/{y}/')
        self.txtCrsId.setValidator(QIntValidator())
        self.txtPostgisCrsId.setValidator(QIntValidator())

        QApplication.instance().focusChanged.connect(self.focus_changed)
    def ud_options(self):
        """ Dialog ud_options.ui """

        # Create dialog
        dlg_udoptions = UDoptions()
        utils_giswater.setDialog(dlg_udoptions)

        dlg_udoptions.min_slope.setValidator(QDoubleValidator())
        dlg_udoptions.lengthening_step.setValidator(QDoubleValidator())
        dlg_udoptions.max_trials.setValidator(QIntValidator())
        dlg_udoptions.sys_flow_tol.setValidator(QIntValidator())
        dlg_udoptions.variable_step.setValidator(QIntValidator())
        dlg_udoptions.min_surfarea.setValidator(QIntValidator())
        dlg_udoptions.head_tolerance.setValidator(QDoubleValidator())
        dlg_udoptions.lat_flow_tol.setValidator(QIntValidator())

        # Set values from widgets of type QComboBox
        sql = "SELECT DISTINCT(id) FROM " + self.schema_name + ".inp_value_options_fu ORDER BY id"
        rows = self.dao.get_rows(sql)
        utils_giswater.fillComboBox("flow_units", rows, False)
        sql = "SELECT DISTINCT(id) FROM " + self.schema_name + ".inp_value_options_fr ORDER BY id"
        rows = self.dao.get_rows(sql)
        utils_giswater.fillComboBox("flow_routing", rows, False)
        sql = "SELECT DISTINCT(id) FROM " + self.schema_name + ".inp_value_options_lo ORDER BY id"
        rows = self.dao.get_rows(sql)
        utils_giswater.fillComboBox("link_offsets", rows, False)
        sql = "SELECT DISTINCT(id) FROM " + self.schema_name + ".inp_value_options_fme ORDER BY id"
        rows = self.dao.get_rows(sql)
        utils_giswater.fillComboBox("force_main_equation", rows, False)
        sql = "SELECT DISTINCT(id) FROM " + self.schema_name + ".inp_value_options_nfl ORDER BY id"
        rows = self.dao.get_rows(sql)
        utils_giswater.fillComboBox("normal_flow_limited", rows, False)
        sql = "SELECT DISTINCT(id) FROM " + self.schema_name + ".inp_value_options_id ORDER BY id"
        rows = self.dao.get_rows(sql)
        utils_giswater.fillComboBox("inertial_damping", rows, False)
        sql = "SELECT DISTINCT(id) FROM " + self.schema_name + ".value_yesno ORDER BY id"
        rows = self.dao.get_rows(sql)
        utils_giswater.fillComboBox("allow_ponding", rows, False)
        utils_giswater.fillComboBox("skip_steady_state", rows, False)
        utils_giswater.fillComboBox("ignore_rainfall", rows, False)
        utils_giswater.fillComboBox("ignore_snowmelt", rows, False)
        utils_giswater.fillComboBox("ignore_groundwater", rows, False)
        utils_giswater.fillComboBox("ignore_routing", rows, False)
        utils_giswater.fillComboBox("ignore_quality", rows, False)
        update = True
        dlg_udoptions.btn_accept.pressed.connect(
            partial(self.insert_or_update, update, 'inp_options',
                    dlg_udoptions))
        dlg_udoptions.btn_cancel.pressed.connect(dlg_udoptions.close)
        self.go2epa_options_get_data('inp_options')
        dlg_udoptions.exec_()
    def ud_options(self):
        """ Dialog ud_options.ui """
        
        # Create dialog
        dlg_udoptions = UDoptions()
        self.load_settings(dlg_udoptions)

        dlg_udoptions.min_slope.setValidator(QDoubleValidator())
        dlg_udoptions.lengthening_step.setValidator(QDoubleValidator())
        dlg_udoptions.max_trials.setValidator(QIntValidator())
        dlg_udoptions.sys_flow_tol.setValidator(QIntValidator())
        dlg_udoptions.variable_step.setValidator(QIntValidator())
        dlg_udoptions.min_surfarea.setValidator(QIntValidator())
        dlg_udoptions.head_tolerance.setValidator(QDoubleValidator())
        dlg_udoptions.lat_flow_tol.setValidator(QIntValidator())

        # Set values from widgets of type QComboBox
        sql = "SELECT DISTINCT(id) FROM "+self.schema_name+".inp_value_options_fu ORDER BY id"
        rows = self.controller.get_rows(sql)
        utils_giswater.fillComboBox(dlg_udoptions, dlg_udoptions.flow_units, rows, False)
        sql = "SELECT DISTINCT(id) FROM "+self.schema_name+".inp_value_options_fr ORDER BY id"
        rows = self.controller.get_rows(sql)
        utils_giswater.fillComboBox(dlg_udoptions, dlg_udoptions.flow_routing, rows, False)
        sql = "SELECT DISTINCT(id) FROM "+self.schema_name+".inp_value_options_lo ORDER BY id"
        rows = self.controller.get_rows(sql)
        utils_giswater.fillComboBox(dlg_udoptions, dlg_udoptions.link_offsets, rows, False)
        sql = "SELECT DISTINCT(id) FROM "+self.schema_name+".inp_value_options_fme ORDER BY id"
        rows = self.controller.get_rows(sql)
        utils_giswater.fillComboBox(dlg_udoptions, dlg_udoptions.force_main_equation, rows, False)
        sql = "SELECT DISTINCT(id) FROM "+self.schema_name+".inp_value_options_nfl ORDER BY id"
        rows = self.controller.get_rows(sql)
        utils_giswater.fillComboBox(dlg_udoptions, dlg_udoptions.normal_flow_limited, rows, False)
        sql = "SELECT DISTINCT(id) FROM "+self.schema_name+".inp_value_options_id ORDER BY id"
        rows = self.controller.get_rows(sql)
        utils_giswater.fillComboBox(dlg_udoptions, dlg_udoptions.inertial_damping, rows, False)
        sql = "SELECT DISTINCT(id) FROM "+self.schema_name+".value_yesno ORDER BY id"
        rows = self.controller.get_rows(sql)
        utils_giswater.fillComboBox(dlg_udoptions, dlg_udoptions.allow_ponding, rows, False)
        utils_giswater.fillComboBox(dlg_udoptions, dlg_udoptions.skip_steady_state, rows, False)
        utils_giswater.fillComboBox(dlg_udoptions, dlg_udoptions.ignore_rainfall, rows, False)
        utils_giswater.fillComboBox(dlg_udoptions, dlg_udoptions.ignore_snowmelt, rows, False)
        utils_giswater.fillComboBox(dlg_udoptions, dlg_udoptions.ignore_groundwater, rows, False)
        utils_giswater.fillComboBox(dlg_udoptions, dlg_udoptions.ignore_routing, rows, False)
        utils_giswater.fillComboBox(dlg_udoptions, dlg_udoptions.ignore_quality, rows, False)
        dlg_udoptions.btn_accept.clicked.connect(partial(self.update_table, 'inp_options', dlg_udoptions))
        dlg_udoptions.btn_cancel.clicked.connect(dlg_udoptions.close)
        self.go2epa_options_get_data('inp_options', dlg_udoptions)
        dlg_udoptions.setWindowFlags(Qt.WindowStaysOnTopHint)
        dlg_udoptions.exec_()
Exemple #7
0
    def __init__(self, iface, parent=None):

        super(PreVesperDialog, self).__init__(iface.mainWindow())

        # Set up the user interface from Designer.
        self.setupUi(self)

        # The qgis interface
        self.iface = iface
        self.DISP_TEMP_LAYERS = read_setting(
            PLUGIN_NAME + '/DISP_TEMP_LAYERS', bool)
        self.DEBUG = config.get_debug_mode()

        # Catch and redirect python errors directed at the log messages python
        # error tab.
        QgsMessageLog.instance().messageReceived.connect(errorCatcher)

        if not os.path.exists(TEMPDIR):
            os.mkdir(TEMPDIR)

        # Setup for validation messagebar on gui-----------------------------
        self.setWindowIcon(QtGui.QIcon(
            ':/plugins/pat/icons/icon_vesperKriging.svg'))

        self.validationLayout = QtGui.QFormLayout(self)
        # source: https://nathanw.net/2013/08/02/death-to-the-message-box-use-the-qgis-messagebar/
        # Add the error messages to top of form via a message bar.
        # leave this message bar for bailouts
        self.messageBar = QgsMessageBar(self)

        if isinstance(self.layout(), (QtGui.QFormLayout, QtGui.QGridLayout)):
            # create a validation layout so multiple messages can be added and
            # cleaned up.
            self.layout().insertRow(0, self.validationLayout)
            self.layout().insertRow(0, self.messageBar)
        else:
            # for use with Vertical/horizontal layout box
            self.layout().insertWidget(0, self.messageBar)

        # Set Class default variables -------------------------------------
        self.vesp_dict = None
        self.in_qgscrs = None
        self.dfCSV = None

        # this is a validation flag
        self.OverwriteCtrlFile = False
        self.cboMethod.addItems(
            ['High Density Kriging', 'Low Density Kriging (Advanced)'])

        # To allow only integers for the min number of pts.
        self.onlyInt = QIntValidator()
        self.lneMinPoint.setValidator(self.onlyInt)

        self.vesper_exe = check_vesper_dependency()
        if self.vesper_exe is None or self.vesper_exe == '':
            self.gbRunVesper.setTitle(
                'WARNING:Vesper not found please configure using the about dialog.')
            self.gbRunVesper.setChecked(False)
            self.gbRunVesper.setCheckable(False)
            self.gbRunVesper.setEnabled(False)
Exemple #8
0
    def init_gui(self):
        #Set integer validator for the port number
        int_validator = QIntValidator(1024, 49151)
        self.txtPort.setValidator(int_validator)

        #Load profiles
        self.load_profiles()

        #Set current profile in the combobox
        curr_profile = current_profile()
        if not curr_profile is None:
            setComboCurrentIndexWithText(self.cbo_profiles, curr_profile.name)

        #Load current database connection properties
        self._load_db_conn_properties()

        #Load existing PostgreSQL connections
        self._load_qgis_pg_connections()

        #Load directory paths
        self._load_directory_paths()

        self.edtEntityRecords.setMaximum(MAX_LIMIT)
        self.edtEntityRecords.setValue(get_entity_browser_record_limit())

        #Sorting order
        self.populate_sort_order()
        self.set_current_sort_order(get_entity_sort_order())

        # Debug logging
        lvl = debug_logging()
        if lvl:
            self.chk_logging.setCheckState(Qt.Checked)
        else:
            self.chk_logging.setCheckState(Qt.Unchecked)
Exemple #9
0
 def change_array_size(self):
     """Update the size of the multirun array based on the number of rows
     and columns specified in the line edit."""
     self.nrows = int(self.rows_edit.text()) if self.rows_edit.text() else 1
     if self.nrows < 1:
         self.nrows = 1
     self.table.setRowCount(self.nrows)
     self.ncols = int(self.cols_edit.text()) if self.cols_edit.text() else 1
     if self.ncols < 1:
         self.ncols = 1
     self.table.setColumnCount(self.ncols)
     self.col_index.setValidator(QIntValidator(1, self.ncols - 1))
     if self.col_index.text() and int(
             self.col_index.text()) > self.ncols - 1:
         self.col_index.setText(str(self.ncols - 1))
     self.reset_array()
     self.col_range_text = self.col_range_text[:self.ncols] + [''] * (
         self.ncols - len(self.col_range_text))
     self.ui_param['runs included'] = [[] for i in range(self.nrows)]
     for key, default in zip([
             'Type', 'Analogue type', 'Time step name', 'Analogue channel',
             'list index'
     ], ['Time step length', 'Fast analogue', [], [], '0']):
         for i in range(len(self.ui_param[key]), self.ncols):
             self.ui_param[key].append(default)
         if len(self.ui_param[key]) > self.ncols:
             self.ui_param[key] = self.ui_param[key][:self.ncols]
Exemple #10
0
    def __init__(self, parent=None):
        super(ClassPropertiesDlg, self).__init__(parent)
        idlabel = QLabel("&ID(Digits)")
        self.idLineEditBox = QLineEdit(self)
        self.idLineEditBox.setValidator(QIntValidator())
        idlabel.setBuddy(self.idLineEditBox)

        namelabel = QLabel("&Name")
        self.nameLineEditBox = QLineEdit(self)
        namelabel.setBuddy(self.nameLineEditBox)

        descriptionlabel = QLabel("&Description")
        self.descriptionLineEditBox = QTextEdit(self)
        descriptionlabel.setBuddy(self.descriptionLineEditBox)

        self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok
                                          | QDialogButtonBox.Cancel)

        layout = QGridLayout()
        layout.addWidget(idlabel, 0, 0)
        layout.addWidget(self.idLineEditBox, 0, 1)
        layout.addWidget(namelabel, 1, 0)
        layout.addWidget(self.nameLineEditBox, 1, 1, 1, 3)
        layout.addWidget(descriptionlabel, 2, 0, 1, 4)
        layout.addWidget(self.descriptionLineEditBox, 3, 0, 3, 4)
        layout.addWidget(self.buttonBox)

        self.setLayout(layout)

        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)
        self.setWindowTitle("Class Properties")
Exemple #11
0
    def __init__(self, iface, parent=None):
        super(AccuratePCISettingDlg, self).__init__()
        self.iface = iface
        self.parent = parent

        self.setWindowTitle(u"PCI规划(高级)")
        self.setWindowFlags(Qt.WindowStaysOnTopHint)

        label = QLabel(u"请选择算法循环次数:")
        self.Cycles = QLineEdit()
        validator = QIntValidator(0, 999, self)
        self.Cycles.setValidator(validator)
        setting_grid = QGridLayout()
        setting_grid.setSpacing(15)
        setting_grid.addWidget(label, 0, 0)
        setting_grid.addWidget(self.Cycles, 0, 1)

        ok = QPushButton(u"确定")
        self.connect(ok, SIGNAL("clicked()"), self.run)
        cancel = QPushButton(u"取消")
        self.connect(cancel, SIGNAL("clicked()"), self.accept)
        btn_hbox = QHBoxLayout()
        btn_hbox.setSpacing(10)
        btn_hbox.addStretch(1)
        btn_hbox.addWidget(ok)
        btn_hbox.addWidget(cancel)
        btn_hbox.addStretch(1)

        vbox = QVBoxLayout()
        vbox.addLayout(setting_grid)
        vbox.addStretch(1)
        vbox.addLayout(btn_hbox)

        self.setLayout(vbox)
        self.resize(180, 80)
Exemple #12
0
    def settings(self, parent):
        # CRIANDO LABEL PARA SELECIONAR O TEMPO DE AMOSTRAGEM
        self.lbTimeAmostragem = QLabel(parent)
        mensagem = "Digite o tempo de amostragem em segundos (Deve ser no mínimo 2 segundos): "
        self.lbTimeAmostragem.setText(mensagem)
        self.lbTimeAmostragem.setAlignment(Qt.AlignCenter)

        # CRIANDO O LINEEDIT PARA SELECIONAR O TEMPO DE AMOSTRAGEM
        self.LETimeAmostragem = QLineEdit(parent)
        sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.LETimeAmostragem.sizePolicy().hasHeightForWidth())
        self.LETimeAmostragem.setSizePolicy(sizePolicy)
        self.LETimeAmostragem.setMaximumSize(QSize(40, 16777215))
        self.LETimeAmostragem.setLayoutDirection(Qt.LeftToRight)
        self.validator = QIntValidator(0, 999999, self)
        self.LETimeAmostragem.setValidator(self.validator)

        # CRIANDO UM SPACER PARA ORGANIZAR DENTRO DO LAYOUT OS ITENS
        spacerItem = QSpacerItem(40, 20, QSizePolicy.Expanding,
                                 QSizePolicy.Minimum)

        # ADICIONANDO OS WIDGETS NO LAYOUT
        self.addWidget(self.lbTimeAmostragem)
        self.addWidget(self.LETimeAmostragem)
        self.addItem(spacerItem)
 def __init__(self):
     QDialog.__init__(self)
     self.ui = Ui_ComputerDialog()
     self.ui.setupUi(self)
     self.valid = QIntValidator(0, 1000000, self)
     self.ui.speed.setValidator(self.valid)
     self.ui.ram.setValidator(self.valid)
Exemple #14
0
    def __createLayout(self):
        " Creates the dialog layout "

        self.resize(400, 80)
        self.setSizeGripEnabled(True)

        vboxLayout = QVBoxLayout(self)

        hboxLayout = QHBoxLayout()
        hboxLayout.addWidget(QLabel("Status update interval, sec."))
        self.__intervalEdit = QLineEdit()
        self.__intervalEdit.setValidator(QIntValidator(1, 3600, self))
        self.__intervalEdit.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
        hboxLayout.addWidget(self.__intervalEdit)

        # Buttons at the bottom
        self.__buttonBox = QDialogButtonBox(self)
        self.__buttonBox.setOrientation(Qt.Horizontal)
        self.__buttonBox.setStandardButtons(QDialogButtonBox.Ok
                                            | QDialogButtonBox.Cancel)
        self.__buttonBox.accepted.connect(self.userAccept)
        self.__buttonBox.rejected.connect(self.close)

        vboxLayout.addLayout(hboxLayout)
        vboxLayout.addWidget(self.__buttonBox)
        return
Exemple #15
0
 def createMetronomeWidget(self):
     self.metronomeLabel = QLabel()
     self.metronomeNote = QComboBox()
     self.metronomeNote.setModel(
         listmodel.ListModel(
             durations,
             display=None,
             icon=lambda item: symbols.icon('note_{0}'.format(
                 item.replace('.', 'd')))))
     self.metronomeNote.setCurrentIndex(durations.index('4'))
     self.metronomeNote.view().setIconSize(QSize(22, 22))
     self.metronomeEqualSign = QLabel('=')
     self.metronomeEqualSign.setFixedWidth(
         self.metronomeEqualSign.minimumSizeHint().width())
     self.metronomeValue = QComboBox(editable=True)
     self.metronomeValue.setModel(
         listmodel.ListModel(metronomeValues,
                             self.metronomeValue,
                             display=format))
     self.metronomeValue.setCompleter(None)
     self.metronomeValue.setValidator(
         QIntValidator(0, 999, self.metronomeValue))
     self.metronomeValue.setCurrentIndex(metronomeValues.index(100))
     self.metronomeTempo = widgets.tempobutton.TempoButton()
     self.metronomeTempo.tempo.connect(self.setMetronomeValue)
     self.metronomeLabel.setBuddy(self.metronomeNote)
     self.metronomeRound = QCheckBox()
 def __init__(self):
     QDialog.__init__(self)
     self.ui = Ui_LinkDialog()
     self.ui.setupUi(self)
     self.valid = QIntValidator(0, 1000000, self)
     self.ui.capacity.setValidator(self.valid)
     self.ui.length.setValidator(self.valid)
Exemple #17
0
    def setData(self, m):
        self.method = m
        self.visualizer.Visualize(self.method)
        self.ui.stepforth.setEnabled(True)
        self.ui.lineEdit.setEnabled(True)
        self.ui.labelTotal.setText(str(self.method.trace.length()))
        self.ui.lineEdit.setText(str(self.method.trace.current + 1))
        self.validator = QIntValidator(1, self.method.trace.length(), self)
        self.ui.lineEdit.setValidator(self.validator)
        op = self.method.trace.getCurrent()
        self.showTotals(op[1])

        if self.method.trace.current == 0:
            self.ui.stepback.setEnabled(False)
            self.ui.rewind.setEnabled(False)
        else:
            self.ui.stepback.setEnabled(True)
            self.ui.rewind.setEnabled(True)

        if self.method.trace.current == self.method.trace.length() - 1:
            self.ui.stepforth.setEnabled(False)
            self.ui.replay.setEnabled(False)
        else:
            self.ui.stepforth.setEnabled(True)
            self.ui.replay.setEnabled(True)
Exemple #18
0
    def init_gui(self):
        #Set integer validator for the port number
        int_validator = QIntValidator(1024, 49151)
        self.txtPort.setValidator(int_validator)

        #Load profiles
        self.load_profiles()

        #Set current profile in the combobox
        curr_profile = current_profile()
        if not curr_profile is None:
            setComboCurrentIndexWithText(self.cbo_profiles, curr_profile.name)

        #Load current database connection properties
        self._load_db_conn_properties()

        #Load existing PostgreSQL connections
        self._load_qgis_pg_connections()

        #Load directory paths
        self._load_directory_paths()

        # Debug logging
        lvl = debug_logging()
        if lvl:
            self.chk_logging.setCheckState(Qt.Checked)
        else:
            self.chk_logging.setCheckState(Qt.Unchecked)
Exemple #19
0
    def __init__(self, table_group, parent, *args, **kwargs):
        QDialog.__init__(self, parent, *args, **kwargs)

        self.parent = table_group
        group_id = self.parent.table_group.group.group_id
        self.group = Group.select().where(Group.id == group_id).get()
        vbox = QVBoxLayout()
        vbox.addWidget(
            FBoxTitle(u"<h3>Groupe: {}</h3>".format(self.group.name)))
        self.order_number = LineEdit()

        # form transfer
        self.amount = LineEdit()
        self.amount.setFont(QFont("Arial", 15))
        self.amount.setValidator(QIntValidator())
        self.amount.setToolTip(u"Taper le montant du transfert")
        # self.solde = FLabel(get_solde())
        self.amount_error = ErrorLabel(u"")

        send_butt = Button(u"Envoyer")
        send_butt.clicked.connect(self.sender)
        cancel_but = Button(u"Annuler")
        cancel_but.clicked.connect(self.cancel)

        formbox = QGridLayout()
        formbox.addWidget(FLabel(u"Montant: "), 0, 0)
        formbox.addWidget(self.amount, 0, 1)
        formbox.addWidget(send_butt, 2, 1)
        formbox.addWidget(cancel_but, 2, 0)

        vbox.addLayout(formbox)
        self.setLayout(vbox)
    def __init__(self, parent=None):
        super(login, self).__init__(parent)
        self.setupUi(self)

        db = QSqlDatabase.addDatabase('QMYSQL')
        db.setHostName("localhost")
        db.setDatabaseName("TiendaVrt")
        db.setUserName("root")
        db.setPassword("")

        if not db.open():
            print("Could not open testdb database")
            print(db.lastError().driverText())
            print(db.lastError().databaseText())
        else:
            print("Database is OK")

        self.txt_id.setValidator(QIntValidator())
        self.r = Registro.Reg()  #llama la clase que sera en el documento .py
        self.p = Productos.products()
        self.btn_registro.clicked.connect(
            self.r.show)  #muesta la clase en un boton
        self.btn_Ingresar.clicked.connect(self.login)

        db.close()
Exemple #21
0
    def __init__(self):
        super().__init__()

        gui.lineEdit(self.controlArea, self, "number", "Enter a number",
                     box="Number",
                     callback=self.number_changed,
                     valueType=int, validator=QIntValidator())
        self.number_changed()
Exemple #22
0
 def __init__(self):
     QDialog.__init__(self)
     self.ui = Ui_VertexDialog()
     self.ui.setupUi(self)
     self.valid = QIntValidator(0, 1000000, self)
     self.ui.time.setValidator(self.valid)
     self.ui.versions.verticalHeader().hide()
     self.ui.versions.horizontalHeader().setStretchLastSection(True)
 def __init__(self):
     QDialog.__init__(self)
     self.ui = Ui_OptionsDialog()
     self.ui.setupUi(self)
     self.valid = QIntValidator(0, 10000, self)
     self.ui.esDelayEdit.setValidator(self.valid)
     self.ui.switchDelayEdit.setValidator(self.valid)
     self.ui.ifgEdit.setValidator(self.valid)
Exemple #24
0
 def __init__(self):
     QDialog.__init__(self)
     self.ui = Ui_ComputerDialog()
     self.ui.setupUi(self)
     self.valid = QIntValidator(0, 1000000, self)
     self.ui.speed.setValidator(self.valid)
     self.ui.ram.setValidator(self.valid)
     self.setWindowTitle(self.tr("Edit VM")) #we use the same dialog for resources and demands
Exemple #25
0
 def setContent(self):
     self.content = QLineEdit(self)
     self.validator = QIntValidator(0, 2147483647, self)
     self.content.setValidator(self.validator)
     self.hlayout.addWidget(self.content)
     self.connect(self.content, SIGNAL("textChanged(const QString &)"),
                  self.updateQuery)
     self.connect(self.content, SIGNAL("textEdited(const QString &)"),
                  self.updateQuery)
Exemple #26
0
 def setup(self):
     self.ui.reportBtn.setEnabled(False)
     self.ui.downloadBtn.setEnabled(False)
     self.ui.stopSelectionBtn.setEnabled(False)
     self.ui.courseNo.setValidator(QIntValidator(99999999, 1000000000))
     self.ui.courseNo.setFocus()
     self.ui.courseNo.paste()
     # self.autoSearch()
     self.ui.folderLE.setText(os.getcwd())
    def __init__(self, parent=None):
        """Constructor."""
        super(NetworkAPIDialog, self).__init__(parent)
        self.setupUi(self)
        # After setupUI you can access any designer object by doing
        # self.<objectname>

        self.port.setValidator(QIntValidator(0, 65536))
        self.buttons.clicked.connect(self.handleButtonClick)
        self.loadSettings()
Exemple #28
0
 def __init__(self):
     QWidget.__init__(self)
     self.setupUi(self)
     self.pushButton_Add.clicked.connect(self.addIP)
     validator = QIntValidator()
     validator.setRange(0, 255)
     self.lineEdit_IP_1.setValidator(validator)
     self.lineEdit_IP_2.setValidator(validator)
     self.lineEdit_IP_3.setValidator(validator)
     self.lineEdit_IP_4.setValidator(validator)
    def ud_times(self):
        """ Dialog ud_times.ui """

        dlg_udtimes = UDtimes()
        self.load_settings(dlg_udtimes)
        dlg_udtimes.dry_days.setValidator(QIntValidator())
        dlg_udtimes.btn_accept.clicked.connect(partial(self.update_table, 'inp_options', dlg_udtimes))
        dlg_udtimes.btn_cancel.clicked.connect(dlg_udtimes.close)
        self.go2epa_options_get_data('inp_options', dlg_udtimes)
        dlg_udtimes.setWindowFlags(Qt.WindowStaysOnTopHint)
        dlg_udtimes.exec_()
 def ud_times(self):
     """ Dialog ud_times.ui """
     
     dlg_udtimes = UDtimes()
     utils_giswater.setDialog(dlg_udtimes)
     self.load_settings(dlg_udtimes)
     dlg_udtimes.dry_days.setValidator(QIntValidator())
     dlg_udtimes.btn_accept.pressed.connect(partial(self.update_table, 'inp_options', dlg_udtimes))
     dlg_udtimes.btn_cancel.pressed.connect(dlg_udtimes.close)
     self.go2epa_options_get_data('inp_options')
     dlg_udtimes.exec_()