def __init__(self):
     QDialog.__init__(self)
     self.obj_form = Ui_form_cuotas_vencidas_30dias()
     self.obj_form.setupUi(self)
     self.obj_form.boton_generar.clicked.connect(self.generar_30dias)
     self.obj_form.boton_generar_60_dias.clicked.connect(self.generar_60dias)
     self.obj_form.boton_generar_90_dias.clicked.connect(self.generar_90dias)
Пример #2
0
    def __init__(self, parent, repo, project=None, collection=None):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        self.project = project
        self.parent = parent
        self.repo = repo
        self.repo_uri = os.path.join(repo.base_uri, repo.index_name)
        self.collection = None
        self.origCollection = None
        self.tmpCollection = None

        if collection:
            self.origCollection = collection
            self.tmpCollection = copy.deepcopy(collection)
        else:
            self.tmpCollection = PackageCollection(packages=PackageSet(self.repo_uri))

        self.connect(self.titleText, SIGNAL("textChanged(const QString &)"), self.titleChanged)
        self.connect(self.descriptionText, SIGNAL("textChanged()"), self.descriptionChanged)
        self.connect(self.languagesCombo, SIGNAL("currentIndexChanged(int)"), self.updateTranslations)
        self.connect(self.packagesButton, SIGNAL("clicked()"), self.slotSelectPackages)
        self.connect(self.selectIcon, SIGNAL("clicked()"), self.slotSelectIcon)
        self.connect(self.clearIcon, SIGNAL("clicked()"), self.slotClearIcon)
        self.connect(self.buttonBox, SIGNAL("accepted()"), self.accept)
        self.connect(self.buttonBox, SIGNAL("rejected()"), self.reject)
        self.fillContent()
Пример #3
0
    def __init__(self, parent=None):
        QDialog.__init__(self, parent)
        self._color = None
        self._color_global=False

        self._linewidth=None
        self._linewidth_global=False

        self._fontcolor=None
        self._fontcolor_global=False

        self._fontsize=None
        self._fontsize_global=False


        self.ui = uic.loadUi(os.path.join(os.path.split(__file__)[0],
                                          'box_dialog.ui'),
                             self)

        self.ui.colorButton.clicked.connect(self.onColor)
        self.ui.fontColorButton.clicked.connect(self.onFontColor)
        self.ui.spinBoxWidth.valueChanged.connect(self.setLineWidth)
        self.ui.spinFontSize.valueChanged.connect(self.setFontSize)

        self.ui.checkColorGlobal.stateChanged.connect(self.setColorGlobal)
        self.ui.checkLineWidthGlobal.stateChanged.connect(self.setLineWidthGlobal)
        self.ui.checkFontColorGlobal.stateChanged.connect(self.setFontColorGlobal)
        self.ui.checkFontSizeGlobal.stateChanged.connect(self.setFontSizeGlobal)



        self._modelIndex=None
Пример #4
0
	def __init__(self, iface):
		QDialog.__init__(self)
		self.iface = iface
		self.setupUi(self)
		self.btnOutput.clicked.connect(self.outFile)
		self.buttonBox.accepted.connect(self.accept)
		self.buttonBox.rejected.connect(self.reject)
		self.btnHelp.clicked.connect(self.open_help)

		mapCanvas = self.iface.mapCanvas()
		# init dictionaries of items:
		self.rastItems = {}
		for i in range(mapCanvas.layerCount()):
			layer = mapCanvas.layer(i)
			if ( layer.type() == layer.RasterLayer ):
		# read  layers
				provider = layer.dataProvider()
				self.cmbClay.addItem(layer.source())
				self.cmbSand.addItem(layer.source())

		currentDIR = unicode(os.path.abspath( os.path.dirname(__file__)))
		listDat=[s for s in os.listdir(currentDIR) if fnmatch.fnmatch(s,'*.dat')]
		self.cmbSchema.addItems(listDat)
		#self.textEdit.append(str(currentDIR))
		print(currentDIR,listDat)
		self.textEdit.clear()
Пример #5
0
    def __init__(self, project_finder, project_search_model, projectSearch=None):
        QDialog.__init__(self)
        self.setupUi(self)

        self.project_finder = project_finder
        self.project_search_model = project_search_model
        self.projectSearch = projectSearch

        self.layerCombo.setFilters(QgsMapLayerProxyModel.HasGeometry)
        self.layerCombo.layerChanged.connect(self.fieldExpressionWidget.setLayer)
        self.fieldExpressionWidget.setLayer(self.layerCombo.currentLayer())

        self.progressBar.hide()
        self.cancelButton.hide()
        self.cancelButton.clicked.connect(self.project_finder.stop_record)
        self.okButton.clicked.connect(self.process)

        self.project_finder.recordingSearchProgress.connect(self.progressBar.setValue)

        if projectSearch is not None:
            self.searchName.setText(projectSearch.searchName)
            self.layerCombo.setLayer(projectSearch.layer())
            self.fieldExpressionWidget.setField(projectSearch.expression)
            gsIndex = self.geometryStorageCombo.findText(projectSearch.geometryStorage, Qt.MatchFixedString)
            if gsIndex:
                self.geometryStorageCombo.setCurrentIndex(gsIndex)
            self.priorityBox.setValue(projectSearch.priority)
 def __init__(self):
     QDialog.__init__(self)
     obj_form= Ui_Form_clientes_buscar()
     self.obj_form.setupUi(self)
     self.obj_form.boton_buscar_buscar.clicked.connect(self.buscar_cliente)
     self.obj_form.boton_limpiar.clicked.connect(self.limpiar)
     self.obj_form.lne_dni_filtro_buscar.setFocus()
Пример #7
0
    def __init__(self, parent):
        QDialog.__init__(self, parent)
        self.parent = parent
        self.setWindowTitle(self.tr('Insert table'))
        buttonBox = QDialogButtonBox(self)
        buttonBox.setStandardButtons(QDialogButtonBox.Ok |
                                     QDialogButtonBox.Cancel)
        buttonBox.accepted.connect(self.makeTable)
        buttonBox.rejected.connect(self.close)

        layout = QGridLayout(self)

        rowsLabel = QLabel(self.tr('Number of rows') + ':', self)
        columnsLabel = QLabel(self.tr('Number of columns') + ':', self)
        self.rowsSpinBox = QSpinBox(self)
        self.columnsSpinBox = QSpinBox(self)

        self.rowsSpinBox.setRange(1, 10)
        self.columnsSpinBox.setRange(1, 10)
        self.rowsSpinBox.setValue(3)
        self.columnsSpinBox.setValue(3)

        layout.addWidget(rowsLabel, 0, 0)
        layout.addWidget(self.rowsSpinBox, 0, 1, Qt.AlignRight)
        layout.addWidget(columnsLabel, 1, 0)
        layout.addWidget(self.columnsSpinBox, 1, 1, Qt.AlignRight)
        layout.addWidget(buttonBox, 2, 0, 1, 2)
Пример #8
0
    def __init__(self, parent=None):
        Ui_JSPlotDialog.__init__(self)
        QDialog.__init__(self, parent)
        self.setupUi(self)
        self.webView.loadFinished.connect(self.draw)
        self.webView.load(QUrl(timeline_url))

        self.tasks = [
                {
                    "startDate": 10,
                    "endDate": 20,
                    "taskName": "E Job",
                    "status": "no0"
                    },
                {
                    "startDate": 30,
                    "endDate": 40,
                    "taskName": "A Job",
                    "status": "no1"
                    }
                ]

        self.taskNames = [ "D Job", "P Job", "E Job", "A Job", "N Job" ]
        self.statusNames = ["no0", "no1"]
        self.colors = ["#000000", "#FFDD89", "#957244", "#F26223"]
Пример #9
0
    def __init__(self, parent, repo, packages=[], components=[]):
        QDialog.__init__(self, parent)
        self.setupUi(self)

        # Package repository
        self.repo = repo

        # Selected packages/components
        self.packages = packages
        self.components = components
        self.all_packages = []

        # Search widget
        self.connect(self.searchPackage, SIGNAL("textChanged(const QString &)"), self.slotSearchPackage)

        # Ok/cancel buttons
        self.connect(self.buttonBox, SIGNAL("accepted()"), self.accept)
        self.connect(self.buttonBox, SIGNAL("rejected()"), self.reject)

        # Filter combo
        self.connect(self.comboFilter, SIGNAL("currentIndexChanged(int)"), self.slotComboFilter)

        # Package/Component changes
        self.connect(self.treeComponents, SIGNAL("currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)"), self.slotSelectComponent)
        self.connect(self.treeComponents, SIGNAL("itemClicked(QTreeWidgetItem *, int)"), self.slotClickComponent)
        self.connect(self.treePackages, SIGNAL("currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)"), self.slotSelectPackage)
        self.connect(self.treePackages, SIGNAL("itemClicked(QTreeWidgetItem *, int)"), self.slotClickPackage)

        self.subcomponents = False
        self.component_only = False
        self.selected_component = None

        # Go go go!
        self.initialize()
    def __init__(self, parent, session, script_manager):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        self.red_plugin = parent

        self.setAttribute(Qt.WA_DeleteOnClose)

        font = QFont()
        self.tedit_main.setFont(font)

        self.session = session
        self.dialog_session = True
        self.script_manager = script_manager

        self.update_info = None
        self.current_state = self.STATE_INIT
        self.update_install_serialisation_queue = queue.Queue()

        self.pbar.hide()
        self.label_pbar.hide()
        self.tedit_main.setText(self.MESSAGE_INFO_START)

        # Connect signals.
        self.pbutton_n.clicked.connect(self.pbutton_n_clicked)
        self.pbutton_p.clicked.connect(self.pbutton_p_clicked)
Пример #11
0
    def __init__(self, parent):
        QDialog.__init__(self, parent)
        self.setWindowTitle("Configuration systeme")
        self.setPalette(white_palette)

        panel = QWidget(self)

        panelSizer = QVBoxLayout()

        textes = informations_configuration().split("\n")

        for i, texte in enumerate(textes):
            if texte.startswith("+ "):
                textes[i] = '<i>' + texte + '</i>'
        t = QLabel('<br>'.join(textes), panel)
        panelSizer.addWidget(t)


        btnOK = QPushButton("OK", panel)
        btnOK.clicked.connect(self.close)
        btnCopier = QPushButton("Copier", panel)
        btnCopier.clicked.connect(self.copier)

        sizer = QHBoxLayout()
        sizer.addWidget(btnOK)
        sizer.addStretch()
        sizer.addWidget(btnCopier)
        panelSizer.addLayout(sizer)

        panel.setLayout(panelSizer)

        topSizer = QHBoxLayout()
        topSizer.addWidget(panel)

        self.setLayout(topSizer)
Пример #12
0
    def __init__(self, parent, titre, contenu, fonction_modif):
        QDialog.__init__(self, parent)
        self.setWindowTitle(titre)
        sizer = QVBoxLayout()
        self.parent = parent
        self.fonction_modif = fonction_modif
        self.texte = EditeurPython(self)
#        self.texte.setMinimumSize(300, 10)
        self.texte.setText(contenu)
##        self.texte.SetInsertionPointEnd()
        sizer.addWidget(self.texte)

        boutons = QHBoxLayout()
        self.btn_modif = QPushButton("Modifier - F5")
        boutons.addWidget(self.btn_modif)
        self.btn_esc = QPushButton("Annuler - ESC")
        boutons.addStretch()
        boutons.addWidget(self.btn_esc)
        sizer.addLayout(boutons)
        self.setLayout(sizer)

        self.btn_modif.clicked.connect(self.executer)
        self.btn_esc.clicked.connect(self.close)

        self.setMinimumSize(400, 500)
        self.texte.setFocus()
