Esempio n. 1
0
    def __init__(self, parent):
        QDialog.__init__(self, parent=parent)
        self.setupUi(self)
        self.initUi()
        self.model = None
        self.delegate = []

        self.CameraGroup.setVisible(False)

        self.QR_data = ''
        self.slip_json = None
        self.slip_lines = None

        self.slipsAPI = SlipsTaxAPI()
        self.tensor_flow_present = dependency_present(['tensorflow'])

        self.qr_data_available.connect(self.parseQRdata)
        self.qr_data_validated.connect(self.downloadSlipJSON)
        self.qr_data_loaded.connect(self.recognizeCategories)
        self.LoadQRfromFileBtn.clicked.connect(self.loadFileQR)
        self.GetQRfromClipboardBtn.clicked.connect(self.readClipboardQR)
        self.GetQRfromCameraBtn.clicked.connect(self.readCameraQR)
        self.StopCameraBtn.clicked.connect(self.closeCamera)
        self.ScannerQR.decodedQR.connect(self.onCameraQR)
        self.GetSlipBtn.clicked.connect(self.downloadSlipJSON)
        self.LoadJSONfromFileBtn.clicked.connect(self.loadFileSlipJSON)
        self.AddOperationBtn.clicked.connect(self.addOperation)
        self.ClearBtn.clicked.connect(self.clearSlipData)
        self.AssignCategoryBtn.clicked.connect(self.recognizeCategories)

        self.AssignCategoryBtn.setEnabled(self.tensor_flow_present)
Esempio n. 2
0
    def __init__(self, symbol, isin='', name=''):
        QDialog.__init__(self)
        self.setupUi(self)
        self.asset_id = None

        self.SymbolEdit.setText(symbol)
        self.isinEdit.setText(isin)
        self.NameEdit.setText(name)

        self.type_model = QSqlTableModel(db=db_connection())
        self.type_model.setTable('asset_types')
        self.type_model.select()
        self.TypeCombo.setModel(self.type_model)
        self.TypeCombo.setModelColumn(1)

        self.data_src_model = QSqlTableModel(db=db_connection())
        self.data_src_model.setTable('data_sources')
        self.data_src_model.select()
        self.DataSrcCombo.setModel(self.data_src_model)
        self.DataSrcCombo.setModelColumn(1)

        # center dialog with respect to main application window
        parent = None
        for widget in QApplication.topLevelWidgets():
            if widget.objectName() == Setup.MAIN_WND_NAME:
                parent = widget
        if parent:
            x = parent.x() + parent.width() / 2 - self.width() / 2
            y = parent.y() + parent.height() / 2 - self.height() / 2
            self.setGeometry(x, y, self.width(), self.height())
    def __init__(self, img):
        QDialog.__init__(self, parent=None)
        self.ui = Ui_Dialog()
        self.ui.setupUi(self)

        self.pix = img.pixmap()
        self.ui.buttonBox.rejected.connect(self.close)
        self.ui.buttonBox.accepted.connect(self.save_image)
        self.ui.qrCodeLabel.setPixmap(self.pix)
Esempio n. 4
0
    def __init__(self, parent):
        QDialog.__init__(self, parent=parent)
        self.setupUi(self)
        self.StartDateEdit.setDate(QDate.currentDate().addMonths(-1))
        self.EndDateEdit.setDate(QDate.currentDate())

        # center dialog with respect to parent window
        x = parent.x() + parent.width() / 2 - self.width() / 2
        y = parent.y() + parent.height() / 2 - self.height() / 2
        self.setGeometry(x, y, self.width(), self.height())
