WIP
This commit is contained in:
6
main.py
6
main.py
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user