diff --git a/app/attributes/attributecontroller.h b/app/attributes/attributecontroller.h index 9915b3e46..59535feb5 100644 --- a/app/attributes/attributecontroller.h +++ b/app/attributes/attributecontroller.h @@ -60,6 +60,9 @@ class AttributeController : public QObject */ Q_PROPERTY( FeatureLayerPair featureLayerPair READ featureLayerPair WRITE setFeatureLayerPair NOTIFY featureLayerPairChanged ) + //! Returns TRUE if the feature has not been saved yet (has a new/null feature id) + Q_PROPERTY( bool isNewFeature READ isNewFeature NOTIFY featureLayerPairChanged ) + // this is never nullptr (a form with no tabs will be parsed as having a single tab) Q_PROPERTY( AttributeTabProxyModel *attributeTabProxyModel READ attributeTabProxyModel NOTIFY attributeTabProxyModelChanged ) diff --git a/app/qml/dialogs/MMRemovePhotoDialog.qml b/app/qml/dialogs/MMRemovePhotoDialog.qml index 20885cbdd..f0d321d79 100644 --- a/app/qml/dialogs/MMRemovePhotoDialog.qml +++ b/app/qml/dialogs/MMRemovePhotoDialog.qml @@ -18,10 +18,11 @@ MMDrawerDialog { signal unlinkImage() property string imagePath + property bool offerUnlinkOption: true imageSource: __style.negativeMMSymbolImage title: qsTr( "Delete photo?" ) - description: qsTr( "Would you like to delete or unlink the photo? Deleting removes the photo from your project entirely, while unlinking keeps the photo in your project but removes it from this specific feature." ) + description: root.offerUnlinkOption ? qsTr( "Would you like to delete or unlink the photo? Deleting removes the photo from your project entirely, while unlinking keeps the photo in your project but removes it from this specific feature." ) : qsTr( "Would you like to delete the photo?" ) primaryButton { text: qsTr( "Delete photo" ) @@ -35,6 +36,8 @@ MMDrawerDialog { secondaryButton { text: qsTr( "Unlink photo" ) + visible: root.offerUnlinkOption + fontColor: __style.grapeColor fontColorHover: __style.negativeColor } diff --git a/app/qml/form/editors/MMFormPhotoEditor.qml b/app/qml/form/editors/MMFormPhotoEditor.qml index 621559d4e..71dc72730 100644 --- a/app/qml/form/editors/MMFormPhotoEditor.qml +++ b/app/qml/form/editors/MMFormPhotoEditor.qml @@ -129,6 +129,7 @@ MMFormPhotoViewer { id: imageDeleteDialog property string imagePath + offerUnlinkOption: !root._fieldController.isNewFeature onDeleteImage: { // schedule the image for deletion