summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Lundblad <ml@dfupdate.se>2023-03-25 17:01:23 +0100
committerMarcus Lundblad <ml@dfupdate.se>2023-03-26 22:50:52 +0200
commitc20ca10d4311f4954f4beaadebecc8120ae7d49a (patch)
tree6689b367d57283a5f5ab1af71ffde84d5bb43898
parent4d17f100fcc4e8990eab64d0cdde99c8565a16bb (diff)
downloadgnome-maps-c20ca10d4311f4954f4beaadebecc8120ae7d49a.tar.gz
osmEditDialog: Replace MessageDialog with a toast
Replace the Gtk.MessageDialog on error with an Adw.Toast.
-rw-r--r--src/osmEditDialog.js13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/osmEditDialog.js b/src/osmEditDialog.js
index b5e2ea50..5b60ce89 100644
--- a/src/osmEditDialog.js
+++ b/src/osmEditDialog.js
@@ -559,17 +559,8 @@ export class OSMEditDialog extends Gtk.Dialog {
* a generic error message for the HTTP status code */
let statusMessage =
error ? error.message : OSMConnection.getStatusMessage(status);
- let messageDialog =
- new Gtk.MessageDialog({ transient_for: this.get_root(),
- destroy_with_parent: true,
- message_type: Gtk.MessageType.ERROR,
- buttons: Gtk.ButtonsType.OK,
- modal: true,
- text: _("An error has occurred"),
- secondary_text: statusMessage });
-
- messageDialog.connect('response', () => messageDialog.destroy());
- messageDialog.show();
+
+ this.transient_for.showToast(statusMessage);
this.response(OSMEditDialog.Response.ERROR);
}