Commit ce45cbdb authored by Flavio TARSETTI's avatar Flavio TARSETTI
Browse files

[widgets] Improve dialog boxes for deleted/updated asset widgets

Fixes #241
parent 5a4d7eb2
Pipeline #37663 passed with stage
in 6 minutes and 24 seconds
......@@ -333,8 +333,8 @@ class AssetWidget(QWidget):
if self.current_editor.isDirty():
answer = QMessageBox.question(
self,
self.tr(f"Save {self.current_asset.name} ?"),
self.tr("Content changed.\n" "Do you want to save ?"),
self.tr("Save changed content"),
self.tr(f"Content changed.\nSave {self.current_asset.name} ?"),
)
if answer == QMessageBox.Yes:
......@@ -371,7 +371,7 @@ class AssetWidget(QWidget):
self,
self.tr("Deletion requested"),
self.tr(
"You are about to delete the asset you are currently editing\n\nAre you sure you want to do that ?"
f"You are about to delete the asset {self.current_asset.name} you are currently editing\n\nAre you sure you want to do that ?"
),
)
if answer == QMessageBox.No:
......@@ -384,16 +384,17 @@ class AssetWidget(QWidget):
self.current_asset = None
else:
# Check before deletion
asset = Asset.from_path(self.prefix_root_path, file_path)
asset_type = str(asset.type).split("AssetType.")[1].lower()
answer = QMessageBox.question(
self,
self.tr("Deletion requested"),
self.tr(
"You are about to delete an asset\n\nAre you sure you want to do that ?"
f"You are about to delete an asset of type {asset_type} named {asset.name}.\n\nAre you sure you want to do that ?"
),
)
if answer == QMessageBox.No:
return
asset = Asset.from_path(self.prefix_root_path, file_path)
asset.delete()
def confirm_loading(self, errors):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment