[meld] filediff: Migrate save handling to new error dialog helper
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] filediff: Migrate save handling to new error dialog helper
- Date: Wed, 31 Dec 2014 23:32:41 +0000 (UTC)
commit 3add7ef47c2456c912ee380be4edb711cc0a586b
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Dec 14 06:52:54 2014 +1000
filediff: Migrate save handling to new error dialog helper
meld/filediff.py | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 614b66c..c7a5086 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1601,10 +1601,12 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
def _save_text_to_filename(self, filename, text):
try:
open(filename, "wb").write(text)
- except IOError as e:
- misc.run_dialog(
- _("Error writing to %s\n\n%s.") % (filename, e),
- self, Gtk.MessageType.ERROR, Gtk.ButtonsType.OK)
+ except IOError as err:
+ misc.error_dialog(
+ primary=_("Could not save file %s.") % filename,
+ secondary=_("Couldn't save file due to:\n%s") % (
+ GLib.markup_escape_text(str(err))),
+ )
return False
return True
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]