[meld] filediff: Update fileentry handling to use new single-pane API



commit 36e41939ff275952465375c5532a6839a5a424d1
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Dec 10 07:49:13 2017 +1000

    filediff: Update fileentry handling to use new single-pane API
    
    This makes everything a bit better and will maintain currently-set
    file encodings, but we still need to use the encoding selector in
    FileDiff if we want to handle opening new files with predetermined
    encodings from there.

 meld/filediff.py |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 491eac4..b532822 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1667,14 +1667,12 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
         self.save_file(idx)
 
     def on_fileentry_file_set(self, entry):
-        entries = self.fileentry[:self.num_panes]
+        pane = self.fileentry[:self.num_panes].index(entry)
         if self.check_save_modified() != Gtk.ResponseType.CANCEL:
-            gfiles = [e.get_file() for e in entries]
-            # TODO: Make sure to reuse file encodings if present
-            self.set_files(gfiles)
+            # TODO: Use encoding file selectors in FileDiff
+            self.set_file(pane, entry.get_file())
         else:
-            idx = entries.index(entry)
-            existing_path = self.textbuffer[idx].data.filename
+            existing_path = self.textbuffer[pane].data.filename
             entry.set_filename(existing_path)
         return True
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]