Refactor SelectFileDialog and SettingsTab for improved metadata handling and UI consistency

- Removed unused local_settings reference from qmldir.
- Enhanced SelectFileDialog to include a masterTypeFieldText property for better metadata representation.
- Updated normalizedRows to merge settingsModel.masters with sidecar data for dynamic UI updates.
- Adjusted column headers and removed the save button from the table model for a cleaner interface.
- Modified SettingsTab to streamline CSV file handling and ensure settings are saved upon updates.
This commit is contained in:
Jack.Le
2026-05-05 09:59:18 -07:00
parent b338eedb13
commit bbe7baea5b
3 changed files with 86 additions and 94 deletions
+12 -6
View File
@@ -23,8 +23,7 @@ Item {
}
function handleCsvSelected(filePath) {
console.log("Doing work with:", filePath);
// @todo: implement CSV metadata handling after file selection.
// Selection confirmed — metadata editing is handled inline inside SelectFileDialog.
}
// ===== Settings Data Helpers =====
@@ -136,7 +135,7 @@ Item {
title: "Choose Master CSV"
nameFilters: ["CSV files (*.csv)"]
property string targetFamily: ""
onAccepted: settingsModel.setMaster(targetFamily, selectedFile.toLocalFile())
onAccepted: settingsModel.setMaster(targetFamily, String(selectedFile).replace(/^file:\/\//, ""))
}
// ===== Settings Page Layout =====
@@ -206,7 +205,6 @@ Item {
Layout.minimumWidth: Theme.settingsFieldMinWidth
placeholderText: "Enter chamber ID"
text: settingsModel.chamberId
onEditingFinished: settingsModel.setChamberId(text)
Connections {
target: settingsModel
@@ -222,7 +220,10 @@ Item {
text: "Set"
Layout.preferredWidth: 90
Layout.preferredHeight: Theme.settingsButtonHeight
onClicked: settingsModel.setChamberId(chamberField.text)
onClicked: {
settingsModel.setChamberId(chamberField.text);
settingsModel.saveSettings();
}
}
}
}
@@ -389,6 +390,11 @@ Item {
Layout.fillWidth: true
}
}
// Bottom spacer so last group isn't flush with scroll edge
Item {
Layout.preferredHeight: Theme.settingsSectionSpacing
}
}
}
@@ -406,7 +412,7 @@ Item {
}
GradientStop {
position: 1.0
color: Qt.transparent
color: Qt.rgba(0, 0, 0, 0)
}
}