62 self.historyTree.customContextMenuRequested.connect( |
62 self.historyTree.customContextMenuRequested.connect( |
63 self.__customContextMenuRequested) |
63 self.__customContextMenuRequested) |
64 |
64 |
65 self.searchEdit.textChanged.connect( |
65 self.searchEdit.textChanged.connect( |
66 self.__proxyModel.setFilterFixedString) |
66 self.__proxyModel.setFilterFixedString) |
67 self.removeButton.clicked[()].connect(self.historyTree.removeSelected) |
67 self.removeButton.clicked.connect(self.historyTree.removeSelected) |
68 self.removeAllButton.clicked[()].connect(self.__historyManager.clear) |
68 self.removeAllButton.clicked.connect(self.__historyManager.clear) |
69 |
69 |
70 self.__proxyModel.modelReset.connect(self.__modelReset) |
70 self.__proxyModel.modelReset.connect(self.__modelReset) |
71 |
71 |
72 def __modelReset(self): |
72 def __modelReset(self): |
73 """ |
73 """ |
84 menu = QMenu() |
84 menu = QMenu() |
85 idx = self.historyTree.indexAt(pos) |
85 idx = self.historyTree.indexAt(pos) |
86 idx = idx.sibling(idx.row(), 0) |
86 idx = idx.sibling(idx.row(), 0) |
87 if idx.isValid() and not self.historyTree.model().hasChildren(idx): |
87 if idx.isValid() and not self.historyTree.model().hasChildren(idx): |
88 menu.addAction( |
88 menu.addAction( |
89 self.trUtf8("&Open"), self.__openHistoryInCurrentTab) |
89 self.tr("&Open"), self.__openHistoryInCurrentTab) |
90 menu.addAction( |
90 menu.addAction( |
91 self.trUtf8("Open in New &Tab"), self.__openHistoryInNewTab) |
91 self.tr("Open in New &Tab"), self.__openHistoryInNewTab) |
92 menu.addSeparator() |
92 menu.addSeparator() |
93 menu.addAction(self.trUtf8("&Copy"), self.__copyHistory) |
93 menu.addAction(self.tr("&Copy"), self.__copyHistory) |
94 menu.addAction(self.trUtf8("&Remove"), self.historyTree.removeSelected) |
94 menu.addAction(self.tr("&Remove"), self.historyTree.removeSelected) |
95 menu.exec_(QCursor.pos()) |
95 menu.exec_(QCursor.pos()) |
96 |
96 |
97 def __activated(self, idx): |
97 def __activated(self, idx): |
98 """ |
98 """ |
99 Private slot to handle the activation of an entry. |
99 Private slot to handle the activation of an entry. |