Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_open_recent_file(self):
constants.SETTINGS.setValue("recentFiles", [])
# Ensure we have at least one recent action
self.form.add_files([get_path_for_data_file("esaver.coco")])
self.assertEqual(len(self.form.signal_tab_controller.signal_frames), 1)
self.form.recentFileActionList[0].trigger()
self.assertEqual(len(self.form.signal_tab_controller.signal_frames), 2)
def closeEvent(self, event: QCloseEvent):
self.ui.lineEditParameters.editingFinished.emit()
constants.SETTINGS.setValue("{}/geometry".format(self.__class__.__name__), self.saveGeometry())
for gv in (self.ui.gVCarrier, self.ui.gVData, self.ui.gVModulated, self.ui.gVOriginalSignal):
# Eliminate graphic views to prevent segfaults
gv.eliminate()
super().closeEvent(event)
def on_btn_lock_bw_sr_clicked(self):
self.bw_sr_are_locked = self.ui.btnLockBWSR.isChecked()
constants.SETTINGS.setValue("lock_bandwidth_sample_rate", self.bw_sr_are_locked)
if self.bw_sr_are_locked:
self.ui.btnLockBWSR.setIcon(QIcon(":/icons/icons/lock.svg"))
self.ui.spinBoxBandwidth.setValue(self.ui.spinBoxSampleRate.value())
self.ui.spinBoxBandwidth.editingFinished.emit()
else:
self.ui.btnLockBWSR.setIcon(QIcon(":/icons/icons/unlock.svg"))
def closeEvent(self, event: QCloseEvent):
constants.SETTINGS.setValue("{}/geometry".format(self.__class__.__name__), self.saveGeometry())
super().closeEvent(event)
def closeEvent(self, event: QCloseEvent):
self.ui.tblViewRuleset.setItemDelegateForColumn(2, None)
self.ui.tblViewRuleset.setItemDelegateForColumn(3, None)
constants.SETTINGS.setValue("{}/geometry".format(self.__class__.__name__), self.saveGeometry())
super().closeEvent(event)
def save_enabled_states(self):
for plugin in self.model.plugins:
constants.SETTINGS.setValue(plugin.name, plugin.enabled)
def on_accepted(self):
if self.checked_radiobutton is not None:
bw_type = self.checked_radiobutton.objectName().replace("radioButton", "").replace("_", " ")
constants.SETTINGS.setValue("bandpass_filter_bw_type", bw_type)
constants.SETTINGS.setValue("bandpass_filter_custom_bw", self.ui.doubleSpinBoxCustomBandwidth.value())
def closeEvent(self, event: QCloseEvent):
constants.SETTINGS.setValue("{}/geometry".format(self.__class__.__name__), self.saveGeometry())
super().closeEvent(event)
def set_gnuradio_status(self):
self.backend_handler.python2_exe = self.ui.lineEditPython2Interpreter.text()
self.backend_handler.gnuradio_install_dir = self.ui.lineEditGnuradioDirectory.text()
constants.SETTINGS.setValue("gnuradio_install_dir", self.ui.lineEditGnuradioDirectory.text())
self.backend_handler.use_gnuradio_install_dir = self.ui.radioButtonGnuradioDirectory.isChecked()
self.backend_handler.set_gnuradio_installed_status()
constants.SETTINGS.setValue("use_gnuradio_install_dir", self.backend_handler.use_gnuradio_install_dir)
self.refresh_device_tab()