Пример #13
0
    def __init__(self, parent, data, host_index):
        QDialog.__init__(self, parent)
        self.setupUi(self)

        self.data = data
        self.host_index = host_index

        for i, card in enumerate(data):
            self.tableWidget.insertRow(i)

            for j in range(self.tableWidget.columnCount()):
                header = self.tableWidget.horizontalHeaderItem(j).data(Qt.DisplayRole).toString()
                header = str(header)
                 
                try:
                    k = card._data[header]
                    if not k:
                        continue
                    #k = k.replace("\n", "<br>")
                    k = QTableWidgetItem(k)
                    self.tableWidget.setItem(i, j, k)
                except (AttributeError, KeyError, TypeError) as e:
                    print(e)

        self.tableWidget.resizeRowsToContents()
        self.tableWidget.resizeColumnsToContents()
Пример #14
0
    def __init__(self, parent):
        QDialog.__init__(self, parent, get_modeless_dialog_flags())
        self.parent = parent

        self.setupUi(self)

        # Synced air pressure, altitude and temperature. Updated with callbacks.
        self.air_pressure = 0
        self.altitude = 0
        self.temperature = 0

        self.btn_cal_remove.clicked.connect(self.btn_cal_remove_clicked)
        self.btn_cal_calibrate.clicked.connect(self.btn_cal_calibrate_clicked)

        self.cbe_air_pressure = CallbackEmulator(self.parent.barometer.get_air_pressure,
                                                 None,
                                                 self.cb_air_pressure,
                                                 self.parent.increase_error_count)

        self.cbe_altitude = CallbackEmulator(self.parent.barometer.get_altitude,
                                             None,
                                             self.cb_altitude,
                                             self.parent.increase_error_count)

        self.cbe_temperature = CallbackEmulator(self.parent.barometer.get_temperature,
                                                None,
                                                self.cb_temperature,
                                                self.parent.increase_error_count)
Пример #15
0
	def __init__(self):
		QDialog.__init__(self)
		self.setWindowTitle('pyqt5界面实时更新例子')
		self.resize(400, 100)
		self.input = QLineEdit(self)
		self.input.resize(400, 100)
		self.initUI()
Пример #16
0
    def __init__(self, parent):
        QDialog.__init__(self, parent, get_modeless_dialog_flags())

        self.setupUi(self)

        self.parent = parent
        self.master = self.parent.master
        self.client_group = [
            (self.wifi_client_status_status, self.wifi_client_status_status_label),
            (self.wifi_client_status_signal_strength, self.wifi_client_status_signal_strength_label),
            (self.wifi_client_status_ip, self.wifi_client_status_ip_label),
            (self.wifi_client_status_subnet_mask, self.wifi_client_status_subnet_mask_label),
            (self.wifi_client_status_gateway, self.wifi_client_status_gateway_label),
            (self.wifi_client_status_mac_address, self.wifi_client_status_mac_address_label),
            (self.wifi_client_status_rx, self.wifi_client_status_rx_label),
            (self.wifi_client_status_tx, self.wifi_client_status_tx_label),
        ]

        self.ap_group = [
            (self.wifi_ap_status_connected_count, self.wifi_ap_status_connected_count_label),
            (self.wifi_ap_status_ip, self.wifi_ap_status_ip_label),
            (self.wifi_ap_status_subnet_mask, self.wifi_ap_status_subnet_mask_label),
            (self.wifi_ap_status_gateway, self.wifi_ap_status_gateway_label),
            (self.wifi_ap_status_mac_address, self.wifi_ap_status_mac_address_label),
            (self.wifi_ap_status_rx, self.wifi_ap_status_rx_label),
            (self.wifi_ap_status_tx, self.wifi_ap_status_tx_label),
        ]

        self.wifi_status_button_close.clicked.connect(self.close)
        self.update_status()
Пример #17
0
    def __init__(self, parent, url):
        QDialog.__init__(self, parent)

        self.resize(800, 600)

        l = QVBoxLayout()

        self.te = QTextBrowser(self)
        self.te.sourceChanged.connect(self.onSourceChanged)
        self.te.setOpenExternalLinks(True)
        if not url.startswith('http'):
            pwd = os.path.dirname(__file__)
            locale = QSettings().value("locale/userLocale")[0:2]
            file = "{}/doc/{}/{}".format(pwd, locale, url)
            if not os.path.isfile(file):
                file = "{}/doc/en/{}".format(pwd, url)
            self.te.setSource(QUrl.fromLocalFile(file))
        else:
            self.te.setSource(QUrl(url))

        btn = QDialogButtonBox(QDialogButtonBox.Ok, Qt.Horizontal, self)
        btn.clicked.connect(self.close)

        l.addWidget(self.te)
        l.addWidget(btn)

        self.setLayout(l)
Пример #18
0
    def __init__(self, data=DataStore):
        QDialog.__init__(self)
        self.data = data

        self.inbound_sequence_list = []
        self.outbound_sequence_list = []

        self.inbound_buttons = []
        self.outbound_buttons = []

        self.inboundlayout = QHBoxLayout()
        self.outboundlayout = QHBoxLayout()

        self.layout = QVBoxLayout()
        self.layout.addLayout(self.inboundlayout)
        self.layout.addLayout(self.outboundlayout)

        self.done_button = QPushButton('Done')
        self.done_button.clicked.connect(self.sequence_done)
        self.layout.addWidget(self.done_button)

        self.setWindowTitle('Set Sequence')
        self.setGeometry(300, 400, 500, 500)
        self.setWindowModality(Qt.ApplicationModal)
        self.setLayout(self.layout)
        self.set_truck_and_doors()
        self.set_buttons()
        self.sequence = Sequence()
Пример #19
0
    def __init__(self, parent=None, numStages=1):
        QDialog.__init__(self, parent)

        self.threadRouter = ThreadRouter(self)
        self.currentStep = 0
        self.progress = None

        l = QVBoxLayout()
        self.setLayout(l)

        self.overallProgress = QProgressBar()
        self.overallProgress.setRange(0, numStages)
        self.overallProgress.setFormat("step %v of "+str(numStages))

        self.currentStepProgress = QProgressBar()
        self.currentStepProgress.setRange(0, 100)
        self.currentStepProgress.setFormat("%p %")

        self.overallLabel = QLabel("Overall progress")
        self.currentStepLabel = QLabel("Current step")

        l.addWidget(self.overallLabel)
        l.addWidget(self.overallProgress)
        l.addWidget(self.currentStepLabel)
        l.addWidget(self.currentStepProgress)
        l.maximumSize()

        self.update()
Пример #20
0
    def __init__(self, parent=None):
        QDialog.__init__(self, parent)
        self.config = Configurator()
        self.setupUi(self)
        self.pushButtonLoading.setDisabled(True)

        self.comboBoxDatabase.activated.connect(self.showFbPathButton)
        self.pushButtonShemaList.clicked.connect(self.showTableShemaList)
        self.toolButtonPath.clicked.connect(self.browse)
        self.pushButtonLoading.clicked.connect(self.downloading)
        self.lineEditVersionDownload.textChanged.connect(self.activatePushButtonLoading)
        self.lineEditPath.textChanged.connect(self.activatePushButtonLoading)
        self.lineEditReport.textChanged.connect(self.activatePushButtonLoading)
        self.pushButtonReport.clicked.connect(self.viewReports)
        self.pushButtonVersion.clicked.connect(self.viewVersion)

        self.table = TreeShemaForm(self)
        self.table.setTextToAzkFormLabel.connect(self.setTextToAzkFormLabel)

        self.reportDialog = DialogReports(self)
        self.reportDialog.setTextToLineEditReport.connect(self.setTextlineEditReport)

        self.DialogLog = DialogLog(self)

        self.versiondict = {}
        self.reportdict = {}

        self.pathReport1 = self.config.getoption('azkfin', 'report1')
        self.pathReport2 = self.config.getoption('azkfin', 'report2')
        self.pathVersion1 = self.config.getoption('azkfin', 'path1')
        self.pathVersion2 = self.config.getoption('azkfin', 'path2')
        self.extr = self.config.getoption('dialog', '7z')
Пример #21
0
    def __init__(self, parent=None, update=True):
        QDialog.__init__(self, parent=parent)
        layout = QVBoxLayout()
        self.tree = QTreeWidget()
        layout.addWidget(self.tree)
        self.setLayout(layout)

        self._mgr = CacheMemoryManager()

        self._tracked_caches = {}

        # tree setup code
        self.tree.setHeaderLabels(
            ["cache", "memory", "roi", "dtype", "type", "info", "id"])
        self._idIndex = self.tree.columnCount() - 1
        self.tree.setColumnHidden(self._idIndex, True)
        self.tree.setSortingEnabled(True)
        self.tree.clear()

        self._root = TreeNode()

        # refresh every x seconds (see showEvent())
        self.timer = QTimer(self)
        if update:
            self.timer.timeout.connect(self._updateReport)
Пример #22
0
    def __init__(self, parent, label, current, minimum, maximum, step, scalePoints):
        QDialog.__init__(self, parent)
        self.ui = ui_inputdialog_value.Ui_Dialog()
        self.ui.setupUi(self)

        self.ui.label.setText(label)
        self.ui.doubleSpinBox.setMinimum(minimum)
        self.ui.doubleSpinBox.setMaximum(maximum)
        self.ui.doubleSpinBox.setValue(current)
        self.ui.doubleSpinBox.setSingleStep(step)

        if not scalePoints:
            self.ui.groupBox.setVisible(False)
            self.resize(200, 0)
        else:
            text = "<table>"
            for scalePoint in scalePoints:
                text += "<tr><td align='right'>%f</td><td align='left'> - %s</td></tr>" % (scalePoint['value'], scalePoint['label'])
            text += "</table>"
            self.ui.textBrowser.setText(text)
            self.resize(200, 300)

        self.fRetValue = current

        self.accepted.connect(self.slot_setReturnValue)
Пример #23
0
    def __init__(self, parent, fields):
        QDialog.__init__(self, parent)

        layout = QVBoxLayout(self)

        self._list_elements = QListWidget(self)
        self._fields = dict(fields)
        for field, ftype in fields.items():
            self._list_elements.addItem(field + ' (' + ftype + ')')

        self._list_elements.setSelectionMode(
            QAbstractItemView.ExtendedSelection)

        layout.addWidget(self._list_elements)

        add_remove = AddRemoveButtonBar(self, 'Remove selected field(s)',
                                        self.remove, 'Add field', self.add)
        layout.addWidget(add_remove)

        buttons = QWidget(self)
        buttons_layout = QHBoxLayout()
        buttons.setLayout(buttons_layout)
        buttons_layout.addStretch()
        ok_button = QPushButton("Ok")
        cancel_button = QPushButton("Cancel")
        ok_button.clicked.connect(self.accept)
        cancel_button.clicked.connect(self.reject)
        buttons_layout.addWidget(ok_button)
        buttons_layout.addWidget(cancel_button)
        layout.addWidget(buttons)

        self.setLayout(layout)
Пример #24
0
 def __init__(self, parent, seed, name, width, height, num_plates):
     QDialog.__init__(self, parent)
     self._init_ui()
     self.world = None
     self.gen_thread = GenerationThread(self, seed, name, width, height,
                                        num_plates)
     self.gen_thread.start()