Esempio n. 5
0
    def __init__(self):
        QDialog.__init__(self)

        if platform.system() == 'Darwin':
            self.stylesheet_path = "res/stylesheet.qss"
        else:
            self.stylesheet_path = "res/stylesheet-win-linux.qss"
        stylesheet = open(resource_path(self.stylesheet_path)).read()
        self.setStyleSheet(stylesheet)
        self.standard_names = []
        self.init_standard_names()

        self.setWindowTitle("Select A Region of Interest To Draw")
        self.setMinimumSize(350, 180)

        self.icon = QtGui.QIcon()
        self.icon.addPixmap(
            QtGui.QPixmap(resource_path("res/images/icon.ico")),
            QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.setWindowIcon(self.icon)

        self.explanation_text = QLabel("Search for ROI:")

        self.input_field = QLineEdit()
        self.input_field.textChanged.connect(self.on_text_edited)

        self.button_area = QWidget()
        self.cancel_button = QPushButton("Cancel")
        self.cancel_button.clicked.connect(self.on_cancel_clicked)
        self.begin_draw_button = QPushButton("Begin Draw Process")

        self.begin_draw_button.clicked.connect(self.on_begin_clicked)

        self.button_layout = QHBoxLayout()
        self.button_layout.addWidget(self.cancel_button)
        self.button_layout.addWidget(self.begin_draw_button)
        self.button_area.setLayout(self.button_layout)

        self.list_label = QLabel()
        self.list_label.setText("Select a Standard Region of Interest")

        self.list_of_ROIs = QListWidget()
        for standard_name in self.standard_names:
            self.list_of_ROIs.addItem(standard_name)

        self.layout = QVBoxLayout()
        self.layout.addWidget(self.explanation_text)
        self.layout.addWidget(self.input_field)
        self.layout.addWidget(self.list_label)
        self.layout.addWidget(self.list_of_ROIs)
        self.layout.addWidget(self.button_area)
        self.setLayout(self.layout)

        self.list_of_ROIs.clicked.connect(self.on_roi_clicked)
Esempio n. 6
0
    def __init__(self, parent, frontier):
        QDialog.__init__(self)
        self.setupUi(self)

        self.LastRadioButton.toggle()
        self.frontier = frontier
        frontier_text = datetime.utcfromtimestamp(frontier).strftime(
            '%d/%m/%Y')
        self.FrontierDateLabel.setText(frontier_text)
        self.CustomDateEdit.setDate(QDate.currentDate())

        # center dialog with respect to parent window
        x = parent.x() + parent.width() / 2 - self.width() / 2
        y = parent.y() + parent.height() / 2 - self.height() / 2
        self.setGeometry(x, y, self.width(), self.height())
Esempio n. 7
0
    def __init__(self):
        QDialog.__init__(self)
        self.setupUi(self)

        self.model = None
        self._previous_row = -1
        self.selected_id = 0
        self.p_selected_name = ''
        self._filter_text = ''
        self.selection_enabled = False
        self.group_id = None
        self.group_key_field = None
        self.group_key_index = None
        self.group_fkey_field = None
        self.filter_field = None
        self._filter_value = ''
        self.toggle_state = False
        self.toggle_field = None
        self.search_field = None
        self.search_text = ""
        self.tree_view = False
        self.toolbar = None
        self.custom_editor = False

        self.AddChildBtn.setVisible(False)
        self.GroupLbl.setVisible(False)
        self.GroupCombo.setVisible(False)
        self.SearchFrame.setVisible(False)

        self.AddBtn.setIcon(load_icon("add.png"))
        self.AddChildBtn.setIcon(load_icon("add_child.png"))
        self.RemoveBtn.setIcon(load_icon("delete.png"))
        self.CommitBtn.setIcon(load_icon("accept.png"))
        self.RevertBtn.setIcon(load_icon("cancel.png"))

        self.SearchString.textChanged.connect(self.OnSearchChange)
        self.GroupCombo.currentIndexChanged.connect(self.OnGroupChange)
        self.Toggle.stateChanged.connect(self.OnToggleChange)
        self.AddBtn.clicked.connect(self.OnAdd)
        self.AddChildBtn.clicked.connect(self.OnChildAdd)
        self.RemoveBtn.clicked.connect(self.OnRemove)
        self.CommitBtn.clicked.connect(self.OnCommit)
        self.RevertBtn.clicked.connect(self.OnRevert)
        self.DataView.doubleClicked.connect(self.OnDoubleClicked)
        self.DataView.clicked.connect(self.OnClicked)
        self.TreeView.doubleClicked.connect(self.OnDoubleClicked)
        self.TreeView.clicked.connect(self.OnClicked)
Esempio n. 8
0
    def __init__(self):
        QDialog.__init__(self)
        self.setupUi(self)
        self._asset_id = -1
        # Custom model to allow common submit errors handling and error message display
        self._model = AssetsListModel("assets", self)

        self._mapper = QDataWidgetMapper(self._model)
        self._mapper.setModel(self._model)
        self._mapper.setSubmitPolicy(QDataWidgetMapper.AutoSubmit)

        self._mapper.addMapping(self.NameEdit,
                                self._model.fieldIndex("full_name"))
        self._mapper.addMapping(self.isinEdit, self._model.fieldIndex("isin"))
        self._mapper.addMapping(self.TypeCombo,
                                self._model.fieldIndex("type_id"))
        self._mapper.addMapping(self.CountryCombo,
                                self._model.fieldIndex("country_id"))
        self._mapper.addMapping(self.BaseAssetSelector,
                                self._model.fieldIndex("base_asset"))

        self._model.select()

        self._symbols_model = SymbolsListModel("asset_tickers",
                                               self.SymbolsTable)
        self.SymbolsTable.setModel(self._symbols_model)
        self._symbols_model.select()
        self._symbols_model.configureView()

        self._data_model = ExtraDataModel("asset_data", self.DataTable)
        self.DataTable.setModel(self._data_model)
        self._data_model.select()
        self._data_model.configureView()

        self.AddSymbolButton.setIcon(load_icon("add.png"))
        self.RemoveSymbolButton.setIcon(load_icon("delete.png"))
        self.AddDataButton.setIcon(load_icon("add.png"))
        self.RemoveDataButton.setIcon(load_icon("delete.png"))
        self.OkButton.setIcon(load_icon("accept.png"))
        self.CancelButton.setIcon(load_icon("cancel.png"))

        self.TypeCombo.currentIndexChanged.connect(self.onTypeUpdate)
        self.AddSymbolButton.clicked.connect(self.onAddSymbol)
        self.RemoveSymbolButton.clicked.connect(self.onRemoveSymbol)
        self.AddDataButton.clicked.connect(self.onAddData)
        self.RemoveDataButton.clicked.connect(self.onRemoveData)
Esempio n. 9
0
    def __init__(self, description, current_account, recent_account=None):
        QDialog.__init__(self)
        self.setupUi(self)
        self.account_id = recent_account
        self.store_account = False
        self.current_account = current_account

        self.DescriptionLbl.setText(description)
        if self.account_id:
            self.AccountWidget.selected_id = self.account_id

        # center dialog with respect to main application window
        parent = None
        for widget in QApplication.topLevelWidgets():
            if widget.objectName() == Setup.MAIN_WND_NAME:
                parent = widget
        if parent:
            x = parent.x() + parent.width() / 2 - self.width() / 2
            y = parent.y() + parent.height() / 2 - self.height() / 2
            self.setGeometry(x, y, self.width(), self.height())
Esempio n. 10
0
    def __init__(self, parent=None):
        QDialog.__init__(self, parent=parent)
        self.setupUi(self)

        self.phone_number = ''
        self.web_session = requests.Session()
        self.web_session.headers['ClientVersion'] = '2.9.0'
        self.web_session.headers['Device-Id'] = str(uuid.uuid1())
        self.web_session.headers['Device-OS'] = 'Android'
        self.web_session.headers[
            'Content-Type'] = 'application/json; charset=UTF-8'
        self.web_session.headers['Accept-Encoding'] = 'gzip'
        self.web_session.headers['User-Agent'] = 'okhttp/4.2.2'
        self.web_profile = QWebEngineProfile()
        self.web_interceptor = RequestInterceptor()
        self.web_interceptor.response_intercepted.connect(self.response_esia)
        self.web_profile.setRequestInterceptor(self.web_interceptor)
        self.ESIAWebView.setPage(QWebEnginePage(self.web_profile, self))

        self.LoginMethodTabs.currentChanged.connect(self.on_tab_changed)
        self.GetCodeBtn.clicked.connect(self.send_sms)
        self.SMSLoginBtn.clicked.connect(self.login_sms)
        self.FNSLoginBtn.clicked.connect(self.login_fns)
Esempio n. 11
0
    def __init__(self, master):
        QDialog.__init__(self)
        self.setWindowTitle("Configuração")
        self.setFixedSize(200, 200)
        self.setWindowIcon(QIcon(r'images\icon6.ico'))
        self.setModal(True)

        button1 = QPushButton("Cancelar")
        button1.clicked.connect(self.closeDialog)
        button2 = QPushButton("Confirmar")
        button2.clicked.connect(lambda: self.saveAndClose(master))

        num_elementos = len(master.timedeltas)
        self.checkboxes = [0]*num_elementos
        for i in range(num_elementos):
            self.checkboxes[i] = QCheckBox(master.timedeltastr[i])

        # Organizando o layout
        grupo = QGroupBox("Incluir Precipitação Acumulada Em")
        grid = QGridLayout()
        for x in range(num_elementos):
            if x < num_elementos/2:
                grid.addWidget(self.checkboxes[x], x , 0)
            else:
                grid.addWidget(self.checkboxes[x], x - num_elementos/2, 1)
        #
        grupo.setLayout(grid)
        self.startCheckboxes(master)
        #
        sublayout = QHBoxLayout()
        sublayout.addWidget(button1)
        sublayout.addWidget(button2)
        #
        layout = QVBoxLayout()
        layout.addWidget(grupo)
        layout.addLayout(sublayout)
        self.setLayout(layout)
Esempio n. 12
0
    def __init__(self,
                 view: BinaryView,
                 typelibrary: TypeLibrary,
                 parent: QWidget = None):
        QDialog.__init__(self, parent,
                         QtCore.Qt.Dialog | QtCore.Qt.WindowFlags())
        self.lib = typelibrary
        self.view = view
        self.setWindowTitle(self.lib.name)

        self.layout = QVBoxLayout()
        self.button_layout = QWidget()
        self.button_layout.setLayout(QHBoxLayout())

        import_selected_button = QPushButton("Import Selected")
        QtCore.QObject.connect(import_selected_button,
                               QtCore.SIGNAL("clicked()"),
                               self.import_selected)

        import_all_button = QPushButton("Import All")
        QtCore.QObject.connect(import_all_button, QtCore.SIGNAL("clicked()"),
                               self.import_all)

        self.button_layout.layout().addWidget(import_selected_button)
        self.button_layout.layout().addWidget(import_all_button)
        self.layout.addWidget(self.button_layout)

        self.layout.addWidget(QLabel("Types"))
        self.types_table = TypeTableWidget(typelibrary.named_types, self)
        self.layout.addWidget(self.types_table)

        self.layout.addWidget(QLabel("Objects"))
        self.objects_table = TypeTableWidget(typelibrary.named_objects, self)
        self.layout.addWidget(self.objects_table)

        self.setLayout(self.layout)
Esempio n. 13
0
    def __init__(self, parent, data):
        assert type(data) == BinaryView
        self.bv = data
        QDialog.__init__(self, parent)

        debug_state = binjaplug.get_state(self.bv)

        self.setWindowTitle("Debug Adapter Settings")
        self.setMinimumSize(UIContext.getScaledWindowSize(400, 130))
        self.setAttribute(Qt.WA_DeleteOnClose)

        layout = QVBoxLayout()
        layout.setSpacing(0)

        titleLabel = QLabel("Adapter Settings")
        titleLayout = QHBoxLayout()
        titleLayout.setContentsMargins(0, 0, 0, 0)
        titleLayout.addWidget(titleLabel)

        self.adapterEntry = QPushButton(self)
        self.adapterMenu = QMenu(self)
        for adapter in DebugAdapter.ADAPTER_TYPE:
            if not DebugAdapter.ADAPTER_TYPE.can_use(adapter):
                continue

            def select_adapter(adapter):
                return lambda: self.selectAdapter(adapter)

            self.adapterMenu.addAction(adapter.name, select_adapter(adapter))
            if adapter == debug_state.adapter_type:
                self.adapterEntry.setText(adapter.name)

        self.adapterEntry.setMenu(self.adapterMenu)

        self.argumentsEntry = QLineEdit(self)
        self.addressEntry = QLineEdit(self)
        self.portEntry = QLineEdit(self)
        self.requestTerminalEmulator = QCheckBox(self)

        self.formLayout = QFormLayout()
        self.formLayout.addRow("Adapter Type", self.adapterEntry)
        self.formLayout.addRow("Command Line Arguments", self.argumentsEntry)
        self.formLayout.addRow("Address", self.addressEntry)
        self.formLayout.addRow("Port", self.portEntry)
        self.formLayout.addRow("Request Terminal Emulator",
                               self.requestTerminalEmulator)

        buttonLayout = QHBoxLayout()
        buttonLayout.setContentsMargins(0, 0, 0, 0)

        self.cancelButton = QPushButton("Cancel")
        self.cancelButton.clicked.connect(lambda: self.reject())
        self.acceptButton = QPushButton("Accept")
        self.acceptButton.clicked.connect(lambda: self.accept())
        self.acceptButton.setDefault(True)
        buttonLayout.addStretch(1)
        buttonLayout.addWidget(self.cancelButton)
        buttonLayout.addWidget(self.acceptButton)

        layout.addLayout(titleLayout)
        layout.addSpacing(10)
        layout.addLayout(self.formLayout)
        layout.addStretch(1)
        layout.addSpacing(10)
        layout.addLayout(buttonLayout)

        self.setLayout(layout)

        self.addressEntry.setText(debug_state.remote_host)
        self.portEntry.setText(str(debug_state.remote_port))

        self.addressEntry.textEdited.connect(lambda: self.apply())
        self.portEntry.textEdited.connect(lambda: self.apply())

        self.argumentsEntry.setText(' '.join(
            shlex.quote(arg) for arg in debug_state.command_line_args))
        self.argumentsEntry.textEdited.connect(lambda: self.updateArguments())

        self.requestTerminalEmulator.setChecked(
            debug_state.request_terminal_emulator)
        self.requestTerminalEmulator.stateChanged.connect(lambda: self.apply())

        self.accepted.connect(lambda: self.apply())
Esempio n. 14
0
 def __init__(self):
     QDialog.__init__(self)
     self.ui = Ui_AzanDialog
Esempio n. 15
0
 def __init__(self, parent: Any | None = None):
     QDialog.__init__(self, parent)
     UiLoad().loadUi("prefs.ui", self, parent)
     self.load_ui()
Esempio n. 16
0
    def __init__(self, existing_rtss, parent=None):
        QDialog.__init__(self, parent=parent)

        if platform.system() == 'Darwin':
            self.stylesheet_path = "res/stylesheet.qss"
        else:
            self.stylesheet_path = "res/stylesheet-win-linux.qss"
        stylesheet = open(resource_path(self.stylesheet_path)).read()
        self.setStyleSheet(stylesheet)

        self.setWindowTitle("Multiple RTSTRUCTs detected!")
        self.setMinimumSize(350, 180)

        self.icon = QtGui.QIcon()
        self.icon.addPixmap(
            QtGui.QPixmap(resource_path("res/images/icon.ico")),
            QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.setWindowIcon(self.icon)

        self.explanation_text = QLabel("Multiple RTSTRUCTs attached to the "
                                       "selected image set have been "
                                       "identified."
                                       "\nPlease select 1 "
                                       "RTSTRUCTs to continue!")

        # Create scrolling area widget to contain the content.
        self.scroll_area = QScrollArea()
        self.scroll_area.setWidgetResizable(True)

        self.scroll_area_content = QWidget(self.scroll_area)
        self.scroll_area.ensureWidgetVisible(self.scroll_area_content)

        # Create layout for checkboxes
        self.layout_content = QVBoxLayout(self.scroll_area_content)
        self.layout_content.setContentsMargins(5, 5, 5, 5)
        self.layout_content.setSpacing(0)
        self.layout_content.setAlignment(QtCore.Qt.AlignTop
                                         | QtCore.Qt.AlignTop)

        # Add all the attached RTSSs as checkboxes
        self.checkbox_group = QButtonGroup()
        self.checkbox_group.setExclusive(True)
        for i in range(len(existing_rtss)):
            checkbox = QCheckBox()
            checkbox.rtss = existing_rtss[i]
            rtss = dcmread(checkbox.rtss.get_files()[0])
            checkbox.setFocusPolicy(QtCore.Qt.NoFocus)
            checkbox.setText("Series: %s (%s, %s %s)" % (
                checkbox.rtss.series_description,
                checkbox.rtss.get_series_type(),
                len(rtss.StructureSetROISequence),
                "ROIs" if len(rtss.StructureSetROISequence) > 1 else "ROI"
            ))
            self.checkbox_group.addButton(checkbox)
            self.layout_content.addWidget(checkbox)
        self.checkbox_group.buttonClicked.connect(self.on_checkbox_clicked)

        # Create a cancel button
        self.cancel_button = QPushButton("Cancel")
        self.cancel_button.clicked.connect(self.on_cancel_clicked)

        # Create a continue button
        self.continue_button = QPushButton("Continue Process")
        self.continue_button.setDisabled(True)
        self.continue_button.clicked.connect(self.on_continue_clicked)

        # Create a widget to contain cancel and continue buttons
        self.button_area = QWidget()
        self.button_layout = QHBoxLayout()
        self.button_layout.addWidget(self.cancel_button)
        self.button_layout.addWidget(self.continue_button)
        self.button_area.setLayout(self.button_layout)

        # Add all components to a vertical layout
        self.layout = QVBoxLayout()
        self.layout.addWidget(self.explanation_text)
        self.layout.addWidget(self.scroll_area)
        self.layout.addWidget(self.button_area)
        self.setLayout(self.layout)