[meld] Move open_paths to MeldWindow; fixes drag and drop opening
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Move open_paths to MeldWindow; fixes drag and drop opening
- Date: Sun, 29 May 2011 02:18:39 +0000 (UTC)
commit 8c5425498e9105d0916eaabb90db23f0dbfcfb74
Author: Kai Willadsen <kai willadsen gmail com>
Date: Tue May 24 07:30:38 2011 +1000
Move open_paths to MeldWindow; fixes drag and drop opening
meld/meldapp.py | 17 ++---------------
meld/meldwindow.py | 13 +++++++++++++
2 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/meld/meldapp.py b/meld/meldapp.py
index 0bc6f74..c4d7238 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -179,28 +179,15 @@ class MeldApp(gobject.GObject):
parser.error(_("too many arguments (wanted 0-4, got %d)") % len(args))
for files in options.diff:
- self.open_paths(files)
+ self.window.open_paths(files)
- tab = self.open_paths(args, options.auto_compare)
+ tab = self.window.open_paths(args, options.auto_compare)
if tab:
tab.set_labels(options.label)
if options.outfile and tab and isinstance(tab, filediff.FileDiff):
tab.set_merge_output_file(options.outfile)
- def open_paths(self, paths, auto_compare=False):
- tab = None
- if len(paths) == 1:
- a = paths[0]
- if os.path.isfile(a):
- self.window._single_file_open(a)
- else:
- tab = self.window.append_vcview(a, auto_compare)
-
- elif len(paths) in (2, 3, 4):
- tab = self.window.append_diff(paths, auto_compare)
- return tab
-
app = MeldApp()
diff --git a/meld/meldwindow.py b/meld/meldwindow.py
index 4f5e201..e475744 100644
--- a/meld/meldwindow.py
+++ b/meld/meldwindow.py
@@ -655,6 +655,19 @@ class MeldWindow(gnomeglade.Component):
doc.connect("create-diff", lambda obj,arg: self.append_diff(arg))
doc.run_diff([path])
+ def open_paths(self, paths, auto_compare=False):
+ tab = None
+ if len(paths) == 1:
+ a = paths[0]
+ if os.path.isfile(a):
+ self._single_file_open(a)
+ else:
+ tab = self.append_vcview(a, auto_compare)
+
+ elif len(paths) in (2, 3, 4):
+ tab = self.append_diff(paths, auto_compare)
+ return tab
+
def current_doc(self):
"Get the current doc or a dummy object if there is no current"
index = self.notebook.get_current_page()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]