def plugin_browse_clicked(self): last_dir = get_home_path() if len(self.edit_custom_plugin.text()) > 0: last_dir = os.path.dirname(os.path.realpath(self.edit_custom_plugin.text())) filename = get_open_file_name(get_main_window(), 'Open Plugin', last_dir, '*.bin') if len(filename) > 0: self.edit_custom_plugin.setText(filename)
def sample_file_clicked(self): if len(self.sample_edit.text()) > 0: last_dir = os.path.dirname(os.path.realpath(self.sample_edit.text())) else: last_dir = get_home_path() filename = get_open_file_name(get_main_window(), "Open Sample Points", last_dir) if len(filename) > 0: self.sample_edit.setText(filename)
def firmware_browse_clicked(self): if len(self.edit_custom_firmware.text()) > 0: last_dir = os.path.dirname(os.path.realpath(self.edit_custom_firmware.text())) else: last_dir = get_home_path() filename = get_open_file_name(get_main_window(), 'Open Firmware', last_dir, '*.bin') if len(filename) > 0: self.edit_custom_firmware.setText(filename)
def private_key_browse_clicked(self): if len(self.wifi_private_key_url.text()) > 0: last_dir = os.path.dirname(os.path.realpath(self.wifi_private_key_url.text())) else: last_dir = get_home_path() filename = get_open_file_name(get_main_window(), 'Open Private Key', last_dir) if len(filename) > 0: self.wifi_private_key_url.setText(filename)
def client_certificate_browse_clicked(self): if len(self.wifi_client_certificate_url.text()) > 0: last_dir = os.path.dirname(os.path.realpath(self.wifi_client_certificate_url.text())) else: last_dir = get_home_path() filename = get_open_file_name(get_main_window(), 'Open Client Certificate', last_dir) if len(filename) > 0: self.wifi_client_certificate_url.setText(filename)
def browse_archive(self): if len(self.edit_archive.text()) > 0: last_directory = os.path.dirname(os.path.realpath(self.edit_archive.text())) else: last_directory = get_home_path() filename = get_open_file_name(get_main_window(), 'Open Archive', last_directory, '*.tfrba') if len(filename) > 0: self.edit_archive.setText(filename) self.refresh_program_list()
def btn_load_config_clicked(self): filename = get_open_file_name(get_main_window(), 'Load Config', get_home_path(), 'JSON Files (*.json)') if len(filename) == 0: return config = load_and_validate_config(filename) if config == None: QMessageBox.warning(get_main_window(), 'Load Config', 'Could not load config from file! See Debug tab for details.', QMessageBox.Ok) return self.update_setup_tab(config) self.update_devices_tab(config)
def btn_load_config_clicked(self): filename = get_open_file_name(self, 'Load Config', get_home_path(), 'JSON Files(*.json);;All Files(*)') if len(filename) == 0: return config = load_and_validate_config(filename) if config == None: QMessageBox.warning(self, 'Load Config', 'Could not load config from file! See Debug tab for details.', QMessageBox.Ok) return self.update_setup_tab(config) self.update_devices_tab(config)