This commit is contained in:
2025-07-15 21:00:09 +02:00
parent fdfe0948fe
commit 84b315dad5
5 changed files with 4 additions and 53 deletions

View File

@ -86,9 +86,7 @@ class MainWindow(QtWidgets.QMainWindow):
self.settings = self.get_defaults()
self.save_settings(self.profile)
self.populate_profiles()
self.ui.combo_profile.setCurrentText(self.profile)
self.on_combo_profile_changed(self.profile)
self.ui.combo_port.setCurrentText(self.settings.get("device", "Auto"))
def on_pb_delete_profile(self):
"""Delete the currently selected profile and load the previous one, or defaults if none remain."""
@ -220,11 +218,13 @@ class MainWindow(QtWidgets.QMainWindow):
for fname in os.listdir(config_dir):
if fname.endswith('.json'):
profiles.append(fname[:-5])
self.ui.combo_profile.blockSignals(True)
self.ui.combo_profile.clear()
self.ui.combo_profile.addItems(sorted(profiles))
# Optionally, set current profile
if self.profile in profiles:
self.ui.combo_profile.setCurrentText(self.profile)
self.ui.combo_profile.blockSignals(False)
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)