[meld] filediff: Replace old replace-confirm dialog
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] filediff: Replace old replace-confirm dialog
- Date: Wed, 31 Dec 2014 23:33:07 +0000 (UTC)
commit 2e5305cc45fb4c224f8cee417aeedd525586c0c0
Author: Kai Willadsen <kai willadsen gmail com>
Date: Mon Dec 29 09:00:54 2014 +1000
filediff: Replace old replace-confirm dialog
meld/filediff.py | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index da06c8c..6a098ae 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1594,11 +1594,22 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
dialog.destroy()
if filename:
if os.path.exists(filename):
- response = misc.run_dialog(
- _('"%s" exists!\nOverwrite?') % os.path.basename(filename),
- parent = self,
- buttonstype = Gtk.ButtonsType.YES_NO)
- if response == Gtk.ResponseType.NO:
+ parent_name = os.path.dirname(filename)
+ file_name = os.path.basename(filename)
+ dialog_buttons = [
+ (_("_Cancel"), Gtk.ResponseType.CANCEL),
+ (_("_Replace"), Gtk.ResponseType.OK),
+ ]
+ replace = misc.modal_dialog(
+ primary=_(u"Replace file ā%sā?") % file_name,
+ secondary=_(
+ u"A file with this name already exists in ā%sā.\n"
+ u"If you replace the existing file, its contents "
+ u"will be lost.") % parent_name,
+ buttons=dialog_buttons,
+ messagetype=Gtk.MessageType.WARNING,
+ )
+ if replace != Gtk.ResponseType.OK:
return None
return filename
return None
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]