Make open CSV more friendly & add help button

This commit is contained in:
Alex Spataru 2021-02-04 23:40:32 -05:00
parent 25fe286355
commit d3f8774278
2 changed files with 28 additions and 13 deletions

View File

@ -133,11 +133,18 @@ Control {
Behavior on opacity {NumberAnimation{}}
text: Cpp_Misc_Translator.dummy +
(Cpp_JSON_Generator.jsonMapFilename.length ? qsTr("Change map file (%1)").arg(Cpp_JSON_Generator.jsonMapFilename) :
qsTr("Select map file") + "...")
qsTr("Select map file") + "...")
}
//
// CSV options
// Spacer
//
Item {
height: app.spacing / 2
}
//
// Enable/disable CSV logging
//
RowLayout {
Layout.fillWidth: true
@ -148,19 +155,21 @@ Control {
palette.highlight: "#2e895c"
Layout.leftMargin: -app.spacing
Layout.alignment: Qt.AlignVCenter
text: qsTr("CSV Export") + Cpp_Misc_Translator.dummy
text: qsTr("Create CSV file") + Cpp_Misc_Translator.dummy
onCheckedChanged: Cpp_CSV_Export.exportEnabled = checked
}
Button {
Item {
Layout.fillWidth: true
opacity: enabled ? 1 : 0.5
enabled: commManual.checked
onClicked: Cpp_CSV_Player.openFile()
Layout.alignment: Qt.AlignVCenter
text: qsTr("CSV Player") + Cpp_Misc_Translator.dummy
}
Behavior on opacity {NumberAnimation{}}
RoundButton {
icon.width: 24
icon.height: 24
icon.color: "#fff"
icon.source: "qrc:/icons/help.svg"
Layout.alignment: Qt.AlignVCenter
onClicked: Qt.openUrlExternally("https://github.com/Serial-Studio/Serial-Studio/wiki")
}
}
@ -168,7 +177,7 @@ Control {
// Spacer
//
Item {
height: app.spacing * 2
height: app.spacing / 2
}
//

View File

@ -162,12 +162,18 @@ Control {
icon.height: 24
Layout.fillHeight: true
icon.color: palette.text
enabled: Cpp_CSV_Export.isOpen
opacity: enabled ? 1 : 0.5
enabled: !Cpp_CSV_Player.isOpen
icon.source: "qrc:/icons/open.svg"
onClicked: Cpp_CSV_Export.openCurrentCsv()
text: qsTr("Open CSV") + _btSpacer + Cpp_Misc_Translator.dummy
onClicked: {
if (Cpp_CSV_Export.isOpen)
Cpp_CSV_Export.openCurrentCsv()
else
Cpp_CSV_Player.openFile()
}
Behavior on opacity {NumberAnimation{}}
}