[Pkg-bazaar-commits] ./bzr-gtk/unstable r117: Rename put into context menu (Fixed: #73774).

Szilveszter Farkas (Phanatic) Szilveszter.Farkas at gmail.com
Fri Apr 10 07:45:35 UTC 2009


------------------------------------------------------------
revno: 117
committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
branch nick: bzr-gtk
timestamp: Sun 2006-12-10 21:16:18 +0100
message:
  Rename put into context menu (Fixed: #73774).
modified:
  cmenu.ui
  olive/__init__.py
  olive/menu.py
-------------- next part --------------
=== modified file 'cmenu.ui'
--- a/cmenu.ui	2006-09-07 09:03:36 +0000
+++ b/cmenu.ui	2006-12-10 20:16:18 +0000
@@ -2,6 +2,7 @@
     <popup name="context_right">
         <menuitem name="add" action="add" />
         <menuitem name="remove" action="remove" />
+        <menuitem name="rename" action="rename" />
         <menuitem name="open" action="open" />
         <separator />
         <menuitem name="commit" action="commit" />

=== modified file 'olive/__init__.py'
--- a/olive/__init__.py	2006-11-04 23:16:23 +0000
+++ b/olive/__init__.py	2006-12-10 20:16:18 +0000
@@ -418,6 +418,7 @@
             # get the menu items
             m_add = menu.ui.get_widget('/context_right/add')
             m_remove = menu.ui.get_widget('/context_right/remove')
+            m_rename = menu.ui.get_widget('/context_right/rename')
             m_commit = menu.ui.get_widget('/context_right/commit')
             m_diff = menu.ui.get_widget('/context_right/diff')
             # check if we're in a branch
@@ -426,11 +427,13 @@
                 Branch.open_containing(self.get_path())
                 m_add.set_sensitive(True)
                 m_remove.set_sensitive(True)
+                m_rename.set_sensitive(True)
                 m_commit.set_sensitive(True)
                 m_diff.set_sensitive(True)
             except errors.NotBranchError:
                 m_add.set_sensitive(False)
                 m_remove.set_sensitive(False)
+                m_rename.set_sensitive(False)
                 m_commit.set_sensitive(False)
                 m_diff.set_sensitive(False)
 

=== modified file 'olive/menu.py'
--- a/olive/menu.py	2006-12-10 19:55:56 +0000
+++ b/olive/menu.py	2006-12-10 20:16:18 +0000
@@ -59,6 +59,10 @@
                                        _('Remove'), None,
                                        _('Remove the selected file'),
                                        self.remove_file),
+                                      ('rename', None,
+                                       _('Rename'), None,
+                                       _('Rename the selected file'),
+                                       self.rename_file),
                                       ('open', gtk.STOCK_OPEN,
                                        _('Open'), None,
                                        _('Open the selected file'),
@@ -169,6 +173,13 @@
                          _('The selected file is not versioned.'))
             return
 
+    def rename_file(self, action):
+        """ Right context menu -> Rename """
+        from rename import OliveRename
+        wt = WorkingTree.open_containing(self.path + os.sep + self.selected)[0]
+        rename = OliveRename(wt, wt.relpath(self.path), self.selected)
+        rename.display()
+    
     def open_file(self, action):
         """ Right context menu -> Open """
         # Open only the selected file



More information about the Pkg-bazaar-commits mailing list