Пример #25
0
    def __init__(self, parent):
        QDialog.__init__(self, parent, Qt.Dialog)
        self.setWindowTitle(self.tr("Language Manager"))
        self.resize(700, 500)

        vbox = QVBoxLayout(self)
        self._tabs = QTabWidget()
        vbox.addWidget(self._tabs)
        # Footer
        hbox = QHBoxLayout()
        btn_close = QPushButton(self.tr('Close'))
        btnReload = QPushButton(self.tr("Reload"))
        hbox.addWidget(btn_close)
        hbox.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding))
        hbox.addWidget(btnReload)
        vbox.addLayout(hbox)
        self.overlay = ui_tools.Overlay(self)
        self.overlay.show()

        self._languages = []
        self._loading = True
        self.downloadItems = []

        #Load Themes with Thread
        btnReload.clicked.connect(self._reload_languages)
        self._thread = ui_tools.ThreadExecution(self.execute_thread)
        self._thread.finished.connect(self.load_languages_data)
        btn_close.clicked.connect(self.close)
        self._reload_languages()
    def __init__(self, parent, session, dict_provider, dict_country):
        QDialog.__init__(self, parent)

        self.setupUi(self)

        self.session = session

        self.dict_country = dict_country
        self.dict_provider = dict_provider

        self.cbox_mi_presets_country.currentIndexChanged.connect(self.cbox_mi_presets_country_current_index_changed)
        self.cbox_mi_presets_provider.currentIndexChanged.connect(self.cbox_mi_presets_provider_current_index_changed)
        self.cbox_mi_presets_plan.currentIndexChanged.connect(self.cbox_mi_presets_plan_current_index_changed)
        self.pbutton_mi_presets_select.clicked.connect(self.pbutton_mi_presets_select_clicked)
        self.pbutton_mi_presets_close.clicked.connect(self.pbutton_mi_presets_close_clicked)

        if not dict_provider or \
           not dict_country or \
           len(dict_provider) == 0 or \
           len(dict_country) == 0:
            self.label_mi_preview_dial.setText('-')
            self.label_mi_preview_apn.setText('-')
            self.label_mi_preview_username.setText('-')
            self.label_mi_preview_password.setText('-')
            self.cbox_mi_presets_country.clear()
            self.cbox_mi_presets_provider.clear()
            self.cbox_mi_presets_plan.clear()
            self.pbutton_mi_presets_select.setEnabled(False)
            self.cbox_mi_presets_country.setEnabled(False)
            self.cbox_mi_presets_provider.setEnabled(False)
            self.cbox_mi_presets_plan.setEnabled(False)
        else:
            self.populate_cbox_mi_presets_country()
Пример #27
0
	def __init__(self, db):
		QDialog.__init__(self)
		self.db = db

		self.chooser = TagChooser(db)
		self.setLayout(QVBoxLayout())
		self.layout().addWidget(self.chooser)
Пример #28
0
    def __init__(self, parent):
        QDialog.__init__(self, parent)
        layout = QVBoxLayout(self)
        self.setLayout(layout)

        layout.addWidget(QLabel('Enter the field name:', self))
        self._field_name_edit = QLineEdit(self)
        self._field_name_edit.textChanged.connect(self._text_changed)
        layout.addWidget(self._field_name_edit)
        layout.addWidget(QLabel('Type:', self))
        self._type_combo = QComboBox(self)
        self._type_combo.addItems(['int', 'float', 'bool', 'str'])
        layout.addWidget(self._type_combo)

        buttons = QWidget(self)
        buttons_layout = QHBoxLayout()
        buttons.setLayout(buttons_layout)
        buttons_layout.addStretch()
        self._ok_button = QPushButton("Ok")
        self._ok_button.setEnabled(False)
        cancel_button = QPushButton("Cancel")
        self._ok_button.clicked.connect(self.accept)
        cancel_button.clicked.connect(self.reject)
        buttons_layout.addWidget(self._ok_button)
        buttons_layout.addWidget(cancel_button)
        layout.addWidget(buttons)
 def __init__(self,singleton_idusu):
     QDialog.__init__(self)
     self.obj_form= Ui_Form_reparar_cuota()
     self.obj_form.setupUi(self)
     self.obj_form.boton_buscar.clicked.connect(self.buscar)
     self.obj_form.boton_actualizar.clicked.connect(self.actualizar)
     self.singleton_idusu= singleton_idusu
Пример #30
0
    def __init__(self, parent, objets, islabel = False):
        "Le paramètre 'label' indique si l'objet à éditer est un label"
        print("OBJETS:")
        print(objets)
        print(str(objets[0]))
        print(repr(objets[0]))
        print(objets[0].__class__)
        print(isinstance(objets[0], str))
        objets[0].titre_complet("du", False)
        self.parent = parent
        self.islabel = islabel
        self.fenetre_principale = self.parent.window()
        self.panel = app.fenetre_principale.onglets.onglet_actuel
        self.canvas = self.panel.canvas

        self.objets = objets
        if self.islabel:
            titre = "du label"
        else:
            if len(objets) == 0:
                self.close()
            if len(objets) == 1:
                titre = objets[0].titre_complet("du", False)
            else:
                titre = "des objets"
#        wx.MiniFrame.__init__(self, parent, -1, u"Propriétés " + titre, style=wx.DEFAULT_FRAME_STYLE | wx.TINY_CAPTION_HORIZ)
        QDialog.__init__(self, parent)
        self.setWindowTitle("Propriétés " + titre)
        self.setPalette(white_palette)
        ##self.SetExtraStyle(wx.WS_EX_BLOCK_EVENTS )
        main = QVBoxLayout()
        self.setLayout(main)
        self.onglets = OngletsProprietes(self)
        main.addWidget(self.onglets)
Пример #31
0
    def __init__(self, handler, data):
        '''Ask user for 2nd factor authentication. Support text, security card and paired mobile methods.
        Use last method from settings, but support new pairing and downgrade.
        '''
        QDialog.__init__(self, handler.top_level_window())
        self.handler = handler
        self.txdata = data
        self.idxs = self.txdata[
            'keycardData'] if self.txdata['confirmationType'] > 1 else ''
        self.setMinimumWidth(650)
        self.setWindowTitle(_("Ledger Wallet Authentication"))
        self.cfg = copy.deepcopy(self.handler.win.wallet.get_keystore().cfg)
        self.dongle = self.handler.win.wallet.get_keystore().get_client(
        ).dongle
        self.ws = None
        self.pin = ''

        self.devmode = self.getDevice2FAMode()
        if self.devmode == 0x11 or self.txdata['confirmationType'] == 1:
            self.cfg['mode'] = 0

        vbox = QVBoxLayout()
        self.setLayout(vbox)

        def on_change_mode(idx):
            if idx < 2 and self.ws:
                self.ws.stop()
                self.ws = None
            self.cfg[
                'mode'] = 0 if self.devmode == 0x11 else idx if idx > 0 else 1
            if self.cfg['mode'] > 1 and self.cfg['pair'] and not self.ws:
                self.req_validation()
            if self.cfg['mode'] > 0:
                self.handler.win.wallet.get_keystore().cfg = self.cfg
                self.handler.win.wallet.save_keystore()
            self.update_dlg()

        def add_pairing():
            self.do_pairing()

        def return_pin():
            self.pin = self.pintxt.text(
            ) if self.txdata['confirmationType'] == 1 else self.cardtxt.text()
            if self.cfg['mode'] == 1:
                self.pin = ''.join(chr(int(str(i), 16)) for i in self.pin)
            self.accept()

        self.modebox = QWidget()
        modelayout = QHBoxLayout()
        self.modebox.setLayout(modelayout)
        modelayout.addWidget(QLabel(_("Method:")))
        self.modes = QComboBox()
        modelayout.addWidget(self.modes, 2)
        self.addPair = QPushButton(_("Pair"))
        self.addPair.setMaximumWidth(60)
        modelayout.addWidget(self.addPair)
        modelayout.addStretch(1)
        self.modebox.setMaximumHeight(50)
        vbox.addWidget(self.modebox)

        self.populate_modes()
        self.modes.currentIndexChanged.connect(on_change_mode)
        self.addPair.clicked.connect(add_pairing)

        self.helpmsg = QTextEdit()
        self.helpmsg.setStyleSheet(
            "QTextEdit { background-color: lightgray; }")
        self.helpmsg.setReadOnly(True)
        vbox.addWidget(self.helpmsg)

        self.pinbox = QWidget()
        pinlayout = QHBoxLayout()
        self.pinbox.setLayout(pinlayout)
        self.pintxt = QLineEdit()
        self.pintxt.setEchoMode(2)
        self.pintxt.setMaxLength(4)
        self.pintxt.returnPressed.connect(return_pin)
        pinlayout.addWidget(QLabel(_("Enter PIN:")))
        pinlayout.addWidget(self.pintxt)
        pinlayout.addWidget(QLabel(_("NOT DEVICE PIN - see above")))
        pinlayout.addStretch(1)
        self.pinbox.setVisible(self.cfg['mode'] == 0)
        vbox.addWidget(self.pinbox)

        self.cardbox = QWidget()
        card = QVBoxLayout()
        self.cardbox.setLayout(card)
        self.addrtext = QTextEdit()
        self.addrtext.setStyleSheet(
            "QTextEdit { color:blue; background-color:lightgray; padding:15px 10px; border:none; font-size:20pt; font-family:monospace; }"
        )
        self.addrtext.setReadOnly(True)
        self.addrtext.setMaximumHeight(130)
        card.addWidget(self.addrtext)

        def pin_changed(s):
            if len(s) < len(self.idxs):
                i = self.idxs[len(s)]
                addr = self.txdata['address']
                if not constants.net.TESTNET:
                    text = addr[:i] + '<u><b>' + addr[
                        i:i + 1] + '</u></b>' + addr[i + 1:]
                else:
                    # pin needs to be created from mainnet address
                    addr_mainnet = bitcoin.script_to_address(
                        bitcoin.address_to_script(addr),
                        net=constants.BitcoinMainnet)
                    addr_mainnet = addr_mainnet[:i] + '<u><b>' + addr_mainnet[
                        i:i + 1] + '</u></b>' + addr_mainnet[i + 1:]
                    text = str(addr) + '\n' + str(addr_mainnet)
                self.addrtext.setHtml(str(text))
            else:
                self.addrtext.setHtml(_("Press Enter"))

        pin_changed('')
        cardpin = QHBoxLayout()
        cardpin.addWidget(QLabel(_("Enter PIN:")))
        self.cardtxt = QLineEdit()
        self.cardtxt.setEchoMode(2)
        self.cardtxt.setMaxLength(len(self.idxs))
        self.cardtxt.textChanged.connect(pin_changed)
        self.cardtxt.returnPressed.connect(return_pin)
        cardpin.addWidget(self.cardtxt)
        cardpin.addWidget(QLabel(_("NOT DEVICE PIN - see above")))
        cardpin.addStretch(1)
        card.addLayout(cardpin)
        self.cardbox.setVisible(self.cfg['mode'] == 1)
        vbox.addWidget(self.cardbox)

        self.pairbox = QWidget()
        pairlayout = QVBoxLayout()
        self.pairbox.setLayout(pairlayout)
        pairhelp = QTextEdit(helpTxt[5])
        pairhelp.setStyleSheet("QTextEdit { background-color: lightgray; }")
        pairhelp.setReadOnly(True)
        pairlayout.addWidget(pairhelp, 1)
        self.pairqr = QRCodeWidget()
        pairlayout.addWidget(self.pairqr, 4)
        self.pairbox.setVisible(False)
        vbox.addWidget(self.pairbox)
        self.update_dlg()

        if self.cfg['mode'] > 1 and not self.ws:
            self.req_validation()
Пример #32
0
 def __init__(self, parent=None, defSettings=None):
     QDialog.__init__(self, parent=parent)
     self.initUI(parent)
     self.restoreDefaultSettings(defSettings)
     self.updateTriggerred.connect(parent.updateSettings)
