14 from E5Gui.E5ModelToolBar import E5ModelToolBar |
14 from E5Gui.E5ModelToolBar import E5ModelToolBar |
15 |
15 |
16 import Helpviewer.HelpWindow |
16 import Helpviewer.HelpWindow |
17 |
17 |
18 from .BookmarksModel import BookmarksModel |
18 from .BookmarksModel import BookmarksModel |
19 from .BookmarksMenu import BookmarksMenu |
|
20 from .AddBookmarkDialog import AddBookmarkDialog |
|
21 from .BookmarkPropertiesDialog import BookmarkPropertiesDialog |
|
22 |
19 |
23 |
20 |
24 class BookmarksToolBar(E5ModelToolBar): |
21 class BookmarksToolBar(E5ModelToolBar): |
25 """ |
22 """ |
26 Class implementing a tool bar showing bookmarks. |
23 Class implementing a tool bar showing bookmarks. |
173 |
170 |
174 def __newBookmark(self): |
171 def __newBookmark(self): |
175 """ |
172 """ |
176 Private slot to add a new bookmark. |
173 Private slot to add a new bookmark. |
177 """ |
174 """ |
|
175 from .AddBookmarkDialog import AddBookmarkDialog |
178 dlg = AddBookmarkDialog() |
176 dlg = AddBookmarkDialog() |
179 dlg.setCurrentIndex(self.rootIndex()) |
177 dlg.setCurrentIndex(self.rootIndex()) |
180 dlg.exec_() |
178 dlg.exec_() |
181 |
179 |
182 def __newFolder(self): |
180 def __newFolder(self): |
183 """ |
181 """ |
184 Private slot to add a new bookmarks folder. |
182 Private slot to add a new bookmarks folder. |
185 """ |
183 """ |
|
184 from .AddBookmarkDialog import AddBookmarkDialog |
186 dlg = AddBookmarkDialog() |
185 dlg = AddBookmarkDialog() |
187 dlg.setCurrentIndex(self.rootIndex()) |
186 dlg.setCurrentIndex(self.rootIndex()) |
188 dlg.setFolder(True) |
187 dlg.setFolder(True) |
189 dlg.exec_() |
188 dlg.exec_() |
190 |
189 |
192 """ |
191 """ |
193 Protected method to create the menu for a tool bar action. |
192 Protected method to create the menu for a tool bar action. |
194 |
193 |
195 @return menu for a tool bar action (E5ModelMenu) |
194 @return menu for a tool bar action (E5ModelMenu) |
196 """ |
195 """ |
|
196 from .BookmarksMenu import BookmarksMenu |
197 menu = BookmarksMenu(self) |
197 menu = BookmarksMenu(self) |
198 menu.openUrl.connect(self.openUrl) |
198 menu.openUrl.connect(self.openUrl) |
199 menu.newUrl.connect(self.newUrl) |
199 menu.newUrl.connect(self.newUrl) |
200 return menu |
200 return menu |
201 |
201 |
202 def __edit(self): |
202 def __edit(self): |
203 """ |
203 """ |
204 Private slot to edit a bookmarks properties. |
204 Private slot to edit a bookmarks properties. |
205 """ |
205 """ |
|
206 from .BookmarkPropertiesDialog import BookmarkPropertiesDialog |
206 idx = self.index(self.sender()) |
207 idx = self.index(self.sender()) |
207 node = self.__bookmarksModel.node(idx) |
208 node = self.__bookmarksModel.node(idx) |
208 dlg = BookmarkPropertiesDialog(node) |
209 dlg = BookmarkPropertiesDialog(node) |
209 dlg.exec_() |
210 dlg.exec_() |