Skip to content

Commit

Permalink
Relocate toggle to sit below the 3 action buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Feb 25, 2024
1 parent d040fc7 commit d495763
Showing 1 changed file with 53 additions and 53 deletions.
106 changes: 53 additions & 53 deletions src/qml/QFieldCloudPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,59 @@ Popup {
onClicked: projectUpload(false)
}

Text {
id: pushText
font: Theme.tipFont
color: Theme.secondaryTextColor
visible: !cloudProjectsModel.layerObserver.deltaFileWrapper.hasError()
text: qsTr('Save internet bandwidth by only pushing the local features and pictures to the cloud, without updating the whole project.')
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
Layout.bottomMargin: 20
Layout.fillWidth: true
}

QfButton {
id: discardButton
Layout.fillWidth: true
bgcolor: Theme.darkRed
text: !cloudProjectsModel.layerObserver.deltaFileWrapper.hasError()
? qsTr('Revert local changes')
: qsTr('Reset project')
enabled: cloudProjectsModel.layerObserver.deltaFileWrapper.count > 0 || cloudProjectsModel.layerObserver.deltaFileWrapper.hasError()
icon.source: Theme.getThemeVectorIcon('ic_undo_black_24dp')

onClicked: {
if (!cloudProjectsModel.layerObserver.deltaFileWrapper.hasError()) {
revertDialog.open();
} else {
resetDialog.open();
}
}
}

Text {
id: discardText
font: Theme.tipFont
color: Theme.secondaryTextColor
text: !cloudProjectsModel.layerObserver.deltaFileWrapper.hasError()
? qsTr('Revert all modified features in the local layers. You cannot restore those changes.')
: qsTr('The local copy of this cloud project has been corrupted. Resetting the project will re-download the cloud version and will remove any local changes, make sure those were copied first if needed.\n\nWhile you can still view and use the project, it is strongly recommended to reset to avoid any accidental data loss as none of the changes made will be pushed back to the cloud.')
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
Layout.bottomMargin: 10
Layout.fillWidth: true
}

Rectangle {
color: Theme.controlBorderColor
height: 1
Layout.fillWidth: true
Layout.leftMargin: 10
Layout.rightMargin: 10
Layout.bottomMargin: 5
}

RowLayout {
Layout.leftMargin: 10
Layout.rightMargin: 10
Expand Down Expand Up @@ -473,59 +526,6 @@ Popup {
}
}

Text {
id: pushText
font: Theme.tipFont
color: Theme.secondaryTextColor
visible: !cloudProjectsModel.layerObserver.deltaFileWrapper.hasError()
text: qsTr('Save internet bandwidth by only pushing the local features and pictures to the cloud, without updating the whole project.')
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
Layout.bottomMargin: 20
Layout.fillWidth: true
}

QfButton {
id: discardButton
Layout.fillWidth: true
bgcolor: Theme.darkRed
text: !cloudProjectsModel.layerObserver.deltaFileWrapper.hasError()
? qsTr('Revert local changes')
: qsTr('Reset project')
enabled: cloudProjectsModel.layerObserver.deltaFileWrapper.count > 0 || cloudProjectsModel.layerObserver.deltaFileWrapper.hasError()
icon.source: Theme.getThemeVectorIcon('ic_undo_black_24dp')

onClicked: {
if (!cloudProjectsModel.layerObserver.deltaFileWrapper.hasError()) {
revertDialog.open();
} else {
resetDialog.open();
}
}
}

Text {
id: discardText
font: Theme.tipFont
color: Theme.secondaryTextColor
text: !cloudProjectsModel.layerObserver.deltaFileWrapper.hasError()
? qsTr('Revert all modified features in the local layers. You cannot restore those changes.')
: qsTr('The local copy of this cloud project has been corrupted. Resetting the project will re-download the cloud version and will remove any local changes, make sure those were copied first if needed.\n\nWhile you can still view and use the project, it is strongly recommended to reset to avoid any accidental data loss as none of the changes made will be pushed back to the cloud.')
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
Layout.bottomMargin: 10
Layout.fillWidth: true
}

Rectangle {
color: Theme.controlBorderColor
height: 1
Layout.fillWidth: true
Layout.leftMargin: 10
Layout.rightMargin: 10
Layout.bottomMargin: 5
}

Text {
id: lastExportPushText
font: Theme.tipFont
Expand Down

0 comments on commit d495763

Please sign in to comment.