Пример #33
0
    def __init__(self, tx, parent, desc, prompt_if_unsaved):
        '''Transactions in the wallet will show their description.
        Pass desc to give a description for txs not yet in the wallet.
        '''
        # We want to be a top-level window
        QDialog.__init__(self, parent=None)
        # Take a copy; it might get updated in the main window by
        # e.g. the FX plugin.  If this happens during or after a long
        # sign operation the signatures are lost.
        self.tx = tx = copy.deepcopy(tx)  # type: Transaction
        try:
            self.tx.deserialize()
        except BaseException as e:
            raise SerializationError(e)
        self.main_window = parent  # type: ElectrumWindow
        self.wallet = parent.wallet
        self.prompt_if_unsaved = prompt_if_unsaved
        self.saved = False
        self.desc = desc

        # if the wallet can populate the inputs with more info, do it now.
        # as a result, e.g. we might learn an imported address tx is segwit,
        # in which case it's ok to display txid
        tx.add_inputs_info(self.wallet)

        self.setMinimumWidth(950)
        self.setWindowTitle(_("Transaction"))

        vbox = QVBoxLayout()
        self.setLayout(vbox)

        vbox.addWidget(QLabel(_("Transaction ID:")))
        self.tx_hash_e = ButtonsLineEdit()
        qr_show = lambda: parent.show_qrcode(
            str(self.tx_hash_e.text()), 'Transaction ID', parent=self)
        qr_icon = "qrcode_white.png" if ColorScheme.dark_scheme else "qrcode.png"
        self.tx_hash_e.addButton(qr_icon, qr_show, _("Show as QR code"))
        self.tx_hash_e.setReadOnly(True)
        vbox.addWidget(self.tx_hash_e)

        self.add_tx_stats(vbox)
        vbox.addSpacing(10)
        self.add_io(vbox)
        if tx.tx_type:
            self.extra_pld_label = QLabel('Extra payload:')
            vbox.addWidget(self.extra_pld_label)
            self.extra_pld = ExtraPayloadWidget()
            vbox.addWidget(self.extra_pld)

        self.sign_button = b = QPushButton(_("Sign"))
        b.clicked.connect(self.sign)

        self.broadcast_button = b = QPushButton(_("Broadcast"))
        b.clicked.connect(self.do_broadcast)

        self.save_button = b = QPushButton(_("Save"))
        save_button_disabled = not tx.is_complete()
        b.setDisabled(save_button_disabled)
        if save_button_disabled:
            b.setToolTip(SAVE_BUTTON_DISABLED_TOOLTIP)
        else:
            b.setToolTip(SAVE_BUTTON_ENABLED_TOOLTIP)
        b.clicked.connect(self.save)

        self.export_button = b = QPushButton(_("Export"))
        b.clicked.connect(self.export)

        self.cancel_button = b = QPushButton(_("Close"))
        b.clicked.connect(self.close)
        b.setDefault(True)

        self.qr_button = b = QPushButton()
        b.setIcon(read_QIcon(qr_icon))
        b.clicked.connect(self.show_qr)

        self.copy_button = CopyButton(lambda: str(self.tx), parent.app)

        # Action buttons
        self.buttons = [
            self.sign_button, self.broadcast_button, self.cancel_button
        ]
        # Transaction sharing buttons
        self.sharing_buttons = [
            self.copy_button, self.qr_button, self.export_button,
            self.save_button
        ]

        run_hook('transaction_dialog', self)

        hbox = QHBoxLayout()
        hbox.addLayout(Buttons(*self.sharing_buttons))
        hbox.addStretch(1)
        hbox.addLayout(Buttons(*self.buttons))
        vbox.addLayout(hbox)
        self.update()
Пример #34
0
 def __init__(self, parent, title=None):
     QDialog.__init__(self, parent)
     self.setWindowModality(Qt.WindowModal)
     if title:
         self.setWindowTitle(title)
Пример #35
0
    def __init__(self, parent=None):
        """Dialogs that allows users to load music libraries.

        A list of libraries is listed in a ListWidget on the left with the library module's InitWidget shown on the right.

        First all libraries stored in puddlestuff.libraries are loaded.
        Then puddlestuff.musiclib.extralibs is checked for an extra libraries.
        They should already be loaded.

        

        Useful methods:
            loadLib()->Loads the currently selected library.
            loadLibConfig()

        Libraries are module which should contain the following:
            name->The name of the library.
            InitWidget class->Used to allow the use to set options required for loading the library.
        """
        QDialog.__init__(self, parent)
        self.listbox = QListWidget()
        self.setWindowTitle(translate('MusicLib', 'Import Music Library'))
        winsettings('importmusiclib', self)

        self.libattrs = []
        for libname in libraries.__all__:
            try:
                lib = __import__('puddlestuff.libraries.%s' % libname,
                                 fromlist=['puddlestuff', 'libraries'])
                if not hasattr(lib, 'InitWidget'):
                    raise Exception(translate('MusicLib', 'Invalid library'))
            except Exception as detail:
                msg = translate('MusicLib', 'Error loading %1: %2\n')
                msg = msg.arg(libname).arg(str(detail))
                sys.stderr.write(msg)
                continue

            try:
                name = lib.name
            except AttributeError:
                name = translate('MusicLib', 'Anonymous Library')

            try:
                desc = lib.description
            except AttributeError:
                desc = translate('MusicLib', 'Description was left out.')

            try:
                author = lib.author
            except AttributeError:
                author = translate('MusicLib', 'Anonymous author.')

            self.libattrs.append({
                'name': name,
                'desc': desc,
                'author': author,
                'module': lib
            })

        self.libattrs.extend(extralibs)

        if not self.libattrs:
            raise MusicLibError(0, errors[0])

        self.listbox.addItems([z['name'] for z in self.libattrs])
        self.stackwidgets = [z['module'].InitWidget() for z in self.libattrs]
        self.listbox.currentRowChanged.connect(self.changeWidget)

        okcancel = OKCancel()
        okcancel.ok.connect(self.loadLib)
        okcancel.cancel.connect(self.close)

        self.stack = QStackedWidget()
        self.stack.setFrameStyle(QFrame.Box)
        list(map(self.stack.addWidget, self.stackwidgets))

        hbox = QHBoxLayout()
        hbox.addWidget(self.listbox, 0)
        hbox.addWidget(self.stack, 1)

        vbox = QVBoxLayout()
        vbox.addLayout(hbox)
        vbox.addLayout(okcancel)

        self.setLayout(vbox)
