[meld/meld-3-12] filediff: Reset chooser filename for cancelled selection (bgo#741928)
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/meld-3-12] filediff: Reset chooser filename for cancelled selection (bgo#741928)
- Date: Mon, 29 Dec 2014 22:50:21 +0000 (UTC)
commit 47a8e3813d7a6ca653169ba33426b6bff7879683
Author: Kai Willadsen <kai willadsen gmail com>
Date: Tue Dec 30 08:45:26 2014 +1000
filediff: Reset chooser filename for cancelled selection (bgo#741928)
If the user has an unsaved file and selects a new file in the chooser,
we prompt for saving the existing file. If that dialog is cancelled,
we're left in an inconsistent state where the file chooser thinks
we've got one file, and the buffer has another.
This commit adds a slightly bodgy workaround for this situation, just
manually checking whether the action was cancelled. It would be
possible to do something more serious by performing our checks before
the chooser dialog closes, but that would be a lot more work for little
gain.
meld/filediff.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 2c9f027..58c6c3c 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1770,11 +1770,15 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
self.save_file(idx)
def on_fileentry_file_set(self, entry):
+ entries = self.fileentry[:self.num_panes]
if self.check_save_modified() != Gtk.ResponseType.CANCEL:
- entries = self.fileentry[:self.num_panes]
files = [e.get_file() for e in entries]
paths = [f.get_path() for f in files]
self.set_files(paths)
+ else:
+ idx = entries.index(entry)
+ existing_path = self.textbuffer[idx].data.filename
+ entry.set_filename(existing_path)
return True
def _get_focused_pane(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]