Anonymous avatar Anonymous committed d9e8bdb

Fix so that bookmarking works on the current folder if no items are selected

Comments (0)

Files changed (1)

Explorers/ExplorerNodes.py

     bookmarkBmp = 'Images/Shared/Bookmark.png'
     def __init__(self):
         self.clipMenuDef = ( (wxID_CLIPRELOAD, 'Reload', self.OnReloadItems, '-'),
-                             (-1, '-', None, '-'),
-                             (wxID_CLIPCUT, 'Cut', self.OnCutItems, self.cutBmp),
-                             (wxID_CLIPCOPY, 'Copy', self.OnCopyItems, self.copyBmp),
-                             (wxID_CLIPPASTE, 'Paste', self.OnPasteItems, self.pasteBmp),
-                             (-1, '-', None, ''),
-                             (wxID_CLIPDELETE, 'Delete', self.OnDeleteItems, self.deleteBmp),
-                             (wxID_CLIPRENAME, 'Rename', self.OnRenameItems, '-'),
-                             (-1, '-', None, ''),
-                             (wx.wxNewId(), 'New', (
-                               (wxID_CLIPNEWFOLDER, 'Folder', self.OnNewFolder, '-'),
-                               (wxID_CLIPNEWBLANKDOC, 'Blank document', self.OnNewBlankDoc, '-'),
-                             ), '-'),
-                             (wxID_CLIPBOOKMARK, 'Bookmark folder', self.OnBookmarkItems, self.bookmarkBmp),
-                              )
+         (-1, '-', None, '-'),
+         (wxID_CLIPCUT, 'Cut', self.OnCutItems, self.cutBmp),
+         (wxID_CLIPCOPY, 'Copy', self.OnCopyItems, self.copyBmp),
+         (wxID_CLIPPASTE, 'Paste', self.OnPasteItems, self.pasteBmp),
+         (-1, '-', None, ''),
+         (wxID_CLIPDELETE, 'Delete', self.OnDeleteItems, self.deleteBmp),
+         (wxID_CLIPRENAME, 'Rename', self.OnRenameItems, '-'),
+         (-1, '-', None, ''),
+         (wx.wxNewId(), 'New', (
+           (wxID_CLIPNEWFOLDER, 'Folder', self.OnNewFolder, '-'),
+           (wxID_CLIPNEWBLANKDOC, 'Blank document', self.OnNewBlankDoc, '-'),
+         ), '-'),
+         (wxID_CLIPBOOKMARK, 'Bookmark folder', self.OnBookmarkItems, 
+          self.bookmarkBmp),
+        )
     def destroy(self):
         self.clipMenuDef = ()
 
                 if node.bookmarks:
                     if node.isFolderish():
                         node.bookmarks.add(node.getURI())
-                        self.editor.statusBar.setHint('Bookmarked %s'% node.resourcepath, 'Info')
+                        self.editor.statusBar.setHint(
+                              'Bookmarked %s'% node.resourcepath, 'Info')
                     else:
-                        self.editor.statusBar.setHint('Not a directory: %s'% node.resourcepath, 'Error')
+                        self.editor.statusBar.setHint(
+                              'Not a directory: %s'% node.resourcepath, 'Error')
+            else:
+                node = self.list.node
+                if not nodes and node.bookmarks:
+                    node.bookmarks.add(node.getURI())
+                    self.editor.statusBar.setHint(
+                          'Bookmarked %s'% node.getURI(), 'Info')
 
 class TransportError(Exception):
     def __str__(self):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.