Пример #36
0
                def __init__(self):
                    QDialog.__init__(self)

                    grid = QGridLayout()
                    grid.setSpacing(20)
                    self.setWindowTitle("Wijzigen Cluster")
                    self.setWindowIcon(QIcon('./images/logos/logo.jpg'))

                    self.setFont(QFont('Arial', 10))

                    self.Omschrijving = QLabel()
                    q1Edit = QLineEdit(rpsel[1])
                    q1Edit.setFont(QFont("Arial", 10))
                    q1Edit.textChanged.connect(self.q1Changed)
                    reg_ex = QRegExp("^.{0,49}$")
                    input_validator = QRegExpValidator(reg_ex, q1Edit)
                    q1Edit.setValidator(input_validator)

                    self.Prijs = QLabel()
                    q2Edit = QLineEdit(str(round(rpsel[2], 2)))
                    q2Edit.setFixedWidth(150)
                    q2Edit.setFont(QFont("Arial", 10))
                    q2Edit.textChanged.connect(self.q2Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q2Edit)
                    q2Edit.setValidator(input_validator)

                    self.Eenheid = QLabel()
                    q3Edit = QLineEdit(str(rpsel[3]))
                    q3Edit.setFixedWidth(150)
                    q3Edit.setFont(QFont("Arial", 10))
                    q3Edit.textChanged.connect(self.q3Changed)
                    reg_ex = QRegExp("^.{0,10}$")
                    input_validator = QRegExpValidator(reg_ex, q3Edit)
                    q3Edit.setValidator(input_validator)

                    self.Materialen = QLabel()
                    q4Edit = QLineEdit(str(round(rpsel[4], 2)))
                    q4Edit.setFixedWidth(150)
                    q4Edit.setFont(QFont("Arial", 10))
                    q4Edit.textChanged.connect(self.q4Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q4Edit)
                    q4Edit.setValidator(input_validator)
                    q4Edit.setDisabled(True)

                    self.Lonen = QLabel()
                    q5Edit = QLineEdit(str(round(rpsel[5], 2)))
                    q5Edit.setFixedWidth(150)
                    q5Edit.setFont(QFont("Arial", 10))
                    q5Edit.textChanged.connect(self.q5Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q5Edit)
                    q5Edit.setValidator(input_validator)
                    q5Edit.setDisabled(True)

                    self.Diensten = QLabel()
                    q6Edit = QLineEdit(str(round(rpsel[6], 2)))
                    q6Edit.setFixedWidth(150)
                    q6Edit.setFont(QFont("Arial", 10))
                    q6Edit.textChanged.connect(self.q6Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q6Edit)
                    q6Edit.setValidator(input_validator)
                    q6Edit.setDisabled(True)

                    self.Materiëel = QLabel()
                    q7Edit = QLineEdit(str(round(rpsel[7], 2)))
                    q7Edit.setFixedWidth(150)
                    q7Edit.setFont(QFont("Arial", 10))
                    q7Edit.textChanged.connect(self.q7Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q7Edit)
                    q7Edit.setValidator(input_validator)
                    q7Edit.setDisabled(True)

                    self.Inhuur = QLabel()
                    q8Edit = QLineEdit(str(round(rpsel[8], 2)))
                    q8Edit.setFixedWidth(150)
                    q8Edit.setFont(QFont("Arial", 10))
                    q8Edit.textChanged.connect(self.q8Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q8Edit)
                    q8Edit.setValidator(input_validator)
                    q8Edit.setDisabled(True)

                    self.Construktieuren = QLabel()
                    q9Edit = QLineEdit(str(rpsel[9]))
                    q9Edit.setFixedWidth(150)
                    q9Edit.setFont(QFont("Arial", 10))
                    q9Edit.textChanged.connect(self.q9Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q9Edit)
                    q9Edit.setValidator(input_validator)

                    self.Montageuren = QLabel()
                    q10Edit = QLineEdit(str(rpsel[10]))
                    q10Edit.setFixedWidth(150)
                    q10Edit.setFont(QFont("Arial", 10))
                    q10Edit.textChanged.connect(self.q10Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q10Edit)
                    q10Edit.setValidator(input_validator)

                    self.Retourlasuren = QLabel()
                    q11Edit = QLineEdit(str(rpsel[11]))
                    q11Edit.setFixedWidth(150)
                    q11Edit.setFont(QFont("Arial", 10))
                    q11Edit.textChanged.connect(self.q11Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q11Edit)
                    q11Edit.setValidator(input_validator)

                    self.BFIuren = QLabel()
                    q12Edit = QLineEdit(str(rpsel[12]))
                    q12Edit.setFixedWidth(150)
                    q12Edit.setFont(QFont("Arial", 10))
                    q12Edit.textChanged.connect(self.q12Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q12Edit)
                    q12Edit.setValidator(input_validator)

                    self.Telecomuren = QLabel()
                    q29Edit = QLineEdit(str(rpsel[29]))
                    q29Edit.setFixedWidth(150)
                    q29Edit.setFont(QFont("Arial", 10))
                    q29Edit.textChanged.connect(self.q29Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q29Edit)
                    q29Edit.setValidator(input_validator)

                    self.Voedinguren = QLabel()
                    q13Edit = QLineEdit(str(rpsel[13]))
                    q13Edit.setFixedWidth(150)
                    q13Edit.setFont(QFont("Arial", 10))
                    q13Edit.textChanged.connect(self.q13Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q13Edit)
                    q13Edit.setValidator(input_validator)

                    self.Bvluren = QLabel()
                    q14Edit = QLineEdit(str(rpsel[14]))
                    q14Edit.setFixedWidth(150)
                    q14Edit.setFont(QFont("Arial", 10))
                    q14Edit.textChanged.connect(self.q14Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q14Edit)
                    q14Edit.setValidator(input_validator)

                    self.Spoorleguren = QLabel()
                    q15Edit = QLineEdit(str(rpsel[15]))
                    q15Edit.setFixedWidth(150)
                    q15Edit.setFont(QFont("Arial", 10))
                    q15Edit.textChanged.connect(self.q15Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q15Edit)
                    q15Edit.setValidator(input_validator)

                    self.Spoorlasuren = QLabel()
                    q16Edit = QLineEdit(str(rpsel[16]))
                    q16Edit.setFixedWidth(150)
                    q16Edit.setFont(QFont("Arial", 10))
                    q16Edit.textChanged.connect(self.q16Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q16Edit)
                    q16Edit.setValidator(input_validator)

                    self.Inhuururen = QLabel()
                    q17Edit = QLineEdit(str(rpsel[17]))
                    q17Edit.setFixedWidth(150)
                    q17Edit.setFont(QFont("Arial", 10))
                    q17Edit.textChanged.connect(self.q17Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q17Edit)
                    q17Edit.setValidator(input_validator)

                    self.Sleuvengraver = QLabel()
                    q18Edit = QLineEdit(str(rpsel[18]))
                    q18Edit.setFixedWidth(150)
                    q18Edit.setFont(QFont("Arial", 10))
                    q18Edit.textChanged.connect(self.q18Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q18Edit)
                    q18Edit.setValidator(input_validator)

                    self.Persapparaat = QLabel()
                    q19Edit = QLineEdit(str(rpsel[19]))
                    q19Edit.setFixedWidth(150)
                    q19Edit.setFont(QFont("Arial", 10))
                    q19Edit.textChanged.connect(self.q19Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q19Edit)
                    q19Edit.setValidator(input_validator)

                    self.Atlaskraan = QLabel()
                    q20Edit = QLineEdit(str(rpsel[20]))
                    q20Edit.setFixedWidth(150)
                    q20Edit.setFont(QFont("Arial", 10))
                    q20Edit.textChanged.connect(self.q20Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q20Edit)
                    q20Edit.setValidator(input_validator)

                    self.Kraan_groot = QLabel()
                    q21Edit = QLineEdit(str(rpsel[21]))
                    q21Edit.setFixedWidth(150)
                    q21Edit.setFont(QFont("Arial", 10))
                    q21Edit.textChanged.connect(self.q21Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q21Edit)
                    q21Edit.setValidator(input_validator)

                    self.Mainliner = QLabel()
                    q22Edit = QLineEdit(str(rpsel[22]))
                    q22Edit.setFixedWidth(150)
                    q22Edit.setFont(QFont("Arial", 10))
                    q22Edit.textChanged.connect(self.q22Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q22Edit)
                    q22Edit.setValidator(input_validator)

                    self.Hormachine = QLabel()
                    q23Edit = QLineEdit(str(rpsel[23]))
                    q23Edit.setFixedWidth(150)
                    q23Edit.setFont(QFont("Arial", 10))
                    q23Edit.textChanged.connect(self.q23Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q23Edit)
                    q23Edit.setValidator(input_validator)

                    self.Wagon = QLabel()
                    q24Edit = QLineEdit(str(rpsel[24]))
                    q24Edit.setFixedWidth(150)
                    q24Edit.setFont(QFont("Arial", 10))
                    q24Edit.textChanged.connect(self.q24Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q24Edit)
                    q24Edit.setValidator(input_validator)

                    self.Locomotor = QLabel()
                    q25Edit = QLineEdit(str(rpsel[25]))
                    q25Edit.setFixedWidth(150)
                    q25Edit.setFont(QFont("Arial", 10))
                    q25Edit.textChanged.connect(self.q25Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q25Edit)
                    q25Edit.setValidator(input_validator)

                    self.Locomotief = QLabel()
                    q26Edit = QLineEdit(str(rpsel[26]))
                    q26Edit.setFixedWidth(150)
                    q26Edit.setFont(QFont("Arial", 10))
                    q26Edit.textChanged.connect(self.q26Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q26Edit)
                    q26Edit.setValidator(input_validator)

                    self.Stormobiel = QLabel()
                    q27Edit = QLineEdit(str(rpsel[27]))
                    q27Edit.setFixedWidth(150)
                    q27Edit.setFont(QFont("Arial", 10))
                    q27Edit.textChanged.connect(self.q27Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q27Edit)
                    q27Edit.setValidator(input_validator)

                    self.Montagewagen = QLabel()
                    q28Edit = QLineEdit(str(rpsel[28]))
                    q28Edit.setFixedWidth(150)
                    q28Edit.setFont(QFont("Arial", 10))
                    q28Edit.textChanged.connect(self.q28Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q28Edit)
                    q28Edit.setValidator(input_validator)

                    self.Robeltrein = QLabel()
                    q30Edit = QLineEdit(str(rpsel[30]))
                    q30Edit.setFixedWidth(150)
                    q30Edit.setFont(QFont("Arial", 10))
                    q30Edit.textChanged.connect(self.q30Changed)
                    reg_ex = QRegExp("^[0-9.]{0,12}$")
                    input_validator = QRegExpValidator(reg_ex, q30Edit)
                    q30Edit.setValidator(input_validator)

                    grid = QGridLayout()
                    grid.setSpacing(20)

                    lbl1 = QLabel('Clusternummer')
                    lbl1.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl1, 1, 0)

                    lbl2 = QLabel(clusternr)
                    grid.addWidget(lbl2, 1, 1)

                    lbl3 = QLabel('Omschrijving')
                    lbl3.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl3, 2, 0)
                    grid.addWidget(q1Edit, 2, 1, 1,
                                   3)  # RowSpan 1 ,ColumnSpan 3

                    lbl4 = QLabel('Prijs')
                    lbl4.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl4, 3, 0)
                    grid.addWidget(q2Edit, 3, 1)

                    lbl5 = QLabel('Eenheid')
                    lbl5.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl5, 4, 0)
                    grid.addWidget(q3Edit, 4, 1)

                    lbl6 = QLabel('Materialen')
                    lbl6.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl6, 5, 0)
                    grid.addWidget(q4Edit, 5, 1)

                    lbl7 = QLabel('Lonen')
                    lbl7.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl7, 6, 0)
                    grid.addWidget(q5Edit, 6, 1)

                    lbl8 = QLabel('Diensten')
                    lbl8.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl8, 7, 0)
                    grid.addWidget(q6Edit, 7, 1)

                    lbl9 = QLabel('Materiëel')
                    lbl9.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl9, 8, 0)
                    grid.addWidget(q7Edit, 8, 1)

                    lbl10 = QLabel('Inhuur')
                    lbl10.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl10, 9, 0)
                    grid.addWidget(q8Edit, 9, 1)

                    lbl20 = QLabel('Sleuvengraven-uren')
                    lbl20.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl20, 10, 0)
                    grid.addWidget(q18Edit, 10, 1)

                    lbl21 = QLabel('Persapparaat-uren')
                    lbl21.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl21, 11, 0)
                    grid.addWidget(q19Edit, 11, 1)

                    lbl22 = QLabel('Atlaskraan-uren')
                    lbl22.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl22, 12, 0)
                    grid.addWidget(q20Edit, 12, 1)

                    lbl23 = QLabel('Kraan_groot-uren')
                    lbl23.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl23, 13, 0)
                    grid.addWidget(q21Edit, 13, 1)

                    lbl24 = QLabel('Mainliner-uren')
                    lbl24.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl24, 14, 0)
                    grid.addWidget(q22Edit, 14, 1)

                    lbl25 = QLabel('Hormachine-uren')
                    lbl25.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl25, 15, 0)
                    grid.addWidget(q23Edit, 15, 1)

                    lbl26 = QLabel('Wagon-uren')
                    lbl26.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl26, 16, 0)
                    grid.addWidget(q24Edit, 16, 1)

                    lbl27 = QLabel('Locomotor-uren')
                    lbl27.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl27, 3, 2)
                    grid.addWidget(q25Edit, 3, 3)

                    lbl28 = QLabel('Locomotief-uren')
                    lbl28.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl28, 4, 2)
                    grid.addWidget(q26Edit, 4, 3)

                    lbl29 = QLabel('Stormobiel-uren')
                    lbl29.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl29, 5, 2)
                    grid.addWidget(q27Edit, 5, 3)

                    lbl30 = QLabel('Montagewagen-uren')
                    lbl30.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl30, 6, 2)
                    grid.addWidget(q28Edit, 6, 3)

                    lbl31 = QLabel('Robeltrein-uren')
                    lbl31.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl31, 7, 2)
                    grid.addWidget(q30Edit, 7, 3)

                    lbl19 = QLabel('Inhuur-uren')
                    lbl19.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl19, 8, 2)
                    grid.addWidget(q17Edit, 8, 3)

                    lbl11 = QLabel('Construktie-uren')
                    lbl11.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl11, 9, 2)
                    grid.addWidget(q9Edit, 9, 3)

                    lbl12 = QLabel('Montage-uren')
                    lbl12.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl12, 10, 2)
                    grid.addWidget(q10Edit, 10, 3)

                    lbl13 = QLabel('Retourlas-uren')
                    lbl13.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl13, 11, 2)
                    grid.addWidget(q11Edit, 11, 3)

                    lbl14 = QLabel('BFI-uren')
                    lbl14.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl14, 12, 2)
                    grid.addWidget(q12Edit, 12, 3)

                    lbl19 = QLabel('Telecom-uren')
                    lbl19.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl19, 13, 2)
                    grid.addWidget(q29Edit, 13, 3)

                    lbl15 = QLabel('Voeding-uren')
                    lbl15.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl15, 14, 2)
                    grid.addWidget(q13Edit, 14, 3)

                    lbl16 = QLabel('Bovenleiding-uren')
                    lbl16.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl16, 15, 2)
                    grid.addWidget(q14Edit, 15, 3)

                    lbl17 = QLabel('Spoorleg-uren')
                    lbl17.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl17, 16, 2)
                    grid.addWidget(q15Edit, 16, 3)

                    lbl18 = QLabel('Spoorlas-uren')
                    lbl18.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    grid.addWidget(lbl18, 17, 2)
                    grid.addWidget(q16Edit, 17, 3)

                    lbl = QLabel()
                    pixmap = QPixmap('./images/logos/verbinding.jpg')
                    lbl.setPixmap(pixmap)
                    grid.addWidget(lbl, 0, 0, 1, 1, Qt.AlignRight)

                    logo = QLabel()
                    pixmap = QPixmap('./images/logos/logo.jpg')
                    logo.setPixmap(pixmap)
                    grid.addWidget(logo, 0, 3, 1, 1, Qt.AlignRight)

                    grid.addWidget(QLabel('Wijzigen Cluster'), 0, 1, 1, 2,
                                   Qt.AlignCenter)

                    grid.addWidget(
                        QLabel(
                            '\u00A9 2017 all rights reserved [email protected]'
                        ), 19, 1, 1, 3)

                    self.setLayout(grid)
                    self.setGeometry(400, 50, 150, 150)

                    applyBtn = QPushButton('Wijzig')
                    applyBtn.clicked.connect(self.accept)

                    grid.addWidget(applyBtn, 18, 3, 1, 1, Qt.AlignRight)
                    applyBtn.setFont(QFont("Arial", 10))
                    applyBtn.setFixedWidth(100)
                    applyBtn.setStyleSheet(
                        "color: black;  background-color: gainsboro")

                    closeBtn = QPushButton('Sluiten')
                    closeBtn.clicked.connect(self.close)

                    grid.addWidget(closeBtn, 18, 2, 1, 2, Qt.AlignCenter)
                    closeBtn.setFont(QFont("Arial", 10))
                    closeBtn.setFixedWidth(100)
                    closeBtn.setStyleSheet(
                        "color: black;  background-color: gainsboro")
