Helpviewer/Bookmarks/BookmarksDialog.py

changeset 1733
231e6f05d274
parent 1509
c0b5e693b0eb
child 2223
054c285dab38
equal deleted inserted replaced
1732:b140a24e147a 1733:231e6f05d274
13 from E5Gui.E5TreeSortFilterProxyModel import E5TreeSortFilterProxyModel 13 from E5Gui.E5TreeSortFilterProxyModel import E5TreeSortFilterProxyModel
14 14
15 import Helpviewer.HelpWindow 15 import Helpviewer.HelpWindow
16 from .BookmarkNode import BookmarkNode 16 from .BookmarkNode import BookmarkNode
17 from .BookmarksModel import BookmarksModel 17 from .BookmarksModel import BookmarksModel
18 from .BookmarkPropertiesDialog import BookmarkPropertiesDialog
18 19
19 from .Ui_BookmarksDialog import Ui_BookmarksDialog 20 from .Ui_BookmarksDialog import Ui_BookmarksDialog
20 21
21 import UI.PixmapCache 22 import UI.PixmapCache
22 23
148 if idx.isValid() and node.type() != BookmarkNode.Folder: 149 if idx.isValid() and node.type() != BookmarkNode.Folder:
149 menu.addAction(self.trUtf8("Edit &Address"), self.__editAddress) 150 menu.addAction(self.trUtf8("Edit &Address"), self.__editAddress)
150 menu.addSeparator() 151 menu.addSeparator()
151 act = menu.addAction(self.trUtf8("&Delete"), self.bookmarksTree.removeSelected) 152 act = menu.addAction(self.trUtf8("&Delete"), self.bookmarksTree.removeSelected)
152 act.setEnabled(idx.flags() & Qt.ItemIsDragEnabled) 153 act.setEnabled(idx.flags() & Qt.ItemIsDragEnabled)
154 menu.addSeparator()
155 act = menu.addAction(self.trUtf8("&Properties..."), self.__edit)
156 act.setEnabled(idx.flags() & Qt.ItemIsEditable)
153 menu.exec_(QCursor.pos()) 157 menu.exec_(QCursor.pos())
154 158
155 def __activated(self, idx): 159 def __activated(self, idx):
156 """ 160 """
157 Private slot to handle the activation of an entry. 161 Private slot to handle the activation of an entry.
208 """ 212 """
209 idx = self.bookmarksTree.currentIndex() 213 idx = self.bookmarksTree.currentIndex()
210 idx = idx.sibling(idx.row(), 1) 214 idx = idx.sibling(idx.row(), 1)
211 self.bookmarksTree.edit(idx) 215 self.bookmarksTree.edit(idx)
212 216
217 def __edit(self):
218 """
219 Private slot to edit a bookmarks properties.
220 """
221 idx = self.bookmarksTree.currentIndex()
222 sourceIndex = self.__proxyModel.mapToSource(idx)
223 node = self.__bookmarksModel.node(sourceIndex)
224 dlg = BookmarkPropertiesDialog(node)
225 dlg.exec_()
226
213 def __newFolder(self): 227 def __newFolder(self):
214 """ 228 """
215 Private slot to add a new bookmarks folder. 229 Private slot to add a new bookmarks folder.
216 """ 230 """
217 currentIndex = self.bookmarksTree.currentIndex() 231 currentIndex = self.bookmarksTree.currentIndex()

eric ide

mercurial