dedup qml: move accessible properties to MyButton

This commit is contained in:
Justin Wang 2023-05-23 17:26:49 +02:00 committed by AT
parent eb6a7cca47
commit e3d6eb334b
6 changed files with 5 additions and 22 deletions

View File

@ -234,12 +234,10 @@ Dialog {
text: "Remove"
anchors.right: parent.right
anchors.rightMargin: 20
Accessible.description: qsTr("Remove button to remove model from filesystem")
onClicked: {
Download.removeModel(modelData.filename);
}
Accessible.role: Accessible.Button
Accessible.name: qsTr("Remove button")
Accessible.description: qsTr("Remove button to remove model from filesystem")
}
}
@ -298,6 +296,7 @@ Dialog {
anchors.topMargin: 15
anchors.rightMargin: 20
visible: !modelData.isChatGPT && !modelData.installed && !modelData.calcHash
Accessible.description: qsTr("Cancel/Download button to stop/start the download")
onClicked: {
if (!downloading) {
downloading = true;
@ -307,9 +306,6 @@ Dialog {
Download.cancelDownload(modelData.filename);
}
}
Accessible.role: Accessible.Button
Accessible.name: text
Accessible.description: qsTr("Cancel/Download button to stop/start the download")
}
}
@ -420,8 +416,6 @@ Dialog {
}
MyButton {
text: qsTr("Browse")
Accessible.role: Accessible.Button
Accessible.name: text
Accessible.description: qsTr("Opens a folder picker dialog to choose where to save model files")
onClicked: modelPathDialog.open()
}

View File

@ -20,4 +20,6 @@ Button {
radius: 10
color: theme.backgroundLight
}
Accessible.role: Accessible.Button
Accessible.name: text
}

View File

@ -119,15 +119,11 @@ NOTE: By turning on this feature, you will be sending your data to the GPT4All O
spacing: 10
MyButton {
text: qsTr("Enable")
Accessible.role: Accessible.Button
Accessible.name: text
Accessible.description: qsTr("Enable opt-in button")
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
}
MyButton {
text: qsTr("Cancel")
Accessible.role: Accessible.Button
Accessible.name: text
Accessible.description: qsTr("Cancel opt-in button")
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
}

View File

@ -50,6 +50,7 @@ Dialog {
anchors.verticalCenter: label.verticalCenter
padding: 20
text: qsTr("Update")
Accessible.description: qsTr("Update to new version")
onClicked: {
if (!LLM.checkForUpdates())
checkForUpdatesError.open()

View File

@ -530,8 +530,6 @@ Dialog {
Layout.column: 1
Layout.fillWidth: true
text: qsTr("Restore Defaults")
Accessible.role: Accessible.Button
Accessible.name: text
Accessible.description: qsTr("Restores the settings dialog to a default state")
onClicked: {
settingsDialog.restoreGenerationDefaults()
@ -646,8 +644,6 @@ Dialog {
Layout.row: 2
Layout.column: 2
text: qsTr("Browse")
Accessible.role: Accessible.Button
Accessible.name: text
Accessible.description: qsTr("Opens a folder picker dialog to choose where to save model files")
onClicked: modelPathDialog.open()
}
@ -747,8 +743,6 @@ Dialog {
Layout.column: 1
Layout.fillWidth: true
text: qsTr("Restore Defaults")
Accessible.role: Accessible.Button
Accessible.name: text
Accessible.description: qsTr("Restores the settings dialog to a default state")
onClicked: {
settingsDialog.restoreApplicationDefaults()

View File

@ -79,15 +79,11 @@ Dialog {
spacing: 10
MyButton {
text: qsTr("Submit")
Accessible.role: Accessible.Button
Accessible.name: text
Accessible.description: qsTr("Submits the user's response")
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
}
MyButton {
text: qsTr("Cancel")
Accessible.role: Accessible.Button
Accessible.name: text
Accessible.description: qsTr("Closes the response dialog")
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
}