Пример #37
0
    def __init__(self, temp_config, parent=None):
        QDialog.__init__(self, parent)
        self.setStyleSheet("""	QWidget{background-color: rgba(0,41,59,255);
										border-color: rgba(0,41,59,255);
										color:white;
										font-weight:bold;}""")
        self.default_temp_config = temp_config
        self.temp_config = temp_config

        if self.temp_config['language'] == "georgian":
            Geo_Checked = True
            Eng_Checked = False
        else:
            Geo_Checked = False
            Eng_Checked = True

        self.setWindowTitle("პარამეტრები")
        self.setWindowIcon(
            QtGui.QIcon("img/settings.png"))  # Set main window icon

        self.groupBox_language = QGroupBox("ენა")  # create groupbox with lane
        self.groupBox_language.setAlignment(Qt.AlignCenter)

        self.groupBox_window_size = QGroupBox(
            "ფანჯრის ზომა")  # create groupbox with lane
        self.groupBox_window_size.setAlignment(Qt.AlignCenter)

        VLbox = QVBoxLayout()
        VLbox.addWidget(self.groupBox_language)
        VLbox.addWidget(self.groupBox_window_size)

        hboxLayout_language = QHBoxLayout()
        hboxLayout_size = QHBoxLayout()

        self.Edit_length = QLineEdit()
        self.Edit_width = QLineEdit()

        self.Label_length = QLabel("სიგრძე")
        self.Label_width = QLabel("სიგანე")

        self.Edit_length.setText(str(self.temp_config['length']))
        self.Edit_width.setText(str(self.temp_config['width']))

        hboxLayout_size.addWidget(self.Label_length)
        hboxLayout_size.addWidget(self.Edit_length)
        hboxLayout_size.addWidget(self.Label_width)

        hboxLayout_size.addWidget(self.Edit_width)

        self.radioButton1 = QRadioButton("ქართული")  # create radiobutton1
        self.radioButton1.setChecked(
            Geo_Checked)  # set radiobutton1 as default ticked
        self.radioButton1.setIcon(
            QtGui.QIcon("img/georgia.png"))  # set icon on radiobutton1
        self.radioButton1.setIconSize(QtCore.QSize(40, 40))  # set icon size
        self.radioButton1.toggled.connect(
            self.geo
        )  # create radiobutton1 and "OnRadioBtn" function conection
        hboxLayout_language.addWidget(
            self.radioButton1)  # add radiobutton1 in horizontal layout

        self.radioButton2 = QRadioButton("ინგლისური")  # create radiobutton2
        self.radioButton2.setChecked(Eng_Checked)
        self.radioButton2.setIcon(
            QtGui.QIcon("img/english.png"))  # set icon on radiobutton2
        self.radioButton2.setIconSize(QtCore.QSize(40, 40))  # set icon size
        hboxLayout_language.addWidget(
            self.radioButton2)  # add radiobutton2 in horizontal layout
        self.radioButton2.toggled.connect(self.eng)

        self.ApplySet = PushBut("დადასტურება")
        self.CancelSet = PushBut("გაუქმება")
        self.ApplySet.clicked.connect(self.applySettings)
        self.CancelSet.clicked.connect(self.CancelSettings)

        self.groupBox_language.setLayout(
            hboxLayout_language)  # in group box set horizontal layout
        self.groupBox_window_size.setLayout(
            hboxLayout_size)  # in group box set horizontal layout

        VLbox.addWidget(self.ApplySet)
        VLbox.addWidget(self.CancelSet)

        if self.temp_config['language'] == "georgian":
            self.geo()
        else:
            self.eng()

        self.setLayout(VLbox)
Пример #38
0
    def __init__(self,
                 parent=None,
                 row=None,
                 files=None,
                 preview_mode=False,
                 artwork=True,
                 status=None):

        if status is None:
            status = {'cover_pattern': 'folder'}

        self.status = status

        QDialog.__init__(self, parent)
        winsettings('extendedtags', self)
        self.get_fieldlist = []
        self.previewMode = preview_mode

        add = QColor.fromRgb(255, 255, 0)
        edit = QColor.fromRgb(0, 255, 0)
        remove = QColor.fromRgb(255, 0, 0)
        self._colors = {
            ADD: QBrush(add),
            EDIT: QBrush(edit),
            REMOVE: QBrush(remove)
        }

        self.table = QTableWidget(0, 2, self)
        self.table.setVerticalHeader(VerticalHeader())
        self.table.verticalHeader().setVisible(False)
        self.table.setSortingEnabled(True)
        self.table.setSelectionBehavior(
            QAbstractItemView.SelectionBehavior.SelectRows)
        self.table.setHorizontalHeaderLabels([
            translate('Extended Tags', 'Field'),
            translate('Extended Tags', 'Value')
        ])

        header = self.table.horizontalHeader()
        header.setVisible(True)
        header.setSortIndicatorShown(True)
        header.setStretchLastSection(True)
        header.setSortIndicator(0, Qt.SortOrder.AscendingOrder)

        self.piclabel = PicWidget(buttons=True)
        self.piclabel.imageChanged.connect(self._imageChanged)

        if not isinstance(self.piclabel.removepic, QAction):
            self.piclabel.removepic.clicked.connect(self.removePic)
        else:
            self.piclabel.removepic.triggered.connect(self.removePic)

        if row and row >= 0 and files:
            buttons = MoveButtons(files, row)
            buttons.indexChanged.connect(self._prevnext)
            buttons.setVisible(True)
        else:
            buttons = MoveButtons([], row)
            buttons.setVisible(False)

        self._files = files

        self.okcancel = OKCancel()
        self.okcancel.insertWidget(0, buttons)

        self._reset = QToolButton()
        self._reset.setToolTip(
            translate('Extended Tags',
                      'Resets the selected fields to their original value.'))
        self._reset.setIcon(get_icon('edit-undo', ':/undo.png'))
        self._reset.clicked.connect(self.resetFields)

        self.listbuttons = ListButtons()
        self.listbuttons.layout().addWidget(self._reset)
        self.listbuttons.moveupButton.hide()
        self.listbuttons.movedownButton.hide()

        listframe = QFrame()
        listframe.setFrameStyle(QFrame.Shape.Box)
        hbox = QHBoxLayout()
        hbox.addWidget(self.table, 1)
        hbox.addLayout(self.listbuttons, 0)
        listframe.setLayout(hbox)

        layout = QVBoxLayout()
        if artwork:
            imageframe = QFrame()
            imageframe.setFrameStyle(QFrame.Shape.Box)
            vbox = QVBoxLayout()
            vbox.setContentsMargins(0, 0, 0, 0)
            vbox.addWidget(self.piclabel)
            vbox.addStretch()
            vbox.addStrut(0)
            imageframe.setLayout(vbox)

            hbox = QHBoxLayout()
            hbox.addWidget(listframe, 1)
            hbox.addSpacing(4)
            hbox.addWidget(imageframe)
            hbox.addStrut(1)
            layout.addLayout(hbox)
        else:
            layout.addWidget(listframe)

        layout.addLayout(self.okcancel)
        self.setLayout(layout)

        self.okcancel.cancel.connect(self.closeMe)
        self.table.itemDoubleClicked.connect(self.editField)
        self.table.itemSelectionChanged.connect(self._checkListBox)
        self.okcancel.ok.connect(self.okClicked)

        self.listbuttons.edit.connect(self.editField)
        self.listbuttons.addButton.clicked.connect(self.addField)
        self.listbuttons.removeButton.clicked.connect(self.removeField)
        self.listbuttons.duplicate.connect(self.duplicate)

        self.setMinimumSize(450, 350)

        self.canceled = False
        self.filechanged = False

        if row and row >= 0 and files:
            self._prevnext(row)
        else:
            self.loadFiles(files)
Пример #39
0
 def __init__(self, tag, parent=None):
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.__initLabel()
     self.__setUIStyle()
Пример #40
0
    def __init__(self, parent, session, source_name):
        QDialog.__init__(self, parent)

        self.setupUi(self)
        self.setModal(True)

        self.source_name = source_name
        self.last_filename = os.path.join(get_home_path(),
                                          posixpath.split(source_name)[1])
        self.log_file = None
        self.content = None

        source_name_parts = posixpath.split(source_name)[1].split('_')

        if source_name_parts[0] == 'continuous':
            date_time = 'Continuous ({0})'.format(source_name_parts[1])
            self.continuous = True
        else:
            try:
                timestamp = int(source_name_parts[1].split('+')[0]) // 1000000
            except ValueError:
                timestamp = 0

            date_time = '{0} ({1})'.format(
                timestamp_to_date_at_time(timestamp), source_name_parts[2])
            self.continuous = False

        self.rejected.connect(self.abort_download)
        self.progress_download.setRange(0, 0)
        self.label_date_time.setText(date_time)
        self.button_save.clicked.connect(self.save_content)
        self.button_close.clicked.connect(self.reject)

        self.button_save.setEnabled(False)

        def cb_open(dummy):
            def cb_read_status(bytes_read, max_length):
                self.progress_download.setValue(bytes_read)

            def cb_read(result):
                self.log_file.release()
                self.log_file = None

                self.label_download.setVisible(False)
                self.progress_download.setVisible(False)

                if result.error != None:
                    self.log('Error: ' + html.escape(str(result.error)),
                             bold=True)
                    return

                try:
                    self.content = result.data.decode('utf-8')
                except UnicodeDecodeError:
                    # FIXME: maybe add a encoding guesser here or try some common encodings if UTF-8 fails
                    self.log('Error: Log file is not UTF-8 encoded', bold=True)
                    return

                self.button_save.setEnabled(True)

                if self.continuous:
                    content = self.content.lstrip()
                else:
                    content = self.content

                self.edit_content.setPlainText('')

                font = QFont('monospace')
                font.setStyleHint(QFont.TypeWriter)

                self.edit_content.setFont(font)
                self.edit_content.setPlainText(content)

            self.progress_download.setRange(0, self.log_file.length)
            self.log_file.read_async(self.log_file.length, cb_read,
                                     cb_read_status)

        def cb_open_error():
            self.label_download.setVisible(False)
            self.progress_download.setVisible(False)
            self.log('Error: Could not open log file', bold=True)

        self.log_file = REDFile(session)

        async_call(self.log_file.open, (source_name, REDFile.FLAG_READ_ONLY
                                        | REDFile.FLAG_NON_BLOCKING, 0, 0, 0),
                   cb_open, cb_open_error)
Пример #41
0
 def __init__(self, main_tab):
     QDialog.__init__(self, parent=main_tab.ui)
     self.main_tab = main_tab
     self.setWindowTitle('Sweep All Rewards')
     self.setupUI()
     self.connectButtons()
Пример #42
0
    def __init__(self,
                 parent=None,
                 minval=0,
                 numtracks=0,
                 enablenumtracks=False):

        QDialog.__init__(self, parent)

        self.setWindowTitle(
            translate('Autonumbering Wizard', "Autonumbering Wizard"))
        winsettings('autonumbering', self)

        def hbox(*widgets):
            box = QHBoxLayout()
            [box.addWidget(z) for z in widgets]
            box.addStretch()
            return box

        vbox = QVBoxLayout()

        self._start = QSpinBox()
        self._start.setValue(minval)
        self._start.setMaximum(65536)

        startlabel = QLabel(translate('Autonumbering Wizard', "&Start: "))
        startlabel.setBuddy(self._start)

        vbox.addLayout(hbox(startlabel, self._start))

        self._padlength = QSpinBox()
        self._padlength.setValue(1)
        self._padlength.setMaximum(65535)
        self._padlength.setMinimum(1)

        label = QLabel(
            translate('Autonumbering Wizard',
                      'Max length after padding with zeroes: '))
        label.setBuddy(self._padlength)

        vbox.addLayout(hbox(label, self._padlength))

        self._separator = QCheckBox(
            translate('Autonumbering Wizard',
                      "Add track &separator ['/']: Number of tracks"))
        self._numtracks = QSpinBox()
        self._numtracks.setEnabled(False)
        self._numtracks.setMaximum(65535)
        if numtracks:
            self._numtracks.setValue(numtracks)
        self._restart_numbering = QCheckBox(
            translate('Autonumbering Wizard',
                      "&Restart numbering at each directory group."))
        self._restart_numbering.stateChanged.connect(
            self.showDirectorySplittingOptions)

        vbox.addLayout(hbox(self._separator, self._numtracks))
        vbox.addWidget(self._restart_numbering)

        self.custom_numbering_widgets = []

        label = QLabel(
            translate('Autonumbering Wizard', "Group tracks using pattern:: "))

        self.grouping = QLineEdit()
        label.setBuddy(self.grouping)

        vbox.addLayout(hbox(label, self.grouping))
        self.custom_numbering_widgets.extend([label, self.grouping])

        label = QLabel(translate('Autonumbering Wizard', "Output field: "))

        self.output_field = QComboBox()
        label.setBuddy(self.output_field)

        self.output_field.setEditable(True)
        completer = self.output_field.completer()
        completer.setCaseSensitivity(Qt.CaseSensitivity.CaseSensitive)
        completer.setCompletionMode(
            QCompleter.CompletionMode.UnfilteredPopupCompletion)

        self.output_field.setCompleter(completer)
        self.output_field.addItems(gettaglist())
        vbox.addLayout(hbox(label, self.output_field))
        self.custom_numbering_widgets.extend([label, self.output_field])

        self.count_by_group = QCheckBox(
            translate('Autonumbering Wizard',
                      'Increase counter only on group change'))
        vbox.addWidget(self.count_by_group)
        self.custom_numbering_widgets.append(self.count_by_group)

        okcancel = OKCancel()
        vbox.addLayout(okcancel)
        self.setLayout(vbox)

        okcancel.ok.connect(self.emitValuesAndSave)
        okcancel.cancel.connect(self.close)
        self._separator.stateChanged.connect(
            lambda v: self._numtracks.setEnabled(v == Qt.CheckState.Checked))

        # self._restart_numbering.stateChanged.connect(
        #              self.showDirectorySplittingOptions)

        self._separator.setChecked(enablenumtracks)

        self._loadSettings()
