[kupfer] trash: Make the restore action return the file as result
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [kupfer] trash: Make the restore action return the file as result
- Date: Mon, 29 Mar 2010 20:33:00 +0000 (UTC)
commit 7a4492ffe788076264ac3d544c80df0f33382be5
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Mon Mar 29 22:08:46 2010 +0200
trash: Make the restore action return the file as result
kupfer/plugin/trash.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/plugin/trash.py b/kupfer/plugin/trash.py
index 8e6e7d9..0fa27f9 100644
--- a/kupfer/plugin/trash.py
+++ b/kupfer/plugin/trash.py
@@ -6,7 +6,7 @@ __author__ = "Ulrik Sverdrup <ulrik sverdrup gmail com>"
import gio
-from kupfer.objects import Leaf, Action, Source, SourceLeaf
+from kupfer.objects import Leaf, Action, Source, SourceLeaf, FileLeaf
from kupfer.obj.fileactions import Open
from kupfer import utils, icons, pretty
@@ -18,6 +18,9 @@ class RestoreTrashedFile (Action):
def __init__(self):
Action.__init__(self, _("Restore"))
+ def has_result(self):
+ return True
+
def activate(self, leaf):
orig_path = leaf.get_orig_path()
if not orig_path:
@@ -29,6 +32,7 @@ class RestoreTrashedFile (Action):
pretty.print_debug(__name__, "Move %s to %s" % (cur_gfile, orig_gfile))
ret = cur_gfile.move(orig_gfile)
pretty.print_debug(__name__, "Move ret=%s" % (ret, ))
+ return FileLeaf(orig_gfile.get_path())
def get_description(self):
return _("Move file back to original location")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]