[meld] Make external opening an app-wide action
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Make external opening an app-wide action
- Date: Sat, 17 Sep 2011 03:48:43 +0000 (UTC)
commit 9b2c41469e3f58c9351807bf9a5ea575a75940a6
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sat Sep 10 08:22:23 2011 +1000
Make external opening an app-wide action
data/ui/dirdiff-ui.xml | 4 ++--
data/ui/filediff-ui.xml | 4 ++--
data/ui/vcview-ui.xml | 4 ++--
meld/dirdiff.py | 5 ++---
meld/filediff.py | 3 +--
meld/melddoc.py | 3 +++
meld/meldwindow.py | 4 ++++
meld/vcview.py | 3 +--
8 files changed, 17 insertions(+), 13 deletions(-)
---
diff --git a/data/ui/dirdiff-ui.xml b/data/ui/dirdiff-ui.xml
index 0fd530f..ff9dca3 100644
--- a/data/ui/dirdiff-ui.xml
+++ b/data/ui/dirdiff-ui.xml
@@ -16,7 +16,7 @@
<menuitem action="DirCopyRight" />
<menuitem action="DirDelete" />
<separator/>
- <menuitem action="DirOpen" />
+ <menuitem action="OpenExternal" />
</placeholder>
</menu>
@@ -51,7 +51,7 @@
<menuitem action="DirCopyRight" />
<menuitem action="DirDelete" />
<separator/>
- <menuitem action="DirOpen" />
+ <menuitem action="OpenExternal" />
</popup>
<popup name="CustomPopup">
diff --git a/data/ui/filediff-ui.xml b/data/ui/filediff-ui.xml
index 7d92b48..d9bf54c 100644
--- a/data/ui/filediff-ui.xml
+++ b/data/ui/filediff-ui.xml
@@ -33,7 +33,7 @@
<menuitem action="MergeFromRight"/>
<menuitem action="MergeAll"/>
<separator/>
- <menuitem action="FileOpen"/>
+ <menuitem action="OpenExternal"/>
</placeholder>
</menu>
<menu action="ViewMenu">
@@ -54,7 +54,7 @@
<menuitem action="Copy" />
<menuitem action="Paste" />
<separator/>
- <menuitem action="FileOpen" />
+ <menuitem action="OpenExternal" />
<menuitem action="Save" />
<menuitem action="SaveAs" />
</popup>
diff --git a/data/ui/vcview-ui.xml b/data/ui/vcview-ui.xml
index 433b081..2b19784 100644
--- a/data/ui/vcview-ui.xml
+++ b/data/ui/vcview-ui.xml
@@ -7,7 +7,7 @@
<menuitem action="VcCommit" />
<menuitem action="VcUpdate" />
<separator/>
- <menuitem action="VcOpen" />
+ <menuitem action="OpenExternal" />
<separator/>
<menuitem action="VcAdd" />
<menuitem action="VcResolved" />
@@ -57,7 +57,7 @@
<menuitem action="VcUpdate" />
<menuitem action="VcCommit" />
<separator/>
- <menuitem action="VcOpen" />
+ <menuitem action="OpenExternal" />
<separator/>
<menuitem action="VcAdd" />
<menuitem action="VcAddBinary" />
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 493ddec..6392666 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -229,8 +229,6 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
("DirCopyRight", gtk.STOCK_GO_FORWARD, _("Copy _Right"), "<Alt>Right", _("Copy to right"), self.on_button_copy_right_clicked),
("DirDelete", gtk.STOCK_DELETE, None, "Delete", _("Delete selected"), self.on_button_delete_clicked),
("Hide", gtk.STOCK_NO, _("Hide"), None, _("Hide selected"), self.on_filter_hide_current_clicked),
-
- ("DirOpen", None, _("Open externally"), None, _("Open selected file or directory in the default external application"), self.on_button_open_clicked),
)
toggleactions = (
@@ -810,7 +808,8 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
self.copy_selected(1)
def on_button_delete_clicked(self, button):
self.delete_selected()
- def on_button_open_clicked(self, button):
+
+ def open_external(self):
pane = self._get_focused_pane()
if pane is not None:
m = self.model
diff --git a/meld/filediff.py b/meld/filediff.py
index 9239717..b3413f6 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -295,7 +295,6 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
"replace" : darken(self.fill_colors["replace"])}
actions = (
- ("FileOpen", None, _("Open externally"), None, _("Open selected file in the default external application"), self.on_open_activate),
("MakePatch", None, _("Format as patch..."), None, _("Create a patch using differences between files"), self.make_patch),
("PrevConflict", None, _("Previous conflict"), "<Ctrl>I", _("Go to the previous conflict"), lambda x: self.on_next_conflict(gtk.gdk.SCROLL_UP)),
("NextConflict", None, _("Next conflict"), "<Ctrl>K", _("Go to the next conflict"), lambda x: self.on_next_conflict(gtk.gdk.SCROLL_DOWN)),
@@ -869,7 +868,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
#
#
- def on_open_activate(self, *args):
+ def open_external(self):
pane = self._get_focused_pane()
if pane >= 0:
if self.bufferdata[pane].filename:
diff --git a/meld/melddoc.py b/meld/melddoc.py
index ff1bfea..0267997 100644
--- a/meld/melddoc.py
+++ b/meld/melddoc.py
@@ -83,6 +83,9 @@ class MeldDoc(gobject.GObject):
os_open(dirs)
+ def open_external(self):
+ pass
+
def on_undo_activate(self):
if self.undosequence.can_undo():
self.undosequence.undo()
diff --git a/meld/meldwindow.py b/meld/meldwindow.py
index e475744..55e3061 100644
--- a/meld/meldwindow.py
+++ b/meld/meldwindow.py
@@ -144,6 +144,7 @@ class MeldWindow(gnomeglade.Component):
("ChangesMenu", None, _("_Changes")),
("NextChange", gtk.STOCK_GO_DOWN, _("Next change"), "<Alt>Down", _("Go to the next change"), self.on_menu_edit_down_activate),
("PrevChange", gtk.STOCK_GO_UP, _("Previous change"), "<Alt>Up", _("Go to the previous change"), self.on_menu_edit_up_activate),
+ ("OpenExternal", None, _("Open externally"), None, _("Open selected file or directory in the default external application"), self.on_open_external),
("ViewMenu", None, _("_View")),
("FileStatus", None, _("File status")),
@@ -497,6 +498,9 @@ class MeldWindow(gnomeglade.Component):
def on_menu_edit_up_activate(self, *args):
self.current_doc().next_diff(gtk.gdk.SCROLL_UP)
+ def on_open_external(self, *args):
+ self.current_doc().open_external()
+
def on_toolbar_stop_clicked(self, *args):
self.current_doc().stop()
diff --git a/meld/vcview.py b/meld/vcview.py
index 222b536..3c89f53 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -116,7 +116,6 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
actions = (
("VcCompare", gtk.STOCK_DIALOG_INFO, _("_Compare"), None, _("Compare selected"), self.on_button_diff_clicked),
- ("VcOpen", None, _("Open externally"), None, _("Open selected file or directory in the default external application"), self.on_button_open_clicked),
("VcCommit", "vc-commit-24", _("Co_mmit"), None, _("Commit"), self.on_button_commit_clicked),
("VcUpdate", "vc-update-24", _("_Update"), None, _("Update"), self.on_button_update_clicked),
("VcAdd", "vc-add-24", _("_Add"), None, _("Add to VC"), self.on_button_add_clicked),
@@ -516,7 +515,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
if len(files):
self.run_diff(files)
- def on_button_open_clicked(self, obj):
+ def open_external(self):
self._open_files(self._get_selected_files())
def show_patch(self, prefix, patch, silent=False):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]