Пример #43
0
 def __init__(self, parent=None):
     QDialog.__init__(self, parent)
     self.initUI()
Пример #44
0
    def __init__(self):
        QDialog.__init__(self)
        self.ui = ui_donate.Ui_Dialog()
        self.ui.setupUi(self)

        self.ui.toolButtonPrevious.clicked.connect(self.goPrevious)
        self.ui.toolButtonNext.clicked.connect(self.goNext)

        if not isDarkTheme(self):
            self.ui.labelLogo.setText(
                "<html><head/><body><p><img src=\":/logo-LZK4_light.svg\"/></p></body></html>"
            )

        global_tips = [
            _translate(
                'tip of day',
                "<html><head/><body><p>Do you know <span style=\" font-weight:600;\">ALT + F2</span> shortcut ?</p><p><br/>This shortcut allows you to start very quicky<br/>any software by typing its name.</p><p>This way, you don't have to create many and many<br/>shortcuts on the desktop.</p></body></html>"
            ),
            _translate(
                'tip of day',
                "<html><head/><body><p>Do you know <span style=\" font-weight:600;\">ALT + Tab</span> shortcut ?</p><p><br/>This shortcut allows you to switch quickly<br/>between windows.</p></body></html>"
            ),
            _translate(
                'tip of day',
                "<html><head/><body><p>Do you know that you can come and chat live with other LibraZiK users?</p><p></br>Come on the <span style=\" font-weight:600;\">#librazik IRC channel.</span><br/>People can talk English and/or French there.</p><p>More information about that <a href=\"https://librazik.tuxfamily.org/base-site-LZK/english.php#help\"><span style=\" font-weight:600; text-decoration: underline; color:#2980b9;\">here</span></a>.</p></body></html>"
            ),
            _translate(
                'tip of day',
                "<html><head/><body><p>Pretty sure you don't know <a href=\"https://github.com/deufrai/Qrest\"><span style=\" font-weight:600; text-decoration: underline; color:#2980b9;\">Qrest</span></a>.</p><p></br>Do you?</p></body></html>"
            )
        ]
        mate_tips = [
            _translate(
                'tip of day',
                "<html><head/><body><p>Do you know <span style=\" font-weight:600;\">Alt + left-click + move</span> shortcut ?</p><p><br/>This shortcut allows you to move a window. Very useful if a window is too big for your screen!</p><p>More information about MATE <a href=\"https://mate-desktop.org/\"><span style=\" font-weight:600; text-decoration: underline; color:#2980b9;\">here</span></a>.</p></body></html>"
            ),
        ]
        kde_tips = [
            _translate(
                'tip of day',
                "<html><head/><body><p>Do you know <span style=\" font-weight:600;\">Ctrl + Alt + Esc</span> shortcut ?</p><p><br/>This shortcut allows you to kill windows if they are not responding</p></body></html>"
            ),
            _translate(
                'tip of day',
                "<html><head/><body><p>Do you know <span style=\" font-weight:600;\">Alt + left-click + move</span> shortcut ?</p><p><br/>This shortcut allows you to move a window. Very useful if a window is too big for your screen!</p></body></html>"
            )
        ]

        self.bottom_texts = [
            _translate(
                'bottom_texts',
                "<html><head/><body><p align=\"center\">Creating and maintaining this distribution is<br/>a hard and constant work that takes time.<br/><br/>That is why donations (even modest ones) are very much appreciated<br/>to help keep the motivation alive.</p><p align=\"center\">You can make a donation <a href=\"https://liberapay.com/LibraZiK/donate\"><span style=\" text-decoration: underline; color:#2980b9;\">here</span></a>.<br/>More information and alternatives about donation can be found <a href=\"https://librazik.tuxfamily.org/base-site-LZK/english.php#donation\"><span style=\" text-decoration: underline; color:#0986d3;\">here</span></a>.</p><p align=\"center\">Now, go make some music!</p></body></html>"
            ),
            _translate(
                'bottom_texts',
                "<html><head/><body><p align=\"center\">The development of LibraZiK takes many hours every week.<br/>LibraZiK is free (as a free speech), but not really free (as a free drink). If the users do not make donations, the project will eventually stop.</p><p align=\"center\">So, if you can help financing the project, please donate! If not, that's ok, keep using it, we don't want money to be a blocker.</p><p align=\"center\">You can make a donation <a href=\"https://liberapay.com/LibraZiK/donate\"><span style=\" text-decoration: underline; color:#2980b9;\">here</span></a>.<br/>More information and alternatives about donation can be found <a href=\"https://librazik.tuxfamily.org/base-site-LZK/english.php#donation\"><span style=\" text-decoration: underline; color:#0986d3;\">here</span></a>.</p><p align=\"center\">Thank you very much for thinking about that.</p></body></html>"
            ),
            _translate(
                'bottom_texts',
                "<html><head/><body><p align=\"center\">LibraZiK is an operating system for computer-aided audio production.<br/>The development of LibraZiK requires a lot of time and effort. We would like the lead developer of the project to be able to benefit from donations allowing him to consider the development of LibraZiK as a perennial work.</p><p align=\"center\">If LibraZiK is useful to you, please consider to make a donation to the project. Don't be shy, any amount will be gratefully received.</p><p align=\"center\">You can make a donation <a href=\"https://liberapay.com/LibraZiK/donate\"><span style=\" text-decoration: underline; color:#2980b9;\">here</span></a>.<br/>More information and alternatives about donation can be found <a href=\"https://librazik.tuxfamily.org/base-site-LZK/english.php#donation\"><span style=\" text-decoration: underline; color:#0986d3;\">here</span></a>.</p><p align=\"center\">By advance, thank you.</p></body></html>"
            ),
        ]

        desktop = os.getenv('XDG_CURRENT_DESKTOP')
        if desktop == 'MATE':
            desktop_tips = mate_tips
        elif desktop == 'KDE':
            desktop_tips = kde_tips

        # mixer les messages généraux et les messages d'environnement de bureau
        self.tips = []
        n = 0
        while global_tips or desktop_tips:
            if not global_tips:
                self.tips += desktop_tips
                break
            if not desktop_tips:
                self.tips += global_tips
                break

            if n % 2:
                self.tips.append(desktop_tips.pop(0))
            else:
                self.tips.append(global_tips.pop(0))
            n += 1

        self.tip_day = 0

        if self.ui.toolButtonNext.icon().isNull():
            self.ui.toolButtonNext.setIcon(QIcon(':/go-next.png'))
        if self.ui.toolButtonPrevious.icon().isNull():
            self.ui.toolButtonPrevious.setIcon(QIcon(':/go-previous.png'))
 def __init__(self):
     QDialog.__init__(self)
     self.setupUi(self)
     btn = self.SearchButton
     btn.clicked.connect(lambda: self.search(self.SearchText.text()))
Пример #46
0
    def __init__(self, nb_row, nb_col):
        QDialog.__init__(self)
        self.layout = QGridLayout(self)
        self.label1 = QLabel('النتيجة ')
        self.btn = QPushButton('تم ')
        self.btn.setFixedWidth(100)
        self.nb_row = nb_row
        self.nb_col = nb_col

        # creating empty table
        # data = [[] for i in range(self.nb_row)]
        # # self.querys("name",names)

        # for i in range(self.nb_row):
        #     for j in range(self.nb_col):
        #         data[i].append('')
        self.combo_box = QComboBox(self)

        for i in x:

            self.combo_box.addItem(i)

        list = []
        conn = pyodbc.connect(
            r'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};'
            r'DBQ=E:\project\year\code\exe project\project v1.0\v1\filter.accdb;'
        )
        cursor = conn.cursor()

        sql = f'''select * from test'''
        cursor.execute(sql)

        for row in cursor.fetchall():
            # print(row)
            list.append(row)
            # print(row[0])
            # ALL columns value
            num1.append(row[0])
            num2.append(row[1])
            num3.append(row[2])
            num4.append(row[3])
            num5.append(row[4])
            num6.append(row[5])

        self.table1 = QTableWidget()
        delegate = Delegate(self.table1)

        self.table1.setItemDelegate(delegate)

        self.table1.setRowCount(self.nb_row)
        self.table1.setColumnCount(self.nb_col)

        self.table1.setHorizontalHeaderLabels(
            ['Id', 'name', "s1", "s2", "s3", "s4"])
        for row in range(self.nb_row):
            for col in range(self.nb_col):
                item = QTableWidgetItem(str(list[row][col]))
                self.table1.setItem(row, col, item)

        self.layout.addWidget(self.label1, 0, 0)
        self.layout.addWidget(self.combo_box, 1, 0)

        self.layout.addWidget(self.table1, 2, 0)
        self.layout.addWidget(self.btn, 4, 0)
        self.combo_box.activated[str].connect(self.on_combobox_changed)

        self.btn.clicked.connect(self.print_table_values)
 def __init__(self):
     QDialog.__init__(self)
     self.setupUi(self)
     btn1 = self.yes
     btn1.clicked.connect(lambda: self.sendMessage(self.lineEdit.text(),
                                                   self.lineEdit_2.text()))
Пример #48
0
 def __init__(self,parent):
     QDialog.__init__(self,parent)
     loadUi('./Tools/Calculators/UI_Forms/mplPlot.ui',self)
Пример #49
0
 def __init__(self):
     QDialog.__init__(self)
     self.setupUi(self)
     self.buttonBox.accepted.connect(self.onAccept)
     self.buttonBox.rejected.connect(self.onReject)
 def __init__(self):
     QDialog.__init__(self)
     self.setupUi(self)
     btn1 = self.yes
     btn1.clicked.connect(lambda: self.deleteOneLink(
         self.lineEdit.text(), self.lineEdit_2.text()))
Пример #51
0
 def __init__(self, parent=None):
     QDialog.__init__(self, parent)
     self.ui = Ui_AboutOsdag()
     self.ui.setupUi(self)
     self.osdagmainwindow = parent
