GNOME Bugzilla – Bug 416387
Compare differently-named files across directories
Last modified: 2017-12-13 18:48:24 UTC
I open a directory comparison. There's a 'compare' button in the toolbar, so I assume I can compare files that I suspect may be similar but have different filenames: Dir A Dir B foo.txt foo2.txt But I can't select them both at the same time. Selecting in one pane loses the selection in the other.
I can confirm this bug in 1.1.4. The use case that is accommodated today is this: - Open directory comparison. - Select a file in either panel, and click Compare in the toolbar, Meld automatically opens a comparison of that file with a file that has the same name from the other panel. First bug: there's no visual indicator that the comparison will involve a file that has the same name from the other panel. The desired use case is this: - Open a directory comparison. - Select one file in one panel, and another file in another panel. While selecting a file in the second panel, the first panel's selection should remain indicated. - Click Compare. This desired use case is a second bug (RFE).
I wanted to work on "first bug", i.e. selecting the same rows in the two panes, but I couldn't find what to do in dirdiff.py to achieve that simple thing. Could someone more accustomed with the way this thing works give a hint on what to do ? Maybe that will hint me enough to do the other RFE part of that bug...
Hi Vincent, For the first part you need to modify the treeview selection. That is, self.treeview[x].get_selection(). Here's some sample code to select lines of pane 0 when another pane is selected. Note that you'll have to manage the unselect too. Probably, you'll need to modify the selection colour of the non-focused panes so it's obvious which pane is the active one. --- dirdiff.py (revision 1158) +++ dirdiff.py (working copy) @@ -587,6 +587,8 @@ if pane == None: return paths = self._get_selected_paths(pane) if len(paths) > 0: + for p in paths: + self.treeview[0].get_selection().select_path( p) def rwx(mode): return "".join( [ ((mode& (1<<i)) and "xwr"[i%3] or "-") for i in range(8,-1,-1) ] ) def nice(deltat):
*** Bug 749244 has been marked as a duplicate of this bug. ***
*** Bug 706695 has been marked as a duplicate of this bug. ***
I haven't looked at this, but I think it's trickier than I'd like. We go to some effort to maintain a single selection across the trees, and I suspect that there's more than a bit of dirdiff code that assumes that this is the case. Also, see bug 706695 for a secondary interface (drag and drop) to support at the same time.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/meld/issues/11.