def __init__(self, parent=None): super().__init__(parent) self.setItemDelegateForColumn( 1, ComboBoxDelegate([""] * len(constants.LABEL_COLORS), colors=constants.LABEL_COLORS, parent=self)) self.setItemDelegateForColumn( 2, ComboBoxDelegate(ProtocolLabel.DISPLAY_FORMATS, parent=self)) orders = OrderedDict([ ("Big Endian (BE)", [bo + "/BE" for bo in ProtocolLabel.DISPLAY_BIT_ORDERS]), ("Little Endian (LE)", [bo + "/LE" for bo in ProtocolLabel.DISPLAY_BIT_ORDERS]) ]) self.setItemDelegateForColumn( 3, SectionComboBoxDelegate(orders, parent=self)) self.del_rows_action = QAction("Delete selected labels", self) self.del_rows_action.setShortcut(QKeySequence.Delete) self.del_rows_action.setIcon(QIcon.fromTheme("edit-delete")) self.del_rows_action.setShortcutContext(Qt.WidgetWithChildrenShortcut) self.del_rows_action.triggered.connect(self.delete_rows) self.addAction(self.del_rows_action)
def __init__(self, message_type: MessageType, parent=None): super().__init__(parent) self.ui = Ui_DialogMessageType() self.ui.setupUi(self) self.setAttribute(Qt.WA_DeleteOnClose) self.setWindowFlags(Qt.Window) operator_descriptions = list(OPERATION_DESCRIPTION.values()) operator_descriptions.sort() self.setWindowTitle(self.tr("Rules for {}".format(message_type.name))) self.message_type = message_type self.original_ruleset = copy.deepcopy(message_type.ruleset) self.original_assigned_status = message_type.assigned_by_ruleset self.ruleset_table_model = RulesetTableModel(message_type.ruleset, operator_descriptions, parent=self) self.ui.tblViewRuleset.setModel(self.ruleset_table_model) self.ui.btnRemoveRule.setEnabled(len(message_type.ruleset) > 0) self.set_ruleset_ui_status() self.ui.rbAssignAutomatically.setChecked(self.message_type.assigned_by_ruleset) self.ui.rbAssignManually.setChecked(self.message_type.assign_manually) self.ui.tblViewRuleset.setItemDelegateForColumn(2, ComboBoxDelegate(["Bit", "Hex", "ASCII"], parent=self)) self.ui.tblViewRuleset.setItemDelegateForColumn(3, ComboBoxDelegate(operator_descriptions, parent=self)) for i in range(len(message_type.ruleset)): self.open_editors(i) self.ui.cbRulesetMode.setCurrentIndex(self.message_type.ruleset.mode.value) self.create_connects() self.restoreGeometry(settings.read("{}/geometry".format(self.__class__.__name__), type=bytes))
def __init__(self, preselected_index, message: Message, viewtype: int, parent=None): super().__init__(parent) self.ui = Ui_DialogLabels() self.ui.setupUi(self) field_types = FieldType.load_from_xml() self.model = PLabelTableModel(message, field_types) self.preselected_index = preselected_index self.ui.tblViewProtoLabels.setItemDelegateForColumn( 0, ComboBoxDelegate([ft.caption for ft in field_types], is_editable=True, return_index=False, parent=self)) self.ui.tblViewProtoLabels.setItemDelegateForColumn( 1, SpinBoxDelegate(1, len(message), self)) self.ui.tblViewProtoLabels.setItemDelegateForColumn( 2, SpinBoxDelegate(1, len(message), self)) self.ui.tblViewProtoLabels.setItemDelegateForColumn( 3, ComboBoxDelegate([""] * len(constants.LABEL_COLORS), colors=constants.LABEL_COLORS, parent=self)) self.ui.tblViewProtoLabels.setItemDelegateForColumn( 4, CheckBoxDelegate(self)) self.ui.tblViewProtoLabels.setModel(self.model) self.ui.tblViewProtoLabels.selectRow(preselected_index) self.ui.tblViewProtoLabels.setEditTriggers( QAbstractItemView.AllEditTriggers) self.ui.tblViewProtoLabels.horizontalHeader().setSectionResizeMode( QHeaderView.Stretch) self.ui.tblViewProtoLabels.resizeColumnsToContents() self.setWindowFlags(Qt.Window) self.setWindowTitle( self.tr("Edit Protocol Labels from message type %s") % message.message_type.name) self.configure_special_config_tabs() self.ui.splitter.setSizes([self.height() / 2, self.height() / 2]) self.create_connects() self.ui.cbProtoView.setCurrentIndex(viewtype) self.setAttribute(Qt.WA_DeleteOnClose) try: self.restoreGeometry( constants.SETTINGS.value("{}/geometry".format( self.__class__.__name__))) except TypeError: pass for i in range(self.model.rowCount()): self.open_editors(i)
def __init__(self, installed_plugins, highlighted_plugins=None, parent=None): super().__init__(parent) self.backend_handler = BackendHandler() self.ui = Ui_DialogOptions() self.ui.setupUi(self) self.setAttribute(Qt.WA_DeleteOnClose) layout = QHBoxLayout(self.ui.tab_plugins) self.plugin_controller = PluginController(installed_plugins, highlighted_plugins, parent=self) layout.addWidget(self.plugin_controller) self.ui.tab_plugins.setLayout(layout) self.ui.labelWindowsError.setVisible(sys.platform == "win32" and platform.architecture()[0] != "64bit") self.ui.checkBoxAlignLabels.setChecked(constants.SETTINGS.value("align_labels", True, bool)) self.ui.checkBoxFallBackTheme.setChecked(constants.SETTINGS.value('use_fallback_theme', False, bool)) self.ui.checkBoxShowConfirmCloseDialog.setChecked(not constants.SETTINGS.value('not_show_close_dialog', False, bool)) self.ui.checkBoxHoldShiftToDrag.setChecked(constants.SETTINGS.value('hold_shift_to_drag', False, bool)) self.ui.checkBoxDefaultFuzzingPause.setChecked(constants.SETTINGS.value('use_default_fuzzing_pause', True, bool)) self.ui.radioButtonGnuradioDirectory.setChecked(self.backend_handler.use_gnuradio_install_dir) self.ui.radioButtonPython2Interpreter.setChecked(not self.backend_handler.use_gnuradio_install_dir) if self.backend_handler.gnuradio_install_dir: self.ui.lineEditGnuradioDirectory.setText(self.backend_handler.gnuradio_install_dir) if self.backend_handler.python2_exe: self.ui.lineEditPython2Interpreter.setText(self.backend_handler.python2_exe) self.ui.doubleSpinBoxFuzzingPause.setValue(constants.SETTINGS.value("default_fuzzing_pause", 10**6, int)) self.ui.doubleSpinBoxFuzzingPause.setEnabled(constants.SETTINGS.value('use_default_fuzzing_pause', True, bool)) completer = QCompleter() completer.setModel(QDirModel(completer)) self.ui.lineEditPython2Interpreter.setCompleter(completer) self.ui.lineEditGnuradioDirectory.setCompleter(completer) for dev_name in self.backend_handler.DEVICE_NAMES: self.ui.listWidgetDevices.addItem(dev_name) self.set_device_enabled_suffix() self.ui.listWidgetDevices.setCurrentRow(0) self.set_gnuradio_status() self.refresh_device_tab() self.create_connects() self.old_symbol_tresh = 10 self.old_show_pause_as_time = False self.field_type_table_model = FieldTypeTableModel([], parent=self) self.ui.tblLabeltypes.setModel(self.field_type_table_model) self.ui.tblLabeltypes.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch) self.ui.tblLabeltypes.setItemDelegateForColumn(1, ComboBoxDelegate([f.name for f in FieldType.Function], return_index=False, parent=self)) self.ui.tblLabeltypes.setItemDelegateForColumn(2, ComboBoxDelegate(ProtocolLabel.DISPLAY_FORMATS, parent=self)) self.read_options() self.old_default_view = self.ui.comboBoxDefaultView.currentIndex()
def __init__(self, preselected_index, message_type: MessageType, viewtype: int, max_end: int, parent=None): super().__init__(parent) self.ui = Ui_DialogLabels() self.ui.setupUi(self) field_types = FieldType.load_from_xml() self.model = PLabelTableModel(message_type, field_types) self.preselected_index = preselected_index self.ui.tblViewProtoLabels.setItemDelegateForColumn( 0, ComboBoxDelegate([ft.caption for ft in field_types], is_editable=True, return_index=False, parent=self)) self.ui.tblViewProtoLabels.setItemDelegateForColumn( 1, SpinBoxDelegate(1, max_end, self)) self.ui.tblViewProtoLabels.setItemDelegateForColumn( 2, SpinBoxDelegate(1, max_end, self)) self.ui.tblViewProtoLabels.setItemDelegateForColumn( 3, ComboBoxDelegate([""] * len(constants.LABEL_COLORS), colors=constants.LABEL_COLORS, parent=self)) self.ui.tblViewProtoLabels.setItemDelegateForColumn( 4, CheckBoxDelegate(self)) self.ui.tblViewProtoLabels.setModel(self.model) self.ui.tblViewProtoLabels.selectRow(preselected_index) self.ui.tblViewProtoLabels.horizontalHeader().setSectionResizeMode( QHeaderView.Stretch) for i in range(self.model.row_count): self.open_editors(i) self.ui.tblViewProtoLabels.resizeColumnsToContents() self.setWindowTitle( self.tr("Edit Protocol Labels from %s") % message_type.name) self.create_connects() self.ui.cbProtoView.setCurrentIndex(viewtype) self.setAttribute(Qt.WA_DeleteOnClose)
def update_field_name_column(self): field_types = [ft.caption for ft in self.field_types] self.ui.tblViewFieldValues.setItemDelegateForColumn( 0, ComboBoxDelegate(field_types, is_editable=True, return_index=False, parent=self.ui.tblViewFieldValues))
def refresh_participant_table(self): n = len(self.model().participants) items = [str(i) for i in range(n)] if len(items) >= 2: items[0] += " (low)" items[-1] += " (high)" for row in range(n): self.closePersistentEditor(self.model().index(row, 3)) self.setItemDelegateForColumn( 2, ComboBoxDelegate([""] * len(settings.PARTICIPANT_COLORS), colors=settings.PARTICIPANT_COLORS, parent=self)) self.setItemDelegateForColumn(3, ComboBoxDelegate(items, parent=self)) for row in range(n): self.openPersistentEditor(self.model().index(row, 2)) self.openPersistentEditor(self.model().index(row, 3))
def __init__(self, parent=None): super().__init__(parent) self.setItemDelegateForColumn( 1, ComboBoxDelegate(ProtocolLabel.DISPLAY_FORMATS, parent=self)) orders = OrderedDict([ ("Big Endian (BE)", [bo + "/BE" for bo in ProtocolLabel.DISPLAY_BIT_ORDERS]), ("Little Endian (LE)", [bo + "/LE" for bo in ProtocolLabel.DISPLAY_BIT_ORDERS]) ]) self.setItemDelegateForColumn( 2, SectionComboBoxDelegate(orders, parent=self)) self.setEditTriggers(QTableView.AllEditTriggers)
def __set_relative_rssi_delegate(self): n = len(self.participants) if n == 0: items = [] elif n == 1: items = ["0"] else: items = [str(i) for i in range(n)] items[0] += " (low)" items[-1] += " (high)" for row in range(len(self.participants)): self.ui.tblParticipants.closePersistentEditor(self.participant_table_model.index(row, 3)) self.ui.tblParticipants.setItemDelegateForColumn(3, ComboBoxDelegate(items, parent=self))
def __init__(self, preselected_index, proto_group: ProtocolGroup, offset: int, viewtype: int, parent=None): super().__init__(parent) self.ui = Ui_DialogLabels() self.ui.setupUi(self) self.model = PLabelTableModel(proto_group, offset) self.preselected_index = preselected_index if proto_group.num_blocks > 0: maxval = numpy.max([len(block) for block in proto_group.decoded_bits_str]) else: maxval = 42000 self.ui.tblViewProtoLabels.setItemDelegateForColumn(1, SpinBoxDelegate(1, maxval, self)) self.ui.tblViewProtoLabels.setItemDelegateForColumn(2, SpinBoxDelegate(1, maxval, self)) self.ui.tblViewProtoLabels.setItemDelegateForColumn(3, CheckBoxDelegate(self)) self.ui.tblViewProtoLabels.setItemDelegateForColumn(4, SpinBoxDelegate(offset+1, offset+proto_group.num_blocks, self)) self.ui.tblViewProtoLabels.setItemDelegateForColumn(5, ComboBoxDelegate([""] * len(constants.LABEL_COLORS), True, self)) self.ui.tblViewProtoLabels.setItemDelegateForColumn(6, CheckBoxDelegate(self)) self.ui.tblViewProtoLabels.setItemDelegateForColumn(7, DeleteButtonDelegate(self)) self.ui.tblViewProtoLabels.setModel(self.model) self.ui.tblViewProtoLabels.selectRow(preselected_index) for i in range(self.model.row_count): self.openEditors(i) self.ui.tblViewProtoLabels.resizeColumnsToContents() self.setWindowTitle(self.tr("Edit Protocol Labels from %s") % proto_group.name) self.create_connects() self.ui.cbProtoView.setCurrentIndex(viewtype) self.setAttribute(Qt.WA_DeleteOnClose)
def __init__(self, compare_frame_controller: CompareFrameController, generator_tab_controller: GeneratorTabController, project_manager: ProjectManager, parent): super().__init__(parent) self.project_manager = project_manager self.compare_frame_controller = compare_frame_controller self.generator_tab_controller = generator_tab_controller self.proto_analyzer = compare_frame_controller.proto_analyzer self.simulator_config = SimulatorConfiguration(self.project_manager) self.sim_expression_parser = SimulatorExpressionParser( self.simulator_config) SimulatorItem.simulator_config = self.simulator_config SimulatorItem.expression_parser = self.sim_expression_parser self.ui = Ui_SimulatorTab() self.ui.setupUi(self) util.set_splitter_stylesheet(self.ui.splitter) util.set_splitter_stylesheet(self.ui.splitterLeftRight) self.ui.splitter.setSizes([self.width() / 0.7, self.width() / 0.3]) self.ui.treeProtocols.setHeaderHidden(True) self.tree_model = self.generator_tab_controller.tree_model self.ui.treeProtocols.setModel(self.tree_model) self.participant_table_model = ParticipantTableModel( project_manager.participants) self.ui.tableViewParticipants.setModel(self.participant_table_model) self.participant_table_model.update() self.simulator_message_field_model = SimulatorMessageFieldModel(self) self.ui.tblViewFieldValues.setModel(self.simulator_message_field_model) self.ui.tblViewFieldValues.setItemDelegateForColumn( 1, ComboBoxDelegate(ProtocolLabel.DISPLAY_FORMATS, parent=self.ui.tblViewFieldValues)) self.ui.tblViewFieldValues.setItemDelegateForColumn( 2, ComboBoxDelegate(SimulatorProtocolLabel.VALUE_TYPES, parent=self.ui.tblViewFieldValues)) self.ui.tblViewFieldValues.setItemDelegateForColumn( 3, ProtocolValueDelegate(controller=self, parent=self.ui.tblViewFieldValues)) self.project_manager.reload_field_types() self.update_field_name_column() self.simulator_message_table_model = SimulatorMessageTableModel( self.project_manager, self) self.ui.tblViewMessage.setModel(self.simulator_message_table_model) self.ui.ruleCondLineEdit.setValidator( RuleExpressionValidator(self.sim_expression_parser, is_formula=False)) self.completer_model = QStringListModel([]) self.ui.ruleCondLineEdit.setCompleter( QCompleter(self.completer_model, self.ui.ruleCondLineEdit)) self.ui.ruleCondLineEdit.setToolTip( self.sim_expression_parser.rule_condition_help) self.simulator_scene = SimulatorScene( mode=0, simulator_config=self.simulator_config) self.simulator_scene.tree_root_item = compare_frame_controller.proto_tree_model.rootItem self.ui.gvSimulator.setScene(self.simulator_scene) self.ui.gvSimulator.setAlignment(Qt.AlignLeft | Qt.AlignTop) self.ui.gvSimulator.proto_analyzer = compare_frame_controller.proto_analyzer self.__active_item = None self.ui.listViewSimulate.setModel( SimulatorParticipantListModel(self.simulator_config)) self.ui.spinBoxNRepeat.setValue( self.project_manager.simulator_num_repeat) self.ui.spinBoxTimeout.setValue( self.project_manager.simulator_timeout_ms) self.ui.spinBoxRetries.setValue(self.project_manager.simulator_retries) self.ui.comboBoxError.setCurrentIndex( self.project_manager.simulator_error_handling_index) # place save/load button at corner of tab widget frame = QFrame(parent=self) frame.setLayout(QHBoxLayout()) frame.setFrameStyle(frame.NoFrame) self.ui.btnSave = QToolButton(self.ui.tab) self.ui.btnSave.setIcon(QIcon.fromTheme("document-save")) frame.layout().addWidget(self.ui.btnSave) self.ui.btnLoad = QToolButton(self.ui.tab) self.ui.btnLoad.setIcon(QIcon.fromTheme("document-open")) frame.layout().addWidget(self.ui.btnLoad) frame.layout().setContentsMargins(0, 0, 0, 0) self.ui.tabWidget.setCornerWidget(frame) self.ui.splitterLeftRight.setSizes( [0.2 * self.width(), 0.8 * self.width()]) self.create_connects()
def __init__(self, installed_plugins, highlighted_plugins=None, parent=None): super().__init__(parent) self.backend_handler = BackendHandler() self.ui = Ui_DialogOptions() self.ui.setupUi(self) self.setWindowFlags(Qt.Window) self.device_options_model = DeviceOptionsTableModel( self.backend_handler, self) self.device_options_model.update() self.ui.tblDevices.setModel(self.device_options_model) self.ui.tblDevices.horizontalHeader().setSectionResizeMode( QHeaderView.Stretch) self.ui.tblDevices.setItemDelegateForColumn( 1, ComboBoxDelegate(["native", "GNU Radio"])) self.setAttribute(Qt.WA_DeleteOnClose) layout = QHBoxLayout(self.ui.tab_plugins) self.plugin_controller = PluginFrame(installed_plugins, highlighted_plugins, parent=self) layout.addWidget(self.plugin_controller) self.ui.tab_plugins.setLayout(layout) self.ui.btnViewBuildLog.hide() self.build_log = "" # We use bundled native device backends on windows, so no need to reconfigure them self.ui.groupBoxNativeOptions.setVisible(sys.platform != "win32") self.ui.labelIconTheme.setVisible(sys.platform == "linux") self.ui.comboBoxIconTheme.setVisible(sys.platform == "linux") self.ui.comboBoxTheme.setCurrentIndex( settings.read("theme_index", 0, int)) self.ui.comboBoxIconTheme.setCurrentIndex( settings.read("icon_theme_index", 0, int)) self.ui.checkBoxShowConfirmCloseDialog.setChecked( not settings.read('not_show_close_dialog', False, bool)) self.ui.checkBoxHoldShiftToDrag.setChecked( settings.read('hold_shift_to_drag', True, bool)) self.ui.checkBoxDefaultFuzzingPause.setChecked( settings.read('use_default_fuzzing_pause', True, bool)) self.ui.checkBoxAlignLabels.setChecked( settings.read('align_labels', True, bool)) self.ui.doubleSpinBoxRAMThreshold.setValue( 100 * settings.read('ram_threshold', 0.6, float)) if self.backend_handler.gr_python_interpreter: self.ui.lineEditGRPythonInterpreter.setText( self.backend_handler.gr_python_interpreter) self.ui.doubleSpinBoxFuzzingPause.setValue( settings.read("default_fuzzing_pause", 10**6, int)) self.ui.doubleSpinBoxFuzzingPause.setEnabled( settings.read('use_default_fuzzing_pause', True, bool)) self.ui.checkBoxMultipleModulations.setChecked( settings.read("multiple_modulations", False, bool)) self.ui.radioButtonLowModulationAccuracy.setChecked( Modulator.get_dtype() == np.int8) self.ui.radioButtonMediumModulationAccuracy.setChecked( Modulator.get_dtype() == np.int16) self.ui.radioButtonHighModulationAccuracy.setChecked( Modulator.get_dtype() == np.float32) completer = QCompleter() completer.setModel(QDirModel(completer)) self.ui.lineEditGRPythonInterpreter.setCompleter(completer) self.ui.spinBoxFontSize.setValue(qApp.font().pointSize()) self.refresh_device_tab() self.create_connects() self.old_show_pause_as_time = False self.field_type_table_model = FieldTypeTableModel([], parent=self) self.ui.tblLabeltypes.setModel(self.field_type_table_model) self.ui.tblLabeltypes.horizontalHeader().setSectionResizeMode( QHeaderView.Stretch) self.ui.tblLabeltypes.setItemDelegateForColumn( 1, ComboBoxDelegate([f.name for f in FieldType.Function], return_index=False, parent=self)) self.ui.tblLabeltypes.setItemDelegateForColumn( 2, ComboBoxDelegate(ProtocolLabel.DISPLAY_FORMATS, parent=self)) self.read_options() self.old_default_view = self.ui.comboBoxDefaultView.currentIndex() self.old_num_sending_repeats = self.ui.spinBoxNumSendingRepeats.value() self.ui.labelRebuildNativeStatus.setText("") self.show_available_colormaps() try: self.restoreGeometry( settings.read("{}/geometry".format(self.__class__.__name__))) except TypeError: pass
def __init__(self, new_project=True, project_manager: ProjectManager = None, parent=None): super().__init__(parent) if not new_project: assert project_manager is not None self.ui = Ui_ProjectDialog() self.ui.setupUi(self) if new_project: self.participant_table_model = self.ProtocolParticipantModel([]) else: self.participant_table_model = self.ProtocolParticipantModel( project_manager.participants) self.ui.spinBoxSampleRate.setValue( project_manager.device_conf["sample_rate"]) self.ui.spinBoxFreq.setValue( project_manager.device_conf["frequency"]) self.ui.spinBoxBandwidth.setValue( project_manager.device_conf["bandwidth"]) self.ui.spinBoxGain.setValue(project_manager.device_conf["gain"]) self.ui.txtEdDescription.setPlainText(project_manager.description) self.ui.lineEdit_Path.setText(project_manager.project_path) self.ui.lineEditBroadcastAddress.setText( project_manager.broadcast_address_hex) self.ui.btnSelectPath.hide() self.ui.lineEdit_Path.setDisabled(True) self.setWindowTitle("Edit project settings") self.ui.lNewProject.setText("Edit project") self.ui.btnOK.setText("Accept") self.ui.tblParticipants.setModel(self.participant_table_model) self.ui.tblParticipants.setItemDelegateForColumn( 2, ComboBoxDelegate([""] * len(constants.PARTICIPANT_COLORS), colors=constants.PARTICIPANT_COLORS, parent=self)) self.__set_relative_rssi_delegate() "(([a-fA-F]|[0-9]){2}){3}" self.ui.lineEditBroadcastAddress.setValidator( QRegExpValidator(QRegExp("([a-fA-F ]|[0-9]){,}"))) self.sample_rate = self.ui.spinBoxSampleRate.value() self.freq = self.ui.spinBoxFreq.value() self.bandwidth = self.ui.spinBoxBandwidth.value() self.gain = self.ui.spinBoxGain.value() self.description = self.ui.txtEdDescription.toPlainText() self.broadcast_address_hex = self.ui.lineEditBroadcastAddress.text() self.ui.btnRemoveParticipant.setDisabled(len(self.participants) <= 1) self.path = self.ui.lineEdit_Path.text() self.new_project = new_project self.committed = False self.setModal(True) completer = QCompleter() completer.setModel(QDirModel(completer)) self.ui.lineEdit_Path.setCompleter(completer) self.create_connects() if new_project: self.ui.lineEdit_Path.setText( os.path.realpath(os.path.join(os.curdir, "new"))) self.on_line_edit_path_text_edited() self.open_editors() try: self.restoreGeometry( constants.SETTINGS.value("{}/geometry".format( self.__class__.__name__))) except TypeError: pass
def __init__(self, parent=None): super().__init__(parent) self.setItemDelegateForColumn( 1, ComboBoxDelegate(ProtocolLabel.DISPLAY_TYPES, False, self)) self.setEditTriggers(QTableView.AllEditTriggers)
def __init__(self, installed_plugins, highlighted_plugins=None, parent=None): super().__init__(parent) self.backend_handler = BackendHandler() self.ui = Ui_DialogOptions() self.ui.setupUi(self) self.setAttribute(Qt.WA_DeleteOnClose) layout = QHBoxLayout(self.ui.tab_plugins) self.plugin_controller = PluginFrame(installed_plugins, highlighted_plugins, parent=self) layout.addWidget(self.plugin_controller) self.ui.tab_plugins.setLayout(layout) self.ui.btnViewBuildLog.hide() self.build_log = "" # We use bundled native device backends on windows, so no need to reconfigure them self.ui.groupBoxNativeOptions.setVisible(sys.platform != "win32") self.ui.labelWindowsError.setVisible(sys.platform == "win32" and platform.architecture()[0] != "64bit") self.ui.labelIconTheme.setVisible(sys.platform == "linux") self.ui.comboBoxIconTheme.setVisible(sys.platform == "linux") self.ui.comboBoxTheme.setCurrentIndex(constants.SETTINGS.value("theme_index", 0, int)) self.ui.comboBoxIconTheme.setCurrentIndex(constants.SETTINGS.value("icon_theme_index", 0, int)) self.ui.checkBoxShowConfirmCloseDialog.setChecked( not constants.SETTINGS.value('not_show_close_dialog', False, bool)) self.ui.checkBoxHoldShiftToDrag.setChecked(constants.SETTINGS.value('hold_shift_to_drag', True, bool)) self.ui.checkBoxDefaultFuzzingPause.setChecked( constants.SETTINGS.value('use_default_fuzzing_pause', True, bool)) self.ui.checkBoxAlignLabels.setChecked(constants.SETTINGS.value('align_labels', True, bool)) self.ui.doubleSpinBoxRAMThreshold.setValue(100 * constants.SETTINGS.value('ram_threshold', 0.6, float)) self.ui.radioButtonGnuradioDirectory.setChecked(self.backend_handler.use_gnuradio_install_dir) self.ui.radioButtonPython2Interpreter.setChecked(not self.backend_handler.use_gnuradio_install_dir) if self.backend_handler.gnuradio_install_dir: self.ui.lineEditGnuradioDirectory.setText(self.backend_handler.gnuradio_install_dir) if self.backend_handler.python2_exe: self.ui.lineEditPython2Interpreter.setText(self.backend_handler.python2_exe) self.ui.doubleSpinBoxFuzzingPause.setValue(constants.SETTINGS.value("default_fuzzing_pause", 10 ** 6, int)) self.ui.doubleSpinBoxFuzzingPause.setEnabled(constants.SETTINGS.value('use_default_fuzzing_pause', True, bool)) self.ui.checkBoxMultipleModulations.setChecked(constants.SETTINGS.value("multiple_modulations", False, bool)) completer = QCompleter() completer.setModel(QDirModel(completer)) self.ui.lineEditPython2Interpreter.setCompleter(completer) self.ui.lineEditGnuradioDirectory.setCompleter(completer) for dev_name in self.backend_handler.DEVICE_NAMES: self.ui.listWidgetDevices.addItem(dev_name) self.set_device_status() self.ui.listWidgetDevices.setCurrentRow(0) self.refresh_device_tab() self.create_connects() self.old_show_pause_as_time = False self.field_type_table_model = FieldTypeTableModel([], parent=self) self.ui.tblLabeltypes.setModel(self.field_type_table_model) self.ui.tblLabeltypes.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch) self.ui.tblLabeltypes.setItemDelegateForColumn(1, ComboBoxDelegate([f.name for f in FieldType.Function], return_index=False, parent=self)) self.ui.tblLabeltypes.setItemDelegateForColumn(2, ComboBoxDelegate(ProtocolLabel.DISPLAY_FORMATS, parent=self)) self.read_options() self.old_default_view = self.ui.comboBoxDefaultView.currentIndex() self.old_num_sending_repeats = self.ui.spinBoxNumSendingRepeats.value() self.ui.labelRebuildNativeStatus.setText("") self.show_available_colormaps() try: self.restoreGeometry(constants.SETTINGS.value("{}/geometry".format(self.__class__.__name__))) except TypeError: pass