Пример #52
0
    def __init__(self, layer, parent=None):
        QDialog.__init__(self, parent)
        p = os.path.split(os.path.abspath(__file__))[0]
        uic.loadUi(p + "/ui/rgbaLayerDialog.ui", self)
        self.setLayername(layer.name)

        if layer.datasources[0] == None:
            self.showRedThresholds(False)
        if layer.datasources[1] == None:
            self.showGreenThresholds(False)
        if layer.datasources[2] == None:
            self.showBlueThresholds(False)
        if layer.datasources[3] == None:
            self.showAlphaThresholds(False)

        def dbgPrint(layerIdx, a, b):
            layer.set_normalize(layerIdx, (a, b))
            logger.debug("normalization changed for channel=%d to [%d, %d]" %
                         (layerIdx, a, b))

        self.redChannelThresholdingWidget.setRange(layer.range[0][0],
                                                   layer.range[0][1])
        self.greenChannelThresholdingWidget.setRange(layer.range[1][0],
                                                     layer.range[1][1])
        self.blueChannelThresholdingWidget.setRange(layer.range[2][0],
                                                    layer.range[2][1])
        self.alphaChannelThresholdingWidget.setRange(layer.range[3][0],
                                                     layer.range[3][1])

        self.redChannelThresholdingWidget.setValue(layer.normalize[0][0],
                                                   layer.normalize[0][1])
        self.greenChannelThresholdingWidget.setValue(layer.normalize[1][0],
                                                     layer.normalize[1][1])
        self.blueChannelThresholdingWidget.setValue(layer.normalize[2][0],
                                                    layer.normalize[2][1])
        self.alphaChannelThresholdingWidget.setValue(layer.normalize[3][0],
                                                     layer.normalize[3][1])

        self.redChannelThresholdingWidget.valueChanged.connect(
            partial(dbgPrint, 0))
        self.greenChannelThresholdingWidget.valueChanged.connect(
            partial(dbgPrint, 1))
        self.blueChannelThresholdingWidget.valueChanged.connect(
            partial(dbgPrint, 2))
        self.alphaChannelThresholdingWidget.valueChanged.connect(
            partial(dbgPrint, 3))

        def redAutoRange(state):
            if state == 2:
                self.redChannelThresholdingWidget.setValue(
                    layer.normalize[0][0], layer.normalize[0][1])  # update gui
                layer.set_normalize(0, None)  # set to auto
                self.redChannelThresholdingWidget.setEnabled(False)
            if state == 0:
                self.redChannelThresholdingWidget.setEnabled(True)
                layer.set_normalize(0, layer.normalize[0])

        def greenAutoRange(state):
            if state == 2:
                self.greenChannelThresholdingWidget.setValue(
                    layer.normalize[1][0], layer.normalize[1][1])  # update gui
                layer.set_normalize(1, None)  # set to auto
                self.greenChannelThresholdingWidget.setEnabled(False)
            if state == 0:
                self.greenChannelThresholdingWidget.setEnabled(True)
                layer.set_normalize(1, layer.normalize[1])

        def blueAutoRange(state):
            if state == 2:
                self.blueChannelThresholdingWidget.setValue(
                    layer.normalize[2][0], layer.normalize[2][1])  # update gui
                layer.set_normalize(2, None)  # set to auto
                self.blueChannelThresholdingWidget.setEnabled(False)
            if state == 0:
                self.blueChannelThresholdingWidget.setEnabled(True)
                layer.set_normalize(2, layer.normalize[2])

        def alphaAutoRange(state):
            if state == 2:
                self.alphaChannelThresholdingWidget.setValue(
                    layer.normalize[3][0], layer.normalize[3][1])  # update gui
                layer.set_normalize(3, None)  # set to auto
                self.alphaChannelThresholdingWidget.setEnabled(False)
            if state == 0:
                self.alphaChannelThresholdingWidget.setEnabled(True)
                layer.set_normalize(3, layer.normalize[3])

        self.redAutoRange.stateChanged.connect(redAutoRange)
        self.redAutoRange.setCheckState(layer._autoMinMax[0] * 2)
        self.greenAutoRange.stateChanged.connect(greenAutoRange)
        self.greenAutoRange.setCheckState(layer._autoMinMax[1] * 2)
        self.blueAutoRange.stateChanged.connect(blueAutoRange)
        self.blueAutoRange.setCheckState(layer._autoMinMax[2] * 2)
        self.alphaAutoRange.stateChanged.connect(alphaAutoRange)
        self.alphaAutoRange.setCheckState(layer._autoMinMax[3] * 2)

        self.resize(self.minimumSize())
Пример #53
0
 def __init__(self, parent=None):
     QDialog.__init__(self, parent)
     self.ui = Ui_MapGenerationDialog()
     self.ui.setupUi(self)
     self.setupUIActions()
Пример #54
0
 def __init__(self, parent=None):
     QDialog.__init__(self, parent)
     self.ui = Ui_AskQuestion()
     self.ui.setupUi(self)
     self.osdagmainwindow = parent
Пример #55
0
    def __init__(self, iface):
        QDialog.__init__(self)
        self.setupUi(self)
        self.iface = iface

        self.previewUrl = None
        self.layer_search_combo = None
        self.exporter_combo = None

        self.feedback = FeedbackDialog(self)
        self.feedback.setModal(True)

        stgs = QSettings()

        self.restoreGeometry(
            stgs.value("qgis2web/MainDialogGeometry",
                       QByteArray(),
                       type=QByteArray))

        if stgs.value("qgis2web/previewOnStartup", Qt.Checked) == Qt.Checked:
            self.previewOnStartup.setCheckState(Qt.Checked)
        else:
            self.previewOnStartup.setCheckState(Qt.Unchecked)
        if (stgs.value("qgis2web/closeFeedbackOnSuccess",
                       Qt.Checked) == Qt.Checked):
            self.closeFeedbackOnSuccess.setCheckState(Qt.Checked)
        else:
            self.closeFeedbackOnSuccess.setCheckState(Qt.Unchecked)
        self.previewFeatureLimit.setText(
            stgs.value("qgis2web/previewFeatureLimit", "1000"))

        self.paramsTreeOL.setSelectionMode(QAbstractItemView.SingleSelection)
        self.preview = None
        if webkit_available:
            widget = QWebView()
            self.preview = widget
            try:
                # if os.environ["TRAVIS"]:
                self.preview.setPage(WebPage())
            except:
                print("Failed to set custom webpage")
            webview = self.preview.page()
            webview.setNetworkAccessManager(QgsNetworkAccessManager.instance())
            self.preview.settings().setAttribute(
                QWebSettings.DeveloperExtrasEnabled, True)
        else:
            widget = QTextBrowser()
            widget.setText(
                self.tr('Preview is not available since QtWebKit '
                        'dependency is missing on your system'))
        self.right_layout.insertWidget(0, widget)
        self.populateConfigParams(self)
        self.populate_layers_and_groups(self)
        self.populateLayerSearch()

        writer = WRITER_REGISTRY.createWriterFromProject()
        self.setStateToWriter(writer)

        self.exporter = EXPORTER_REGISTRY.createFromProject()
        self.exporter_combo.setCurrentIndex(
            self.exporter_combo.findText(self.exporter.name()))
        self.exporter_combo.currentIndexChanged.connect(
            self.exporterTypeChanged)

        self.toggleOptions()
        if webkit_available:
            if self.previewOnStartup.checkState() == Qt.Checked:
                self.autoUpdatePreview()
            self.buttonPreview.clicked.connect(self.previewMap)
        else:
            self.buttonPreview.setDisabled(True)
        self.layersTree.model().dataChanged.connect(self.populateLayerSearch)
        self.ol3.clicked.connect(self.changeFormat)
        self.leaflet.clicked.connect(self.changeFormat)
        self.buttonExport.clicked.connect(self.saveMap)
        helpText = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                "helpFile.md")
        if helpText == "/usr/src/qgis2web/helpFile.md":
            helpText = "/usr/src/qgis2web/qgis2web/helpFile.md"
        self.helpField.setSource(QUrl.fromLocalFile(helpText))
        if webkit_available:
            self.devConsole = QWebInspector(self.verticalLayoutWidget_2)
            self.devConsole.setFixedHeight(0)
            self.devConsole.setObjectName("devConsole")
            self.devConsole.setPage(self.preview.page())
            self.devConsole.hide()
            self.right_layout.insertWidget(1, self.devConsole)
        self.filter = devToggleFilter()
        self.filter.devToggle.connect(self.showHideDevConsole)
        self.installEventFilter(self.filter)
        self.setModal(False)
Пример #56
0
 def __init__(self):
     QDialog.__init__(self)
     self.setupUi(self)
Пример #57
0
 def __init__(self, parent=None):
     QDialog.__init__(self, parent, Qt.ToolTip|Qt.WindowStaysOnTopHint)
     self.setAttribute( Qt.WA_ShowWithoutActivating)
     self.parent=parent
Пример #58
0
 def __init__(self, videos, parent):
     QDialog.__init__(self, parent)
     self.videos = videos
     self.setupUi(self)
Пример #59
0
    def __init__(self,
                 *,
                 parent: 'ElectrumWindow',
                 invoice,
                 desc,
                 prompt_if_unsaved,
                 finalized: bool,
                 external_keypairs=None):
        '''Transactions in the wallet will show their description.
        Pass desc to give a description for txs not yet in the wallet.
        '''
        # We want to be a top-level window
        QDialog.__init__(self, parent=None)
        self.tx = None  # type: Optional[Transaction]
        self.external_keypairs = external_keypairs
        self.finalized = finalized
        self.main_window = parent
        self.config = parent.config
        self.wallet = parent.wallet
        self.prompt_if_unsaved = prompt_if_unsaved
        self.saved = False
        self.desc = desc
        self.invoice = invoice
        self.setMinimumWidth(950)
        self.set_title()

        self.psbt_only_widgets = []  # type: List[QWidget]

        vbox = QVBoxLayout()
        self.setLayout(vbox)

        vbox.addWidget(QLabel(_("Transaction ID:")))
        self.tx_hash_e = ButtonsLineEdit()
        qr_show = lambda: parent.show_qrcode(
            str(self.tx_hash_e.text()), 'Transaction ID', parent=self)
        qr_icon = "qrcode_white.png" if ColorScheme.dark_scheme else "qrcode.png"
        self.tx_hash_e.addButton(qr_icon, qr_show, _("Show as QR code"))
        self.tx_hash_e.setReadOnly(True)
        vbox.addWidget(self.tx_hash_e)

        self.add_tx_stats(vbox)

        vbox.addSpacing(10)

        self.inputs_header = QLabel()
        vbox.addWidget(self.inputs_header)
        self.inputs_textedit = QTextEditWithDefaultSize()
        vbox.addWidget(self.inputs_textedit)
        self.outputs_header = QLabel()
        vbox.addWidget(self.outputs_header)
        self.outputs_textedit = QTextEditWithDefaultSize()
        vbox.addWidget(self.outputs_textedit)
        self.sign_button = b = QPushButton(_("Sign"))
        b.clicked.connect(self.sign)

        self.broadcast_button = b = QPushButton(_("Broadcast"))
        b.clicked.connect(self.do_broadcast)

        self.save_button = b = QPushButton(_("Save"))
        b.clicked.connect(self.save)

        self.cancel_button = b = QPushButton(_("Close"))
        b.clicked.connect(self.close)
        b.setDefault(True)

        self.export_actions_menu = export_actions_menu = QMenu()
        self.add_export_actions_to_menu(export_actions_menu)
        export_actions_menu.addSeparator()
        export_submenu = export_actions_menu.addMenu(
            _("For CoinJoin; strip privates"))
        self.add_export_actions_to_menu(export_submenu,
                                        gettx=self._gettx_for_coinjoin)
        self.psbt_only_widgets.append(export_submenu)

        self.export_actions_button = QToolButton()
        self.export_actions_button.setText(_("Export"))
        self.export_actions_button.setMenu(export_actions_menu)
        self.export_actions_button.setPopupMode(QToolButton.InstantPopup)

        self.finalize_button = QPushButton(_('Finalize'))
        self.finalize_button.clicked.connect(self.on_finalize)

        partial_tx_actions_menu = QMenu()
        ptx_merge_sigs_action = QAction(_("Merge signatures from"), self)
        ptx_merge_sigs_action.triggered.connect(self.merge_sigs)
        partial_tx_actions_menu.addAction(ptx_merge_sigs_action)
        ptx_join_txs_action = QAction(_("Join inputs/outputs"), self)
        ptx_join_txs_action.triggered.connect(self.join_tx_with_another)
        partial_tx_actions_menu.addAction(ptx_join_txs_action)
        self.partial_tx_actions_button = QToolButton()
        self.partial_tx_actions_button.setText(_("Combine"))
        self.partial_tx_actions_button.setMenu(partial_tx_actions_menu)
        self.partial_tx_actions_button.setPopupMode(QToolButton.InstantPopup)
        self.psbt_only_widgets.append(self.partial_tx_actions_button)

        # Action buttons
        self.buttons = [
            self.partial_tx_actions_button, self.sign_button,
            self.broadcast_button, self.cancel_button
        ]
        # Transaction sharing buttons
        self.sharing_buttons = [
            self.finalize_button, self.export_actions_button, self.save_button
        ]
        run_hook('transaction_dialog', self)
        if not self.finalized:
            self.create_fee_controls()
            vbox.addWidget(self.feecontrol_fields)
        self.hbox = hbox = QHBoxLayout()
        hbox.addLayout(Buttons(*self.sharing_buttons))
        hbox.addStretch(1)
        hbox.addLayout(Buttons(*self.buttons))
        vbox.addLayout(hbox)
        self.set_buttons_visibility()

        dialogs.append(self)
Пример #60
0
 def __init__(self, parent=None):
     QDialog.__init__(self, parent)
     self.parent = parent
     self._widgetsDisplayMode = WidgetsDisplayMode.Vertical